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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 return hasInlineURL(element, "src") || element.hasAttribute("srcdoc"); | 90 return hasInlineURL(element, "src") || element.hasAttribute("srcdoc"); |
91 case "frame": | 91 case "frame": |
92 return hasInlineURL(element, "src"); | 92 return hasInlineURL(element, "src"); |
93 case "object": | 93 case "object": |
94 return hasInlineURL(element, "data") && element.contentDocument; | 94 return hasInlineURL(element, "data") && element.contentDocument; |
95 default: | 95 default: |
96 return false; | 96 return false; |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 function resolveURL(url) | |
101 { | |
102 var a = document.createElement("a"); | |
103 a.href = url; | |
104 return a.href; | |
105 } | |
106 | |
107 function reinjectRulesWhenRemoved(document, style) | 100 function reinjectRulesWhenRemoved(document, style) |
108 { | 101 { |
109 var MutationObserver = window.MutationObserver || window.WebKitMutationObserve
r; | 102 var MutationObserver = window.MutationObserver || window.WebKitMutationObserve
r; |
110 if (!MutationObserver) | 103 if (!MutationObserver) |
111 return; | 104 return; |
112 | 105 |
113 var observer = new MutationObserver(function(mutations) | 106 var observer = new MutationObserver(function(mutations) |
114 { | 107 { |
115 var isStyleRemoved = false; | 108 var isStyleRemoved = false; |
116 for (var i = 0; i < mutations.length; i++) | 109 for (var i = 0; i < mutations.length; i++) |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 }, true); | 266 }, true); |
274 | 267 |
275 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); | 268 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); |
276 } | 269 } |
277 | 270 |
278 if (document instanceof HTMLDocument) | 271 if (document instanceof HTMLDocument) |
279 { | 272 { |
280 checkSitekey(); | 273 checkSitekey(); |
281 init(document); | 274 init(document); |
282 } | 275 } |
OLD | NEW |