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

Side by Side Diff: include.preload.js

Issue 5644946291818496: Issue 433 - Made adjustments for $sitekey-related changes to the Matcher API (Closed)
Patch Set: Created Sept. 15, 2014, 9:22 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 | « background.js ('k') | lib/whitelisting.js » ('j') | 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 if (tag == "frame") 51 if (tag == "frame")
52 element.style.setProperty("visibility", "hidden", "important"); 52 element.style.setProperty("visibility", "hidden", "important");
53 else 53 else
54 element.style.setProperty("display", "none", "important"); 54 element.style.setProperty("display", "none", "important");
55 } 55 }
56 } 56 }
57 ); 57 );
58 } 58 }
59 } 59 }
60 60
61 function checkExceptionKey() 61 function checkSitekey()
62 { 62 {
63 var attr = document.documentElement.getAttribute("data-adblockkey"); 63 var attr = document.documentElement.getAttribute("data-adblockkey");
64 if (attr) 64 if (attr)
65 ext.backgroundPage.sendMessage({type: "add-key-exception", token: attr}); 65 ext.backgroundPage.sendMessage({type: "add-sitekey", token: attr});
66 } 66 }
67 67
68 function hasInlineURL(element, attribute) 68 function hasInlineURL(element, attribute)
69 { 69 {
70 var value = element.getAttribute(attribute); 70 var value = element.getAttribute(attribute);
71 return value == null || /^\s*(javascript:|about:|$)/i.test(value); 71 return value == null || /^\s*(javascript:|about:|$)/i.test(value);
72 } 72 }
73 73
74 function isInlineFrame(element) 74 function isInlineFrame(element)
75 { 75 {
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 for (var tagName in typeMap) 196 for (var tagName in typeMap)
197 Array.prototype.forEach.call(element.contentDocument.getElementsByTagNam e(tagName), checkCollapse); 197 Array.prototype.forEach.call(element.contentDocument.getElementsByTagNam e(tagName), checkCollapse);
198 } 198 }
199 }, true); 199 }, true);
200 200
201 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); 201 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules);
202 } 202 }
203 203
204 if (document instanceof HTMLDocument) 204 if (document instanceof HTMLDocument)
205 { 205 {
206 checkExceptionKey(); 206 checkSitekey();
207 init(document); 207 init(document);
208 } 208 }
OLDNEW
« no previous file with comments | « background.js ('k') | lib/whitelisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld