| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 var shadow = null; | 285 var shadow = null; |
| 286 var style = null; | 286 var style = null; |
| 287 var observer = null; | 287 var observer = null; |
| 288 | 288 |
| 289 // Use Shadow DOM if available to don't mess with web pages that rely on | 289 // Use Shadow DOM if available to don't mess with web pages that rely on |
| 290 // the order of their own <style> tags (#309). | 290 // the order of their own <style> tags (#309). |
| 291 // | 291 // |
| 292 // However, creating a shadow root breaks running CSS transitions. So we | 292 // However, creating a shadow root breaks running CSS transitions. So we |
| 293 // have to create the shadow root before transistions might start (#452). | 293 // have to create the shadow root before transistions might start (#452). |
| 294 // | 294 // |
| 295 // Also, we can't use shadow DOM on Google Docs since it breaks printing | 295 // Also, using shadow DOM causes issues on some Google websites, |
| 296 // there (#1770), and Google Mail since the feedback from breaks the layout | 296 // including Goolgle Docs and Gmail (#1770, #2602). |
| 297 // there when using shadow DOM (#2602). | 297 if ("createShadowRoot" in document.documentElement && !/\.google\.com$/.test(d
ocument.domain)) |
| 298 if ("createShadowRoot" in document.documentElement | |
| 299 && document.domain != "docs.google.com" | |
| 300 && document.domain != "mail.google.com") | |
| 301 { | 298 { |
| 302 shadow = document.documentElement.createShadowRoot(); | 299 shadow = document.documentElement.createShadowRoot(); |
| 303 shadow.appendChild(document.createElement("shadow")); | 300 shadow.appendChild(document.createElement("shadow")); |
| 304 } | 301 } |
| 305 | 302 |
| 306 var updateStylesheet = function(reinject) | 303 var updateStylesheet = function(reinject) |
| 307 { | 304 { |
| 308 ext.backgroundPage.sendMessage({type: "get-selectors"}, function(selectors) | 305 ext.backgroundPage.sendMessage({type: "get-selectors"}, function(selectors) |
| 309 { | 306 { |
| 310 if (observer) | 307 if (observer) |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 }, true); | 392 }, true); |
| 396 | 393 |
| 397 return updateStylesheet; | 394 return updateStylesheet; |
| 398 } | 395 } |
| 399 | 396 |
| 400 if (document instanceof HTMLDocument) | 397 if (document instanceof HTMLDocument) |
| 401 { | 398 { |
| 402 checkSitekey(); | 399 checkSitekey(); |
| 403 window.updateStylesheet = init(document); | 400 window.updateStylesheet = init(document); |
| 404 } | 401 } |
| OLD | NEW |