DescriptionThe 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
MessagesTotal messages: 7
|