aboutsummaryrefslogtreecommitdiffstats
path: root/platform/firefox/frameModule.js
diff options
context:
space:
mode:
authorAlexVallat <github@alex.vallat.name>2015-04-25 14:08:01 +0100
committergorhill <rhill@raymondhill.net>2015-06-17 14:06:59 -0400
commit909244cdbdf2fc46217dec7239ac5704a41c7d60 (patch)
treec80d893666623276d11dc104eaaffa37ce31cdd1 /platform/firefox/frameModule.js
parentc4b08567237af79bd97d130b93f7933002e8a64d (diff)
downloaduBlock-909244cdbdf2fc46217dec7239ac5704a41c7d60.zip
uBlock-909244cdbdf2fc46217dec7239ac5704a41c7d60.tar.gz
uBlock-909244cdbdf2fc46217dec7239ac5704a41c7d60.tar.bz2
Imported https://github.com/AlexVallat/uBlock/commit/d9b23d4f109881a87e2516aee31c20f23105c90e
Diffstat (limited to 'platform/firefox/frameModule.js')
-rw-r--r--platform/firefox/frameModule.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js
index 87edc75..1d759a8 100644
--- a/platform/firefox/frameModule.js
+++ b/platform/firefox/frameModule.js
@@ -331,6 +331,17 @@ const contentObserver = {
let docReady = (e) => {
let doc = e.target;
doc.removeEventListener(e.type, docReady, true);
+
+ if (doc.docShell) {
+ // It is possible, in some cases (#1140) for document-element-inserted to occur *before* nsIWebProgressListener.onLocationChange, so ensure that the URL is correct before continuing
+ let messageManager = doc.docShell.getInterface(Ci.nsIContentFrameMessageManager);
+
+ messageManager.sendSyncMessage(locationChangedMessageName, {
+ url: loc.href,
+ noRefresh: true, // If the URL is the same, then don't refresh it so that if this occurs after onLocationChange, no the block count isn't reset
+ });
+ }
+
lss(this.contentBaseURI + 'contentscript-end.js', sandbox);
if ( doc.querySelector('a[href^="abp:"]') ) {