| 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) | 328 if (subject.document.readyState == "uninitialized") |
| 329 { | 329 { |
| 330 // The window is in an invalid state - delay processing until it's ready. | 330 // It would be nice to listen to the readystatechange event here. However, |
| 331 // it doesn't fire when changing from "uninitialized" state. | |
|
Thomas Greiner
2016/07/18 15:58:14
While the "unitialized" state is not mentioned in
Wladimir Palant
2016/07/18 18:07:18
Given that "uninitialized" means "too early to be
| |
| 331 Utils.runAsync(() => | 332 Utils.runAsync(() => |
| 332 { | 333 { |
| 333 if (!Cu.isDeadWrapper(subject)) | 334 if (!Cu.isDeadWrapper(subject)) |
| 334 this.observe(subject, topic, data) | 335 this.observe(subject, topic, data); |
| 335 }); | 336 }); |
| 336 return; | 337 return; |
| 337 } | 338 } |
| 338 | 339 |
| 339 port.emitWithResponse("elemhideEnabled", { | 340 port.emitWithResponse("elemhideEnabled", { |
| 340 frames: getFrames(subject), | 341 frames: getFrames(subject), |
| 341 isPrivate: isPrivate(subject) | 342 isPrivate: isPrivate(subject) |
| 342 }).then(({ | 343 }).then(({ |
| 343 enabled, contentType, docDomain, thirdParty, location, filter, | 344 enabled, contentType, docDomain, thirdParty, location, filter, |
| 344 filterType | 345 filterType |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 else if (filter) | 377 else if (filter) |
| 377 { | 378 { |
| 378 RequestNotifier.addNodeData(subject.document, subject.top, { | 379 RequestNotifier.addNodeData(subject.document, subject.top, { |
| 379 contentType, docDomain, thirdParty, location, filter, filterType | 380 contentType, docDomain, thirdParty, location, filter, filterType |
| 380 }); | 381 }); |
| 381 } | 382 } |
| 382 }); | 383 }); |
| 383 } | 384 } |
| 384 }; | 385 }; |
| 385 observer.init(); | 386 observer.init(); |
| OLD | NEW |