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

Unified Diff: include.postload.js

Issue 5168731525218304: Issue 1441 - Let the browser resolve URLs instead doing it ourselve (Closed)
Patch Set: Created Sept. 25, 2014, 7:47 a.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 | « no previous file | include.preload.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.postload.js
===================================================================
--- a/include.postload.js
+++ b/include.postload.js
@@ -391,8 +391,8 @@
}
if (url)
{
- clickHideFilters.push(relativeToAbsoluteUrl(url));
- selectorList.push(elt.localName + '[src="' + url + '"]');
+ clickHideFilters.push(url);
+ selectorList.push(elt.localName + '[src="' + elt.getAttribute("src") + '"]');
}
// Show popup
@@ -429,7 +429,7 @@
}
if (url)
- url = normalizeURL(relativeToAbsoluteUrl(url));
+ url = resolveURL(url);
} else if(!url) {
url = elt.src || elt.href;
}
@@ -465,20 +465,6 @@
}
}
-// Does some degree of URL normalization
-function normalizeURL(url)
-{
- var components = url.match(/(.+:\/\/.+?)\/(.*)/);
- if(!components)
- return url;
- var newPath = removeDotSegments(components[2]);
- if(newPath.length == 0)
- return components[1];
- if(newPath[0] != '/')
- newPath = '/' + newPath;
- return components[1] + newPath;
-}
-
// Content scripts are apparently invoked on non-HTML documents, so we have to
// check for that before doing stuff. |document instanceof HTMLDocument| check
// will fail on some sites like planet.mozilla.org because WebKit creates
« no previous file with comments | « no previous file | include.preload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld