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: Wrapped long line Created Jan. 13, 2015, 12:32 p.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
164 // there (#1770).
161 var shadow = null; 165 var shadow = null;
162 if ("createShadowRoot" in document.documentElement) 166 if ("createShadowRoot" in document.documentElement && document.domain != "docs .google.com")
163 { 167 {
164 shadow = document.documentElement.createShadowRoot(); 168 shadow = document.documentElement.createShadowRoot();
165 shadow.appendChild(document.createElement("shadow")); 169 shadow.appendChild(document.createElement("shadow"));
166 } 170 }
167 171
168 // Sets the currently used CSS rules for elemhide filters 172 // Sets the currently used CSS rules for elemhide filters
169 var setElemhideCSSRules = function(selectors) 173 var setElemhideCSSRules = function(selectors)
170 { 174 {
171 if (selectors.length == 0) 175 if (selectors.length == 0)
172 return; 176 return;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 }, true); 242 }, true);
239 243
240 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules); 244 ext.backgroundPage.sendMessage({type: "get-selectors"}, setElemhideCSSRules);
241 } 245 }
242 246
243 if (document instanceof HTMLDocument) 247 if (document instanceof HTMLDocument)
244 { 248 {
245 checkSitekey(); 249 checkSitekey();
246 init(document); 250 init(document);
247 } 251 }
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