Fix occasional Chrome mismatch requestUrl!=sender.tab.url

This commit is contained in:
tophf 2015-10-05 18:06:05 +03:00
parent 274584510f
commit 69a085c116

View File

@ -35,7 +35,9 @@ chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
case "getStyles": case "getStyles":
var styles = getStyles(request, sendResponse); var styles = getStyles(request, sendResponse);
// check if this is a main content frame style enumeration // check if this is a main content frame style enumeration
if (request.matchUrl && !request.id && sender && sender.tab && sender.frameId == 0) { if (request.matchUrl && !request.id
&& sender && sender.tab && sender.frameId == 0
&& sender.tab.url == request.matchUrl) {
updateIcon(sender.tab, styles); updateIcon(sender.tab, styles);
} }
return true; return true;