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

Unified Diff: safari/ext/content.js

Issue 5564089086509056: Issue 1801 - Use URL objects to process URLs in the background page (Closed)
Patch Set: Created Jan. 25, 2015, 1:18 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
Index: safari/ext/content.js
===================================================================
--- a/safari/ext/content.js
+++ b/safari/ext/content.js
@@ -57,13 +57,11 @@
document.addEventListener("beforeload", function(event)
{
- var url = resolveURL(event.url);
-
// we don't block non-HTTP requests anyway, so we can bail out
// without asking the background page. This is even necessary
// because passing large data (like a photo encoded as data: URL)
// to the background page, freezes Safari.
- if (!/^https?:/.test(url))
+ if (/^(?!https?:)[\w-]+:/.test(event.url))
return;
var type = "other";
@@ -96,7 +94,7 @@
if (!safari.self.tab.canLoad(
event, {
category: "webRequest",
- url: url,
+ url: event.url,
type: type,
pageId: documentInfo.pageId,
frameId: documentInfo.frameId
« qunit/tests/url.js ('K') | « safari/ext/background.js ('k') | webrequest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld