diff options
Diffstat (limited to 'application/palemoon')
9 files changed, 162 insertions, 11 deletions
diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index 9a6a9fdc9..3c550ab8b 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -38,14 +38,15 @@ pref("extensions.strictCompatibility", false); pref("extensions.minCompatibleAppVersion", "1.5"); // Preferences for APO integration -#define APO_AM_URL addons.palemoon.org/integration/addon-manager +#define APO_URL addons.palemoon.org +#define APO_AM_URL @APO_URL@/integration/addon-manager #define APO_AUS_ARGS reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE% pref("extensions.getAddons.cache.enabled", false); pref("extensions.getAddons.maxResults", 10); pref("extensions.getAddons.get.url", "https://@APO_AM_URL@/internal/get?addonguid=%IDS%&os=%OS%&version=%VERSION%"); pref("extensions.getAddons.getWithPerformance.url", "https://@APO_AM_URL@/internal/get?addonguid=%IDS%&os=%OS%&version=%VERSION%"); -pref("extensions.getAddons.search.browseURL", "https://@APO_AM_URL@/external/recommended"); +pref("extensions.getAddons.search.browseURL", "https://@APO_AM_URL@/search/?terms=%TERMS%"); pref("extensions.getAddons.search.url", "https://@APO_AM_URL@/internal/search?q=%TERMS%&locale=%LOCALE%&os=%OS%&version=%VERSION%"); pref("extensions.webservice.discoverURL", "http://@APO_AM_URL@/internal/discover/"); pref("extensions.getAddons.recommended.url", "https://@APO_AM_URL@/internal/recommended?locale=%LOCALE%&os=%OS%"); @@ -70,7 +71,7 @@ pref("extensions.update.autoUpdateDefault", true); pref("extensions.autoDisableScopes", 15); // Dictionary download preference -pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/"); +pref("browser.dictionaries.download.url", "https://@APO_URL@/dictionaries/"); // Get More Tools link URL pref("browser.getdevtools.url","https://@APO_AM_URL@/external/devtools"); diff --git a/application/palemoon/base/content/baseMenuOverlay.xul b/application/palemoon/base/content/baseMenuOverlay.xul index e9019dc55..d7c983671 100644 --- a/application/palemoon/base/content/baseMenuOverlay.xul +++ b/application/palemoon/base/content/baseMenuOverlay.xul @@ -41,7 +41,7 @@ label="&helpMenu.label;" accesskey="&helpMenu.accesskey;"> #endif - <menupopup id="menu_HelpPopup"> + <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();"> <menuitem id="menu_openHelp" oncommand="openHelpLink('firefox-help')" onclick="checkForMiddleClick(this, event);" @@ -66,6 +66,14 @@ accesskey="&helpSafeMode.accesskey;" label="&helpSafeMode.label;" oncommand="restart(true);"/> + <menuseparator id="updateSeparator"/> + <menuitem id="checkForUpdates" class="menuitem-iconic" +#ifdef MOZ_UPDATER + label="&updateCmd.label;" + oncommand="checkForUpdates();"/> +#else + hidden="true"/> +#endif <menuseparator id="aboutSeparator"/> <menuitem id="aboutName" accesskey="&aboutProduct.accesskey;" diff --git a/application/palemoon/base/content/browser-appmenu.inc b/application/palemoon/base/content/browser-appmenu.inc index cfc855484..ffb117a60 100644 --- a/application/palemoon/base/content/browser-appmenu.inc +++ b/application/palemoon/base/content/browser-appmenu.inc @@ -341,7 +341,7 @@ <splitmenu id="appmenu_help" label="&helpMenu.label;" oncommand="openHelpLink('firefox-help')"> - <menupopup id="appmenu_helpMenupopup"> + <menupopup id="appmenu_helpMenupopup" onpopupshowing="buildHelpMenu();"> <menuitem id="appmenu_openHelp" label="&helpMenu.label;" oncommand="openHelpLink('firefox-help')" @@ -358,6 +358,13 @@ <menuitem id="appmenu_safeMode" label="&appMenuSafeMode.label;" oncommand="restart(true);"/> +#ifdef MOZ_UPDATER + <menuseparator/> + <menuitem id="appmenu_checkForUpdates" + class="menuitem-iconic" + label="&updateCmd.label;" + oncommand="checkForUpdates();"/> +#endif <menuseparator/> <menuitem id="appmenu_about" label="&aboutProduct.label;" diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index eb4916e37..3feeef9b6 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -4408,7 +4408,13 @@ nsBrowserAccess.prototype = { openURI: function (aURI, aOpener, aWhere, aContext) { var newWindow = null; - var isExternal = (aContext == Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL); + var isExternal = !!(aContext & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL); + + if (aOpener && isExternal) { + Cu.reportError("nsBrowserAccess.openURI did not expect an opener to be " + + "passed if the context is OPEN_EXTERNAL."); + throw Cr.NS_ERROR_FAILURE; + } if (isExternal && aURI && aURI.schemeIs("chrome")) { dump("use -chrome command-line option to load external chrome urls\n"); diff --git a/application/palemoon/base/content/utilityOverlay.js b/application/palemoon/base/content/utilityOverlay.js index 2c1a95f83..fe148ad04 100644 --- a/application/palemoon/base/content/utilityOverlay.js +++ b/application/palemoon/base/content/utilityOverlay.js @@ -541,6 +541,117 @@ function isBidiEnabled() { return rv; } +#ifdef MOZ_UPDATER +/** + * Opens the update manager and checks for updates to the application. + */ +function checkForUpdates() +{ + var um = + Components.classes["@mozilla.org/updates/update-manager;1"]. + getService(Components.interfaces.nsIUpdateManager); + var prompter = + Components.classes["@mozilla.org/updates/update-prompt;1"]. + createInstance(Components.interfaces.nsIUpdatePrompt); + + // If there's an update ready to be applied, show the "Update Downloaded" + // UI instead and let the user know they have to restart the application for + // the changes to be applied. + if (um.activeUpdate && um.activeUpdate.state == "pending") + prompter.showUpdateDownloaded(um.activeUpdate); + else + prompter.checkForUpdates(); +} +#endif + +/** + * Set up the help menu software update items to show proper status, + * also disabling the items if update is disabled. + */ +function buildHelpMenu() +{ +#ifdef MOZ_UPDATER + var updates = + Components.classes["@mozilla.org/updates/update-service;1"]. + getService(Components.interfaces.nsIApplicationUpdateService); + var um = + Components.classes["@mozilla.org/updates/update-manager;1"]. + getService(Components.interfaces.nsIUpdateManager); + + // Disable the UI if the update enabled pref has been locked by the + // administrator or if we cannot update for some other reason. + var checkForUpdates = document.getElementById("checkForUpdates"); + var appMenuCheckForUpdates = document.getElementById("appmenu_checkForUpdates"); + var canCheckForUpdates = updates.canCheckForUpdates; + checkForUpdates.setAttribute("disabled", !canCheckForUpdates); + appMenuCheckForUpdates.setAttribute("disabled", !canCheckForUpdates); + if (!canCheckForUpdates) + return; + + var strings = document.getElementById("bundle_browser"); + var activeUpdate = um.activeUpdate; + + // If there's an active update, substitute its name into the label + // we show for this item, otherwise display a generic label. + function getStringWithUpdateName(key) { + if (activeUpdate && activeUpdate.name) + return strings.getFormattedString(key, [activeUpdate.name]); + return strings.getString(key + "Fallback"); + } + + // By default, show "Check for Updates..." from updatesItem_default or + // updatesItem_defaultFallback + var key = "default"; + if (activeUpdate) { + switch (activeUpdate.state) { + case "downloading": + // If we're downloading an update at present, show the text: + // "Downloading Thunderbird x.x..." from updatesItem_downloading or + // updatesItem_downloadingFallback, otherwise we're paused, and show + // "Resume Downloading Thunderbird x.x..." from updatesItem_resume or + // updatesItem_resumeFallback + key = updates.isDownloading ? "downloading" : "resume"; + break; + case "pending": + // If we're waiting for the user to restart, show: "Apply Downloaded + // Updates Now..." from updatesItem_pending or + // updatesItem_pendingFallback + key = "pending"; + break; + } + } + + checkForUpdates.label = getStringWithUpdateName("updatesItem_" + key); + appMenuCheckForUpdates.label = getStringWithUpdateName("updatesItem_" + key); + // updatesItem_default.accesskey, updatesItem_downloading.accesskey, + // updatesItem_resume.accesskey or updatesItem_pending.accesskey + checkForUpdates.accessKey = strings.getString("updatesItem_" + key + + ".accesskey"); + appMenuCheckForUpdates.accessKey = strings.getString("updatesItem_" + key + + ".accesskey"); + if (um.activeUpdate && updates.isDownloading) { + checkForUpdates.setAttribute("loading", "true"); + appMenuCheckForUpdates.setAttribute("loading", "true"); + } else { + checkForUpdates.removeAttribute("loading"); + appMenuCheckForUpdates.removeAttribute("loading"); + } +#else +#ifndef XP_MACOSX + // Some extensions may rely on these being present so only hide the about + // separator when there are no elements besides the check for updates menuitem + // in between the about separator and the updates separator. + var updatesSeparator = document.getElementById("updatesSeparator"); + var aboutSeparator = document.getElementById("aboutSeparator"); + var checkForUpdates = document.getElementById("checkForUpdates"); + if (updatesSeparator.nextSibling === checkForUpdates && + checkForUpdates.nextSibling === aboutSeparator) + updatesSeparator.hidden = true; +#endif +#endif +} + + function openAboutDialog() { var enumerator = Services.wm.getEnumerator("Browser:About"); while (enumerator.hasMoreElements()) { diff --git a/application/palemoon/branding/shared/pref/preferences.inc b/application/palemoon/branding/shared/pref/preferences.inc index 721c2c90e..8a0454626 100644 --- a/application/palemoon/branding/shared/pref/preferences.inc +++ b/application/palemoon/branding/shared/pref/preferences.inc @@ -1,4 +1,5 @@ -#define APO_AM_URL addons.palemoon.org/integration/addon-manager +#define APO_URL addons.palemoon.org +#define APO_AM_URL @APO_URL@/integration/addon-manager #define APO_AUS_ARGS reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE% // ===| General |============================================================== @@ -36,7 +37,7 @@ pref("extensions.blocklist.url","http://blocklist.palemoon.org/%VERSION%/blockli pref("extensions.blocklist.itemURL", "http://blocklist.palemoon.org/info/?id=%blockID%"); // Dictionary URL -pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/"); +pref("browser.dictionaries.download.url", "https://@APO_URL@/dictionaries/"); pref("extensions.update.autoUpdateDefault", true); // Automatically update extensions by default pref("extensions.getAddons.maxResults", 10); diff --git a/application/palemoon/components/preferences/connection.xul b/application/palemoon/components/preferences/connection.xul index 491bf4878..e6079dd54 100644 --- a/application/palemoon/components/preferences/connection.xul +++ b/application/palemoon/components/preferences/connection.xul @@ -138,9 +138,6 @@ <radio id="networkProxySOCKSVersion5" value="5" label="&socks5.label;" accesskey="&socks5.accesskey;"/> </radiogroup> </row> - <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/> - <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/> - <label value="&noproxyExplain.label;" control="networkProxyNone"/> </rows> </grid> <radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/> @@ -154,6 +151,9 @@ </hbox> </radiogroup> <separator class="thin"/> + <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/> + <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/> + <label value="&noproxyExplain.label;" control="networkProxyNone"/> <checkbox id="autologinProxy" preference="signon.autologin.proxy" label="&autologinproxy.label;" accesskey="&autologinproxy.accesskey;" tooltiptext="&autologinproxy.tooltip;"/> diff --git a/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd b/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd index a926b0ed2..27de3797f 100644 --- a/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd @@ -14,6 +14,7 @@ for the help button in the menubar but Gnome does not. --> <!ENTITY helpMenuWin.label "Help"> <!ENTITY helpMenuWin.accesskey "H"> +<!ENTITY updateCmd.label "Check for Updates…"> <!ENTITY aboutProduct.label "About &brandShortName;"> <!ENTITY aboutProduct.accesskey "A"> <!ENTITY productHelp.label "&brandShortName; Help"> diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.properties b/application/palemoon/locales/en-US/chrome/browser/browser.properties index dbe6dbaa1..4c45e2513 100644 --- a/application/palemoon/locales/en-US/chrome/browser/browser.properties +++ b/application/palemoon/locales/en-US/chrome/browser/browser.properties @@ -201,6 +201,22 @@ update.openUpdateUI.upgradeButton.accesskey=U update.restart.upgradeButton.label=Upgrade Now update.restart.upgradeButton.accesskey=U +# Check for Updates in the Help Menu +# LOCALIZATION NOTE (updatesItem_*): these are alternative labels for Check for Update item in Help menu. +# Which one is used depends on Update process state. +updatesItem_default=Check for Updates… +updatesItem_defaultFallback=Check for Updates… +updatesItem_default.accesskey=C +updatesItem_downloading=Downloading %S… +updatesItem_downloadingFallback=Downloading Update… +updatesItem_downloading.accesskey=D +updatesItem_resume=Resume Downloading %S… +updatesItem_resumeFallback=Resume Downloading Update… +updatesItem_resume.accesskey=D +updatesItem_pending=Apply Downloaded Update Now… +updatesItem_pendingFallback=Apply Downloaded Update Now… +updatesItem_pending.accesskey=D + # RSS Pretty Print feedShowFeedNew=Subscribe to '%S'… |