| Index: include.postload.js |
| =================================================================== |
| --- a/include.postload.js |
| +++ b/include.postload.js |
| @@ -279,11 +279,6 @@ |
| else if (elt.src) |
| url = elt.src; |
| - // Only normalize when the element contains a URL (issue 328.) |
| - // The URL is not always normalized, so do it here |
| - if (url) |
| - url = normalizeURL(relativeToAbsoluteUrl(url)); |
| - |
| // Construct filters. The popup will retrieve these. |
| // Only one ID |
| var elementId = elt.id ? elt.id.split(' ').join('') : null; |
| @@ -315,10 +310,7 @@ |
| } |
| if (url) |
| - { |
| - clickHideFilters.push(relativeToAbsoluteUrl(url)); |
| - selectorList.push(elt.localName + '[src="' + url + '"]'); |
| - } |
| + clickHideFilters.push(normalizeURL(relativeToAbsoluteUrl(url))); |
| // restore the original style, before generating the fallback filter that |
| // will include the style, and to prevent highlightElements from saving those |
| @@ -397,15 +389,13 @@ |
| // Does some degree of URL normalization |
| function normalizeURL(url) |
|
Wladimir Palant
2014/09/30 21:27:42
The function name and comment no longer make sense
|
| { |
| - var components = url.match(/(.+:\/\/.+?)\/(.*)/); |
| + var components = url.match(/(.+:\/\/)(.+?)\/(.*)/); |
|
Wladimir Palant
2014/09/30 21:27:42
This regexp won't work correctly for something lik
|
| if(!components) |
| return url; |
|
Wladimir Palant
2014/09/30 21:27:42
I guess this would make more sense:
return "|"
|
| - var newPath = removeDotSegments(components[2]); |
| - if(newPath.length == 0) |
| - return components[1]; |
| - if(newPath[0] != '/') |
| - newPath = '/' + newPath; |
| - return components[1] + newPath; |
| + var newPath = removeDotSegments(components[3]); |
|
Wladimir Palant
2014/09/30 21:27:42
Do we still need the "dot removal"? This should be
|
| + if(newPath[0] != "/") |
| + newPath = "/" + newPath; |
| + return "||" + components[2] + newPath; |
| } |
| // Content scripts are apparently invoked on non-HTML documents, so we have to |