Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: include.preload.js

Issue 29349823: Fixes 4328 - Multiple shadowRoot deprecated warnings (Closed)
Left Patch Set: Reuse existing shadowRoot Created Aug. 22, 2016, 12:13 p.m.
Right Patch Set: Fixed indentation Created Nov. 17, 2016, 3:45 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
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 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld