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

Delta Between Two Patch Sets: include.preload.js

Issue 6646117731139584: Issue 1613 - Don't collapse elements with non-HTTP URL (Closed)
Left Patch Set: Created Nov. 26, 2014, 3:06 p.m.
Right Patch Set: Fixed typo, also checking for http:// Created Nov. 26, 2014, 4:52 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 15 matching lines...) Expand all
26 "iframe": "SUBDOCUMENT" 26 "iframe": "SUBDOCUMENT"
27 }; 27 };
28 28
29 function checkCollapse(element) 29 function checkCollapse(element)
30 { 30 {
31 var tag = element.localName; 31 var tag = element.localName;
32 if (tag in typeMap) 32 if (tag in typeMap)
33 { 33 {
34 // This element failed loading, did we block it? 34 // This element failed loading, did we block it?
35 var url = element.src; 35 var url = element.src;
36 if (!url || !/^https:/i.test(url)) 36 if (!url || !/^https?:/i.test(url))
kzar 2014/11/26 16:41:10 Shouldn't we also match HTTP as well as HTTPS here
Sebastian Noack 2014/11/26 16:53:13 Ouch, this was a typo.
kzar 2014/11/26 16:58:29 Easily done! Works for me now
37 return; 37 return;
38 38
39 ext.backgroundPage.sendMessage( 39 ext.backgroundPage.sendMessage(
40 { 40 {
41 type: "should-collapse", 41 type: "should-collapse",
42 url: url, 42 url: url,
43 mediatype: typeMap[tag] 43 mediatype: typeMap[tag]
44 }, 44 },
45 45
46 function(response) 46 function(response)
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 }, true); 191 }, true);
192 192
193 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); 193 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules);
194 } 194 }
195 195
196 if (document instanceof HTMLDocument) 196 if (document instanceof HTMLDocument)
197 { 197 {
198 checkSitekey(); 198 checkSitekey();
199 init(document); 199 init(document);
200 } 200 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld