mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
18efcca64b
- Bug 1134800 - Properly cache file matching patterns; r=glandium (0c65935e9) - Bug 1136177 - Amount by mouse wheel scrolling is wrong. r=jimm (6cd8824a3) - Bug 1055369 - Assertion failure: !handle || !handle->IsDoomed(). r=honzab (696f6d801) - Bug 1132728 - Don't draw focus rings on b2g. r=fabrice,bz (0bf2719a2) - Bug 1133201 - part 1 - treat null links in BrowserUtils.linkHasNoReferrer as specifying rel="noreferrer"; r=Gijs,mconley (97031e93c) - Bug 906190 - Persist 'disable protection' option for Mixed Content Blocker in child tabs - tabbrowser part. r=gavin (7467fee83) - Bug 947895 - [e10s] Null check browser.docShell in context-menu Open in new tab. r=gavin (5236b883e) - Bug 1038604 - Rename disableMCB to allowMixedContent. r=dao (2df2b924b) - Bug 1151349 - Make lldb ns(Int)Region summary handle the numRects==0 case. r=jrmuizel (19be5e2c0) - Bug 1146585 - Add a test for Cache.delete; r=bkelly (db28bcc13) - Bug 899222 - Make about:home work via message passing (r=felipe) Bug 900865: Make about:home call nsISearchEngine.getSubmission for all searches. r=gavin (15f8ae2f8) - Bug 910523 - about:home now takes into account async startup of SessionRestore;r=felipe (ceaa0687c) - Bug 927132 - Fix about:home in e10s (r=mdeboer) (53c586ee2) - Bug 897062 - Handle special clicks in e10s. r=felipe,smaug (7ec4573c8) - Bug 899348 - Implement about:tabcrashed page. r=jaws (547bb3e7c) - Bug 899348 - Dispatch an event when an out-of-process browser crashes and display an error page when that occurs (missing parts) (88c87ce75) - Bug 897066 - In e10s builds, some pages should be loaded in the chrome process (r=gavin) (4cc0f8ed5) - Bug 1038811 - Push Notifications - WebIDL changes. r=nsm. sr=jst (2ed030bf3) - Bug 1038811 - Push Notifications - ServiceWorker changes, push event implementation. r=nsm (6313c8c10) - reinstantiate file as of 2015-02-05 (7f12724c8) - Bug 1038811 - Push Notifications - Tests. r=nsm (cbac31308) - Bug 1038811 - Push Notifications - Allow MOZ_DISABLE_NONLOCAL_CONNECTIONS for push subsuite. r=ahalberstadt/jgriffin (859e182ce) - Bug 1038811 - Push Notifications - Push implementation changes. r=nsm (161a739f4) - Bug 898170 - Avoid swapping docshells in e10s mode (r=felipe) (55e96d59a) - Bug 862078 - Use an about:config preference to control multiprocess browsing, part 2 (r=felipe) [missing bits] (9fac04b17) - Bug 666809 - Support SecurityUI in e10s mode. r=felipe f=gavin [missing bits] (0e7aa1368) - Bug 691610 - e10s support for useDefaultIcon. r=felipe sr=smaug (cbf7e5341) - Bug 897066 - Underline tab titles if the tab is remote (r=gavin) [+ followup fix] (2eda1d81e) - Bug 899348 - Make reload of the about:tabcrashed work as expected. r=jaws (72843ef8f) - Bug 1133846 - Add missing arguments to logging call in ActivateTimeoutTick. r=mcmanus (a784a7ce8) - Bug 1135682 - Do not update the all MediaStreamGraph if it's not dirty, r=padenot (49eeeeef5) - Bug 1135255 - Fix mozdevice tempfile handling on Windows. r=gbrown (53a2353bd) - Bug 1134735 - Don't use tee->InitAsync in nsHttpChannel::InstallCacheListener when using cache2, r=michal (3fa833982) - Bug 1132081 - Speed up ConvertHostARGBRow() in the PNG encoder. r=jmuizelaar (6b7890586) - pointer style before patch (3336fab8f) - Bug 1135100 - Don't update GC thing pointers that haven't changed after marking r=terrence (0df3ea820)
288 lines
9.1 KiB
JavaScript
288 lines
9.1 KiB
JavaScript
/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
let Cc = Components.classes;
|
|
let Ci = Components.interfaces;
|
|
let Cu = Components.utils;
|
|
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
|
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
|
|
"resource://gre/modules/BrowserUtils.jsm");
|
|
XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerContent",
|
|
"resource://gre/modules/LoginManagerContent.jsm");
|
|
XPCOMUtils.defineLazyModuleGetter(this, "InsecurePasswordUtils",
|
|
"resource://gre/modules/InsecurePasswordUtils.jsm");
|
|
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
|
|
"resource://gre/modules/PrivateBrowsingUtils.jsm");
|
|
XPCOMUtils.defineLazyModuleGetter(this, "FormSubmitObserver",
|
|
"resource:///modules/FormSubmitObserver.jsm");
|
|
|
|
// Bug 671101 - directly using webNavigation in this context
|
|
// causes docshells to leak
|
|
this.__defineGetter__("webNavigation", function () {
|
|
return docShell.QueryInterface(Ci.nsIWebNavigation);
|
|
});
|
|
|
|
addMessageListener("WebNavigation:LoadURI", function (message) {
|
|
let flags = message.json.flags || webNavigation.LOAD_FLAGS_NONE;
|
|
|
|
webNavigation.loadURI(message.json.uri, flags, null, null, null);
|
|
});
|
|
|
|
// TabChildGlobal
|
|
var global = this;
|
|
|
|
// Load the form validation popup handler
|
|
var formSubmitObserver = new FormSubmitObserver(content, this);
|
|
|
|
addMessageListener("Browser:HideSessionRestoreButton", function (message) {
|
|
// Hide session restore button on about:home
|
|
let doc = content.document;
|
|
let container;
|
|
if (doc.documentURI.toLowerCase() == "about:home" &&
|
|
(container = doc.getElementById("sessionRestoreContainer"))){
|
|
container.hidden = true;
|
|
}
|
|
});
|
|
|
|
addEventListener("DOMFormHasPassword", function(event) {
|
|
InsecurePasswordUtils.checkForInsecurePasswords(event.target);
|
|
LoginManagerContent.onFormPassword(event);
|
|
});
|
|
addEventListener("DOMAutoComplete", function(event) {
|
|
LoginManagerContent.onUsernameInput(event);
|
|
});
|
|
addEventListener("blur", function(event) {
|
|
LoginManagerContent.onUsernameInput(event);
|
|
});
|
|
|
|
let AboutHomeListener = {
|
|
init: function(chromeGlobal) {
|
|
let self = this;
|
|
chromeGlobal.addEventListener('AboutHomeLoad', function(e) { self.onPageLoad(); }, false, true);
|
|
},
|
|
|
|
handleEvent: function(aEvent) {
|
|
switch (aEvent.type) {
|
|
case "AboutHomeLoad":
|
|
this.onPageLoad();
|
|
break;
|
|
}
|
|
},
|
|
|
|
receiveMessage: function(aMessage) {
|
|
switch (aMessage.name) {
|
|
case "AboutHome:Update":
|
|
this.onUpdate(aMessage.data);
|
|
break;
|
|
}
|
|
},
|
|
|
|
onUpdate: function(aData) {
|
|
let doc = content.document;
|
|
if (doc.documentURI.toLowerCase() != "about:home")
|
|
return;
|
|
|
|
if (aData.showRestoreLastSession && !PrivateBrowsingUtils.isWindowPrivate(content))
|
|
doc.getElementById("launcher").setAttribute("session", "true");
|
|
|
|
// Inject search engine and snippets URL.
|
|
let docElt = doc.documentElement;
|
|
// set the following attributes BEFORE searchEngineName, which triggers to
|
|
// show the snippets when it's set.
|
|
docElt.setAttribute("snippetsURL", aData.snippetsURL);
|
|
if (aData.showKnowYourRights)
|
|
docElt.setAttribute("showKnowYourRights", "true");
|
|
docElt.setAttribute("snippetsVersion", aData.snippetsVersion);
|
|
docElt.setAttribute("searchEngineName", aData.defaultEngineName);
|
|
},
|
|
|
|
onPageLoad: function() {
|
|
let doc = content.document;
|
|
if (doc.documentURI.toLowerCase() != "about:home" ||
|
|
doc.documentElement.hasAttribute("hasBrowserHandlers")) {
|
|
return;
|
|
}
|
|
|
|
doc.documentElement.setAttribute("hasBrowserHandlers", "true");
|
|
let updateListener = this;
|
|
addMessageListener("AboutHome:Update", updateListener);
|
|
addEventListener("click", this.onClick, true);
|
|
addEventListener("pagehide", function onPageHide(event) {
|
|
if (event.target.defaultView.frameElement)
|
|
return;
|
|
removeMessageListener("AboutHome:Update", updateListener);
|
|
removeEventListener("click", this.onClick, true);
|
|
removeEventListener("pagehide", onPageHide, true);
|
|
if (event.target.documentElement)
|
|
event.target.documentElement.removeAttribute("hasBrowserHandlers");
|
|
}, true);
|
|
|
|
// XXX bug 738646 - when Marketplace is launched, remove this statement and
|
|
// the hidden attribute set on the apps button in aboutHome.xhtml
|
|
if (Services.prefs.getPrefType("browser.aboutHome.apps") == Services.prefs.PREF_BOOL &&
|
|
Services.prefs.getBoolPref("browser.aboutHome.apps"))
|
|
doc.getElementById("apps").removeAttribute("hidden");
|
|
|
|
sendAsyncMessage("AboutHome:RequestUpdate");
|
|
|
|
doc.addEventListener("AboutHomeSearchEvent", function onSearch(e) {
|
|
sendAsyncMessage("AboutHome:Search", { searchData: e.detail });
|
|
}, true, true);
|
|
},
|
|
|
|
onClick: function(aEvent) {
|
|
if (!aEvent.isTrusted || // Don't trust synthetic events
|
|
aEvent.button == 2 || aEvent.target.localName != "button") {
|
|
return;
|
|
}
|
|
|
|
let originalTarget = aEvent.originalTarget;
|
|
let ownerDoc = originalTarget.ownerDocument;
|
|
let elmId = originalTarget.getAttribute("id");
|
|
|
|
switch (elmId) {
|
|
case "restorePreviousSession":
|
|
sendAsyncMessage("AboutHome:RestorePreviousSession");
|
|
ownerDoc.getElementById("launcher").removeAttribute("session");
|
|
break;
|
|
|
|
case "downloads":
|
|
sendAsyncMessage("AboutHome:Downloads");
|
|
break;
|
|
|
|
case "bookmarks":
|
|
sendAsyncMessage("AboutHome:Bookmarks");
|
|
break;
|
|
|
|
case "history":
|
|
sendAsyncMessage("AboutHome:History");
|
|
break;
|
|
|
|
case "apps":
|
|
sendAsyncMessage("AboutHome:Apps");
|
|
break;
|
|
|
|
case "addons":
|
|
sendAsyncMessage("AboutHome:Addons");
|
|
break;
|
|
|
|
case "sync":
|
|
sendAsyncMessage("AboutHome:Sync");
|
|
break;
|
|
|
|
case "settings":
|
|
sendAsyncMessage("AboutHome:Settings");
|
|
break;
|
|
}
|
|
},
|
|
};
|
|
AboutHomeListener.init(this);
|
|
|
|
var global = this;
|
|
|
|
let ClickEventHandler = {
|
|
init: function init() {
|
|
Cc["@mozilla.org/eventlistenerservice;1"]
|
|
.getService(Ci.nsIEventListenerService)
|
|
.addSystemEventListener(global, "click", this, true);
|
|
},
|
|
|
|
handleEvent: function(event) {
|
|
// Bug 903016: Most of this code is an unfortunate duplication from
|
|
// contentAreaClick in browser.js.
|
|
if (!event.isTrusted || event.defaultPrevented || event.button == 2)
|
|
return;
|
|
|
|
let [href, node] = this._hrefAndLinkNodeForClickEvent(event);
|
|
|
|
let json = { button: event.button, shiftKey: event.shiftKey,
|
|
ctrlKey: event.ctrlKey, metaKey: event.metaKey,
|
|
altKey: event.altKey, href: null, title: null,
|
|
bookmark: false };
|
|
|
|
if (href) {
|
|
json.href = href;
|
|
if (node) {
|
|
json.title = node.getAttribute("title");
|
|
|
|
if (event.button == 0 && !event.ctrlKey && !event.shiftKey &&
|
|
!event.altKey && !event.metaKey) {
|
|
json.bookmark = node.getAttribute("rel") == "sidebar";
|
|
if (json.bookmark)
|
|
event.preventDefault(); // Need to prevent the pageload.
|
|
}
|
|
}
|
|
|
|
sendAsyncMessage("Content:Click", json);
|
|
return;
|
|
}
|
|
|
|
// This might be middle mouse navigation.
|
|
if (event.button == 1)
|
|
sendAsyncMessage("Content:Click", json);
|
|
},
|
|
|
|
/**
|
|
* Extracts linkNode and href for the current click target.
|
|
*
|
|
* @param event
|
|
* The click event.
|
|
* @return [href, linkNode].
|
|
*
|
|
* @note linkNode will be null if the click wasn't on an anchor
|
|
* element (or XLink).
|
|
*/
|
|
_hrefAndLinkNodeForClickEvent: function(event) {
|
|
function isHTMLLink(aNode) {
|
|
// Be consistent with what nsContextMenu.js does.
|
|
return ((aNode instanceof content.HTMLAnchorElement && aNode.href) ||
|
|
(aNode instanceof content.HTMLAreaElement && aNode.href) ||
|
|
aNode instanceof content.HTMLLinkElement);
|
|
}
|
|
|
|
function makeURLAbsolute(aBase, aUrl) {
|
|
// Note: makeURI() will throw if aUri is not a valid URI
|
|
return makeURI(aUrl, null, makeURI(aBase)).spec;
|
|
}
|
|
|
|
let node = event.target;
|
|
while (node && !isHTMLLink(node)) {
|
|
node = node.parentNode;
|
|
}
|
|
|
|
if (node)
|
|
return [node.href, node];
|
|
|
|
// If there is no linkNode, try simple XLink.
|
|
let href, baseURI;
|
|
node = event.target;
|
|
while (node && !href) {
|
|
if (node.nodeType == content.Node.ELEMENT_NODE) {
|
|
href = node.getAttributeNS("http://www.w3.org/1999/xlink", "href");
|
|
if (href)
|
|
baseURI = node.baseURI;
|
|
}
|
|
node = node.parentNode;
|
|
}
|
|
|
|
// In case of XLink, we don't return the node we got href from since
|
|
// callers expect <a>-like elements.
|
|
return [href ? makeURLAbsolute(baseURI, href) : null, null];
|
|
}
|
|
};
|
|
ClickEventHandler.init();
|
|
|
|
// Lazily load the finder code
|
|
addMessageListener("Finder:Initialize", function () {
|
|
let {RemoteFinderListener} = Cu.import("resource://gre/modules/RemoteFinder.jsm", {});
|
|
new RemoteFinderListener(global);
|
|
});
|
|
|
|
addEventListener("DOMWebNotificationClicked", function(event) {
|
|
sendAsyncMessage("DOMWebNotificationClicked", {});
|
|
}, false);
|