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

Side by Side Diff: include.preload.js

Issue 29338491: Issue 3823 - Split up message responder code (Closed)
Patch Set: Implement getPort() Created March 21, 2016, 3:25 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
OLDNEW
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 ); 170 );
171 } 171 }
172 } 172 }
173 ); 173 );
174 } 174 }
175 175
176 function checkSitekey() 176 function checkSitekey()
177 { 177 {
178 var attr = document.documentElement.getAttribute("data-adblockkey"); 178 var attr = document.documentElement.getAttribute("data-adblockkey");
179 if (attr) 179 if (attr)
180 ext.backgroundPage.sendMessage({type: "add-sitekey", token: attr}); 180 ext.backgroundPage.sendMessage({type: "filter.addKey", token: attr});
181 } 181 }
182 182
183 function getContentDocument(element) 183 function getContentDocument(element)
184 { 184 {
185 try 185 try
186 { 186 {
187 return element.contentDocument; 187 return element.contentDocument;
188 } 188 }
189 catch (e) 189 catch (e)
190 { 190 {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 } 237 }
238 238
239 if (matched) 239 if (matched)
240 break; 240 break;
241 } 241 }
242 } 242 }
243 243
244 if (matchedSelectors.length > 0) 244 if (matchedSelectors.length > 0)
245 ext.backgroundPage.sendMessage({ 245 ext.backgroundPage.sendMessage({
246 type: "trace-elemhide", 246 type: "devtools.traceElemHide",
247 selectors: matchedSelectors 247 selectors: matchedSelectors
248 }); 248 });
249 }, 249 },
250 250
251 onTimeout: function() 251 onTimeout: function()
252 { 252 {
253 this.checkNodes(this.changedNodes); 253 this.checkNodes(this.changedNodes);
254 this.changedNodes = []; 254 this.changedNodes = [];
255 this.timeout = null; 255 this.timeout = null;
256 }, 256 },
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 }, true); 552 }, true);
553 553
554 return updateStylesheet; 554 return updateStylesheet;
555 } 555 }
556 556
557 if (document instanceof HTMLDocument) 557 if (document instanceof HTMLDocument)
558 { 558 {
559 checkSitekey(); 559 checkSitekey();
560 window.updateStylesheet = init(document); 560 window.updateStylesheet = init(document);
561 } 561 }
OLDNEW

Powered by Google App Engine
This is Rietveld