From 74e88de9e9e6b10328c69f20b699be6eaf28655a Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Sat, 2 Feb 2019 14:39:23 +0800 Subject: [Basilisk] Use mousemove events instead of MousePosTracker for hiding the navigation bar in fullscreen * Tag #336 --- .../content/browser-fullScreenAndPointerLock.js | 35 +++++++--------------- 1 file changed, 10 insertions(+), 25 deletions(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js index ebe55377f..b26a31f78 100644 --- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js +++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js @@ -322,15 +322,9 @@ var FullScreen = { document.addEventListener("popuphidden", this._setPopupOpen, false); // If it is not safe to collapse, add the mouse position tracker or // else it won't be possible to hide the navigation toolbox again - if (!this._safeToCollapse()) { - let rect = gBrowser.mPanelContainer.getBoundingClientRect(); - this._mouseTargetRect = { - top: rect.top + 50, - bottom: rect.bottom, - left: rect.left, - right: rect.right - }; - MousePosTracker.addListener(this); + if (gPrefService.getBoolPref("browser.fullscreen.autohide")) { + gBrowser.mPanelContainer.addEventListener("mousemove", + this._collapseCallback, false); } // In DOM fullscreen mode, we hide toolbars with CSS if (!document.fullscreenElement) @@ -468,7 +462,8 @@ var FullScreen = { cleanup: function () { if (!window.fullScreen) { - MousePosTracker.removeListener(this); + gBrowser.mPanelContainer.removeEventListener("mousemove", + this._collapseCallback, false); document.removeEventListener("keypress", this._keyToggleCallback, false); document.removeEventListener("popupshown", this._setPopupOpen, false); document.removeEventListener("popuphidden", this._setPopupOpen, false); @@ -497,17 +492,12 @@ var FullScreen = { .getInterface(Ci.nsIDOMWindowUtils); }, - getMouseTargetRect: function() - { - return this._mouseTargetRect; - }, - // Event callbacks _expandCallback: function() { FullScreen.showNavToolbox(); }, - onMouseEnter: function() + _collapseCallback: function() { FullScreen.hideNavToolbox(); }, @@ -588,14 +578,8 @@ var FullScreen = { // Track whether mouse is near the toolbox if (trackMouse && !this.useLionFullScreen) { - let rect = gBrowser.mPanelContainer.getBoundingClientRect(); - this._mouseTargetRect = { - top: rect.top + 50, - bottom: rect.bottom, - left: rect.left, - right: rect.right - }; - MousePosTracker.addListener(this); + gBrowser.mPanelContainer.addEventListener("mousemove", + this._collapseCallback, false); } this._isChromeCollapsed = false; @@ -622,7 +606,8 @@ var FullScreen = { gNavToolbox.style.marginTop = -gNavToolbox.getBoundingClientRect().height + "px"; this._isChromeCollapsed = true; - MousePosTracker.removeListener(this); + gBrowser.mPanelContainer.removeEventListener("mousemove", + this._collapseCallback, false); }, _updateToolbars: function (aEnterFS) { -- cgit v1.2.3 From 6bb02d95f70000b150569089987701c8244d7d5d Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 13 Feb 2019 11:50:04 +0100 Subject: Remove webextensions conditional code from Basilisk. Tag issue #936 --- application/basilisk/base/content/tab-content.js | 11 ----------- application/basilisk/base/content/urlbarBindings.xml | 19 ------------------- 2 files changed, 30 deletions(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/content/tab-content.js b/application/basilisk/base/content/tab-content.js index 6d053dd2b..7441b2140 100644 --- a/application/basilisk/base/content/tab-content.js +++ b/application/basilisk/base/content/tab-content.js @@ -9,9 +9,6 @@ var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -#ifdef MOZ_WEBEXTENSIONS -Cu.import("resource://gre/modules/ExtensionContent.jsm"); -#endif XPCOMUtils.defineLazyModuleGetter(this, "E10SUtils", "resource:///modules/E10SUtils.jsm"); @@ -916,14 +913,6 @@ var UserContextIdNotifier = { UserContextIdNotifier.init(); -#ifdef MOZ_WEBEXTENSIONS -ExtensionContent.init(this); -addEventListener("unload", () => { - ExtensionContent.uninit(this); - RefreshBlocker.uninit(); -}); -#endif - addMessageListener("AllowScriptsToClose", () => { content.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowUtils) diff --git a/application/basilisk/base/content/urlbarBindings.xml b/application/basilisk/base/content/urlbarBindings.xml index eb3150581..ad11f7fdf 100644 --- a/application/basilisk/base/content/urlbarBindings.xml +++ b/application/basilisk/base/content/urlbarBindings.xml @@ -56,11 +56,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. (Components.utils.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants; -#ifdef MOZ_WEBEXTENSIONS - - (Components.utils.import("resource://gre/modules/ExtensionSearchHandler.jsm", {})).ExtensionSearchHandler; - -#endif Date: Wed, 13 Feb 2019 19:11:37 +0100 Subject: Remove WebExtension support from the platform. - Conditional code - WE APIs - WE toolkit theming --- application/basilisk/base/jar.mn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/jar.mn b/application/basilisk/base/jar.mn index c288685b9..ddfb0ffe8 100644 --- a/application/basilisk/base/jar.mn +++ b/application/basilisk/base/jar.mn @@ -95,7 +95,7 @@ browser.jar: #endif content/browser/browser-thumbnails.js (content/browser-thumbnails.js) content/browser/browser-trackingprotection.js (content/browser-trackingprotection.js) -* content/browser/tab-content.js (content/tab-content.js) + content/browser/tab-content.js (content/tab-content.js) content/browser/content.js (content/content.js) content/browser/defaultthemes/1.footer.jpg (content/defaultthemes/1.footer.jpg) content/browser/defaultthemes/1.header.jpg (content/defaultthemes/1.header.jpg) @@ -163,7 +163,7 @@ browser.jar: content/browser/contentSearchUI.css (content/contentSearchUI.css) content/browser/tabbrowser.css (content/tabbrowser.css) content/browser/tabbrowser.xml (content/tabbrowser.xml) -* content/browser/urlbarBindings.xml (content/urlbarBindings.xml) + content/browser/urlbarBindings.xml (content/urlbarBindings.xml) content/browser/utilityOverlay.js (content/utilityOverlay.js) content/browser/usercontext.svg (content/usercontext.svg) content/browser/web-panels.js (content/web-panels.js) -- cgit v1.2.3 From f227feb6efbfa61c62cba88ab85df3c650311560 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Thu, 28 Feb 2019 14:16:09 +0100 Subject: Update Basilisk FE code with HTTP Auth DoS protection. --- application/basilisk/base/content/browser.js | 5 +++++ application/basilisk/base/content/tabbrowser.xml | 5 ++++- application/basilisk/base/content/urlbarBindings.xml | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index 9fb997a42..336670fa0 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/base/content/browser.js @@ -3094,6 +3094,11 @@ function getWebNavigation() } function BrowserReloadWithFlags(reloadFlags) { + + // Reset DOS mitigation for auth prompts when user initiates a reload. + let browser = gBrowser.selectedBrowser; + delete browser.authPromptCounter; + let url = gBrowser.currentURI.spec; if (gBrowser.updateBrowserRemotenessByURL(gBrowser.selectedBrowser, url)) { // If the remoteness has changed, the new browser doesn't have any diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml index 043838020..c84c333c4 100644 --- a/application/basilisk/base/content/tabbrowser.xml +++ b/application/basilisk/base/content/tabbrowser.xml @@ -2991,7 +2991,10 @@ diff --git a/application/basilisk/base/content/urlbarBindings.xml b/application/basilisk/base/content/urlbarBindings.xml index ad11f7fdf..b9c17818a 100644 --- a/application/basilisk/base/content/urlbarBindings.xml +++ b/application/basilisk/base/content/urlbarBindings.xml @@ -540,6 +540,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Cu.reportError(ex); } + // Reset DOS mitigations for the basic auth prompt. + delete browser.authPromptCounter; + let params = { postData, allowThirdPartyFixup: true, -- cgit v1.2.3 From c1ece93c2be6fb571a013f9735dc629d7279f389 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Fri, 1 Mar 2019 14:01:09 +0100 Subject: Make the Auth prompt DOS protection a browser-element opt-in feature. --- application/basilisk/base/content/browser.xul | 3 ++- application/basilisk/base/content/tabbrowser.xml | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/content/browser.xul b/application/basilisk/base/content/browser.xul index 3208538c1..be64f1bac 100644 --- a/application/basilisk/base/content/browser.xul +++ b/application/basilisk/base/content/browser.xul @@ -997,7 +997,8 @@ contentcontextmenu="contentAreaContextMenu" autocompletepopup="PopupAutoComplete" selectmenulist="ContentSelectDropdown" - datetimepicker="DateTimePickerPanel"/> + datetimepicker="DateTimePickerPanel" + authdosprotected="true" />