summaryrefslogtreecommitdiffstats
path: root/browser/base/content/browser.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-05-01 00:01:56 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-05-01 00:01:56 +0200
commit67bd9ff3af81a4e6b09ab9686c09f0f5cf09b452 (patch)
tree9189254a78e2d02e5dd1d7cd2db38b8e21daf47e /browser/base/content/browser.js
parenta0643b997c05e2b72456d184e4ec9e0f78a34578 (diff)
downloadUXP-67bd9ff3af81a4e6b09ab9686c09f0f5cf09b452.tar
UXP-67bd9ff3af81a4e6b09ab9686c09f0f5cf09b452.tar.gz
UXP-67bd9ff3af81a4e6b09ab9686c09f0f5cf09b452.tar.lz
UXP-67bd9ff3af81a4e6b09ab9686c09f0f5cf09b452.tar.xz
UXP-67bd9ff3af81a4e6b09ab9686c09f0f5cf09b452.zip
Bug 1332595 - remove useless click handling
Diffstat (limited to 'browser/base/content/browser.js')
-rwxr-xr-xbrowser/base/content/browser.js52
1 files changed, 3 insertions, 49 deletions
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index 696a2871a..18f9990d0 100755
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -2779,24 +2779,6 @@ var BrowserOnClick = {
}
},
- handleEvent: function (event) {
- if (!event.isTrusted || // Don't trust synthetic events
- event.button == 2) {
- return;
- }
-
- let originalTarget = event.originalTarget;
- let ownerDoc = originalTarget.ownerDocument;
- if (!ownerDoc) {
- return;
- }
-
- if (gMultiProcessBrowser &&
- ownerDoc.documentURI.toLowerCase() == "about:newtab") {
- this.onE10sAboutNewTab(event, ownerDoc);
- }
- },
-
receiveMessage: function (msg) {
switch (msg.name) {
case "Browser:CertExceptionError":
@@ -2990,28 +2972,6 @@ var BrowserOnClick = {
}
},
- /**
- * This functions prevents navigation from happening directly through the <a>
- * link in about:newtab (which is loaded in the parent and therefore would load
- * the next page also in the parent) and instructs the browser to open the url
- * in the current tab which will make it update the remoteness of the tab.
- */
- onE10sAboutNewTab: function(event, ownerDoc) {
- let isTopFrame = (ownerDoc.defaultView.parent === ownerDoc.defaultView);
- if (!isTopFrame) {
- return;
- }
-
- let anchorTarget = event.originalTarget.parentNode;
-
- if (anchorTarget instanceof HTMLAnchorElement &&
- anchorTarget.classList.contains("newtab-link")) {
- event.preventDefault();
- let where = whereToOpenLink(event, false, false);
- openLinkIn(anchorTarget.href, where, { charset: ownerDoc.characterSet, referrerURI: ownerDoc.documentURIObject });
- }
- },
-
ignoreWarningButton: function (reason) {
// Allow users to override and continue through to the site,
// but add a notify bar as a reminder, so that they don't lose
@@ -4809,13 +4769,9 @@ var TabsProgressListener = {
}
}
- // Attach a listener to watch for "click" events bubbling up from error
- // pages and other similar pages (like about:newtab). This lets us fix bugs
- // like 401575 which require error page UI to do privileged things, without
- // letting error pages have any privilege themselves.
- // We can't look for this during onLocationChange since at that point the
- // document URI is not yet the about:-uri of the error page.
-
+ // We used to listen for clicks in the browser here, but when that
+ // became unnecessary, removing the code below caused focus issues.
+ // This code should be removed. Tracked in bug 1337794.
let isRemoteBrowser = aBrowser.isRemoteBrowser;
// We check isRemoteBrowser here to avoid requesting the doc CPOW
let doc = isRemoteBrowser ? null : aWebProgress.DOMWindow.document;
@@ -4830,11 +4786,9 @@ var TabsProgressListener = {
// STATE_STOP may be received twice for documents, thus store an
// attribute to ensure handling it just once.
doc.documentElement.setAttribute("hasBrowserHandlers", "true");
- aBrowser.addEventListener("click", BrowserOnClick, true);
aBrowser.addEventListener("pagehide", function onPageHide(event) {
if (event.target.defaultView.frameElement)
return;
- aBrowser.removeEventListener("click", BrowserOnClick, true);
aBrowser.removeEventListener("pagehide", onPageHide, true);
if (event.target.documentElement)
event.target.documentElement.removeAttribute("hasBrowserHandlers");