Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Commit

Permalink
Fixing for PaleMoon under Linux, and general cosmetic improvements to…
Browse files Browse the repository at this point in the history
… button. Also possibly fix SeaMonkey static filtering broken until settings reset issue.
  • Loading branch information
AlexVallat committed Apr 25, 2015
1 parent 5ac4ec2 commit d9b23d4
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
11 changes: 8 additions & 3 deletions platform/firefox/css/legacy-toolbar-button.css
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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;
}
16 changes: 9 additions & 7 deletions platform/firefox/frameModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,15 @@ const contentObserver = {
let doc = e.target;
doc.removeEventListener(e.type, docReady, true);

// 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
});
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);

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions platform/firefox/vapi-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,11 @@ vAPI.tabs.get = function(tabId, callback) {

if ( tabId === null ) {
win = Services.wm.getMostRecentWindow('navigator:browser');
tab = getTabBrowser(win).selectedTab;
tabId = this.getTabId(tab);
var tabBrowser = getTabBrowser(win);
if (tabBrowser) {
tab = tabBrowser.selectedTab;
tabId = this.getTabId(tab);
}
} else {
tab = this.getTabsForIds(tabId);
if ( tab ) {
Expand Down Expand Up @@ -1535,13 +1538,13 @@ vAPI.toolbarButton.init = function() {

var toolbarButton = document.createElement('toolbarbutton');
toolbarButton.setAttribute('id', legacyButtonId);
toolbarButton.setAttribute('type', 'panel');
toolbarButton.setAttribute('type', 'menu'); // type = panel would be more accurate, but doesn't look as good
toolbarButton.setAttribute('removable', 'true');
toolbarButton.setAttribute('class', 'toolbarbutton-1 chromeclass-toolbar-additional');
toolbarButton.setAttribute('label', vAPI.toolbarButton.label);

var toolbarButtonPanel = document.createElement("panel");
toolbarButtonPanel.setAttribute('level', 'parent');
// toolbarButtonPanel.setAttribute('level', 'parent'); NOTE: Setting level to parent breaks the popup for PaleMoon under linux (mouse pointer misaligned with content). For some reason.
vAPI.toolbarButton.populatePanel(document, toolbarButtonPanel);
toolbarButtonPanel.addEventListener('popupshowing', vAPI.toolbarButton.onViewShowing);
toolbarButtonPanel.addEventListener('popuphiding', vAPI.toolbarButton.onViewHiding);
Expand Down

0 comments on commit d9b23d4

Please sign in to comment.