Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 4538458420805632: Fix: issue with chrome v28 and below (Closed)

Created:
Feb. 6, 2014, 1:35 p.m. by saroyanm
Modified:
Feb. 28, 2014, 12:50 p.m.
Visibility:
Public.

Description

The chrome 24v issue was mentioned in the link below: https://adblockplus.org/forum/viewtopic.php?f=10&t=19973&start=15#p91792 After investigations looks like I found the reason and made some fix that worked for me with same chrome version reporter used (24.0.1312.52). The case is about the sender parameter that onMessage callback parameter gets, so here what I've noticed: common.js line: 109-112 ABP checks if chrome.runtime.sendMessage exists within installed chrome API and i case it’s not, ABP use chrome.extension.sendMessage (v24) for message passing. common.js line: 71-74 Same way ABP check for the corresponding listener for message passing: chrome.runtime.sendMessage -> chrome.runtime.onMessage chrome.extension.sendMessage-> chrome.extension.onMessage (v24) But the sender parameter that the onMessage listener’s callback function is getting looks different: * id * url (missing in chrome.extension.sendMessage chrome v 24) * tab because of that missing parameter chrome v 24 and I guess also the older version who are not using chrome.runtime.onMessage are getting current error: Error in event handler for 'undefined': Cannot call method 'replace' of undefined TypeError: Cannot call method 'replace' of undefined at stripFragmentFromURL (/lib/basedomain.js:165:14) I’ve added current line to modify the sender object so it get tab’s url value: ext/background.js line 189: if(sender.url == null); sender.url = tab.url; but actually in this case I’m getting the tab url not the sender’s one, so in case the request will be sent from Iframe I’ll again get the URL for tab itself.

Patch Set 1 #

Total comments: 1

Patch Set 2 : Descriptive comment #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -0 lines) Patch
M chrome/ext/background.js View 1 1 chunk +5 lines, -0 lines 4 comments Download

Messages

Total messages: 7
Thomas Greiner
http://codereview.adblockplus.org/4538458420805632/diff/5629499534213120/chrome/ext/background.js File chrome/ext/background.js (right): http://codereview.adblockplus.org/4538458420805632/diff/5629499534213120/chrome/ext/background.js#newcode189 chrome/ext/background.js:189: if (sender.url == null); Add a comment above why ...
Feb. 10, 2014, 11:05 a.m. (2014-02-10 11:05:34 UTC) #1
saroyanm
On 2014/02/10 11:05:34, Thomas Greiner wrote: > http://codereview.adblockplus.org/4538458420805632/diff/5629499534213120/chrome/ext/background.js > File chrome/ext/background.js (right): > > http://codereview.adblockplus.org/4538458420805632/diff/5629499534213120/chrome/ext/background.js#newcode189 ...
Feb. 12, 2014, 12:22 p.m. (2014-02-12 12:22:15 UTC) #2
saroyanm
> Add a comment above why this is necessary and investigate further which versions > ...
Feb. 13, 2014, 2:42 p.m. (2014-02-13 14:42:56 UTC) #3
Felix Dahlke
LGTM with a comment http://codereview.adblockplus.org/4538458420805632/diff/5194384987389952/chrome/ext/background.js File chrome/ext/background.js (right): http://codereview.adblockplus.org/4538458420805632/diff/5194384987389952/chrome/ext/background.js#newcode191 chrome/ext/background.js:191: //It's a temporary fix ( ...
Feb. 27, 2014, 8:45 p.m. (2014-02-27 20:45:24 UTC) #4
Felix Dahlke
Spotted something after hitting "publish" :P http://codereview.adblockplus.org/4538458420805632/diff/5194384987389952/chrome/ext/background.js File chrome/ext/background.js (right): http://codereview.adblockplus.org/4538458420805632/diff/5194384987389952/chrome/ext/background.js#newcode192 chrome/ext/background.js:192: if (sender.url == ...
Feb. 27, 2014, 8:46 p.m. (2014-02-27 20:46:39 UTC) #5
saroyanm
Guys what you think should this be somehow commented in the blog post ? In ...
Feb. 28, 2014, 12:47 p.m. (2014-02-28 12:47:15 UTC) #6
Felix Dahlke
Feb. 28, 2014, 12:50 p.m. (2014-02-28 12:50:50 UTC) #7
On 2014/02/28 12:47:15, saroyanm wrote:
> Guys what you think should this be somehow commented in the blog post ?
> In case should this comment be done by mapx, or I can comment ?
> Or that should be commented after release ?

You mean on the forum? You can say that it's fixed and point to the commit that
fixes it.

It'll be mentioned in the next release blog post, probably next week.

Powered by Google App Engine
This is Rietveld