summaryrefslogtreecommitdiffstats
path: root/application/palemoon/base/content
diff options
context:
space:
mode:
Diffstat (limited to 'application/palemoon/base/content')
-rw-r--r--application/palemoon/base/content/autorecovery.js4
-rw-r--r--application/palemoon/base/content/baseMenuOverlay.xul2
-rw-r--r--application/palemoon/base/content/browser-appmenu.inc35
-rw-r--r--application/palemoon/base/content/browser-fullScreen.js2
-rw-r--r--application/palemoon/base/content/browser-menubar.inc31
-rw-r--r--application/palemoon/base/content/browser-sets.inc78
-rw-r--r--application/palemoon/base/content/browser-thumbnails.js4
-rw-r--r--application/palemoon/base/content/browser.css9
-rw-r--r--application/palemoon/base/content/browser.js200
-rw-r--r--application/palemoon/base/content/browser.xul33
-rw-r--r--application/palemoon/base/content/content.js13
-rw-r--r--application/palemoon/base/content/newtab/grid.js7
-rw-r--r--application/palemoon/base/content/newtab/newTab.js4
-rw-r--r--application/palemoon/base/content/nsContextMenu.js13
-rw-r--r--application/palemoon/base/content/padlock.js3
-rw-r--r--application/palemoon/base/content/pageinfo/pageInfo.js4
-rw-r--r--application/palemoon/base/content/pageinfo/permissions.js64
-rw-r--r--application/palemoon/base/content/popup-notifications.inc12
-rw-r--r--application/palemoon/base/content/sanitize.js2
-rw-r--r--application/palemoon/base/content/tabbrowser.xml25
20 files changed, 175 insertions, 370 deletions
diff --git a/application/palemoon/base/content/autorecovery.js b/application/palemoon/base/content/autorecovery.js
index c24d1bfe4..01a092f5c 100644
--- a/application/palemoon/base/content/autorecovery.js
+++ b/application/palemoon/base/content/autorecovery.js
@@ -10,6 +10,10 @@
* have been properly initialized already.
*/
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
+
// Services = object with smart getters for common XPCOM services
Cu.import("resource://gre/modules/Services.jsm");
diff --git a/application/palemoon/base/content/baseMenuOverlay.xul b/application/palemoon/base/content/baseMenuOverlay.xul
index c6c1b16dc..f61348c9f 100644
--- a/application/palemoon/base/content/baseMenuOverlay.xul
+++ b/application/palemoon/base/content/baseMenuOverlay.xul
@@ -29,7 +29,7 @@
<menuitem id="menu_mac_show_all" label="&showAllAppsCmdMac.label;"/>
</menupopup>
<!-- Mac window menu -->
-#include ../../../toolkit/content/macWindowMenu.inc
+#include ../../../../toolkit/content/macWindowMenu.inc
#endif
#ifdef XP_WIN
diff --git a/application/palemoon/base/content/browser-appmenu.inc b/application/palemoon/base/content/browser-appmenu.inc
index 835bf22bc..cfc855484 100644
--- a/application/palemoon/base/content/browser-appmenu.inc
+++ b/application/palemoon/base/content/browser-appmenu.inc
@@ -132,38 +132,8 @@
</splitmenu>
<menuseparator class="appmenu-menuseparator"/>
<splitmenu id="appmenu_webDeveloper"
- command="Tools:DevToolbox"
label="&appMenuWebDeveloper.label;">
<menupopup id="appmenu_webDeveloper_popup">
-#ifdef MOZ_DEVTOOLS
- <menuitem id="appmenu_devToolbox"
- observes="devtoolsMenuBroadcaster_DevToolbox"/>
- <menuseparator id="appmenu_devtools_separator"/>
- <menuitem id="appmenu_devToolbar"
- observes="devtoolsMenuBroadcaster_DevToolbar"/>
- <menuitem id="appmenu_chromeDebugger"
- observes="devtoolsMenuBroadcaster_ChromeDebugger"/>
- <menuitem id="appmenu_browserConsole"
- observes="devtoolsMenuBroadcaster_BrowserConsole"/>
- <menuitem id="appmenu_responsiveUI"
- observes="devtoolsMenuBroadcaster_ResponsiveUI"/>
- <menuitem id="appmenu_eyedropper"
- observes="devtoolsMenuBroadcaster_Eyedropper"/>
- <menuitem id="appmenu_scratchpad"
- observes="devtoolsMenuBroadcaster_Scratchpad"/>
-#endif
- <menuitem id="appmenu_pageSource"
- observes="devtoolsMenuBroadcaster_PageSource"/>
- <menuitem id="appmenu_errorConsole"
- observes="devtoolsMenuBroadcaster_ErrorConsole"/>
-#ifdef MOZ_DEVTOOLS
- <menuitem id="appmenu_devtools_connect"
- observes="devtoolsMenuBroadcaster_connect"/>
-#endif
- <menuseparator id="appmenu_devToolsEndSeparator"/>
- <menuitem id="appmenu_getMoreDevtools"
- observes="devtoolsMenuBroadcaster_GetMoreTools"/>
- <menuseparator/>
#define ID_PREFIX appmenu_developer_
#define OMIT_ACCESSKEYS
#include browser-charsetmenu.inc
@@ -173,6 +143,11 @@
type="checkbox"
observes="workOfflineMenuitemState"
oncommand="BrowserOffline.toggleOfflineStatus();"/>
+ <menuseparator/>
+ <menuitem id="appmenu_pageSource"
+ observes="devtoolsMenuBroadcaster_PageSource"/>
+ <menuitem id="appmenu_javascriptConsole"
+ observes="devtoolsMenuBroadcaster_ErrorConsole"/>
</menupopup>
</splitmenu>
<menuseparator class="appmenu-menuseparator"/>
diff --git a/application/palemoon/base/content/browser-fullScreen.js b/application/palemoon/base/content/browser-fullScreen.js
index b8a29199e..400340e77 100644
--- a/application/palemoon/base/content/browser-fullScreen.js
+++ b/application/palemoon/base/content/browser-fullScreen.js
@@ -304,7 +304,7 @@ var FullScreen = {
},
_cancelAnimation: function() {
- window.mozCancelAnimationFrame(this._animationHandle);
+ window.cancelAnimationFrame(this._animationHandle);
this._animationHandle = 0;
clearTimeout(this._animationTimeout);
this._isAnimating = false;
diff --git a/application/palemoon/base/content/browser-menubar.inc b/application/palemoon/base/content/browser-menubar.inc
index fa9d7f0f4..fc6bc7694 100644
--- a/application/palemoon/base/content/browser-menubar.inc
+++ b/application/palemoon/base/content/browser-menubar.inc
@@ -534,43 +534,12 @@
label="&webDeveloperMenu.label;"
accesskey="&webDeveloperMenu.accesskey;">
<menupopup id="menuWebDeveloperPopup">
-#ifdef MOZ_DEVTOOLS
- <menuitem id="menu_devToolbox"
- observes="devtoolsMenuBroadcaster_DevToolbox"
- accesskey="&devToolboxMenuItem.accesskey;"/>
- <menuseparator id="menu_devtools_separator"/>
- <menuitem id="menu_devToolbar"
- observes="devtoolsMenuBroadcaster_DevToolbar"
- accesskey="&devToolbarMenu.accesskey;"/>
- <menuitem id="menu_chromeDebugger"
- observes="devtoolsMenuBroadcaster_ChromeDebugger"/>
- <menuitem id="menu_browserConsole"
- observes="devtoolsMenuBroadcaster_BrowserConsole"
- accesskey="&browserConsoleCmd.accesskey;"/>
- <menuitem id="menu_responsiveUI"
- observes="devtoolsMenuBroadcaster_ResponsiveUI"
- accesskey="&responsiveDesignTool.accesskey;"/>
- <menuitem id="menu_eyedropper"
- observes="devtoolsMenuBroadcaster_Eyedropper"
- accesskey="&eyedropper.accesskey;"/>
- <menuitem id="menu_scratchpad"
- observes="devtoolsMenuBroadcaster_Scratchpad"
- accesskey="&scratchpad.accesskey;"/>
-#endif
<menuitem id="menu_pageSource"
observes="devtoolsMenuBroadcaster_PageSource"
accesskey="&pageSourceCmd.accesskey;"/>
<menuitem id="javascriptConsole"
observes="devtoolsMenuBroadcaster_ErrorConsole"
accesskey="&errorConsoleCmd.accesskey;"/>
-#ifdef MOZ_DEVTOOLS
- <menuitem id="menu_devtools_connect"
- observes="devtoolsMenuBroadcaster_connect"/>
-#endif
- <menuseparator id="devToolsEndSeparator"/>
- <menuitem id="getMoreDevtools"
- observes="devtoolsMenuBroadcaster_GetMoreTools"
- accesskey="&getMoreDevtoolsCmd.accesskey;"/>
</menupopup>
</menu>
<menuitem id="menu_pageInfo"
diff --git a/application/palemoon/base/content/browser-sets.inc b/application/palemoon/base/content/browser-sets.inc
index 78cfb7faa..64228678e 100644
--- a/application/palemoon/base/content/browser-sets.inc
+++ b/application/palemoon/base/content/browser-sets.inc
@@ -92,24 +92,9 @@
<command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>
<command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
-#ifdef MOZ_DEVTOOLS
- <command id="Tools:DevToolbox" oncommand="gDevToolsBrowser.toggleToolboxCommand(gBrowser);"/>
- <command id="Tools:DevToolbar" oncommand="DeveloperToolbar.toggle();" disabled="true" hidden="true"/>
- <command id="Tools:DevToolbarFocus" oncommand="DeveloperToolbar.focusToggle();" disabled="true"/>
- <command id="Tools:DevAppMgr" oncommand="gDevToolsBrowser.openAppManager(gBrowser);" disabled="true" hidden="true"/>
- <command id="Tools:WebIDE" oncommand="gDevToolsBrowser.openWebIDE();" disabled="true" hidden="true"/>
- <command id="Tools:ChromeDebugger" oncommand="BrowserToolboxProcess.init();" disabled="true" hidden="true"/>
- <command id="Tools:BrowserConsole" oncommand="HUDService.openBrowserConsoleOrFocus();"/>
- <command id="Tools:Scratchpad" oncommand="Scratchpad.openScratchpad();" disabled="true" hidden="true"/>
- <command id="Tools:ResponsiveUI" oncommand="ResponsiveUI.toggle();" disabled="true" hidden="true"/>
- <command id="Tools:Eyedropper" oncommand="openEyedropper();"/>
-#endif
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
<command id="Tools:Permissions" oncommand="BrowserOpenPermissionsMgr();"/>
<command id="Tools:ErrorConsole" oncommand="toJavaScriptConsole()" disabled="true" hidden="true"/>
-#ifdef MOZ_DEVTOOLS
- <command id="Tools:DevToolsConnect" oncommand="gDevToolsBrowser.openConnectScreen(gBrowser)" disabled="true" hidden="true"/>
-#endif
<command id="Tools:Sanitize"
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
<command id="Tools:PrivateBrowsing"
@@ -170,46 +155,6 @@
#endif
<broadcaster id="workOfflineMenuitemState"/>
-#ifdef MOZ_DEVTOOLS
- <!-- DevTools broadcasters -->
- <broadcaster id="devtoolsMenuBroadcaster_DevToolbox"
- label="&devToolboxMenuItem.label;"
- type="checkbox" autocheck="false"
- command="Tools:DevToolbox"
- key="key_devToolbox"/>
- <broadcaster id="devtoolsMenuBroadcaster_DevToolbar"
- label="&devToolbarMenu.label;"
- type="checkbox" autocheck="false"
- command="Tools:DevToolbar"
- key="key_devToolbar"/>
- <broadcaster id="devtoolsMenuBroadcaster_DevAppMgr"
- label="&devAppMgrMenu.label;"
- command="Tools:DevAppMgr"/>
- <broadcaster id="devtoolsMenuBroadcaster_webide"
- label="&webide.label;"
- command="Tools:WebIDE"
- key="key_webide"/>
- <broadcaster id="devtoolsMenuBroadcaster_ChromeDebugger"
- label="&chromeDebuggerMenu.label;"
- command="Tools:ChromeDebugger"/>
- <broadcaster id="devtoolsMenuBroadcaster_BrowserConsole"
- label="&browserConsoleCmd.label;"
- key="key_browserConsole"
- command="Tools:BrowserConsole"/>
- <broadcaster id="devtoolsMenuBroadcaster_Scratchpad"
- label="&scratchpad.label;"
- command="Tools:Scratchpad"
- key="key_scratchpad"/>
- <broadcaster id="devtoolsMenuBroadcaster_ResponsiveUI"
- label="&responsiveDesignTool.label;"
- type="checkbox" autocheck="false"
- command="Tools:ResponsiveUI"
- key="key_responsiveUI"/>
- <broadcaster id="devtoolsMenuBroadcaster_Eyedropper"
- label="&eyedropper.label;"
- type="checkbox" autocheck="false"
- command="Tools:Eyedropper"/>
-#endif
<broadcaster id="devtoolsMenuBroadcaster_PageSource"
label="&pageSourceCmd.label;"
key="key_viewSource"
@@ -217,14 +162,6 @@
<broadcaster id="devtoolsMenuBroadcaster_ErrorConsole"
label="&errorConsoleCmd.label;"
command="Tools:ErrorConsole"/>
- <broadcaster id="devtoolsMenuBroadcaster_GetMoreTools"
- label="&getMoreDevtoolsCmd.label;"
- oncommand="openUILinkIn(gPrefService.getCharPref('browser.getdevtools.url'), 'tab');"/>
-#ifdef MOZ_DEVTOOLS
- <broadcaster id="devtoolsMenuBroadcaster_connect"
- label="&devtoolsConnect.label;"
- command="Tools:DevToolsConnect"/>
-#endif
</broadcasterset>
<keyset id="mainKeyset">
@@ -271,21 +208,6 @@
<key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
#endif
<key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
-#ifdef MOZ_DEVTOOLS
- <key id="key_browserConsole" key="&browserConsoleCmd.commandkey;" command="Tools:BrowserConsole" modifiers="accel,shift"/>
- <key id="key_devToolbox" keycode="VK_F12" keytext="F12" command="Tools:DevToolbox"/>
- <key id="key_devToolbar" keycode="&devToolbar.keycode;" modifiers="shift"
- keytext="&devToolbar.keytext;" command="Tools:DevToolbarFocus"/>
- <key id="key_responsiveUI" key="&responsiveDesignTool.commandkey;" command="Tools:ResponsiveUI"
-#ifdef XP_MACOSX
- modifiers="accel,alt"
-#else
- modifiers="accel,shift"
-#endif
- />
- <key id="key_scratchpad" keycode="&scratchpad.keycode;" modifiers="shift"
- keytext="&scratchpad.keytext;" command="Tools:Scratchpad"/>
-#endif
<key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile" modifiers="accel"/>
<key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
<key id="printKb" key="&printCmd.commandkey;" command="cmd_print" modifiers="accel"/>
diff --git a/application/palemoon/base/content/browser-thumbnails.js b/application/palemoon/base/content/browser-thumbnails.js
index d6fe25231..b06dfd503 100644
--- a/application/palemoon/base/content/browser-thumbnails.js
+++ b/application/palemoon/base/content/browser-thumbnails.js
@@ -95,7 +95,7 @@ let gBrowserThumbnails = {
// Tycho: aCallback([browser.currentURI.spec for (browser of gBrowser.browsers)]);
let result = [];
for (let browser of gBrowser.browsers) {
- result.push(browser.currentURL.spec);
+ result.push(browser.currentURI.spec);
}
aCallback(result);
},
@@ -142,7 +142,7 @@ let gBrowserThumbnails = {
// FIXME Bug 720575 - Don't capture thumbnails for SVG or XML documents as
// that currently regresses Talos SVG tests.
- if (doc instanceof SVGDocument || doc instanceof XMLDocument)
+ if (doc instanceof XMLDocument)
return false;
// There's no point in taking screenshot of loading pages.
diff --git a/application/palemoon/base/content/browser.css b/application/palemoon/base/content/browser.css
index 2c8ba3e69..e6a84421b 100644
--- a/application/palemoon/base/content/browser.css
+++ b/application/palemoon/base/content/browser.css
@@ -115,8 +115,17 @@ toolbar[printpreview="true"] {
#titlebar {
-moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
+ -moz-window-dragging: drag;
}
+%ifdef XP_WIN
+#main-window[tabsontop="true"] #TabsToolbar,
+#main-window[tabsontop="true"] #toolbar-menubar,
+#main-window[tabsontop="true"] #navigator-toolbox > toolbar:-moz-lwtheme {
+ -moz-window-dragging: drag;
+}
+%endif
+
#titlebar-spacer {
pointer-events: none;
}
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index ffb133963..8b3fa0b4f 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -3,9 +3,8 @@
# 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;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/RecentWindow.jsm");
@@ -110,20 +109,6 @@ XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () {
}
});
-#ifdef MOZ_DEVTOOLS
-XPCOMUtils.defineLazyGetter(this, "DeveloperToolbar", function() {
- let tmp = {};
- Cu.import("resource://gre/modules/devtools/DeveloperToolbar.jsm", tmp);
- return new tmp.DeveloperToolbar(window, document.getElementById("developer-toolbar"));
-});
-
-XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() {
- let tmp = {};
- Cu.import("resource://gre/modules/devtools/ToolboxProcess.jsm", tmp);
- return tmp.BrowserToolboxProcess;
-});
-#endif
-
XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
"resource://gre/modules/PageThumbs.jsm");
@@ -153,7 +138,11 @@ let gInitialPages = [
#include browser-plugins.js
#include browser-tabPreviews.js
#include browser-thumbnails.js
+
+#ifdef MOZ_WEBRTC
#include browser-webrtcUI.js
+#endif
+
#include browser-gestureSupport.js
#ifdef MOZ_SERVICES_SYNC
@@ -706,6 +695,8 @@ const gXSSObserver = {
};
var gBrowserInit = {
+ delayedStartupFinished: false,
+
onLoad: function() {
gMultiProcessBrowser = gPrefService.getBoolPref("browser.tabs.remote");
@@ -1020,7 +1011,9 @@ var gBrowserInit = {
OfflineApps.init();
IndexedDBPromptHelper.init();
AddonManager.addAddonListener(AddonsMgrListener);
+#ifdef MOZ_WEBRTC
WebrtcIndicator.init();
+#endif
// Ensure login manager is up and running.
Services.logins;
@@ -1162,27 +1155,6 @@ var gBrowserInit = {
setUrlAndSearchBarWidthForConditionalForwardButton();
});
-#ifdef MOZ_DEVTOOLS
- // Enable Chrome Debugger?
- let chromeEnabled = gPrefService.getBoolPref("devtools.chrome.enabled");
- let remoteEnabled = chromeEnabled &&
- gPrefService.getBoolPref("devtools.debugger.chrome-enabled") &&
- gPrefService.getBoolPref("devtools.debugger.remote-enabled");
- if (remoteEnabled) {
- let cmd = document.getElementById("Tools:ChromeDebugger");
- cmd.removeAttribute("disabled");
- cmd.removeAttribute("hidden");
- }
-
- // Enable Scratchpad in the UI, if the preference allows this.
- let scratchpadEnabled = gPrefService.getBoolPref(Scratchpad.prefEnabledName);
- if (scratchpadEnabled) {
- let cmd = document.getElementById("Tools:Scratchpad");
- cmd.removeAttribute("disabled");
- cmd.removeAttribute("hidden");
- }
-#endif
-
// Enable Error Console?
let consoleEnabled = gPrefService.getBoolPref("devtools.errorconsole.enabled");
if (consoleEnabled) {
@@ -1200,19 +1172,6 @@ var gBrowserInit = {
document.getElementById("appmenu_charsetMenu").hidden = true;
#endif
-#ifdef MOZ_DEVTOOLS
- // Enable Responsive UI?
- let responsiveUIEnabled = gPrefService.getBoolPref("devtools.responsiveUI.enabled");
- if (responsiveUIEnabled) {
- let cmd = document.getElementById("Tools:ResponsiveUI");
- cmd.removeAttribute("disabled");
- cmd.removeAttribute("hidden");
- }
-
- // Add Devtools menuitems and listeners
- gDevToolsBrowser.registerBrowserWindow(window);
-#endif
-
let appMenuButton = document.getElementById("appmenu-button");
let appMenuPopup = document.getElementById("appmenu-popup");
if (appMenuButton && appMenuPopup) {
@@ -1253,6 +1212,8 @@ var gBrowserInit = {
setTimeout(function () { BrowserChromeTest.markAsReady(); }, 0);
});
+ this.delayedStartupFinished = true;
+
Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
},
@@ -1288,15 +1249,6 @@ var gBrowserInit = {
if (!this._loadHandled)
return;
-#ifdef MOZ_DEVTOOLS
- gDevToolsBrowser.forgetBrowserWindow(window);
-
- let desc = Object.getOwnPropertyDescriptor(window, "DeveloperToolbar");
- if (desc && !desc.get) {
- DeveloperToolbar.destroy();
- }
-#endif
-
// First clean up services initialized in gBrowserInit.onLoad (or those whose
// uninit methods don't depend on the services having been initialized).
@@ -2065,49 +2017,43 @@ function readFromClipboard()
return url;
}
-function BrowserViewSourceOfDocument(aDocument)
+function BrowserViewSourceOfDocument(aArgsOrDocument)
{
- var pageCookie;
- var webNav;
-
- // Get the document charset
- var docCharset = "charset=" + aDocument.characterSet;
-
- // Get the nsIWebNavigation associated with the document
- try {
- var win;
- var ifRequestor;
-
- // Get the DOMWindow for the requested document. If the DOMWindow
- // cannot be found, then just use the content window...
- //
- // XXX: This is a bit of a hack...
- win = aDocument.defaultView;
- if (win == window) {
- win = content;
- }
- ifRequestor = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
-
- webNav = ifRequestor.getInterface(nsIWebNavigation);
- } catch(err) {
- // If nsIWebNavigation cannot be found, just get the one for the whole
- // window...
- webNav = gBrowser.webNavigation;
+ let args;
+
+ if (aArgsOrDocument instanceof Document) {
+ let doc = aArgsOrDocument;
+
+ let requestor = doc.defaultView
+ .QueryInterface(Ci.nsIInterfaceRequestor);
+ let browser = requestor.getInterface(Ci.nsIWebNavigation)
+ .QueryInterface(Ci.nsIDocShell)
+ .chromeEventHandler;
+ let outerWindowID = requestor.getInterface(Ci.nsIDOMWindowUtils)
+ .outerWindowID;
+ let URL = browser.currentURI.spec;
+ args = { browser, outerWindowID, URL };
+ } else {
+ args = aArgsOrDocument;
}
- //
- // Get the 'PageDescriptor' for the current document. This allows the
- // view-source to access the cached copy of the content rather than
- // refetching it from the network...
- //
- try{
- var PageLoader = webNav.QueryInterface(Components.interfaces.nsIWebPageDescriptor);
- pageCookie = PageLoader.currentDescriptor;
- } catch(err) {
- // If no page descriptor is available, just use the view-source URL...
+ let viewInternal = () => {
+ top.gViewSourceUtils.viewSource(args);
}
- top.gViewSourceUtils.viewSource(webNav.currentURI.spec, pageCookie, aDocument);
+ // Check if external view source is enabled. If so, try it. If it fails,
+ // fallback to internal view source.
+ if (Services.prefs.getBoolPref("view_source.editor.external")) {
+ top.gViewSourceUtils
+ .openInExternalEditor(args, null, null, null, result => {
+ if (!result) {
+ viewInternal();
+ }
+ });
+ } else {
+ // Display using internal view source
+ viewInternal();
+ }
}
// doc - document to use for source, or null for this window's document
@@ -6880,20 +6826,9 @@ var TabContextMenu = {
};
#ifdef MOZ_DEVTOOLS
+// Note: Do not delete! It is used for: base/content/nsContextMenu.js
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
- "resource://gre/modules/devtools/gDevTools.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "gDevToolsBrowser",
- "resource://gre/modules/devtools/gDevTools.jsm");
-
-Object.defineProperty(this, "HUDService", {
- get: function HUDService_getter() {
- let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
- return devtools.require("devtools/webconsole/hudservice").HUDService;
- },
- configurable: true,
- enumerable: true
-});
+ "resource://devtools/client/framework/gDevTools.jsm");
#endif
// Prompt user to restart the browser in safe mode or normally
@@ -6984,49 +6919,6 @@ function toggleAddonBar() {
setToolbarVisibility(addonBar, addonBar.collapsed);
}
-#ifdef MOZ_DEVTOOLS
-var Scratchpad = {
- prefEnabledName: "devtools.scratchpad.enabled",
-
- openScratchpad: function SP_openScratchpad() {
- return this.ScratchpadManager.openScratchpad();
- }
-};
-
-XPCOMUtils.defineLazyGetter(Scratchpad, "ScratchpadManager", function() {
- let tmp = {};
- Cu.import("resource://gre/modules/devtools/scratchpad-manager.jsm", tmp);
- return tmp.ScratchpadManager;
-});
-
-var ResponsiveUI = {
- toggle: function RUI_toggle() {
- this.ResponsiveUIManager.toggle(window, gBrowser.selectedTab);
- }
-};
-
-XPCOMUtils.defineLazyGetter(ResponsiveUI, "ResponsiveUIManager", function() {
- let tmp = {};
- Cu.import("resource://gre/modules/devtools/responsivedesign.jsm", tmp);
- return tmp.ResponsiveUIManager;
-});
-
-function openEyedropper() {
- var eyedropper = new this.Eyedropper(this, { context: "menu",
- copyOnSelect: true });
- eyedropper.open();
-}
-
-Object.defineProperty(this, "Eyedropper", {
- get: function() {
- let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
- return devtools.require("devtools/eyedropper/eyedropper").Eyedropper;
- },
- configurable: true,
- enumerable: true
-});
-#endif
-
XPCOMUtils.defineLazyGetter(window, "gShowPageResizers", function () {
#ifdef XP_WIN
// Only show resizers on Windows 2000 and XP
diff --git a/application/palemoon/base/content/browser.xul b/application/palemoon/base/content/browser.xul
index 3044ce675..0a0ce01dc 100644
--- a/application/palemoon/base/content/browser.xul
+++ b/application/palemoon/base/content/browser.xul
@@ -440,8 +440,10 @@
<image id="alert-plugins-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="blocked-plugins-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="mixed-content-blocked-notification-icon" class="notification-anchor-icon" role="button"/>
+#ifdef MOZ_WEBRTC
<image id="webRTC-shareDevices-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="webRTC-sharingDevices-notification-icon" class="notification-anchor-icon" role="button"/>
+#endif
<image id="pointerLock-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="servicesInstall-notification-icon" class="notification-anchor-icon" role="button"/>
</box>
@@ -513,7 +515,7 @@
flex="100" persist="width" removable="true">
<searchbar id="searchbar" flex="1"/>
</toolbaritem>
-
+#ifdef MOZ_WEBRTC
<toolbarbutton id="webrtc-status-button"
class="toolbarbutton-1 chromeclass-toolbar-additional"
type="menu"
@@ -525,7 +527,7 @@
onpopuphiding="WebrtcIndicator.clearPopup(this);"
oncommand="WebrtcIndicator.menuCommand(event.target);"/>
</toolbarbutton>
-
+#endif
<toolbarbutton id="bookmarks-menu-button"
class="toolbarbutton-1 chromeclass-toolbar-additional"
persist="class"
@@ -971,33 +973,6 @@
<vbox id="browser-bottombox" layer="true">
<notificationbox id="global-notificationbox"/>
-#ifdef MOZ_DEVTOOLS
- <toolbar id="developer-toolbar"
- class="devtools-toolbar"
- hidden="true">
-#ifdef XP_MACOSX
- <toolbarbutton id="developer-toolbar-closebutton"
- class="devtools-closebutton"
- oncommand="DeveloperToolbar.hide();"
- tooltiptext="&devToolbarCloseButton.tooltiptext;"/>
-#endif
- <stack class="gclitoolbar-stack-node" flex="1">
- <textbox class="gclitoolbar-input-node" rows="1"/>
- <hbox class="gclitoolbar-complete-node"/>
- </stack>
- <toolbarbutton id="developer-toolbar-toolbox-button"
- class="developer-toolbar-button"
- observes="devtoolsMenuBroadcaster_DevToolbox"
- tooltiptext="&devToolbarToolsButton.tooltip;"/>
-#ifndef XP_MACOSX
- <toolbarbutton id="developer-toolbar-closebutton"
- class="devtools-closebutton"
- oncommand="DeveloperToolbar.hide();"
- tooltiptext="&devToolbarCloseButton.tooltiptext;"/>
-#endif
- </toolbar>
-#endif
-
<toolbar id="addon-bar"
toolbarname="&statusBar.label;" accesskey="&statusBar.accesskey;"
collapsed="true"
diff --git a/application/palemoon/base/content/content.js b/application/palemoon/base/content/content.js
index 3587bbeef..19c8b0682 100644
--- a/application/palemoon/base/content/content.js
+++ b/application/palemoon/base/content/content.js
@@ -3,9 +3,9 @@
* 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;
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -13,6 +13,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
"resource://gre/modules/BrowserUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerContent",
"resource://gre/modules/LoginManagerContent.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "LoginFormFactory",
+ "resource://gre/modules/LoginManagerContent.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "InsecurePasswordUtils",
"resource://gre/modules/InsecurePasswordUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FormSubmitObserver",
@@ -47,8 +49,9 @@ addMessageListener("Browser:HideSessionRestoreButton", function (message) {
});
addEventListener("DOMFormHasPassword", function(event) {
- InsecurePasswordUtils.checkForInsecurePasswords(event.target);
- LoginManagerContent.onFormPassword(event);
+ LoginManagerContent.onDOMFormHasPassword(event, content);
+ let formLike = LoginFormFactory.createFromForm(event.target);
+ InsecurePasswordUtils.reportInsecurePasswords(formLike);
});
addEventListener("DOMAutoComplete", function(event) {
LoginManagerContent.onUsernameInput(event);
diff --git a/application/palemoon/base/content/newtab/grid.js b/application/palemoon/base/content/newtab/grid.js
index 37559a063..3b7dfc35f 100644
--- a/application/palemoon/base/content/newtab/grid.js
+++ b/application/palemoon/base/content/newtab/grid.js
@@ -109,7 +109,12 @@ let gGrid = {
// (Re-)initialize all cells.
let cellElements = this.node.querySelectorAll(".newtab-cell");
- this._cells = [new Cell(this, cell) for (cell of cellElements)];
+ // Tycho: this._cells = [new Cell(this, cell) for (cell of cellElements)];
+ this.cells = [];
+
+ for (let cellItem of cellElements) {
+ this.cells.push(new Cell(this, cellItem));
+ }
},
/**
diff --git a/application/palemoon/base/content/newtab/newTab.js b/application/palemoon/base/content/newtab/newTab.js
index 77c929125..6d8647ab6 100644
--- a/application/palemoon/base/content/newtab/newTab.js
+++ b/application/palemoon/base/content/newtab/newTab.js
@@ -4,8 +4,8 @@
"use strict";
-let Cu = Components.utils;
-let Ci = Components.interfaces;
+var Cu = Components.utils;
+var Ci = Components.interfaces;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js
index 8e6bc96c2..f914f5841 100644
--- a/application/palemoon/base/content/nsContextMenu.js
+++ b/application/palemoon/base/content/nsContextMenu.js
@@ -422,12 +422,17 @@ nsContextMenu.prototype = {
},
inspectNode: function CM_inspectNode() {
- let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
+ let {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
let gBrowser = this.browser.ownerDocument.defaultView.gBrowser;
- let tt = devtools.TargetFactory.forTab(gBrowser.selectedTab);
- return gDevTools.showToolbox(tt, "inspector").then(function(toolbox) {
+ let target = devtools.TargetFactory.forTab(gBrowser.selectedTab);
+
+ return gDevTools.showToolbox(target, "inspector").then(function(toolbox) {
let inspector = toolbox.getCurrentPanel();
- inspector.selection.setNode(this.target, "browser-context-menu");
+
+ this.browser.messageManager.sendAsyncMessage("debug:inspect", {}, {node: this.target});
+ inspector.walker.findInspectingNode().then(nodeFront => {
+ inspector.selection.setNodeFront(nodeFront, "browser-context-menu");
+ });
}.bind(this));
},
diff --git a/application/palemoon/base/content/padlock.js b/application/palemoon/base/content/padlock.js
index 9e6715769..9c29524ce 100644
--- a/application/palemoon/base/content/padlock.js
+++ b/application/palemoon/base/content/padlock.js
@@ -1,3 +1,6 @@
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
var padlock_PadLock =
diff --git a/application/palemoon/base/content/pageinfo/pageInfo.js b/application/palemoon/base/content/pageinfo/pageInfo.js
index ba93ee817..83f0ddb91 100644
--- a/application/palemoon/base/content/pageinfo/pageInfo.js
+++ b/application/palemoon/base/content/pageinfo/pageInfo.js
@@ -359,7 +359,7 @@ function loadPageInfo()
makeTabs(gDocument, gWindow);
initFeedTab();
- onLoadPermission();
+ onLoadPermission(gDocument.nodePrincipal);
/* Call registered overlay init functions */
onLoadRegistry.forEach(function(func) { func(); });
@@ -857,7 +857,7 @@ function onBlockImage()
if (checkbox.checked)
permissionManager.add(uri, "image", nsIPermissionManager.DENY_ACTION);
else
- permissionManager.remove(uri.host, "image");
+ permissionManager.remove(uri, "image");
}
function onImageSelect()
diff --git a/application/palemoon/base/content/pageinfo/permissions.js b/application/palemoon/base/content/pageinfo/permissions.js
index 7a0006b61..2fa0cc303 100644
--- a/application/palemoon/base/content/pageinfo/permissions.js
+++ b/application/palemoon/base/content/pageinfo/permissions.js
@@ -12,9 +12,10 @@ const IMAGE_DENY = 2;
const COOKIE_DENY = 2;
const COOKIE_SESSION = 2;
-const nsIQuotaManager = Components.interfaces.nsIQuotaManager;
+const nsIQuotaManagerService = Components.interfaces.nsIQuotaManagerService;
var gPermURI;
+var gPermPrincipal;
var gPrefs;
var gUsageRequest;
@@ -107,7 +108,7 @@ var permissionObserver = {
}
};
-function onLoadPermission()
+function onLoadPermission(principal)
{
gPrefs = Components.classes[PREFERENCES_CONTRACTID]
.getService(Components.interfaces.nsIPrefBranch);
@@ -116,6 +117,7 @@ function onLoadPermission()
var permTab = document.getElementById("permTab");
if (/^https?$/.test(uri.scheme)) {
gPermURI = uri;
+ gPermPrincipal = principal;
var hostText = document.getElementById("hostText");
hostText.value = gPermURI.host;
@@ -187,7 +189,7 @@ function onCheckboxClick(aPartId)
var command = document.getElementById("cmd_" + aPartId + "Toggle");
var checkbox = document.getElementById(aPartId + "Def");
if (checkbox.checked) {
- permissionManager.remove(gPermURI.host, aPartId);
+ permissionManager.remove(gPermURI, aPartId);
command.setAttribute("disabled", "true");
var perm = gPermObj[aPartId]();
setRadioState(aPartId, perm);
@@ -211,7 +213,7 @@ function onRadioClick(aPartId)
var id = radioGroup.selectedItem.id;
var permission = id.split('#')[1];
if (permission == UNKNOWN) {
- permissionManager.remove(gPermURI.host, aPartId);
+ permissionManager.remove(gPermURI, aPartId);
} else {
permissionManager.add(gPermURI, aPartId, permission);
}
@@ -230,10 +232,13 @@ function initIndexedDBRow()
row.appendChild(extras);
- var quotaManager = Components.classes["@mozilla.org/dom/quota/manager;1"]
- .getService(nsIQuotaManager);
+ var quotaManagerService =
+ Components.classes["@mozilla.org/dom/quota-manager-service;1"]
+ .getService(nsIQuotaManagerService);
+
gUsageRequest =
- quotaManager.getUsageForURI(gPermURI, onIndexedDBUsageCallback);
+ quotaManagerService.getUsageForPrincipal(gPermPrincipal,
+ onIndexedDBUsageCallback);
var status = document.getElementById("indexedDBStatus");
var button = document.getElementById("indexedDBClear");
@@ -245,22 +250,24 @@ function initIndexedDBRow()
function onIndexedDBClear()
{
- Components.classes["@mozilla.org/dom/quota/manager;1"]
- .getService(nsIQuotaManager)
- .clearStoragesForURI(gPermURI);
+ Components.classes["@mozilla.org/dom/quota-manager-service;1"]
+ .getService(nsIQuotaManagerService)
+ .clearStoragesForPrincipal(gPermPrincipal);
var permissionManager = Components.classes[PERMISSION_CONTRACTID]
.getService(nsIPermissionManager);
- permissionManager.remove(gPermURI.host, "indexedDB");
+ permissionManager.remove(gPermURI, "indexedDB");
initIndexedDBRow();
}
-function onIndexedDBUsageCallback(uri, usage, fileUsage)
+function onIndexedDBUsageCallback(request)
{
+ let uri = request.principal.URI;
if (!uri.equals(gPermURI)) {
- throw new Error("Callback received for bad URI: " + uri);
+ throw new Error("Callback received for bad URI: " + uri.spec);
}
+ let usage = request.result.usage;
if (usage) {
if (!("DownloadUtils" in window)) {
Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
@@ -355,20 +362,33 @@ function initPluginsRow() {
}
}
- let entries = [
- {
+ // Tycho:
+ // let entries = [
+ // {
+ // "permission": item[0],
+ // "obj": item[1],
+ // }
+ // for (item of permissionMap)
+ // ];
+ let entries = [];
+ for (let item of permissionMap) {
+ entries.push({
"permission": item[0],
- "obj": item[1],
- }
- for (item of permissionMap)
- ];
+ "obj": item[1]
+ });
+ }
entries.sort(function(a, b) {
return ((a.obj.name < b.obj.name) ? -1 : (a.obj.name == b.obj.name ? 0 : 1));
});
- let permissionEntries = [
- fillInPluginPermissionTemplate(p.permission, p.obj) for (p of entries)
- ];
+ // Tycho:
+ // let permissionEntries = [
+ // fillInPluginPermissionTemplate(p.permission, p.obj) for (p of entries)
+ // ];
+ let permissionEntries = [];
+ entries.forEach(function (p) {
+ permissionEntries.push(fillInPluginPermissionTemplate(p.permission, p.obj));
+ });
let permPluginsRow = document.getElementById("permPluginsRow");
clearPluginPermissionTemplate();
diff --git a/application/palemoon/base/content/popup-notifications.inc b/application/palemoon/base/content/popup-notifications.inc
index 04f4cb5b7..7be975b7f 100644
--- a/application/palemoon/base/content/popup-notifications.inc
+++ b/application/palemoon/base/content/popup-notifications.inc
@@ -54,7 +54,7 @@
</hbox>
</panel>
-
+#ifdef MOZ_WEBRTC
<popupnotification id="webRTC-shareDevices-notification" hidden="true">
<popupnotificationcontent id="webRTC-selectCamera" orient="vertical">
<separator class="thin"/>
@@ -75,7 +75,7 @@
</menulist>
</popupnotificationcontent>
</popupnotification>
-
+#endif
<popupnotification id="servicesInstall-notification" hidden="true">
<popupnotificationcontent orient="vertical" align="start">
<!-- XXX bug 974146, tests are looking for this, can't remove yet. -->
@@ -89,6 +89,14 @@
</popupnotificationcontent>
</popupnotification>
+ <popupnotification id="password-notification" hidden="true">
+ <popupnotificationcontent orient="vertical">
+ <textbox id="password-notification-username"/>
+ <textbox id="password-notification-password" type="password" show-content=""/>
+ <checkbox id="password-notification-visibilityToggle" hidden="true"/>
+ </popupnotificationcontent>
+ </popupnotification>
+
<popupnotification id="mixed-content-blocked-notification" hidden="true">
<popupnotificationcontent orient="vertical" align="start">
<separator/>
diff --git a/application/palemoon/base/content/sanitize.js b/application/palemoon/base/content/sanitize.js
index 89843c86d..fccec6c98 100644
--- a/application/palemoon/base/content/sanitize.js
+++ b/application/palemoon/base/content/sanitize.js
@@ -15,7 +15,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Promise",
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
- "resource://gre/modules/devtools/Console.jsm");
+ "resource://gre/modules/Console.jsm");
function Sanitizer() {}
Sanitizer.prototype = {
diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml
index 3e30c2ba1..b5395bbd9 100644
--- a/application/palemoon/base/content/tabbrowser.xml
+++ b/application/palemoon/base/content/tabbrowser.xml
@@ -302,6 +302,16 @@
</body>
</method>
+ <method name="getBrowserForContentWindow">
+ <parameter name="aWindow"/>
+ <body>
+ <![CDATA[
+ var tab = this._getTabForContentWindow(aWindow);
+ return tab ? tab.linkedBrowser : null;
+ ]]>
+ </body>
+ </method>
+
<method name="getBrowserForOuterWindowID">
<parameter name="aID"/>
<body>
@@ -707,7 +717,8 @@
let autocomplete = this.mTabBrowser._placesAutocomplete;
if (this.mBrowser.registeredOpenURI) {
- autocomplete.unregisterOpenPage(this.mBrowser.registeredOpenURI);
+ autocomplete.unregisterOpenPage(this.mBrowser.registeredOpenURI,
+ this.mBrowser.getAttribute("usercontextid") || 0);
delete this.mBrowser.registeredOpenURI;
}
// Tabs in private windows aren't registered as "Open" so
@@ -715,7 +726,8 @@
if (!isBlankPageURL(aLocation.spec) &&
(!PrivateBrowsingUtils.isWindowPrivate(window) ||
PrivateBrowsingUtils.permanentPrivateBrowsing)) {
- autocomplete.registerOpenPage(aLocation);
+ autocomplete.registerOpenPage(aLocation,
+ this.mBrowser.getAttribute("usercontextid") || 0);
this.mBrowser.registeredOpenURI = aLocation;
}
}
@@ -1865,7 +1877,8 @@
this.mTabListeners[aTab._tPos].destroy();
if (browser.registeredOpenURI && !aTabWillBeMoved) {
- this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
+ this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI,
+ browser.getAttribute("usercontextid") || 0);
delete browser.registeredOpenURI;
}
@@ -2209,7 +2222,8 @@
<![CDATA[
// If the current URI is registered as open remove it from the list.
if (aOurBrowser.registeredOpenURI) {
- this._placesAutocomplete.unregisterOpenPage(aOurBrowser.registeredOpenURI);
+ this._placesAutocomplete.unregisterOpenPage(aOurBrowser.registeredOpenURI,
+ aOurBrowser.getAttribute("usercontextid") || 0);
delete aOurBrowser.registeredOpenURI;
}
@@ -3066,7 +3080,8 @@
for (var i = 0; i < this.mTabListeners.length; ++i) {
let browser = this.getBrowserAtIndex(i);
if (browser.registeredOpenURI) {
- this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
+ this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI,
+ browser.getAttribute("usercontextid") || 0);
delete browser.registeredOpenURI;
}
browser.webProgress.removeProgressListener(this.mTabFilters[i]);