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

Side by Side Diff: include.postload.js

Issue 4567408790470656: Issue 1393 - Block element dialog suggests decoded URLs (Closed)
Patch Set: Created Sept. 22, 2014, 9:24 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 var elt = currentElement; 272 var elt = currentElement;
273 var url = null; 273 var url = null;
274 if (currentElement.className && currentElement.className == "__adblockplus__ov erlay") 274 if (currentElement.className && currentElement.className == "__adblockplus__ov erlay")
275 { 275 {
276 elt = currentElement.prisoner; 276 elt = currentElement.prisoner;
277 url = currentElement.prisonerURL; 277 url = currentElement.prisonerURL;
278 } 278 }
279 else if (elt.src) 279 else if (elt.src)
280 url = elt.src; 280 url = elt.src;
281 281
282 // Only normalize when the element contains a URL (issue 328.)
283 // The URL is not always normalized, so do it here
284 if (url)
285 url = normalizeURL(relativeToAbsoluteUrl(url));
286
287 // Construct filters. The popup will retrieve these. 282 // Construct filters. The popup will retrieve these.
288 // Only one ID 283 // Only one ID
289 var elementId = elt.id ? elt.id.split(' ').join('') : null; 284 var elementId = elt.id ? elt.id.split(' ').join('') : null;
290 // Can have multiple classes, and there might be extraneous whitespace 285 // Can have multiple classes, and there might be extraneous whitespace
291 var elementClasses = null; 286 var elementClasses = null;
292 if (elt.className) 287 if (elt.className)
293 elementClasses = elt.className.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '' ).split(' '); 288 elementClasses = elt.className.replace(/\s+/g, ' ').replace(/^\s+|\s+$/g, '' ).split(' ');
294 289
295 clickHideFilters = new Array(); 290 clickHideFilters = new Array();
296 selectorList = new Array(); 291 selectorList = new Array();
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 // No data attribute, look in PARAM child tags for a URL for the swf file 337 // No data attribute, look in PARAM child tags for a URL for the swf file
343 var params = elt.querySelectorAll("param[name=\"movie\"]"); 338 var params = elt.querySelectorAll("param[name=\"movie\"]");
344 // This OBJECT could contain an EMBED we already nuked, in which case there' s no URL 339 // This OBJECT could contain an EMBED we already nuked, in which case there' s no URL
345 if(params[0]) 340 if(params[0])
346 url = params[0].getAttribute("value"); 341 url = params[0].getAttribute("value");
347 else { 342 else {
348 params = elt.querySelectorAll("param[name=\"src\"]"); 343 params = elt.querySelectorAll("param[name=\"src\"]");
349 if(params[0]) 344 if(params[0])
350 url = params[0].getAttribute("value"); 345 url = params[0].getAttribute("value");
351 } 346 }
347
348 // Only normalize when the element contains a URL (issue 328.)
349 // The URL is not always normalized, so do it here
Wladimir Palant 2014/09/22 09:57:03 For reference: this is referring to https://code.g
Thomas Greiner 2014/09/22 13:13:49 Done.
350 if (url)
351 url = normalizeURL(relativeToAbsoluteUrl(url));
352 } else if(!url) { 352 } else if(!url) {
353 url = elt.getAttribute("src") || elt.getAttribute("href"); 353 url = elt.src || elt.href;
354 } 354 }
355 return url; 355 return url;
356 } 356 }
357 357
358 // This function Copyright (c) 2008 Jeni Tennison, from jquery.uri.js 358 // This function Copyright (c) 2008 Jeni Tennison, from jquery.uri.js
359 // and licensed under the MIT license. See jquery-*.min.js for details. 359 // and licensed under the MIT license. See jquery-*.min.js for details.
360 function removeDotSegments(u) { 360 function removeDotSegments(u) {
361 var r = '', m = []; 361 var r = '', m = [];
362 if (/\./.test(u)) { 362 if (/\./.test(u)) {
363 while (u !== undefined && u !== '') { 363 while (u !== undefined && u !== '') {
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 559
560 clickHide_deactivate(); 560 clickHide_deactivate();
561 } 561 }
562 break; 562 break;
563 default: 563 default:
564 sendResponse({}); 564 sendResponse({});
565 break; 565 break;
566 } 566 }
567 }); 567 });
568 } 568 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld