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

Side by Side Diff: include.preload.js

Issue 5562887569408000: Issue 1770 - Don't use shadow DOM on docs.google.com, fixing printing there (Closed)
Patch Set: Created Jan. 10, 2015, 11:53 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 147 }
148 } 148 }
149 ); 149 );
150 }); 150 });
151 151
152 observer.observe(style.parentNode, {childList: true}); 152 observer.observe(style.parentNode, {childList: true});
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 157 // Use Shadow DOM if available to don't mess with web pages that rely on
158 // rely on the order of their own <style> tags (#309). However we 158 // the order of their own <style> tags (#309).
159 // must not create the shadow root in the response callback passed 159 //
160 // to sendMessage(), otherwise Chrome breaks some websites (#450). 160 // However, creating a shadow root breaks running CSS transitions. So we
161 // have to create the shadow root before transistions might start (#452).
162 //
163 // Also, we can't use shadow DOM on Google Docs, since it breaks printing ther e (#1770).
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.
161 var shadow = null; 164 var shadow = null;
162 if ("createShadowRoot" in document.documentElement) 165 if ("createShadowRoot" in document.documentElement && document.domain != "docs .google.com")
163 { 166 {
164 shadow = document.documentElement.createShadowRoot(); 167 shadow = document.documentElement.createShadowRoot();
165 shadow.appendChild(document.createElement("shadow")); 168 shadow.appendChild(document.createElement("shadow"));
166 } 169 }
167 170
168 // Sets the currently used CSS rules for elemhide filters 171 // Sets the currently used CSS rules for elemhide filters
169 var setElemhideCSSRules = function(selectors) 172 var setElemhideCSSRules = function(selectors)
170 { 173 {
171 if (selectors.length == 0) 174 if (selectors.length == 0)
172 return; 175 return;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 }, true); 241 }, true);
239 242
240 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); 243 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules);
241 } 244 }
242 245
243 if (document instanceof HTMLDocument) 246 if (document instanceof HTMLDocument)
244 { 247 {
245 checkSitekey(); 248 checkSitekey();
246 init(document); 249 init(document);
247 } 250 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld