OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 { | 87 { |
88 return false; // third-party | 88 return false; // third-party |
89 } | 89 } |
90 | 90 |
91 if (!contentDocument) | 91 if (!contentDocument) |
92 return false; // not a frame | 92 return false; // not a frame |
93 | 93 |
94 return contentDocument.location.protocol == "about:"; | 94 return contentDocument.location.protocol == "about:"; |
95 } | 95 } |
96 | 96 |
97 function resolveURL(url) | |
98 { | |
99 var a = document.createElement("a"); | |
100 a.href = url; | |
101 return a.href; | |
102 } | |
103 | |
104 function reinjectRulesWhenRemoved(document, style) | 97 function reinjectRulesWhenRemoved(document, style) |
105 { | 98 { |
106 var MutationObserver = window.MutationObserver || window.WebKitMutationObserve
r; | 99 var MutationObserver = window.MutationObserver || window.WebKitMutationObserve
r; |
107 if (!MutationObserver) | 100 if (!MutationObserver) |
108 return; | 101 return; |
109 | 102 |
110 var observer = new MutationObserver(function(mutations) | 103 var observer = new MutationObserver(function(mutations) |
111 { | 104 { |
112 var isStyleRemoved = false; | 105 var isStyleRemoved = false; |
113 for (var i = 0; i < mutations.length; i++) | 106 for (var i = 0; i < mutations.length; i++) |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 }, true); | 263 }, true); |
271 | 264 |
272 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); | 265 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); |
273 } | 266 } |
274 | 267 |
275 if (document instanceof HTMLDocument) | 268 if (document instanceof HTMLDocument) |
276 { | 269 { |
277 checkSitekey(); | 270 checkSitekey(); |
278 init(document); | 271 init(document); |
279 } | 272 } |
OLD | NEW |