Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
460 // Also, using shadow DOM causes issues on some Google websites, | 460 // Also, using shadow DOM causes issues on some Google websites, |
461 // including Google Docs, Gmail and Blogger (#1770, #2602, #2687). | 461 // including Google Docs, Gmail and Blogger (#1770, #2602, #2687). |
462 // | 462 // |
463 // Finally since some users have both AdBlock and Adblock Plus installed we | 463 // Finally since some users have both AdBlock and Adblock Plus installed we |
464 // have to consider how the two extensions interact. For example we want to | 464 // have to consider how the two extensions interact. For example we want to |
465 // avoid creating the shadowRoot twice. | 465 // avoid creating the shadowRoot twice. |
466 if ("createShadowRoot" in document.documentElement && | 466 if ("createShadowRoot" in document.documentElement && |
467 !/\.(?:google|blogger)\.com$/.test(document.domain)) | 467 !/\.(?:google|blogger)\.com$/.test(document.domain)) |
468 { | 468 { |
469 shadow = document.documentElement.shadowRoot || | 469 shadow = document.documentElement.shadowRoot || |
470 document.documentElement.createShadowRoot(); | 470 document.documentElement.createShadowRoot(); |
Sebastian Noack
2016/11/17 15:38:00
Nit: It seems the indentation is off by 2 characte
kzar
2016/11/17 15:45:54
Done.
| |
471 shadow.appendChild(document.createElement("shadow")); | 471 shadow.appendChild(document.createElement("shadow")); |
472 | 472 |
473 // Stop the website from messing with our shadowRoot | 473 // Stop the website from messing with our shadowRoot |
474 if ("shadowRoot" in Element.prototype) | 474 if ("shadowRoot" in Element.prototype) |
475 { | 475 { |
476 runInDocument(document, function() | 476 runInDocument(document, function() |
477 { | 477 { |
478 var ourShadowRoot = document.documentElement.shadowRoot; | 478 var ourShadowRoot = document.documentElement.shadowRoot; |
479 if (!ourShadowRoot) | 479 if (!ourShadowRoot) |
480 return; | 480 return; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
618 }, true); | 618 }, true); |
619 | 619 |
620 return updateStylesheet; | 620 return updateStylesheet; |
621 } | 621 } |
622 | 622 |
623 if (document instanceof HTMLDocument) | 623 if (document instanceof HTMLDocument) |
624 { | 624 { |
625 checkSitekey(); | 625 checkSitekey(); |
626 window.updateStylesheet = init(document); | 626 window.updateStylesheet = init(document); |
627 } | 627 } |
LEFT | RIGHT |