From 413312a47ba6ba054f4c6d1d3ca3f7b1b20c702d Mon Sep 17 00:00:00 2001 From: Chris Aljoudi Date: Sun, 19 Apr 2015 00:13:19 -0600 Subject: [PATCH 1/3] [README] Update Safari Extensions Gallery link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c158fb75e..37e38a35f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ uBlock's main goal is to help users neutralize privacy-invading apparatus — ad #### Installation: -* **Safari**: available to install [from the homepage](https://chrismatic.io/ublock/safari/), or from the [Safari Extension Gallery](https://extensions.apple.com/details/?id=net.chrisaljoudi.uBlock-96G4BAKDQ9). +* **Safari**: available to install [from the homepage](https://chrismatic.io/ublock/safari/), or from the [Safari Extension Gallery](https://extensions.apple.com/details/?id=net.gorhill.uBlock-96G4BAKDQ9). * **Chrome**: available on the [Chrome Web Store](https://chrome.google.com/webstore/detail/ublock/epcnnfbjfcgphgdmggkamkmgojdagdnn) or for [manual](https://github.com/chrisaljoudi/uBlock/tree/master/dist#install) installation. From a9ce082c34221a4126424d52c23a7f3634594589 Mon Sep 17 00:00:00 2001 From: AlexVallat Date: Sun, 19 Apr 2015 16:43:21 +0100 Subject: [PATCH 2/3] Fixes #505 by making popup vertically aligned when appearing in Firefox panel menu --- platform/firefox/css/popup-vertical.css | 23 +++++++++++++++++++++++ platform/firefox/vapi-background.js | 14 +++++++++++++- tools/make-firefox.sh | 1 + 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 platform/firefox/css/popup-vertical.css diff --git a/platform/firefox/css/popup-vertical.css b/platform/firefox/css/popup-vertical.css new file mode 100644 index 000000000..50de6af00 --- /dev/null +++ b/platform/firefox/css/popup-vertical.css @@ -0,0 +1,23 @@ +/* Overrides to popup.css for display in a vertical panel, such as the firefox panel menu */ +body { + width: 100%; +} + +#panes > div { + display: block; +} + +#panes > #dfPane { + width: 100%; + border-right: none; +} + +body[dir="ltr"] #panes > #dfPane { + direction: ltr; /* reset scroll bar to the right */ + margin-right: 0; +} + +body[dir="rtl"] #panes > #dfPane { + direction: rtl; /* reset scroll bar to the left */ + margin-left: 0; +} diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index c28483c95..17d05aa59 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -1470,6 +1470,8 @@ vAPI.toolbarButton.init = function() { return; } + this.CustomizableUI = CustomizableUI; + this.defaultArea = CustomizableUI.AREA_NAVBAR; this.styleURI = [ '#' + this.id + '.off {', @@ -1482,7 +1484,7 @@ vAPI.toolbarButton.init = function() { vAPI.getURL('img/browsericons/icon16.svg'), ');', '}', - '#' + this.viewId + ', #' + this.viewId + ' > iframe {', + '#' + this.viewId + ' {', 'width: 160px;', 'height: 290px;', 'overflow: hidden !important;', @@ -1639,6 +1641,9 @@ vAPI.toolbarButton.onBeforeCreated = function(doc) { delayedResize(); } }; + + var CustomizableUI = this.CustomizableUI; + var widgetId = this.id; var onPopupReady = function() { var win = this.contentWindow; @@ -1646,6 +1651,13 @@ vAPI.toolbarButton.onBeforeCreated = function(doc) { return; } + var placement = CustomizableUI.getPlacementOfWidget(widgetId); + if (placement.area === CustomizableUI.AREA_PANEL) { + // Add some overrides for displaying the popup correctly in a panel + win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils) + .loadSheet(Services.io.newURI(vAPI.getURL("css/popup-vertical.css"), null, null), Ci.nsIDOMWindowUtils.AUTHOR_SHEET); + } + new win.MutationObserver(delayedResize).observe(win.document.body, { attributes: true, characterData: true, diff --git a/tools/make-firefox.sh b/tools/make-firefox.sh index 221ceffa1..c9c69dee8 100755 --- a/tools/make-firefox.sh +++ b/tools/make-firefox.sh @@ -21,6 +21,7 @@ cp platform/firefox/vapi-*.js $DES/js/ cp platform/firefox/bootstrap.js $DES/ cp platform/firefox/frame*.js $DES/ cp -R platform/firefox/img $DES/ +cp -R platform/firefox/css $DES/ cp platform/firefox/chrome.manifest $DES/ cp platform/firefox/install.rdf $DES/ cp platform/firefox/*.xul $DES/ From 4cedd4011a6549eca2e69c7d90b4ef915bffee57 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 19 Apr 2015 19:13:40 -0600 Subject: [PATCH 3/3] Oops: Safari bundle ID; quicker badge updates --- platform/safari/Update.plist | 2 +- src/js/async.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/safari/Update.plist b/platform/safari/Update.plist index f901d820c..1b0c141a4 100644 --- a/platform/safari/Update.plist +++ b/platform/safari/Update.plist @@ -6,7 +6,7 @@ CFBundleIdentifier - net.chrisaljoudi.uBlock + net.gorhill.uBlock Developer Identifier 96G4BAKDQ9 CFBundleShortVersionString diff --git a/src/js/async.js b/src/js/async.js index dc8cfa5e1..8faf5886b 100644 --- a/src/js/async.js +++ b/src/js/async.js @@ -190,7 +190,7 @@ return asyncJobManager; if ( vAPI.isBehindTheSceneTabId(tabId) ) { return; } - µb.asyncJobs.add('updateBadge-' + tabId, tabId, updateBadge, 250); + µb.asyncJobs.add('updateBadge-' + tabId, tabId, updateBadge, 0); }; return updateBadgeAsync;