LEFT | RIGHT |
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-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 { | 105 { |
106 // Make sure this is really an HTML page, as Chrome runs these scripts on just
about everything | 106 // Make sure this is really an HTML page, as Chrome runs these scripts on just
about everything |
107 if (!(document.documentElement instanceof HTMLElement)) | 107 if (!(document.documentElement instanceof HTMLElement)) |
108 return; | 108 return; |
109 | 109 |
110 document.addEventListener("error", checkCollapse, true); | 110 document.addEventListener("error", checkCollapse, true); |
111 document.addEventListener("load", checkCollapse, true); | 111 document.addEventListener("load", checkCollapse, true); |
112 | 112 |
113 ext.backgroundPage.sendMessage( | 113 ext.backgroundPage.sendMessage( |
114 { | 114 { |
115 type: "get-settings", | 115 type: "get-selectors", |
116 selectors: true, | |
117 frameUrl: window.location.href | 116 frameUrl: window.location.href |
118 }, | 117 }, |
119 | 118 setElemhideCSSRules |
120 function(response) | |
121 { | |
122 setElemhideCSSRules(response.selectors); | |
123 } | |
124 ); | 119 ); |
125 } | 120 } |
126 | 121 |
127 // In Chrome 18 the document might not be initialized yet | 122 // In Chrome 18 the document might not be initialized yet |
128 if (document.documentElement) | 123 if (document.documentElement) |
129 init(); | 124 init(); |
130 else | 125 else |
131 window.setTimeout(init, 0); | 126 window.setTimeout(init, 0); |
LEFT | RIGHT |