| Index: lib/content/elemHideEmulation.js |
| =================================================================== |
| --- a/lib/content/elemHideEmulation.js |
| +++ b/lib/content/elemHideEmulation.js |
| @@ -546,16 +546,29 @@ ElemHideEmulation.prototype = { |
| { |
| let newStylesheets = this._scheduledProcessing.stylesheets; |
| this._filteringInProgress = true; |
| this._scheduledProcessing = null; |
| this._addSelectors(newStylesheets, completion); |
| }, |
| MIN_INVOCATION_INTERVAL - (performance.now() - this._lastInvocation)); |
| } |
| + else if (this.document.readyState == "loading") |
| + { |
| + this._scheduledProcessing = {stylesheets}; |
| + let handler = () => |
| + { |
| + document.removeEventListener("DOMContentLoaded", handler); |
| + let newStylesheets = this._scheduledProcessing.stylesheets; |
| + this._filteringInProgress = true; |
| + this._scheduledProcessing = null; |
| + this._addSelectors(newStylesheets, completion); |
| + }; |
| + document.addEventListener("DOMContentLoaded", handler); |
| + } |
| else |
| { |
| this._filteringInProgress = true; |
| this._addSelectors(stylesheets, completion); |
| } |
| }, |
| onLoad(event) |