From 909244cdbdf2fc46217dec7239ac5704a41c7d60 Mon Sep 17 00:00:00 2001 From: AlexVallat Date: Sat, 25 Apr 2015 14:08:01 +0100 Subject: [PATCH] Imported https://github.com/AlexVallat/uBlock/commit/d9b23d4f109881a87e2516aee31c20f23105c90e --- platform/firefox/css/legacy-toolbar-button.css | 11 ++++++++--- platform/firefox/frameModule.js | 11 +++++++++++ .../{icon32-off.svg => icon-large-off.svg} | 2 +- .../img/browsericons/{icon32.svg => icon-large.svg} | 2 +- platform/firefox/vapi-background.js | 12 ++++++++---- 5 files changed, 29 insertions(+), 9 deletions(-) rename platform/firefox/img/browsericons/{icon32-off.svg => icon-large-off.svg} (94%) rename platform/firefox/img/browsericons/{icon32.svg => icon-large.svg} (94%) diff --git a/platform/firefox/css/legacy-toolbar-button.css b/platform/firefox/css/legacy-toolbar-button.css index 2e2f34505..f29052ab7 100644 --- a/platform/firefox/css/legacy-toolbar-button.css +++ b/platform/firefox/css/legacy-toolbar-button.css @@ -1,8 +1,8 @@ #uBlock-legacy-button { - list-style-image: url('../img/browsericons/icon32.svg'); + list-style-image: url('../img/browsericons/icon-large.svg'); } #uBlock-legacy-button.off { - list-style-image: url('../img/browsericons/icon32-off.svg'); + list-style-image: url('../img/browsericons/icon-large-off.svg'); } toolbar[iconsize="small"] #uBlock-legacy-button { @@ -28,10 +28,15 @@ toolbar[iconsize="small"] #uBlock-legacy-button.off { /* Override off state when in palette */ toolbarpaletteitem #uBlock-legacy-button.off { - list-style-image: url('../img/browsericons/icon32.svg'); + list-style-image: url('../img/browsericons/icon-large.svg'); } /* Override badge when in palette */ toolbarpaletteitem #uBlock-legacy-button[badge]::before { content: none; +} + +/* Prevent pale moon from showing the arrow underneath the button */ +#uBlock-legacy-button .toolbarbutton-menu-dropmarker { + -moz-box-orient: horizontal; } \ No newline at end of file diff --git a/platform/firefox/frameModule.js b/platform/firefox/frameModule.js index 87edc757d..1d759a86d 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:"]') ) { diff --git a/platform/firefox/img/browsericons/icon32-off.svg b/platform/firefox/img/browsericons/icon-large-off.svg similarity index 94% rename from platform/firefox/img/browsericons/icon32-off.svg rename to platform/firefox/img/browsericons/icon-large-off.svg index 0b9030845..684a696c9 100644 --- a/platform/firefox/img/browsericons/icon32-off.svg +++ b/platform/firefox/img/browsericons/icon-large-off.svg @@ -1,7 +1,7 @@ + width="24px" height="24px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve"> + width="24px" height="24px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">