Left: | ||
Right: |
OLD | NEW |
---|---|
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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 { | 318 { |
319 this.sheet = null; | 319 this.sheet = null; |
320 }); | 320 }); |
321 }, | 321 }, |
322 | 322 |
323 observe: function(subject, topic, data) | 323 observe: function(subject, topic, data) |
324 { | 324 { |
325 if (topic != this.topic) | 325 if (topic != this.topic) |
326 return; | 326 return; |
327 | 327 |
328 if (!subject.location || !subject.location.href) | |
329 { | |
330 // The window is in an invalid state - delay processing until it's ready. | |
Thomas Greiner
2016/07/14 14:19:21
What are the reasons for the window being in an in
Wladimir Palant
2016/07/14 15:19:42
It seems that Nightly change the initialization se
| |
331 Utils.runAsync(() => | |
332 { | |
333 if (!Cu.isDeadWrapper(subject)) | |
334 this.observe(subject, topic, data) | |
335 }); | |
336 return; | |
337 } | |
338 | |
328 port.emitWithResponse("elemhideEnabled", { | 339 port.emitWithResponse("elemhideEnabled", { |
329 frames: getFrames(subject), | 340 frames: getFrames(subject), |
330 isPrivate: isPrivate(subject) | 341 isPrivate: isPrivate(subject) |
331 }).then(({ | 342 }).then(({ |
332 enabled, contentType, docDomain, thirdParty, location, filter, | 343 enabled, contentType, docDomain, thirdParty, location, filter, |
333 filterType | 344 filterType |
334 }) => | 345 }) => |
335 { | 346 { |
336 if (Cu.isDeadWrapper(subject)) | 347 if (Cu.isDeadWrapper(subject)) |
337 { | 348 { |
(...skipping 27 matching lines...) Expand all Loading... | |
365 else if (filter) | 376 else if (filter) |
366 { | 377 { |
367 RequestNotifier.addNodeData(subject.document, subject.top, { | 378 RequestNotifier.addNodeData(subject.document, subject.top, { |
368 contentType, docDomain, thirdParty, location, filter, filterType | 379 contentType, docDomain, thirdParty, location, filter, filterType |
369 }); | 380 }); |
370 } | 381 } |
371 }); | 382 }); |
372 } | 383 } |
373 }; | 384 }; |
374 observer.init(); | 385 observer.init(); |
OLD | NEW |