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

Unified Diff: webrequest.js

Issue 5564089086509056: Issue 1801 - Use URL objects to process URLs in the background page (Closed)
Patch Set: Rebased and addressed comments Created Feb. 11, 2015, 5:06 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « safari/ext/content.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrequest.js
===================================================================
--- a/webrequest.js
+++ b/webrequest.js
@@ -55,10 +55,10 @@
var docDomain = extractHostFromFrame(frame);
var key = getKey(page, frame);
var filter = defaultMatcher.matchesAny(
- url,
+ stringifyURL(url),
type == "sub_frame" ? "SUBDOCUMENT" : type.toUpperCase(),
docDomain,
- isThirdParty(extractHostFromURL(url), docDomain),
+ isThirdParty(url, docDomain),
key
);
@@ -66,7 +66,7 @@
// check for notifications here
if (platform != "chromium" && type == "sub_frame")
{
- var notificationToShow = NotificationStorage.getNextToShow(url);
+ var notificationToShow = NotificationStorage.getNextToShow(stringifyURL(url));
if (notificationToShow)
showNotification(notificationToShow);
}
@@ -90,7 +90,7 @@
var page = new ext.Page({id: details.tabId});
var frame = ext.getFrame(details.tabId, details.frameId);
- if (!frame || frame.url != details.url)
+ if (!frame || frame.url.href != details.url)
return;
for (var i = 0; i < details.responseHeaders.length; i++)
@@ -100,7 +100,7 @@
processKey(header.value, page, frame);
}
- var notificationToShow = NotificationStorage.getNextToShow(details.url);
+ var notificationToShow = NotificationStorage.getNextToShow(stringifyURL(new URL(details.url)));
if (notificationToShow)
showNotification(notificationToShow);
}
« no previous file with comments | « safari/ext/content.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld