| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 } | 153 } |
| 154 | 154 |
| 155 function init(document) | 155 function init(document) |
| 156 { | 156 { |
| 157 // Use Shadow DOM if available to don't mess with web pages that rely on | 157 // Use Shadow DOM if available to don't mess with web pages that rely on |
| 158 // the order of their own <style> tags (#309). | 158 // the order of their own <style> tags (#309). |
| 159 // | 159 // |
| 160 // However, creating a shadow root breaks running CSS transitions. So we | 160 // However, creating a shadow root breaks running CSS transitions. So we |
| 161 // have to create the shadow root before transistions might start (#452). | 161 // have to create the shadow root before transistions might start (#452). |
| 162 // | 162 // |
| 163 // Also, we can't use shadow DOM on Google Docs, since it breaks printing ther e (#1770). | 163 // Also, we can't use shadow DOM on Google Docs, since it breaks printing |
|
Wladimir Palant
2015/01/13 07:30:27
Nit: Please wrap that long comment and keep line l
Sebastian Noack
2015/01/13 12:32:21
Done.
| |
| 164 // there (#1770). | |
| 164 var shadow = null; | 165 var shadow = null; |
| 165 if ("createShadowRoot" in document.documentElement && document.domain != "docs .google.com") | 166 if ("createShadowRoot" in document.documentElement && document.domain != "docs .google.com") |
| 166 { | 167 { |
| 167 shadow = document.documentElement.createShadowRoot(); | 168 shadow = document.documentElement.createShadowRoot(); |
| 168 shadow.appendChild(document.createElement("shadow")); | 169 shadow.appendChild(document.createElement("shadow")); |
| 169 } | 170 } |
| 170 | 171 |
| 171 // Sets the currently used CSS rules for elemhide filters | 172 // Sets the currently used CSS rules for elemhide filters |
| 172 var setElemhideCSSRules = function(selectors) | 173 var setElemhideCSSRules = function(selectors) |
| 173 { | 174 { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 }, true); | 242 }, true); |
| 242 | 243 |
| 243 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); | 244 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); |
| 244 } | 245 } |
| 245 | 246 |
| 246 if (document instanceof HTMLDocument) | 247 if (document instanceof HTMLDocument) |
| 247 { | 248 { |
| 248 checkSitekey(); | 249 checkSitekey(); |
| 249 init(document); | 250 init(document); |
| 250 } | 251 } |
| LEFT | RIGHT |