diff options
Diffstat (limited to 'application/palemoon')
92 files changed, 2133 insertions, 1794 deletions
diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index 000113fe7..22c4f8654 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -37,15 +37,20 @@ pref("extensions.strictCompatibility", false); // for it to be compatible by default. pref("extensions.minCompatibleAppVersion", "1.5"); -// Preferences for AMO integration -pref("extensions.getAddons.cache.enabled", true); -pref("extensions.getAddons.maxResults", 15); -pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/guid:%IDS%?src=firefox&appOS=%OS%&appVersion=%VERSION%"); -pref("extensions.getAddons.getWithPerformance.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/guid:%IDS%?src=firefox&appOS=%OS%&appVersion=%VERSION%&tMain=%TIME_MAIN%&tFirstPaint=%TIME_FIRST_PAINT%&tSessionRestored=%TIME_SESSION_RESTORED%"); -pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=%OS%&appver=%VERSION%"); -pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%/%COMPATIBILITY_MODE%?src=firefox"); -pref("extensions.webservice.discoverURL", "https://services.addons.mozilla.org/%LOCALE%/firefox/discovery/pane/%VERSION%/%OS%/%COMPATIBILITY_MODE%"); -pref("extensions.getAddons.recommended.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/%OS%/%VERSION%?src=firefox"); +// Preferences for APO integration +#define APO_AM_URL addons.palemoon.org/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.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%"); +pref("extensions.getAddons.browseAddons", "https://addons.palemoon.org"); +pref("extensions.getAddons.recommended.browseURL", "https://@APO_AM_URL@/external/recommended"); // Blocklist preferences pref("extensions.blocklist.enabled", true); @@ -54,9 +59,9 @@ pref("extensions.blocklist.level.updated", false); // Controls what level the blocklist switches from warning about items to forcibly // blocking them. pref("extensions.blocklist.level", 2); -pref("extensions.blocklist.url", "https://addons.mozilla.org/blocklist/3/%APP_ID%/%APP_VERSION%/%PRODUCT%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/%PING_COUNT%/%TOTAL_PING_COUNT%/%DAYS_SINCE_LAST_PING%/"); -pref("extensions.blocklist.detailsURL", "https://www.mozilla.org/%LOCALE%/blocklist/"); -pref("extensions.blocklist.itemURL", "https://addons.mozilla.org/%LOCALE%/%APP%/blocked/%blockID%"); +pref("extensions.blocklist.url", "http://blocklist.palemoon.org/%VERSION%/blocklist.xml"); +pref("extensions.blocklist.detailsURL", "https://blocklist.palemoon.org/about.shtml"); +pref("extensions.blocklist.itemURL", "http://blocklist.palemoon.org/info/?id=%blockID%"); pref("extensions.update.autoUpdateDefault", true); @@ -68,7 +73,7 @@ pref("extensions.autoDisableScopes", 15); pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/"); // Get More Tools link URL -pref("browser.getdevtools.url","https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/"); +pref("browser.getdevtools.url","https://@APO_AM_URL@/external/devtools"); // Feedback URL pref("browser.feedback.url", "https://forum.palemoon.org"); @@ -106,7 +111,7 @@ pref("app.update.backgroundMaxErrors", 10); // final certificate and all certificates the connection is redirected to before // the final certificate for the url specified in the |app.update.url| // preference must be built-in. -pref("app.update.cert.requireBuiltIn", true); +pref("app.update.cert.requireBuiltIn", false); // When |app.update.cert.checkAttributes| is true or not specified the // certificate attributes specified in the |app.update.certs.| preference branch @@ -142,7 +147,7 @@ pref("app.update.enabled", true); // This preference turns on app.update.mode and allows automatic download and // install to take place. We use a separate boolean toggle for this to make // the UI easier to construct. -pref("app.update.auto", true); +pref("app.update.auto", false); // See chart in nsUpdateService.js source for more details pref("app.update.mode", 1); @@ -155,7 +160,7 @@ pref("app.update.silent", false); pref("app.update.staging.enabled", true); // Update service URL: -pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml"); +pref("app.update.url", "https://aus.palemoon.org/?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&buildid=%BUILD_ID%&channel=%CHANNEL%"); // app.update.url.manual is in branding section // app.update.url.details is in branding section @@ -166,7 +171,7 @@ pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%B // app.update.promptWaitTime is in branding section // Show the Update Checking/Ready UI when the user was idle for x seconds -pref("app.update.idletime", 60); +pref("app.update.idletime", 180); // Whether or not we show a dialog box informing the user that the update was // successfully applied. This is off in Firefox by default since we show a @@ -189,8 +194,8 @@ pref("app.update.incompatible.mode", 0); // .. etc .. // pref("extensions.update.enabled", true); -pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?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.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?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.update.url", "https://@APO_AM_URL@/internal/update?@APO_AUS_ARGS@"); +pref("extensions.update.background.url", "https://@APO_AM_URL@/internal/update?@APO_AUS_ARGS@"); pref("extensions.update.interval", 86400); // Check for updates to Extensions and // Themes every day // Non-symmetric (not shared by extensions) extension-specific [update] preferences @@ -224,6 +229,11 @@ pref("keyword.enabled", true); pref("general.useragent.locale", "@AB_CD@"); pref("general.skins.selectedSkin", "classic/1.0"); +// Native UA mode by default +pref("general.useragent.compatMode", 0); +pref("general.useragent.compatmode.gecko", false); +pref("general.useragent.compatmode.firefox", false); + pref("general.smoothScroll", true); #ifdef UNIX_BUT_NOT_MAC pref("general.autoScroll", false); @@ -237,11 +247,7 @@ pref("general.useragent.complexOverride.moodle", false); // bug 797703 pref("browser.shell.checkDefaultBrowser", true); pref("browser.shell.shortcutFavicons",true); pref("browser.shell.mostRecentDateSetAsDefault", ""); -#ifdef RELEASE_OR_BETA pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", false); -#else -pref("browser.shell.skipDefaultBrowserCheckOnFirstRun", true); -#endif pref("browser.shell.skipDefaultBrowserCheck", true); pref("browser.shell.defaultBrowserCheckCount", 0); pref("browser.defaultbrowser.notificationbar", false); @@ -307,7 +313,7 @@ pref("browser.urlbar.suggest.openpage", true); pref("browser.urlbar.suggest.history.onlyTyped", false); pref("browser.urlbar.formatting.enabled", true); -pref("browser.urlbar.trimURLs", true); +pref("browser.urlbar.trimURLs", false); // Display punycode in identity panel: // 0 = Display IDN name @@ -318,7 +324,7 @@ pref("browser.identity.display_punycode", 1); // Address bar RSS icon control, show by default pref("browser.urlbar.rss", true); -pref("browser.altClickSave", false); +pref("browser.altClickSave", true); // Enable logging downloads operations to the Error Console. pref("browser.download.debug", false); @@ -329,7 +335,8 @@ pref("browser.download.debug", false); // feedback from their action. pref("browser.download.saveLinkAsFilenameTimeout", 4000); -pref("browser.download.useDownloadDir", true); +// Do not use default download location as standard, but ask. +pref("browser.download.useDownloadDir", false); pref("browser.download.folderList", 1); pref("browser.download.manager.showAlertOnComplete", true); @@ -338,7 +345,7 @@ pref("browser.download.manager.retention", 2); pref("browser.download.manager.showWhenStarting", true); pref("browser.download.manager.closeWhenDone", false); pref("browser.download.manager.focusWhenStarting", false); -pref("browser.download.manager.flashCount", 2); +pref("browser.download.manager.flashCount", 10); pref("browser.download.manager.addToRecentDocs", true); pref("browser.download.manager.quitBehavior", 2); pref("browser.download.manager.scanWhenDone", true); @@ -352,7 +359,7 @@ pref("browser.download.panel.shown", false); pref("browser.download.panel.firstSessionCompleted", false); // search engines URL -pref("browser.search.searchEnginesURL", "https://addons.mozilla.org/%LOCALE%/firefox/search-engines/"); +pref("browser.search.searchEnginesURL", "https://@APO_AM_URL@/external/searchplugins"); // pointer to the default engine name pref("browser.search.defaultenginename", "chrome://browser-region/locale/region.properties"); @@ -369,8 +376,8 @@ pref("browser.search.order.4", "chrome://browser-region/locale/re // search bar results always open in a new tab pref("browser.search.openintab", false); -// context menu searches open in the foreground -pref("browser.search.context.loadInBackground", false); +// do not swap focus to the context search tab. +pref("browser.search.context.loadInBackground", true); // if no result, add the search term so that the panel of the new UI is shown anyway pref("browser.search.showOneOffButtons", true); @@ -433,10 +440,8 @@ pref("browser.tabs.loadDivertedInBackground", false); pref("browser.tabs.loadBookmarksInBackground", false); pref("browser.tabs.noWindowActivationOnExternal", false); pref("browser.tabs.tabClipWidth", 140); -pref("browser.tabs.tabMinWidth", 100); -pref("browser.tabs.tabMaxWidth", 250); pref("browser.tabs.animate", true); -pref("browser.tabs.onTop", true); +pref("browser.tabs.onTop", false); #ifdef XP_WIN pref("browser.tabs.drawInTitlebar", true); #else @@ -458,8 +463,8 @@ pref("browser.tabs.closeButtons", 1); // false return to the adjacent tab (old default) pref("browser.tabs.selectOwnerOnClose", true); -pref("browser.allTabs.previews", false); -pref("browser.ctrlTab.previews", false); +pref("browser.allTabs.previews", true); +pref("browser.ctrlTab.previews", true); pref("browser.ctrlTab.recentlyUsedLimit", 7); // By default, do not export HTML at shutdown. @@ -486,8 +491,8 @@ pref("general.warnOnAboutConfig", false); // applications, but without it there isn't a really good way to prevent chrome // spoofing, see bug 337344 pref("dom.disable_window_open_feature.location", true); -// prevent JS from setting status messages -pref("dom.disable_window_status_change", true); +// Allow JS to set status messages +pref("dom.disable_window_status_change", false); // allow JS to move and resize existing windows pref("dom.disable_window_move_resize", false); // prevent JS from monkeying with window focus, etc @@ -648,7 +653,7 @@ pref("plugins.hide_infobar_for_outdated_plugin", false); // Pale Moon:pref to always show the plugin indicator or not (default=false) pref("plugins.always_show_indicator", false); -pref("plugins.update.url", "https://www.mozilla.org/%LOCALE%/plugincheck/"); +pref("plugins.update.url", "https://aus.palemoon.org/plugincheck/"); pref("plugins.update.notifyUser", false); //Enable tri-state option (Always/Never/Ask) @@ -678,6 +683,9 @@ pref("browser.backspace_action", 2); pref("browser.backspace_action", 0); #endif +// Pale Moon never eats the space with word selection, regardless of O.S. +pref("layout.word_select.eat_space_to_next_word", false); + // this will automatically enable inline spellchecking (if it is available) for // editable elements in HTML // 0 = spellcheck nothing @@ -715,7 +723,7 @@ pref("browser.audioFeeds.handler", "ask"); // region.properties file is newer than the version number in the handler // service datastore, it will add any new handlers it finds in the prefs (as // seeded by this file) to its datastore. -pref("goanna.handlerService.defaultHandlersVersion", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.defaultHandlersVersion", "chrome://browser-region/locale/region.properties"); // The default set of web-based protocol handlers shown in the application // selection dialog for webcal: ; I've arbitrarily picked 4 default handlers @@ -723,51 +731,51 @@ pref("goanna.handlerService.defaultHandlersVersion", "chrome://browser-region/lo // protocol not currently listed here), we should go ahead and add those. // webcal -pref("goanna.handlerService.schemes.webcal.0.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.webcal.0.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.webcal.1.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.webcal.1.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.webcal.2.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.webcal.2.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.webcal.3.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.webcal.3.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.webcal.0.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.webcal.0.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.webcal.1.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.webcal.1.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.webcal.2.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.webcal.2.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.webcal.3.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.webcal.3.uriTemplate", "chrome://browser-region/locale/region.properties"); // mailto -pref("goanna.handlerService.schemes.mailto.0.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.mailto.0.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.mailto.1.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.mailto.1.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.mailto.2.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.mailto.2.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.mailto.3.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.mailto.3.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.mailto.0.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.mailto.0.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.mailto.1.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.mailto.1.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.mailto.2.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.mailto.2.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.mailto.3.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.mailto.3.uriTemplate", "chrome://browser-region/locale/region.properties"); // irc -pref("goanna.handlerService.schemes.irc.0.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.irc.0.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.irc.1.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.irc.1.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.irc.2.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.irc.2.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.irc.3.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.irc.3.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.irc.0.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.irc.0.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.irc.1.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.irc.1.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.irc.2.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.irc.2.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.irc.3.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.irc.3.uriTemplate", "chrome://browser-region/locale/region.properties"); // ircs -pref("goanna.handlerService.schemes.ircs.0.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.ircs.0.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.ircs.1.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.ircs.1.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.ircs.2.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.ircs.2.uriTemplate", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.ircs.3.name", "chrome://browser-region/locale/region.properties"); -pref("goanna.handlerService.schemes.ircs.3.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.ircs.0.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.ircs.0.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.ircs.1.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.ircs.1.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.ircs.2.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.ircs.2.uriTemplate", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.ircs.3.name", "chrome://browser-region/locale/region.properties"); +pref("gecko.handlerService.schemes.ircs.3.uriTemplate", "chrome://browser-region/locale/region.properties"); // By default, we don't want protocol/content handlers to be registered from a different host, see bug 402287 -pref("goanna.handlerService.allowRegisterFromDifferentHost", false); +pref("gecko.handlerService.allowRegisterFromDifferentHost", false); pref("browser.geolocation.warning.infoURL", "http://www.palemoon.org/info-url/geolocation.shtml"); pref("browser.mixedcontent.warning.infoURL", "http://www.palemoon.org/info-url/mixedcontent.shtml"); -pref("browser.push.warning.infoURL", "https://www.mozilla.org/%LOCALE%/firefox/push/"); +pref("browser.push.warning.infoURL", "https://www.palemoon.org/info-url/push.shtml"); pref("browser.EULA.version", 3); pref("browser.rights.version", 3); @@ -782,7 +790,7 @@ pref("browser.sessionstore.resume_from_crash", true); pref("browser.sessionstore.resume_session_once", false); // minimal interval between two save operations in milliseconds -pref("browser.sessionstore.interval", 15000); +pref("browser.sessionstore.interval",60000); // maximum amount of POSTDATA to be saved in bytes per history entry (-1 = all of it) // (NB: POSTDATA will be saved either entirely or not at all) pref("browser.sessionstore.postdata", 0); @@ -893,7 +901,7 @@ pref("browser.zoom.siteSpecific", true); pref("browser.zoom.updateBackgroundTabs", true); // base URL for web-based support pages -pref("app.support.baseURL", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/"); +pref("app.support.baseURL", "http://www.palemoon.org/support/"); // Name of alternate about: page for certificate errors (when undefined, defaults to about:neterror) pref("security.alternate_certificate_error_page", "certerror"); @@ -1011,7 +1019,6 @@ pref("services.sync.prefs.sync.privacy.clearOnShutdown.sessions", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.siteSettings", true); pref("services.sync.prefs.sync.privacy.clearOnShutdown.connectivityData", true); pref("services.sync.prefs.sync.privacy.donottrackheader.enabled", true); -pref("services.sync.prefs.sync.privacy.donottrackheader.value", true); pref("services.sync.prefs.sync.privacy.sanitize.sanitizeOnShutdown", true); pref("services.sync.prefs.sync.security.OCSP.enabled", true); pref("services.sync.prefs.sync.security.OCSP.require", true); @@ -1037,9 +1044,6 @@ pref("prompts.tab_modal.enabled", true); // Allow tab-modal prompts to switch tab focus pref("prompts.tab_modal.focusSwitch", true); -// Whether the Panorama should animate going in/out of tabs -pref("browser.panorama.animate_zoom", true); - // Defines the url to be used for new tabs. pref("browser.newtab.url", "about:logopage"); // Activates preloading of the new tab url. @@ -1051,11 +1055,16 @@ pref("browser.newtabpage.enabled", true); // XXX: Remove this when "enhanced" tiles are dead pref("browser.newtabpage.enhanced", false); +// enables showing basic placeholders for missing thumbnails +pref("browser.newtabpage.thumbnailPlaceholder", false); + +pref("privacy.usercontext.about_newtab_segregation.enabled", false); + // number of columns of newtab grid pref("browser.newtabpage.columns", 4); // number of rows of newtab grid -pref("browser.newtabpage.rows", 4); +pref("browser.newtabpage.rows", 3); // Enable the DOM fullscreen API. pref("full-screen-api.enabled", true); @@ -1081,10 +1090,7 @@ pref("security.csp.speccompliant", true); // Block insecure active content on https pages pref("security.mixed_content.block_active_content", true); -// Disable HPKP telemetry -pref("security.ssl.errorReporting.enabled", false); - -// Override the Goanna-default value of false for Firefox. +// Override the Gecko-default value of false for Pale Moon. pref("plain_text.wrap_long_lines", true); pref("media.webaudio.enabled", true); @@ -1112,17 +1118,28 @@ pref("browser.padlock.urlbar_background", 2); //Pale Moon standalone image background color pref("browser.display.standalone_images.background_color", "#2E3B41"); +// These are the thumbnail width/height set in about:newtab. +// If you change this, make sure the size is sufficient for tile sizes +// in about:newtab. These values are in CSS pixels. +pref("toolkit.pageThumbs.minWidth", 250); +pref("toolkit.pageThumbs.minHeight", 180); + +// On GTK, we now default to showing the menubar only when alt is pressed: +#ifdef MOZ_WIDGET_GTK +pref("ui.key.menuAccessKeyFocuses", true); +#endif + // ****************** domain-specific UAs ****************** // AMO needs "Firefox", obviously - pass on the OS (determined at build time) #ifdef XP_UNIX #ifdef XP_MACOSX -pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:27.9) Gecko/20100101 Firefox/27.9 (Pale Moon)"); +pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:27.0) Gecko/20100101 Firefox/27.0"); #else -pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Linux; X11; rv:27.9) Gecko/20100101 Firefox/27.9 (Pale Moon)"); +pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Linux; X11; rv:27.0) Gecko/20100101 Firefox/27.0"); #endif #else -pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.9) Gecko/20100101 Firefox/27.9 (Pale Moon)"); +pref("general.useragent.override.addons.mozilla.org","Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0"); #endif // ****************** s4e prefs ****************** diff --git a/application/palemoon/base/content/aboutDialog.css b/application/palemoon/base/content/aboutDialog.css index aa79b0795..d171a0bc1 100644 --- a/application/palemoon/base/content/aboutDialog.css +++ b/application/palemoon/base/content/aboutDialog.css @@ -25,9 +25,6 @@ #PMversion { margin-top: 10px; -moz-margin-start: 0; - -moz-user-select: text; - -moz-user-focus: normal; - cursor: text; } #distribution, diff --git a/application/palemoon/base/content/abouthome/aboutHome.js b/application/palemoon/base/content/abouthome/aboutHome.js index 6a970acd6..6ff8eee98 100644 --- a/application/palemoon/base/content/abouthome/aboutHome.js +++ b/application/palemoon/base/content/abouthome/aboutHome.js @@ -3,133 +3,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const SEARCH_ENGINES = { - "Google": { - // This is the "2x" image designed for OS X retina resolution, Windows at 192dpi, etc.; - // it will be scaled down as necessary on lower-dpi displays. - image: "data:image/png;base64," + - "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" - }, "DuckDuckGo": { image: "data:image/png;base64," + "iVBORw0KGgoAAAANSUhEUgAAAIwAAAA4CAYAAAAvmxBdAAAVhUlEQVR4Xu3dd5SU1d3A8e/vPs/0" + diff --git a/application/palemoon/base/content/browser-fullScreen.js b/application/palemoon/base/content/browser-fullScreen.js index 6afd247be..b1235a8d3 100644 --- a/application/palemoon/base/content/browser-fullScreen.js +++ b/application/palemoon/base/content/browser-fullScreen.js @@ -53,6 +53,18 @@ var FullScreen = { document.addEventListener("popupshown", this._setPopupOpen, false); document.addEventListener("popuphidden", this._setPopupOpen, false); this._shouldAnimate = true; + // 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(document.mozFullScreen)) { + let rect = gBrowser.mPanelContainer.getBoundingClientRect(); + this._mouseTargetRect = { + top: rect.top + 50, + bottom: rect.bottom, + left: rect.left, + right: rect.right + }; + MousePosTracker.addListener(this); + } // We don't animate the toolbar collapse if in DOM full-screen mode, // as the size of the content area would still be changing after the // mozfullscreenchange event fired, which could confuse content script. diff --git a/application/palemoon/base/content/browser.css b/application/palemoon/base/content/browser.css index 76e49436c..a2970aefc 100644 --- a/application/palemoon/base/content/browser.css +++ b/application/palemoon/base/content/browser.css @@ -43,6 +43,8 @@ tabbrowser { .tabbrowser-tab:not([pinned]) { -moz-box-flex: 100; + max-width: 250px; + min-width: 100px; width: 0; transition: min-width 175ms ease-out, max-width 200ms ease-out, @@ -65,12 +67,6 @@ tabbrowser { display: none; } -.tabbrowser-tab[pinned] { - -moz-box-flex: 0; - min-width: 0 !important; - max-width: none !important; -} - .tabbrowser-tabs[positionpinnedtabs] > .tabbrowser-tab[pinned] { position: fixed !important; display: block; /* position:fixed already does this (bug 579776), but let's be explicit */ diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index 4bdac7850..386bd418b 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -53,20 +53,13 @@ var gEditUIVisible = true; // Smart getter for the findbar. If you don't wish to force the creation of // the findbar, check gFindBarInitialized first. -var gFindBarInitialized = false; -XPCOMUtils.defineLazyGetter(window, "gFindBar", function() { - let XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; - let findbar = document.createElementNS(XULNS, "findbar"); - findbar.id = "FindToolbar"; - - let browserBottomBox = document.getElementById("browser-bottombox"); - browserBottomBox.insertBefore(findbar, browserBottomBox.firstChild); - - // Force a style flush to ensure that our binding is attached. - findbar.clientTop; - findbar.browser = gBrowser; - window.gFindBarInitialized = true; - return findbar; + +this.__defineGetter__("gFindBar", function() { + return window.gBrowser.getFindBar(); +}); + +this.__defineGetter__("gFindBarInitialized", function() { + return window.gBrowser.isFindBarInitialized(); }); XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils", @@ -328,6 +321,67 @@ const gSessionHistoryObserver = { } }; +var gFindBarSettings = { + messageName: "Findbar:Keypress", + prefName: "accessibility.typeaheadfind", + findAsYouType: null, + + init: function() { + window.messageManager.addMessageListener(this.messageName, this); + + gPrefService.addObserver(this.prefName, this, false); + this.writeFindAsYouType(); + }, + + uninit: function() { + window.messageManager.removeMessageListener(this.messageName, this); + + try { + gPrefService.removeObserver(this.prefName, this); + } catch (ex) { + Cu.reportError(ex); + } + }, + + observe: function(aSubject, aTopic, aData) { + if (aTopic != "nsPref:changed") { + return; + } + + this.writeFindAsYouType(); + }, + + writeFindAsYouType: function() { + this.findAsYouType = gPrefService.getBoolPref(this.prefName); + }, + + receiveMessage: function(aMessage) { + switch (aMessage.name) { + case this.messageName: + // If the find bar for chrome window's context is not yet alive, + // only initialize it if there's a possibility FindAsYouType + // will be used. + // There's no point in doing it for most random keypresses. + if (!gFindBarInitialized && aMessage.data.shouldFastFind) { + let shouldFastFind = this.findAsYouType; + if (!shouldFastFind) { + // Please keep in sync with toolkit/content/widgets/findbar.xml + const FAYT_LINKS_KEY = "'"; + const FAYT_TEXT_KEY = "/"; + let charCode = aMessage.data.fakeEvent.charCode; + let key = charCode ? String.fromCharCode(charCode) : null; + shouldFastFind = key == FAYT_LINKS_KEY || key == FAYT_TEXT_KEY; + } + if (shouldFastFind) { + // Make sure we return the result. + return gFindBar.receiveMessage(aMessage); + } + } + break; + } + } +}; + var gURLBarSettings = { prefSuggest: "browser.urlbar.suggest.", /* @@ -730,6 +784,7 @@ var gBrowserInit = { #ifdef MOZ_DEVTOOLS DevToolsTheme.init(); #endif + gFindBarSettings.init(); messageManager.loadFrameScript("chrome://browser/content/content.js", true); messageManager.loadFrameScript("chrome://browser/content/content-sessionStore.js", true); @@ -1305,6 +1360,7 @@ var gBrowserInit = { #ifdef MOZ_DEVTOOLS DevToolsTheme.uninit(); #endif + gFindBarSettings.uninit(); UserAgentCompatibility.uninit(); @@ -2344,6 +2400,9 @@ function PageProxyClickHandler(aEvent) * to the DOM for unprivileged pages. */ function BrowserOnAboutPageLoad(doc) { + + /* === about:home === */ + if (doc.documentURI.toLowerCase() == "about:home") { let ss = Components.classes["@mozilla.org/browser/sessionstore;1"]. getService(Components.interfaces.nsISessionStore); @@ -2382,6 +2441,32 @@ function BrowserOnAboutPageLoad(doc) { Services.obs.removeObserver(updateSearchEngine, "browser-search-engine-modified"); }, false); } + + /* === about:newtab === */ + + if (doc.documentURI.toLowerCase() == "about:newtab") { + + let docElt = doc.documentElement; + + function updateSearchEngine() { + let engine = AboutHomeUtils.defaultSearchEngine; + docElt.setAttribute("searchEngineName", engine.name); + docElt.setAttribute("searchEnginePostData", engine.postDataString || ""); + docElt.setAttribute("searchEngineURL", engine.searchURL); + } + updateSearchEngine(); + + // Listen for the event that's triggered when the user changes search engine. + // At this point we simply reload about:newtab to reflect the change. + Services.obs.addObserver(updateSearchEngine, "browser-search-engine-modified", false); + + // Remove the observer when the page is reloaded or closed. + doc.defaultView.addEventListener("pagehide", function removeObserver() { + doc.defaultView.removeEventListener("pagehide", removeObserver); + Services.obs.removeObserver(updateSearchEngine, "browser-search-engine-modified"); + }, false); + } + } /** diff --git a/application/palemoon/base/content/browser.xul b/application/palemoon/base/content/browser.xul index 254e2eee0..90899bb88 100644 --- a/application/palemoon/base/content/browser.xul +++ b/application/palemoon/base/content/browser.xul @@ -334,7 +334,9 @@ </button> </hbox> #endif +#ifndef XP_MACOSX <spacer id="titlebar-spacer" flex="1"/> +#endif <hbox id="titlebar-buttonbox-container" align="start"> <hbox id="titlebar-buttonbox"> <toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/> diff --git a/application/palemoon/base/content/newtab/drag.js b/application/palemoon/base/content/newtab/drag.js index fbd688faa..e3928ebd0 100644 --- a/application/palemoon/base/content/newtab/drag.js +++ b/application/palemoon/base/content/newtab/drag.js @@ -140,7 +140,7 @@ var gDrag = { // drag image with its default opacity. let dragElement = document.createElementNS(HTML_NAMESPACE, "div"); dragElement.classList.add("newtab-drag"); - let scrollbox = document.getElementById("newtab-scrollbox"); + let scrollbox = document.getElementById("newtab-vertical-margin"); scrollbox.appendChild(dragElement); dt.setDragImage(dragElement, 0, 0); diff --git a/application/palemoon/base/content/newtab/dragDataHelper.js b/application/palemoon/base/content/newtab/dragDataHelper.js index 54348ab14..675ff2671 100644 --- a/application/palemoon/base/content/newtab/dragDataHelper.js +++ b/application/palemoon/base/content/newtab/dragDataHelper.js @@ -11,7 +11,7 @@ var gDragDataHelper = { getLinkFromDragEvent: function DragDataHelper_getLinkFromDragEvent(aEvent) { let dt = aEvent.dataTransfer; - if (!dt || !dt.types.contains(this.mimeType)) { + if (!dt || !dt.types.includes(this.mimeType)) { return null; } diff --git a/application/palemoon/base/content/newtab/dropTargetShim.js b/application/palemoon/base/content/newtab/dropTargetShim.js index 046dbea1e..57a97fa00 100644 --- a/application/palemoon/base/content/newtab/dropTargetShim.js +++ b/application/palemoon/base/content/newtab/dropTargetShim.js @@ -23,27 +23,53 @@ var gDropTargetShim = { /** * Initializes the drop target shim. */ - init: function DropTargetShim_init() { - let node = gGrid.node; + init: function () { + gGrid.node.addEventListener("dragstart", this, true); + }, + + /** + * Add all event listeners needed during a drag operation. + */ + _addEventListeners: function () { + gGrid.node.addEventListener("dragend", this); - // Add drag event handlers. - node.addEventListener("dragstart", this, true); - node.addEventListener("dragend", this, true); + let docElement = document.documentElement; + docElement.addEventListener("dragover", this); + docElement.addEventListener("dragenter", this); + docElement.addEventListener("drop", this); + }, + + /** + * Remove all event listeners that were needed during a drag operation. + */ + _removeEventListeners: function () { + gGrid.node.removeEventListener("dragend", this); + + let docElement = document.documentElement; + docElement.removeEventListener("dragover", this); + docElement.removeEventListener("dragenter", this); + docElement.removeEventListener("drop", this); }, /** * Handles all shim events. */ - handleEvent: function DropTargetShim_handleEvent(aEvent) { + handleEvent: function (aEvent) { switch (aEvent.type) { case "dragstart": - this._start(aEvent); + this._dragstart(aEvent); + break; + case "dragenter": + aEvent.preventDefault(); break; case "dragover": this._dragover(aEvent); break; + case "drop": + this._drop(aEvent); + break; case "dragend": - this._end(aEvent); + this._dragend(aEvent); break; } }, @@ -52,69 +78,63 @@ var gDropTargetShim = { * Handles the 'dragstart' event. * @param aEvent The 'dragstart' event. */ - _start: function DropTargetShim_start(aEvent) { + _dragstart: function (aEvent) { if (aEvent.target.classList.contains("newtab-link")) { gGrid.lock(); - - // XXX bug 505521 - Listen for dragover on the document. - document.documentElement.addEventListener("dragover", this, false); + this._addEventListeners(); } }, /** - * Handles the 'drag' event and determines the current drop target. - * @param aEvent The 'drag' event. + * Handles the 'dragover' event. + * @param aEvent The 'dragover' event. */ - _drag: function DropTargetShim_drag(aEvent) { - // Let's see if we find a drop target. - let target = this._findDropTarget(aEvent); - - if (target != this._lastDropTarget) { - if (this._lastDropTarget) - // We left the last drop target. - this._dispatchEvent(aEvent, "dragexit", this._lastDropTarget); - - if (target) - // We're now hovering a (new) drop target. - this._dispatchEvent(aEvent, "dragenter", target); + _dragover: function (aEvent) { + // XXX bug 505521 - Use the dragover event to retrieve the + // current mouse coordinates while dragging. + let sourceNode = aEvent.dataTransfer.mozSourceNode.parentNode; + gDrag.drag(sourceNode._newtabSite, aEvent); - if (this._lastDropTarget) - // We left the last drop target. - this._dispatchEvent(aEvent, "dragleave", this._lastDropTarget); + // Find the current drop target, if there's one. + this._updateDropTarget(aEvent); - this._lastDropTarget = target; + // If we have a valid drop target, + // let the drag-and-drop service know. + if (this._lastDropTarget) { + aEvent.preventDefault(); } }, /** - * Handles the 'dragover' event as long as bug 505521 isn't fixed to get - * current mouse cursor coordinates while dragging. - * @param aEvent The 'dragover' event. + * Handles the 'drop' event. + * @param aEvent The 'drop' event. */ - _dragover: function DropTargetShim_dragover(aEvent) { - let sourceNode = aEvent.dataTransfer.mozSourceNode.parentNode; - gDrag.drag(sourceNode._newtabSite, aEvent); + _drop: function (aEvent) { + // We're accepting all drops. + aEvent.preventDefault(); - this._drag(aEvent); + // remember that drop event was seen, this explicitly + // assumes that drop event preceeds dragend event + this._dropSeen = true; + + // Make sure to determine the current drop target + // in case the dragover event hasn't been fired. + this._updateDropTarget(aEvent); + + // A site was successfully dropped. + this._dispatchEvent(aEvent, "drop", this._lastDropTarget); }, /** * Handles the 'dragend' event. * @param aEvent The 'dragend' event. */ - _end: function DropTargetShim_end(aEvent) { - // Make sure to determine the current drop target in case the dragenter - // event hasn't been fired. - this._drag(aEvent); - + _dragend: function (aEvent) { if (this._lastDropTarget) { - if (aEvent.dataTransfer.mozUserCancelled) { - // The drag operation was cancelled. + if (aEvent.dataTransfer.mozUserCancelled || !this._dropSeen) { + // The drag operation was cancelled or no drop event was generated this._dispatchEvent(aEvent, "dragexit", this._lastDropTarget); this._dispatchEvent(aEvent, "dragleave", this._lastDropTarget); - } else { - // A site was successfully dropped. - this._dispatchEvent(aEvent, "drop", this._lastDropTarget); } // Clean up. @@ -122,10 +142,35 @@ var gDropTargetShim = { this._cellPositions = null; } + this._dropSeen = false; gGrid.unlock(); + this._removeEventListeners(); + }, - // XXX bug 505521 - Remove the document's dragover listener. - document.documentElement.removeEventListener("dragover", this, false); + /** + * Tries to find the current drop target and will fire + * appropriate dragenter, dragexit, and dragleave events. + * @param aEvent The current drag event. + */ + _updateDropTarget: function (aEvent) { + // Let's see if we find a drop target. + let target = this._findDropTarget(aEvent); + + if (target != this._lastDropTarget) { + if (this._lastDropTarget) + // We left the last drop target. + this._dispatchEvent(aEvent, "dragexit", this._lastDropTarget); + + if (target) + // We're now hovering a (new) drop target. + this._dispatchEvent(aEvent, "dragenter", target); + + if (this._lastDropTarget) + // We left the last drop target. + this._dispatchEvent(aEvent, "dragleave", this._lastDropTarget); + + this._lastDropTarget = target; + } }, /** @@ -133,7 +178,7 @@ var gDropTargetShim = { * against all cells in the grid. * @return The currently hovered drop target or null. */ - _findDropTarget: function DropTargetShim_findDropTarget() { + _findDropTarget: function () { // These are the minimum intersection values - we want to use the cell if // the site is >= 50% hovering its position. let minWidth = gDrag.cellWidth / 2; @@ -174,13 +219,12 @@ var gDropTargetShim = { * @param aType The event type. * @param aTarget The target node that receives the event. */ - _dispatchEvent: - function DropTargetShim_dispatchEvent(aEvent, aType, aTarget) { - + _dispatchEvent: function (aEvent, aType, aTarget) { let node = aTarget.node; - let event = document.createEvent("DragEvents"); + let event = document.createEvent("DragEvent"); - event.initDragEvent(aType, true, true, window, 0, 0, 0, 0, 0, false, false, + // The event should not bubble to prevent recursion. + event.initDragEvent(aType, false, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, node, aEvent.dataTransfer); node.dispatchEvent(event); diff --git a/application/palemoon/base/content/newtab/grid.js b/application/palemoon/base/content/newtab/grid.js index fbeb7bd27..db3d319c3 100644 --- a/application/palemoon/base/content/newtab/grid.js +++ b/application/palemoon/base/content/newtab/grid.js @@ -12,6 +12,7 @@ var gGrid = { * The DOM node of the grid. */ _node: null, + _gridDefaultContent: null, get node() { return this._node; }, /** @@ -22,16 +23,26 @@ var gGrid = { /** * All cells contained in the grid. */ - _cells: null, + _cells: [], get cells() { return this._cells; }, /** * All sites contained in the grid's cells. Sites may be empty. */ - get sites() { return [for (cell of this.cells) cell.site]; }, + get sites() { + // return [for (cell of this.cells) cell.site]; + let aSites = []; + for (let cell of this.cells) { + aSites.push(cell.site); + } + return aSites; + }, // Tells whether the grid has already been initialized. - get ready() { return !!this._node; }, + get ready() { return !!this._ready; }, + + // Returns whether the page has finished loading yet. + get isDocumentLoaded() { return document.readyState == "complete"; }, /** * Initializes the grid. @@ -39,8 +50,13 @@ var gGrid = { */ init: function Grid_init() { this._node = document.getElementById("newtab-grid"); + this._gridDefaultContent = this._node.lastChild; this._createSiteFragment(); - this._render(); + + gLinks.populateCache(() => { + this._refreshGrid(); + this._ready = true; + }); }, /** @@ -56,25 +72,10 @@ var gGrid = { }, /** - * Refreshes the grid and re-creates all sites. + * Handles all grid events. */ - refresh: function Grid_refresh() { - let cells = this.cells; - if (!cells) { - return; - } - - // Remove all sites. - cells.forEach(function (cell) { - let node = cell.node; - let child = node.firstElementChild; - - if (child) - node.removeChild(child); - }, this); - - // Render the grid again. - this._render(); + handleEvent: function Grid_handleEvent(aEvent) { + // Any specific events should go here. }, /** @@ -92,12 +93,19 @@ var gGrid = { }, /** - * Creates the newtab grid. + * Renders the grid. */ - _renderGrid: function Grid_renderGrid() { + refresh() { + this._refreshGrid(); + }, + + /** + * Renders the grid, including cells and sites. + */ + _refreshGrid() { let row = document.createElementNS(HTML_NAMESPACE, "div"); - let cell = document.createElementNS(HTML_NAMESPACE, "div"); row.classList.add("newtab-row"); + let cell = document.createElementNS(HTML_NAMESPACE, "div"); cell.classList.add("newtab-cell"); // Clear the grid @@ -107,19 +115,32 @@ var gGrid = { for (let i = 0; i < gGridPrefs.gridColumns; i++) { row.appendChild(cell.cloneNode(true)); } + // Creates the grid for (let j = 0; j < gGridPrefs.gridRows; j++) { this._node.appendChild(row.cloneNode(true)); - } + } - // (Re-)initialize all cells. + // Create cell array. let cellElements = this.node.querySelectorAll(".newtab-cell"); - // 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)); + let cells = Array.from(cellElements, (cell) => new Cell(this, cell)); + + // Fetch links. + let links = gLinks.getLinks(); + + // Create sites. + let numLinks = Math.min(links.length, cells.length); + let hasHistoryTiles = false; + for (let i = 0; i < numLinks; i++) { + if (links[i]) { + this.createSite(links[i], cells[i]); + if (links[i].type == "history") { + hasHistoryTiles = true; + } + } } + + this._cells = cells; }, /** @@ -133,7 +154,8 @@ var gGrid = { // Create the site's inner HTML code. site.innerHTML = '<a class="newtab-link">' + - ' <span class="newtab-thumbnail"/>' + + ' <span class="newtab-thumbnail placeholder"/>' + + ' <span class="newtab-thumbnail thumbnail"/>' + ' <span class="newtab-title"/>' + '</a>' + '<input type="button" title="' + newTabString("pin") + '"' + @@ -146,36 +168,12 @@ var gGrid = { }, /** - * Renders the sites, creates all sites and puts them into their cells. - */ - _renderSites: function Grid_renderSites() { - let cells = this.cells; - // Put sites into the cells. - let links = gLinks.getLinks(); - let length = Math.min(links.length, cells.length); - - for (let i = 0; i < length; i++) { - if (links[i]) - this.createSite(links[i], cells[i]); - } - }, - - /** - * Renders the grid. + * Test a tile at a given position for being pinned or history + * @param position Position in sites array */ - _render: function Grid_render() { - if (this._shouldRenderGrid()) { - this._renderGrid(); - } - - this._renderSites(); - }, - - _shouldRenderGrid : function Grid_shouldRenderGrid() { - let rowsLength = this._node.querySelectorAll(".newtab-row").length; - let cellsLength = this._node.querySelectorAll(".newtab-cell").length; - - return (rowsLength != gGridPrefs.gridRows || - cellsLength != (gGridPrefs.gridRows * gGridPrefs.gridColumns)); + _isHistoricalTile: function Grid_isHistoricalTile(aPos) { + let site = this.sites[aPos]; + return site && (site.isPinned() || site.link && site.link.type == "history"); } + }; diff --git a/application/palemoon/base/content/newtab/newTab.css b/application/palemoon/base/content/newtab/newTab.css index 830e4a8c1..fe745d2fd 100644 --- a/application/palemoon/base/content/newtab/newTab.css +++ b/application/palemoon/base/content/newtab/newTab.css @@ -2,26 +2,37 @@ * 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/. */ -input[type=button] { - cursor: pointer; +html { + width: 100%; + height: 100%; } -/* SCROLLBOX */ -#newtab-scrollbox { +body { + font: message-box; + width: 100%; + height: 100%; + padding: 0; + margin: 0; + background-color: #F9F9F9; display: -moz-box; position: relative; -moz-box-flex: 1; -moz-user-focus: normal; + -moz-box-orient: vertical; } -#newtab-scrollbox:not([page-disabled]) { - overflow: auto; +input { + font: message-box; + font-size: 16px; +} + +input[type=button] { + cursor: pointer; } /* UNDO */ #newtab-undo-container { transition: opacity 100ms ease-out; - display: -moz-box; -moz-box-align: center; -moz-box-pack: center; } @@ -51,9 +62,31 @@ input[type=button] { -moz-box-orient: vertical; } +#newtab-margin-undo-container { + display: -moz-box; + left: 6px; + position: absolute; + top: 6px; + z-index: 1; +} + +#newtab-margin-undo-container:dir(rtl) { + left: auto; + right: 6px; +} + +#newtab-undo-close-button:dir(rtl) { + float:left; +} + +#newtab-horizontal-margin { + display: -moz-box; + -moz-box-flex: 5; +} + #newtab-margin-top { - min-height: 50px; - max-height: 80px; + min-height: 10px; + max-height: 30px; display: -moz-box; -moz-box-flex: 1; -moz-box-align: center; @@ -62,15 +95,10 @@ input[type=button] { #newtab-margin-bottom { min-height: 40px; - max-height: 100px; + max-height: 80px; -moz-box-flex: 1; } -#newtab-horizontal-margin { - display: -moz-box; - -moz-box-flex: 5; -} - .newtab-side-margin { min-width: 40px; max-width: 300px; @@ -84,7 +112,7 @@ input[type=button] { -moz-box-orient: vertical; min-width: 600px; min-height: 400px; - transition: 100ms ease-out; + transition: 175ms ease-out; transition-property: opacity; } @@ -105,6 +133,11 @@ input[type=button] { -moz-box-flex: 1; } +/* + * Thumbnail image sizes are determined in the preferences: + * toolkit.pageThumbs.minWidth + * toolkit.pageThumbs.minHeight + */ /* CELLS */ .newtab-cell { display: -moz-box; @@ -115,7 +148,7 @@ input[type=button] { .newtab-site { position: relative; -moz-box-flex: 1; - transition: 100ms ease-out; + transition: 150ms ease-out; transition-property: top, left, opacity; } @@ -139,38 +172,35 @@ input[type=button] { bottom: 0; } -.newtab-thumbnail { - opacity: .8; - transition: opacity 100ms ease-out; -} - -.newtab-thumbnail[dragged], -.newtab-link:-moz-focusring > .newtab-thumbnail, -.newtab-site:hover > .newtab-link > .newtab-thumbnail { - opacity: 1; -} - /* TITLES */ .newtab-title { + overflow: hidden; position: absolute; - left: 0; right: 0; + text-align: center; +} + +.newtab-title { bottom: 0; white-space: nowrap; - overflow: hidden; text-overflow: ellipsis; + vertical-align: middle; +} + +.newtab-title { + left: 0; + padding: 0 4px; } /* CONTROLS */ .newtab-control { position: absolute; - top: 4px; opacity: 0; transition: opacity 100ms ease-out; } .newtab-control:-moz-focusring, -.newtab-site:hover > .newtab-control { +.newtab-cell:not([ignorehover]) > .newtab-site:hover > .newtab-control { opacity: 1; } @@ -184,16 +214,6 @@ input[type=button] { } } -.newtab-control-pin:-moz-locale-dir(ltr), -.newtab-control-block:-moz-locale-dir(rtl) { - left: 4px; -} - -.newtab-control-block:-moz-locale-dir(ltr), -.newtab-control-pin:-moz-locale-dir(rtl) { - right: 4px; -} - /* DRAG & DROP */ /* @@ -207,3 +227,124 @@ input[type=button] { background-color: #fff; opacity: 0.01; } + +/* SEARCH */ +#searchContainer { + display: -moz-box; + position: relative; + -moz-box-pack: center; + margin: 10px 0 15px; +} + +#searchContainer[page-disabled] { + opacity: 0; + pointer-events: none; +} + +#searchForm { + display: -moz-box; + position: relative; + height: 36px; + -moz-box-flex: 1; + max-width: 600px; /* 2 * (290 cell width + 10 cell margin) */ +} + +#searchEngineLogo { + border: 1px transparent; + padding: 2px 4px; + margin: 0; + width: 32px; + height: 32px; + position: absolute; +} + +#searchText { + -moz-box-flex: 1; + padding-top: 6px; + padding-bottom: 6px; + padding-inline-start: 42px; + padding-inline-end: 8px; + background: hsla(0,0%,100%,.9) padding-box; + border: 1px solid; + border-spacing: 0; + border-radius: 2px 0 0 2px; + border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2); + box-shadow: 0 1px 0 hsla(210,65%,9%,.02) inset, + 0 0 2px hsla(210,65%,9%,.1) inset, + 0 1px 0 hsla(0,0%,100%,.2); + color: inherit; + unicode-bidi: plaintext; +} + +#searchText:dir(rtl) { + border-radius: 0 2px 2px 0; +} + +#searchText[aria-expanded="true"] { + border-radius: 2px 0 0 0; +} + +#searchText[aria-expanded="true"]:dir(rtl) { + border-radius: 0 2px 0 0; +} + +#searchText[keepfocus], +#searchText:focus { + border-color: hsla(216,100%,60%,.6) hsla(216,76%,52%,.6) hsla(214,100%,40%,.6); +} + +#searchSubmit { + margin-inline-start: -1px; + padding: 0; + border: 1px solid; + background-color: #e0e0e0; + color: black; + border-color: hsla(220,54%,20%,.15) hsla(220,54%,20%,.17) hsla(220,54%,20%,.2); + border-radius: 0 2px 2px 0; + border-inline-start: 1px solid transparent; + box-shadow: 0 0 2px hsla(0,0%,100%,.5) inset, + 0 1px 0 hsla(0,0%,100%,.2); + cursor: pointer; + transition-property: background-color, border-color, box-shadow; + transition-duration: 150ms; + width: 50px; +} + +#searchSubmit:dir(rtl) { + border-radius: 2px 0 0 2px; +} + +#searchSubmit:hover { + background-color: hsl(220,54%,20%); + color: white; +} + +#searchText:focus + #searchSubmit, +#searchText + #searchSubmit:hover { + border-color: #5985fc #4573e7 #3264d5; +} + +#searchText:focus + #searchSubmit, +#searchText[keepfocus] + #searchSubmit { + box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset, + 0 0 0 1px hsla(0,0%,100%,.1) inset, + 0 1px 0 hsla(220,54%,20%,.03); +} + +#searchText + #searchSubmit:hover { + box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset, + 0 0 0 1px hsla(0,0%,100%,.1) inset, + 0 1px 0 hsla(220,54%,20%,.03), + 0 0 4px hsla(216,100%,20%,.2); +} + +#searchText + #searchSubmit:hover:active { + box-shadow: 0 1px 1px hsla(221,79%,6%,.1) inset, + 0 0 1px hsla(221,79%,6%,.2) inset; + transition-duration: 0ms; +} + +.contentSearchSuggestionTable { + font: message-box; + font-size: 16px; +} diff --git a/application/palemoon/base/content/newtab/newTab.js b/application/palemoon/base/content/newtab/newTab.js index bba73fd7a..0022f21bb 100644 --- a/application/palemoon/base/content/newtab/newTab.js +++ b/application/palemoon/base/content/newtab/newTab.js @@ -10,8 +10,8 @@ var Ci = Components.interfaces; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/PageThumbs.jsm"); +Cu.import("resource://gre/modules/BackgroundPageThumbs.jsm"); Cu.import("resource://gre/modules/NewTabUtils.jsm"); -Cu.import("resource:///modules/promise.js"); XPCOMUtils.defineLazyModuleGetter(this, "Rect", "resource://gre/modules/Geometry.jsm"); @@ -32,13 +32,24 @@ XPCOMUtils.defineLazyGetter(this, "gStringBundle", function() { createBundle("chrome://browser/locale/newTab.properties"); }); -function newTabString(name) gStringBundle.GetStringFromName('newtab.' + name); +function newTabString(name, args) { + let stringName = "newtab." + name; + if (!args) { + return gStringBundle.GetStringFromName(stringName); + } + return gStringBundle.formatStringFromName(stringName, args, args.length); +} function inPrivateBrowsingMode() { - return PrivateBrowsingUtils.isWindowPrivate(window); + return PrivateBrowsingUtils.isContentWindowPrivate(window); } const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; +const XUL_NAMESPACE = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + +const TILES_EXPLAIN_LINK = "https://support.mozilla.org/kb/how-do-tiles-work-firefox"; +const TILES_INTRO_LINK = "https://www.mozilla.org/firefox/tiles/"; +const TILES_PRIVACY_LINK = "https://www.mozilla.org/privacy/"; #include transformations.js #include page.js @@ -52,6 +63,7 @@ const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; #include dropPreview.js #include updater.js #include undo.js +#include search.js // Everything is loaded. Initialize the New Tab Page. gPage.init(); diff --git a/application/palemoon/base/content/newtab/newTab.xhtml b/application/palemoon/base/content/newtab/newTab.xhtml new file mode 100644 index 000000000..de000e723 --- /dev/null +++ b/application/palemoon/base/content/newtab/newTab.xhtml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- 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/. --> + +<!DOCTYPE html [ + <!ENTITY % newTabDTD SYSTEM "chrome://browser/locale/newTab.dtd"> + %newTabDTD; + <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd"> + %browserDTD; + <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> + %globalDTD; +]> + +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <title>&newtab.pageTitle;</title> + + <link rel="stylesheet" type="text/css" media="all" href="chrome://global/skin/" /> + <link rel="stylesheet" type="text/css" media="all" href="chrome://browser/content/newtab/newTab.css" /> + <link rel="stylesheet" type="text/css" media="all" href="chrome://browser/skin/newtab/newTab.css" /> +</head> + +<body dir="&locale.dir;"> + <div id="newtab-vertical-margin"> + <div id="newtab-margin-top"/> + + <div id="newtab-margin-undo-container"> + <div id="newtab-undo-container" undo-disabled="true"> + <label id="newtab-undo-label">&newtab.undo.removedLabel;</label> + <button id="newtab-undo-button" tabindex="-1" + class="newtab-undo-button">&newtab.undo.undoButton;</button> + <button id="newtab-undo-restore-button" tabindex="-1" + class="newtab-undo-button">&newtab.undo.restoreButton;</button> + <button id="newtab-undo-close-button" tabindex="-1" title="&newtab.undo.closeTooltip;"/> + </div> + </div> + + <div id="searchContainer"> + <form name="searchForm" id="searchForm" onsubmit="onSearchSubmit(event)"> + <div id="searchLogoContainer"><img id="searchEngineLogo"/></div> + <input type="text" name="q" value="" id="searchText" maxlength="256"/> + <input id="searchSubmit" type="submit" value="&newtab.searchEngineButton.label;"/> + </form> + </div> + + <div id="newtab-horizontal-margin"> + <div class="newtab-side-margin"/> + <div id="newtab-grid"> + <!-- site grid --> + </div> + <div class="newtab-side-margin"/> + </div> + + <div id="newtab-margin-bottom"/> + <input id="newtab-toggle" type="button"/> + </div> +</body> +<script type="text/javascript;version=1.8" src="chrome://browser/content/newtab/newTab.js"/> +</html> diff --git a/application/palemoon/base/content/newtab/newTab.xul b/application/palemoon/base/content/newtab/newTab.xul deleted file mode 100644 index 6fc202f29..000000000 --- a/application/palemoon/base/content/newtab/newTab.xul +++ /dev/null @@ -1,55 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- 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/. --> - -<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> -<?xml-stylesheet href="chrome://browser/content/newtab/newTab.css" type="text/css"?> -<?xml-stylesheet href="chrome://browser/skin/newtab/newTab.css" type="text/css"?> - -<!DOCTYPE window [ - <!ENTITY % newTabDTD SYSTEM "chrome://browser/locale/newTab.dtd"> - %newTabDTD; -]> - -<xul:window id="newtab-window" xmlns="http://www.w3.org/1999/xhtml" - xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - title="&newtab.pageTitle;"> - - <div id="newtab-scrollbox"> - - <div id="newtab-vertical-margin"> - <div id="newtab-margin-top"> - <div id="newtab-undo-container" undo-disabled="true"> - <xul:label id="newtab-undo-label" - value="&newtab.undo.removedLabel;" /> - <xul:button id="newtab-undo-button" tabindex="-1" - label="&newtab.undo.undoButton;" - class="newtab-undo-button" /> - <xul:button id="newtab-undo-restore-button" tabindex="-1" - label="&newtab.undo.restoreButton;" - class="newtab-undo-button" /> - <xul:toolbarbutton id="newtab-undo-close-button" tabindex="-1" - class="close-icon" - tooltiptext="&newtab.undo.closeTooltip;" /> - </div> - </div> - - <div id="newtab-horizontal-margin"> - <div class="newtab-side-margin"/> - - <div id="newtab-grid"> - </div> - - <div class="newtab-side-margin"/> - </div> - - <div id="newtab-margin-bottom"/> - </div> - <input id="newtab-toggle" type="button"/> - </div> - - <xul:script type="text/javascript;version=1.8" - src="chrome://browser/content/newtab/newTab.js"/> -</xul:window> diff --git a/application/palemoon/base/content/newtab/page.js b/application/palemoon/base/content/newtab/page.js index fc836a55e..7117d4527 100644 --- a/application/palemoon/base/content/newtab/page.js +++ b/application/palemoon/base/content/newtab/page.js @@ -4,6 +4,9 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #endif +// The amount of time we wait while coalescing updates for hidden pages. +const SCHEDULE_UPDATE_TIMEOUT_MS = 1000; + /** * This singleton represents the whole 'New Tab Page' and takes care of * initializing all its components. @@ -18,10 +21,15 @@ var gPage = { // Listen for 'unload' to unregister this page. addEventListener("unload", this, false); - + // Listen for toggle button clicks. let button = document.getElementById("newtab-toggle"); - button.addEventListener("click", this, false); + button.addEventListener("click", e => this.toggleEnabled(e)); + + // XXX bug 991111 - Not all click events are correctly triggered when + // listening from xhtml nodes -- in particular middle clicks on sites, so + // listen from the xul window and filter then delegate + addEventListener("click", this, false); // Check if the new tab feature is enabled. let enabled = gAllPages.enabled; @@ -34,26 +42,65 @@ var gPage = { /** * Listens for notifications specific to this page. */ - observe: function Page_observe() { - let enabled = gAllPages.enabled; - this._updateAttributes(enabled); + observe: function Page_observe(aSubject, aTopic, aData) { + if (aTopic == "nsPref:changed") { + let enabled = gAllPages.enabled; + this._updateAttributes(enabled); - // Initialize the whole page if we haven't done that, yet. - if (enabled) { - this._init(); - } else { - gUndoDialog.hide(); + // Update thumbnails to the new enhanced setting + if (aData == "browser.newtabpage.enhanced") { + this.update(); + } + + // Initialize the whole page if we haven't done that, yet. + if (enabled) { + this._init(); + } else { + gUndoDialog.hide(); + } + } else if (aTopic == "page-thumbnail:create" && gGrid.ready) { + for (let site of gGrid.sites) { + if (site && site.url === aData) { + site.refreshThumbnail(); + } + } } }, /** - * Updates the whole page and the grid when the storage has changed. + * Updates the page's grid right away for visible pages. If the page is + * currently hidden, i.e. in a background tab or in the preloader, then we + * batch multiple update requests and refresh the grid once after a short + * delay. Accepts a single parameter the specifies the reason for requesting + * a page update. The page may decide to delay or prevent a requested updated + * based on the given reason. */ - update: function Page_update() { - // The grid might not be ready yet as we initialize it asynchronously. - if (gGrid.ready) { - gGrid.refresh(); + update(reason = "") { + // Update immediately if we're visible. + if (!document.hidden) { + // Ignore updates where reason=links-changed as those signal that the + // provider's set of links changed. We don't want to update visible pages + // in that case, it is ok to wait until the user opens the next tab. + if (reason != "links-changed" && gGrid.ready) { + gGrid.refresh(); + } + + return; + } + + // Bail out if we scheduled before. + if (this._scheduleUpdateTimeout) { + return; } + + this._scheduleUpdateTimeout = setTimeout(() => { + // Refresh if the grid is ready. + if (gGrid.ready) { + gGrid.refresh(); + } + + this._scheduleUpdateTimeout = null; + }, SCHEDULE_UPDATE_TIMEOUT_MS); }, /** @@ -66,19 +113,28 @@ var gPage = { this._initialized = true; - gLinks.populateCache(function () { - // Initialize and render the grid. - gGrid.init(); + // Set submit button label for when CSS background are disabled (e.g. + // high contrast mode). + document.getElementById("searchSubmit").value = + document.body.getAttribute("dir") == "ltr" ? "\u25B6" : "\u25C0"; - // Initialize the drop target shim. - gDropTargetShim.init(); + if (document.hidden) { + addEventListener("visibilitychange", this); + } else { + setTimeout(() => this.onPageFirstVisible()); + } + + // Initialize and render the grid. + gGrid.init(); + + // Initialize the drop target shim. + gDropTargetShim.init(); #ifdef XP_MACOSX - // Workaround to prevent a delay on MacOSX due to a slow drop animation. - document.addEventListener("dragover", this, false); - document.addEventListener("drop", this, false); + // Workaround to prevent a delay on MacOSX due to a slow drop animation. + document.addEventListener("dragover", this, false); + document.addEventListener("drop", this, false); #endif - }.bind(this)); }, /** @@ -87,7 +143,7 @@ var gPage = { */ _updateAttributes: function Page_updateAttributes(aValue) { // Set the nodes' states. - let nodeSelector = "#newtab-scrollbox, #newtab-toggle, #newtab-grid"; + let nodeSelector = "#newtab-grid, #searchContainer"; for (let node of document.querySelectorAll(nodeSelector)) { if (aValue) node.removeAttribute("page-disabled"); @@ -98,15 +154,28 @@ var gPage = { // Enables/disables the control and link elements. let inputSelector = ".newtab-control, .newtab-link"; for (let input of document.querySelectorAll(inputSelector)) { - if (aValue) + if (aValue) input.removeAttribute("tabindex"); else input.setAttribute("tabindex", "-1"); } + }, - // Update the toggle button's title. - let toggle = document.getElementById("newtab-toggle"); - toggle.setAttribute("title", newTabString(aValue ? "hide" : "show")); + /** + * Handles unload event + */ + _handleUnloadEvent: function Page_handleUnloadEvent() { + gAllPages.unregister(this); + // compute page life-span and send telemetry probe: using milli-seconds will leave + // many low buckets empty. Instead we use half-second precision to make low end + // of histogram linear and not lose the change in user attention + let delta = Math.round((Date.now() - this._firstVisibleTime) / 500); + if (this._suggestedTilePresent) { + Services.telemetry.getHistogramById("NEWTAB_PAGE_LIFE_SPAN_SUGGESTED").add(delta); + } + else { + Services.telemetry.getHistogramById("NEWTAB_PAGE_LIFE_SPAN").add(delta); + } }, /** @@ -114,11 +183,22 @@ var gPage = { */ handleEvent: function Page_handleEvent(aEvent) { switch (aEvent.type) { + case "load": + this.onPageVisibleAndLoaded(); + break; case "unload": - gAllPages.unregister(this); + this._handleUnloadEvent(); break; case "click": - gAllPages.enabled = !gAllPages.enabled; + let {button, target} = aEvent; + // Go up ancestors until we find a Site or not + while (target) { + if (target.hasOwnProperty("_newtabSite")) { + target._newtabSite.onClick(aEvent); + break; + } + target = target.parentNode; + } break; case "dragover": if (gDrag.isValid(aEvent) && gDrag.draggedSite) @@ -130,6 +210,83 @@ var gPage = { aEvent.stopPropagation(); } break; + case "visibilitychange": + // Cancel any delayed updates for hidden pages now that we're visible. + if (this._scheduleUpdateTimeout) { + clearTimeout(this._scheduleUpdateTimeout); + this._scheduleUpdateTimeout = null; + + // An update was pending so force an update now. + this.update(); + } + + setTimeout(() => this.onPageFirstVisible()); + removeEventListener("visibilitychange", this); + break; + } + }, + + onPageFirstVisible: function () { + // Record another page impression. + Services.telemetry.getHistogramById("NEWTAB_PAGE_SHOWN").add(true); + + for (let site of gGrid.sites) { + if (site) { + // The site may need to modify and/or re-render itself if + // something changed after newtab was created by preloader. + // For example, the suggested tile endTime may have passed. + site.onFirstVisible(); + } + } + + // save timestamp to compute page life-span delta + this._firstVisibleTime = Date.now(); + + if (document.readyState == "complete") { + this.onPageVisibleAndLoaded(); + } else { + addEventListener("load", this); } - } + }, + + onPageVisibleAndLoaded() { + // Send the index of the last visible tile. + this.reportLastVisibleTileIndex(); + // Maybe tell the user they can undo an initial automigration + this.maybeShowAutoMigrationUndoNotification(); + }, + + reportLastVisibleTileIndex() { + let cwu = window.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils); + + let rect = cwu.getBoundsWithoutFlushing(gGrid.node); + let nodes = cwu.nodesFromRect(rect.left, rect.top, 0, rect.width, + rect.height, 0, true, false); + + let i = -1; + let lastIndex = -1; + let sites = gGrid.sites; + + for (let node of nodes) { + if (node.classList && node.classList.contains("newtab-cell")) { + if (sites[++i]) { + lastIndex = i; + if (sites[i].link.targetedSite) { + // record that suggested tile is shown to use suggested-tiles-histogram + this._suggestedTilePresent = true; + } + } + } + } + }, + + toggleEnabled: function(aEvent) { + gAllPages.enabled = !gAllPages.enabled; + event.stopPropagation(); + }, + + maybeShowAutoMigrationUndoNotification() { + // sendAsyncMessage("NewTab:MaybeShowAutoMigrationUndoNotification"); + }, }; diff --git a/application/palemoon/base/content/newtab/search.js b/application/palemoon/base/content/newtab/search.js new file mode 100644 index 000000000..8bc959eee --- /dev/null +++ b/application/palemoon/base/content/newtab/search.js @@ -0,0 +1,134 @@ +#ifdef 0 +/* 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/. */ +#endif + +const SEARCH_ENGINES = { + "DuckDuckGo": { + image: "data:image/png;base64," + + "iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAACT1BMVEXvISn/////9/fvUlr3ra3/" + + "zs7/7+/va2v/5+f/xsbvMTn/tbX/3t7/vb3vOUL3WmPvQkr/zgDvKTHvSlL3hIT3paX/1tbnISn3" + + "c3v3e3v3a3P3jIz3nJz/tb33c3PvKSn3lJT39/cAc73vSkr3e4Tv7+/3Yxj3pa3/tQj3jJT3nKX3" + + "Y2P/xs73hIzvQkL/vQjvQiHn5+f3hBD/ztbvMTH/vcb/3ucIc733lJz/pQilzufe7/fvMSHOzs73" + + "//cQrUpKvVprxmP3Y2vvShiUzmvWlJRzzmMYtUrvOTnn7/davVrWra3v9//nY2PvISGUxudztd7e" + + "3t7/76XvKSHea2v/xgDnOUK93vfW5/f/1t73Uhj/52ut3q2l3rXO784pjMZrrdb/rQjera3/5+/e" + + "paWMxufO79aEazkYrUr/nAj3jBD3axj3lBD///fehIRKpd7/1hCEYzk5vVL3//8ptVLW77UxtVLn" + + "SlLW1tZCvVp7vef/1gj/3invSkL//+fWtbXvpaX/3kr/97XvnJznWmMxjM5zvefOxsbWnKXWjIzG" + + "3u/ea3Pn997O5/fnQkqExuf3Whit1u/nUlrnxs7v5+d7zmuU1pT3exDOSjFjrVL/987/pUoQe8b/" + + "75T/3jFKxnO158bWKSl7zoRSxmtajEK1e0pzxlqcUjH/1iHOMSnOvb33cxDWnJx7td6EzmP/74xz" + + "azlrcznec3Pe771jxlpzczne78YpvVqEvWPn99YxvWOtSjHee3vG787OOTE5lEK1QjHv9+drzmve" + + "tbXO772q+r8wAAAFbUlEQVR4Xo2X84PzTBDHN3Zqu2fbemzbNl7atm3btvGHvTNJ2myuyd3NL2mT" + + "zmdnvjM76RImyGQlH5dCHBeSmscNmQkyfwBrZMLEY2aRF5cMSDYPEx+LZpUlAYRQbVEpnuc1je/M" + + "SbVwYoVFAbpE0IaLmiwqiVymmE3H84YuGs2mheCEhQH5qPUrje2ONxHKVIkXR2x2MxsMkDnLvftk" + + "2fSTQNCzSAgngwCCipkXxHiU+BsnCDFE8f6AQgnwaTGhkmDLymW8jPsBeIsth8iCpha618El1wgo" + + "4FOhWyWLWY+O8pbnAwTI29S1ElncJBmF4L0AGeJSdR4dUpt5w+DL0nAgoUuGGKKCBxDCOxrykaDb" + + "+yFQjhUylLlXpAB5jGnIqV6uvvWUcAAhLmDBXIAMrkXRdHQ+cerUiWefq1hRrAgg8LikUgdkQUAx" + + "6+2Ze0WLEO/1BQzrHCFNrAPAeDSD4q/Ln6R3p68MSYzDAUiwIEutJM0bHXE/gpEhJMxaAB3T6aT8" + + "mfkm+QBiMlwKFqAHvrHu9tvTOLrEdX4hFAkJWQB42qbVyam75ruv3zvF+wBCKJ0MAAV6SAy5+raA" + + "y+lb9tYBUw9sffKRJh+CDl2SAEAPquaC76swU1c+zlxbA9if/EIY78AcCBODDKjnVzDM0+sb57zq" + + "N14gdpbg4nraBaxm3NWpIDKNgJIIDTxEAKMyVM9/VrFcpijK52PbNhmk0RQORCA8dhGhIkDA+qPV" + + "Y/U8No2NHZsUfQCdzYTECSiRSRJKgxYAnK6+tnVrPYL7q2P7GNNnT0L3SQSS61AowK4BAExWq9XJ" + + "OmDT5D4GtUab7p92W1aD6AFBOjUKcONNKMG2o9vmScmhd+v5SCTS91StDLBwmHR5q0iiM4yv3X5g" + + "sD1i24tUHc0GQOrOihdw+ZV7drx+8I1IzfpaCQ1oSIGsbqEBdxy8KkLb8dYt7m7AFBpEJI8OUIAd" + + "Hve+wX509IqYgzLqxKMi5X+r6737wgHfMrZBKGwpQMWP0PN8/8qLn15cSRosEQeI3coxGrzRVfE2" + + "BEyTAMNpmbA3k2erPOyq+CUCPGvv3OmGykYBQhiYFbynDLu2uyW826qb7bSlv/VCe2R3vQqhIYQQ" + + "nLmSGKUAT1AqXn7V6p72iUsTThsNuhKUAeKMNFaiW2nG08H90IF1m6DywVdsHgA4bPgRGgAqUgBr" + + "DwxOtPcdv9RK6yklnaGKOXBMmN7RVCtJJMiUdG2s78dv9HbY7KrI9AQBOHwjaxaA6cKhRLXCHkpF" + + "PrAJYBz1su7LtSBQIjzozgI5AJDWsQ7gTJxETTHuEh5yW8kR5+1fvQBT5PDdWgPokE6GSuK3Aaby" + + "2KwNyGFIZ8/NfexVMAGXEfe8MA5QTVdrgGe2M9evev6FMwiAYr308nVzcx/SgHwSlswyLgDLHU0K" + + "tX5UZwCwZsM1b7516J1333v/g2UAuJoCNMsmZkEDZBXujCoOIfVJxQKsvXnDshvWfrEcAV9RAoqY" + + "rfdvHjY06R3tVmtjzQYsQ8ByC/C1O0dEzqkAGqELbiZ1W/RvBr51Ad9ZgO8dQCkh4/q5xvMC6hot" + + "sBl7rP1QT+HHQz9RGoSHhkyMgqEBdNPFWSWMY+1nBPxy+MjvZ2aZxB9n/zz3FwKiOTZfotb3AhhF" + + "xSUUNmGSjX+vWvPPYacVWJOkUilUT05ymEVb0JFHj9l/AVn+35b/jsx6YzNz8mja+iAEH7rYDntY" + + "Gaz3dizW080KWaeICx77kiG7lTKG6EEoPb0Wu0lZ9OA5whFH8GxHQjOMQls5HSs5t/glHX2FYtT/" + + "mGAs/fCtFU0vQJUSQYfvIBvVyukuLhbjuood/H6WCbD/AQSFvIO3JDxgAAAAAElFTkSuQmCC" + } +}; + +// This global tracks if the page has been set up before, to prevent double inits +var gInitialized = false; +var gObserver = new MutationObserver(function (mutations) { + for (let mutation of mutations) { + if (mutation.attributeName == "searchEngineURL") { + setupSearchEngine(); + if (!gInitialized) { + gInitialized = true; + } + return; + } + } +}); + +window.addEventListener("pageshow", function () { + window.gObserver.observe(document.documentElement, { attributes: true }); +}); + +window.addEventListener("pagehide", function() { + window.gObserver.disconnect(); +}); + +function onSearchSubmit(aEvent) { + let searchTerms = document.getElementById("searchText").value; + let searchURL = document.documentElement.getAttribute("searchEngineURL"); + + if (searchURL && searchTerms.length > 0) { + const SEARCH_TOKEN = "_searchTerms_"; + let searchPostData = document.documentElement.getAttribute("searchEnginePostData"); + if (searchPostData) { + // Check if a post form already exists. If so, remove it. + const POST_FORM_NAME = "searchFormPost"; + let form = document.forms[POST_FORM_NAME]; + if (form) { + form.parentNode.removeChild(form); + } + + // Create a new post form. + form = document.body.appendChild(document.createElement("form")); + form.setAttribute("name", POST_FORM_NAME); + // Set the URL to submit the form to. + form.setAttribute("action", searchURL.replace(SEARCH_TOKEN, searchTerms)); + form.setAttribute("method", "post"); + + // Create new <input type=hidden> elements for search param. + searchPostData = searchPostData.split("&"); + for (let postVar of searchPostData) { + let [name, value] = postVar.split("="); + if (value == SEARCH_TOKEN) { + value = searchTerms; + } + let input = document.createElement("input"); + input.setAttribute("type", "hidden"); + input.setAttribute("name", name); + input.setAttribute("value", value); + form.appendChild(input); + } + // Submit the form. + form.submit(); + } else { + searchURL = searchURL.replace(SEARCH_TOKEN, encodeURIComponent(searchTerms)); + window.location.href = searchURL; + } + } + + aEvent.preventDefault(); +} + + +function setupSearchEngine() { + let searchText = document.getElementById("searchText"); + let searchEngineName = document.documentElement.getAttribute("searchEngineName"); + let searchEngineInfo = SEARCH_ENGINES[searchEngineName]; + let logoElt = document.getElementById("searchEngineLogo"); + + // Add search engine logo. + if (searchEngineInfo && searchEngineInfo.image) { + logoElt.parentNode.hidden = false; + logoElt.src = searchEngineInfo.image; + logoElt.alt = searchEngineName; + searchText.placeholder = ""; + } else { + logoElt.parentNode.hidden = true; + searchText.placeholder = searchEngineName; + } +} diff --git a/application/palemoon/base/content/newtab/sites.js b/application/palemoon/base/content/newtab/sites.js index 873ef201c..a368146bb 100644 --- a/application/palemoon/base/content/newtab/sites.js +++ b/application/palemoon/base/content/newtab/sites.js @@ -4,6 +4,9 @@ * You can obtain one at http://mozilla.org/MPL/2.0/. */ #endif +const THUMBNAIL_PLACEHOLDER_ENABLED = + Services.prefs.getBoolPref("browser.newtabpage.thumbnailPlaceholder"); + /** * This class represents a site that is contained in a cell and can be pinned, * moved around or deleted. @@ -37,7 +40,7 @@ Site.prototype = { /** * The title of the site's link. */ - get title() { return this.link.title; }, + get title() { return this.link.title || this.link.url; }, /** * The site's parent cell. @@ -50,13 +53,19 @@ Site.prototype = { /** * Pins the site on its current or a given index. * @param aIndex The pinned index (optional). + * @return true if link changed type after pin */ pin: function Site_pin(aIndex) { if (typeof aIndex == "undefined") aIndex = this.cell.index; this._updateAttributes(true); - gPinnedLinks.pin(this._link, aIndex); + let changed = gPinnedLinks.pin(this._link, aIndex); + if (changed) { + // render site again + this._render(); + } + return changed; }, /** @@ -108,33 +117,145 @@ Site.prototype = { let control = this._querySelector(".newtab-control-pin"); if (aPinned) { - control.setAttribute("pinned", true); + this.node.setAttribute("pinned", true); control.setAttribute("title", newTabString("unpin")); } else { - control.removeAttribute("pinned"); + this.node.removeAttribute("pinned"); control.setAttribute("title", newTabString("pin")); } }, + _newTabString: function(str, substrArr) { + let regExp = /%[0-9]\$S/g; + let matches; + while ((matches = regExp.exec(str))) { + let match = matches[0]; + let index = match.charAt(1); // Get the digit in the regExp. + str = str.replace(match, substrArr[index - 1]); + } + return str; + }, + + _getSuggestedTileExplanation: function() { + let targetedName = `<strong> ${this.link.targetedName} </strong>`; + let targetedSite = `<strong> ${this.link.targetedSite} </strong>`; + if (this.link.explanation) { + return this._newTabString(this.link.explanation, [targetedName, targetedSite]); + } + return newTabString("suggested.button", [targetedName]); + }, + + /** + * Checks for and modifies link at campaign end time + */ + _checkLinkEndTime: function Site_checkLinkEndTime() { + if (this.link.endTime && this.link.endTime < Date.now()) { + let oldUrl = this.url; + // chop off the path part from url + this.link.url = Services.io.newURI(this.url, null, null).resolve("/"); + // clear supplied images - this triggers thumbnail download for new url + delete this.link.imageURI; + delete this.link.enhancedImageURI; + // remove endTime to avoid further time checks + delete this.link.endTime; + // clear enhanced-content image that may still exist in preloaded page + this._querySelector(".enhanced-content").style.backgroundImage = ""; + gPinnedLinks.replace(oldUrl, this.link); + } + }, + /** * Renders the site's data (fills the HTML fragment). */ _render: function Site_render() { + // first check for end time, as it may modify the link + this._checkLinkEndTime(); + // setup display variables let url = this.url; - let title = this.title || url; - let tooltip = (title == url ? title : title + "\n" + url); + let title = this.link.type == "history" ? this.link.baseDomain : + this.title; + let tooltip = (this.title == url ? this.title : this.title + "\n" + url); let link = this._querySelector(".newtab-link"); link.setAttribute("title", tooltip); link.setAttribute("href", url); - this._querySelector(".newtab-title").textContent = title; + this.node.setAttribute("type", this.link.type); + + let titleNode = this._querySelector(".newtab-title"); + titleNode.textContent = title; + if (this.link.titleBgColor) { + titleNode.style.backgroundColor = this.link.titleBgColor; + } if (this.isPinned()) this._updateAttributes(true); + // Capture the page if the thumbnail is missing, which will cause page.js + // to be notified and call our refreshThumbnail() method. + this.captureIfMissing(); + // but still display whatever thumbnail might be available now. + this.refreshThumbnail(); + }, + + /** + * Called when the site's tab becomes visible for the first time. + * Since the newtab may be preloaded long before it's displayed, + * check for changed conditions and re-render if needed + */ + onFirstVisible: function Site_onFirstVisible() { + if (this.link.endTime && this.link.endTime < Date.now()) { + // site needs to change landing url and background image + this._render(); + } + else { + this.captureIfMissing(); + } + }, + + /** + * Captures the site's thumbnail in the background, but only if there's no + * existing thumbnail and the page allows background captures. + */ + captureIfMissing: function Site_captureIfMissing() { + if (!document.hidden && !this.link.imageURI) { + BackgroundPageThumbs.captureIfMissing(this.url); + } + }, - let thumbnailURL = PageThumbs.getThumbnailURL(this.url); - let thumbnail = this._querySelector(".newtab-thumbnail"); - thumbnail.style.backgroundImage = "url(" + thumbnailURL + ")"; + /** + * Refreshes the thumbnail for the site. + */ + refreshThumbnail: function Site_refreshThumbnail() { + let link = this.link; + + let thumbnail = this._querySelector(".newtab-thumbnail.thumbnail"); + if (link.bgColor) { + thumbnail.style.backgroundColor = link.bgColor; + } + let uri = link.imageURI || PageThumbs.getThumbnailURL(this.url); + thumbnail.style.backgroundImage = 'url("' + uri + '")'; + + if (THUMBNAIL_PLACEHOLDER_ENABLED && + link.type == "history" && + link.baseDomain) { + let placeholder = this._querySelector(".newtab-thumbnail.placeholder"); + let charCodeSum = 0; + for (let c of link.baseDomain) { + charCodeSum += c.charCodeAt(0); + } + const COLORS = 16; + let hue = Math.round((charCodeSum % COLORS) / COLORS * 360); + placeholder.style.backgroundColor = "hsl(" + hue + ",80%,40%)"; + placeholder.textContent = link.baseDomain.substr(0,1).toUpperCase(); + } + }, + + _ignoreHoverEvents: function(element) { + element.addEventListener("mouseover", () => { + this.cell.node.setAttribute("ignorehover", "true"); + }); + element.addEventListener("mouseout", () => { + this.cell.node.removeAttribute("ignorehover"); + }); }, /** @@ -145,10 +266,6 @@ Site.prototype = { this._node.addEventListener("dragstart", this, false); this._node.addEventListener("dragend", this, false); this._node.addEventListener("mouseover", this, false); - - let controls = this.node.querySelectorAll(".newtab-control"); - for (let i = 0; i < controls.length; i++) - controls[i].addEventListener("click", this, false); }, /** @@ -157,7 +274,75 @@ Site.prototype = { _speculativeConnect: function Site_speculativeConnect() { let sc = Services.io.QueryInterface(Ci.nsISpeculativeConnect); let uri = Services.io.newURI(this.url, null, null); - sc.speculativeConnect(uri, null); + try { + // This can throw for certain internal URLs, when they wind up in + // about:newtab. Be sure not to propagate the error. + sc.speculativeConnect(uri, null); + } catch (e) {} + }, + + /** + * Record interaction with site using telemetry. + */ + _recordSiteClicked: function Site_recordSiteClicked(aIndex) { + if (Services.prefs.prefHasUserValue("browser.newtabpage.rows") || + Services.prefs.prefHasUserValue("browser.newtabpage.columns") || + aIndex > 8) { + // We only want to get indices for the default configuration, everything + // else goes in the same bucket. + aIndex = 9; + } + Services.telemetry.getHistogramById("NEWTAB_PAGE_SITE_CLICKED") + .add(aIndex); + }, + + _toggleLegalText: function(buttonClass, explanationTextClass) { + let button = this._querySelector(buttonClass); + if (button.hasAttribute("active")) { + let explain = this._querySelector(explanationTextClass); + explain.parentNode.removeChild(explain); + + button.removeAttribute("active"); + } + }, + + /** + * Handles site click events. + */ + onClick: function Site_onClick(aEvent) { + let action; + let pinned = this.isPinned(); + let tileIndex = this.cell.index; + let {button, target} = aEvent; + + // Handle tile/thumbnail link click + if (target.classList.contains("newtab-link") || + target.parentElement.classList.contains("newtab-link")) { + // Record for primary and middle clicks + if (button == 0 || button == 1) { + this._recordSiteClicked(tileIndex); + action = "click"; + } + } + // Only handle primary clicks for the remaining targets + else if (button == 0) { + aEvent.preventDefault(); + if (target.classList.contains("newtab-control-block")) { + this.block(); + action = "block"; + } + else if (pinned && target.classList.contains("newtab-control-pin")) { + this.unpin(); + action = "unpin"; + } + else if (!pinned && target.classList.contains("newtab-control-pin")) { + if (this.pin()) { + // suggested link has changed - update rest of the pages + gAllPages.update(gPage); + } + action = "pin"; + } + } }, /** @@ -165,15 +350,6 @@ Site.prototype = { */ handleEvent: function Site_handleEvent(aEvent) { switch (aEvent.type) { - case "click": - aEvent.preventDefault(); - if (aEvent.target.classList.contains("newtab-control-block")) - this.block(); - else if (this.isPinned()) - this.unpin(); - else - this.pin(); - break; case "mouseover": this._node.removeEventListener("mouseover", this, false); this._speculativeConnect(); @@ -181,9 +357,6 @@ Site.prototype = { case "dragstart": gDrag.start(this, aEvent); break; - case "drag": - gDrag.drag(this, aEvent); - break; case "dragend": gDrag.end(this, aEvent); break; diff --git a/application/palemoon/base/content/newtab/transformations.js b/application/palemoon/base/content/newtab/transformations.js index 0711d7d0a..f7db0ad84 100644 --- a/application/palemoon/base/content/newtab/transformations.js +++ b/application/palemoon/base/content/newtab/transformations.js @@ -103,7 +103,7 @@ var gTransformation = { let style = aSite.node.style; let comp = getComputedStyle(aSite.node, null); - style.width = comp.getPropertyValue("width") + style.width = comp.getPropertyValue("width"); style.height = comp.getPropertyValue("height"); aSite.node.setAttribute("frozen", "true"); @@ -156,7 +156,7 @@ var gTransformation = { finish(); } else { this.setSitePosition(aSite, targetPosition); - this._whenTransitionEnded(aSite.node, finish); + this._whenTransitionEnded(aSite.node, ["left", "top"], finish); } }, @@ -179,38 +179,42 @@ var gTransformation = { if (!aSite || aSite == gDrag.draggedSite) return; - let deferred = Promise.defer(); - batch.push(deferred.promise); - let cb = function () deferred.resolve(); - - if (!cells[aIndex]) - // The site disappeared from the grid, hide it. - this.hideSite(aSite, cb); - else if (this._getNodeOpacity(aSite.node) != 1) - // The site disappeared before but is now back, show it. - this.showSite(aSite, cb); - else - // The site's position has changed, move it around. - this._moveSite(aSite, aIndex, {unfreeze: unfreeze, callback: cb}); + batch.push(new Promise(resolve => { + if (!cells[aIndex]) { + // The site disappeared from the grid, hide it. + this.hideSite(aSite, resolve); + } else if (this._getNodeOpacity(aSite.node) != 1) { + // The site disappeared before but is now back, show it. + this.showSite(aSite, resolve); + } else { + // The site's position has changed, move it around. + this._moveSite(aSite, aIndex, {unfreeze: unfreeze, callback: resolve}); + } + })); }, this); - let wait = Promise.promised(function () callback && callback()); - wait.apply(null, batch); + if (callback) { + Promise.all(batch).then(callback); + } }, /** * Listens for the 'transitionend' event on a given node and calls the given * callback. * @param aNode The node that is transitioned. + * @param aProperties The properties we'll wait to be transitioned. * @param aCallback The callback to call when finished. */ _whenTransitionEnded: - function Transformation_whenTransitionEnded(aNode, aCallback) { + function Transformation_whenTransitionEnded(aNode, aProperties, aCallback) { - aNode.addEventListener("transitionend", function onEnd() { - aNode.removeEventListener("transitionend", onEnd, false); - aCallback(); - }, false); + let props = new Set(aProperties); + aNode.addEventListener("transitionend", function onEnd(e) { + if (props.has(e.propertyName)) { + aNode.removeEventListener("transitionend", onEnd); + aCallback(); + } + }); }, /** @@ -236,8 +240,9 @@ var gTransformation = { if (aCallback) aCallback(); } else { - if (aCallback) - this._whenTransitionEnded(aNode, aCallback); + if (aCallback) { + this._whenTransitionEnded(aNode, ["opacity"], aCallback); + } aNode.style.opacity = aOpacity; } diff --git a/application/palemoon/base/content/newtab/updater.js b/application/palemoon/base/content/newtab/updater.js index e6da37f87..2bab74d70 100644 --- a/application/palemoon/base/content/newtab/updater.js +++ b/application/palemoon/base/content/newtab/updater.js @@ -20,24 +20,22 @@ var gUpdater = { // Find all sites that remain in the grid. let sites = this._findRemainingSites(links); - let self = this; - // Remove sites that are no longer in the grid. - this._removeLegacySites(sites, function () { + this._removeLegacySites(sites, () => { // Freeze all site positions so that we can move their DOM nodes around // without any visual impact. - self._freezeSitePositions(sites); + this._freezeSitePositions(sites); // Move the sites' DOM nodes to their new position in the DOM. This will // have no visual effect as all the sites have been frozen and will // remain in their current position. - self._moveSiteNodes(sites); + this._moveSiteNodes(sites); // Now it's time to animate the sites actually moving to their new // positions. - self._rearrangeSites(sites, function () { + this._rearrangeSites(sites, () => { // Try to fill empty cells and finish. - self._fillEmptyCells(links, aCallback); + this._fillEmptyCells(links, aCallback); // Update other pages that might be open to keep them synced. gAllPages.update(gPage); @@ -134,21 +132,19 @@ var gUpdater = { if (!aSite || aSites.indexOf(aSite) != -1) return; - let deferred = Promise.defer(); - batch.push(deferred.promise); - - // Fade out the to-be-removed site. - gTransformation.hideSite(aSite, function () { - let node = aSite.node; + batch.push(new Promise(resolve => { + // Fade out the to-be-removed site. + gTransformation.hideSite(aSite, function () { + let node = aSite.node; - // Remove the site from the DOM. - node.parentNode.removeChild(node); - deferred.resolve(); - }); + // Remove the site from the DOM. + node.parentNode.removeChild(node); + resolve(); + }); + })); }); - let wait = Promise.promised(aCallback); - wait.apply(null, batch); + Promise.all(batch).then(aCallback); }, /** @@ -158,29 +154,24 @@ var gUpdater = { */ _fillEmptyCells: function Updater_fillEmptyCells(aLinks, aCallback) { let {cells, sites} = gGrid; - let batch = []; // Find empty cells and fill them. - sites.forEach(function (aSite, aIndex) { + Promise.all(sites.map((aSite, aIndex) => { if (aSite || !aLinks[aIndex]) - return; - - let deferred = Promise.defer(); - batch.push(deferred.promise); + return null; - // Create the new site and fade it in. - let site = gGrid.createSite(aLinks[aIndex], cells[aIndex]); + return new Promise(resolve => { + // Create the new site and fade it in. + let site = gGrid.createSite(aLinks[aIndex], cells[aIndex]); - // Set the site's initial opacity to zero. - site.node.style.opacity = 0; + // Set the site's initial opacity to zero. + site.node.style.opacity = 0; - // Flush all style changes for the dynamically inserted site to make - // the fade-in transition work. - window.getComputedStyle(site.node).opacity; - gTransformation.showSite(site, function () deferred.resolve()); - }); - - let wait = Promise.promised(aCallback); - wait.apply(null, batch); + // Flush all style changes for the dynamically inserted site to make + // the fade-in transition work. + window.getComputedStyle(site.node).opacity; + gTransformation.showSite(site, resolve); + }); + })).then(aCallback).catch(console.exception); } }; diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js index f389491d3..738868ccb 100644 --- a/application/palemoon/base/content/nsContextMenu.js +++ b/application/palemoon/base/content/nsContextMenu.js @@ -1124,14 +1124,11 @@ nsContextMenu.prototype = { } // setting up a new channel for 'right click - save link as ...' - // ideally we should use: - // * doc - as the loadingNode, and/or - // * this.principal - as the loadingPrincipal - // for now lets use systemPrincipal to bypass mixedContentBlocker - // checks after redirects, see bug: 1136055 var channel = NetUtil.newChannel({ uri: makeURI(linkURL), - loadUsingSystemPrincipal: true + loadingPrincipal: this.target.ownerDocument.nodePrincipal, + contentPolicyType: Ci.nsIContentPolicy.TYPE_SAVEAS_DOWNLOAD, + securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS, }); if (linkDownload) diff --git a/application/palemoon/base/content/openLocation.js b/application/palemoon/base/content/openLocation.js index f39e34666..7ad2f7c4a 100644 --- a/application/palemoon/base/content/openLocation.js +++ b/application/palemoon/base/content/openLocation.js @@ -61,53 +61,62 @@ function doEnabling() function open() { - getShortcutOrURIAndPostData(dialog.input.value).then(data => { - let url; - let postData = null; - let mayInheritPrincipal = false; - - if (browser) { - url = data.url; - postData = data.postData; - mayInheritPrincipal = data.mayInheritPrincipal; - } else { - url = dialog.input.value; - } + var openData = { + "url": null, + "postData": null, + "mayInheritPrincipal": false + }; + if (browser) { + browser.getShortcutOrURIAndPostData(dialog.input.value).then(data => { + openData.url = data.url; + openData.postData = data.postData; + openData.mayInheritPrincipal = data.mayInheritPrincipal; + + openLocation(openData); + }); + } else { + openData.url = dialog.input.value; + + openLocation(openData); + } - try { - // Whichever target we use for the load, we allow third-party services to - // fixup the URI - switch (dialog.openWhereList.value) { - case "0": - var webNav = Components.interfaces.nsIWebNavigation; - var flags = webNav.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP | - webNav.LOAD_FLAGS_FIXUP_SCHEME_TYPOS; - if (!mayInheritPrincipal) - flags |= webNav.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL; - browser.gBrowser.loadURIWithFlags(url, flags, null, null, postData); - break; - case "1": - window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", - url, postData, null, null, true); - break; - case "3": - browser.delayedOpenTab(url, null, null, postData, true); - break; - } - } - catch(exception) { - } + return false; +} - if (pref) { - gOpenLocationLastURL.value = dialog.input.value; - pref.setIntPref("general.open_location.last_window_choice", dialog.openWhereList.value); +function openLocation(openData) +{ + try { + // Whichever target we use for the load, we allow third-party services to + // fix up the URI + switch (dialog.openWhereList.value) { + case "0": + var webNav = Components.interfaces.nsIWebNavigation; + var flags = webNav.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP | + webNav.LOAD_FLAGS_FIXUP_SCHEME_TYPOS; + if (!openData.mayInheritPrincipal) + flags |= webNav.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL; + browser.gBrowser.loadURIWithFlags( + openData.url, flags, null, null, openData.postData); + break; + case "1": + window.opener.delayedOpenWindow(getBrowserURL(), "all,dialog=no", + openData.url, openData.postData, + null, null, true); + break; + case "3": + browser.delayedOpenTab( + openData.url, null, null, openData.postData, true); + break; } + } catch (ex) {} - // Delay closing slightly to avoid timing bug on Linux. - window.close(); - }); + if (pref) { + gOpenLocationLastURL.value = dialog.input.value; + pref.setIntPref( + "general.open_location.last_window_choice", dialog.openWhereList.value); + } - return false; + window.close(); } function createInstance(contractid, iidName) diff --git a/application/palemoon/base/content/pageinfo/pageInfo.xul b/application/palemoon/base/content/pageinfo/pageInfo.xul index 943fa805c..e3a61d31e 100644 --- a/application/palemoon/base/content/pageinfo/pageInfo.xul +++ b/application/palemoon/base/content/pageinfo/pageInfo.xul @@ -53,7 +53,6 @@ <command id="cmd_desktop-notificationDef" oncommand="onCheckboxClick('desktop-notification');"/> <command id="cmd_installDef" oncommand="onCheckboxClick('install');"/> <command id="cmd_geoDef" oncommand="onCheckboxClick('geo');"/> - <command id="cmd_indexedDBDef" oncommand="onCheckboxClick('indexedDB');"/> <command id="cmd_pluginsDef" oncommand="onCheckboxClick('plugins');"/> <command id="cmd_imageToggle" oncommand="onRadioClick('image');"/> <command id="cmd_popupToggle" oncommand="onRadioClick('popup');"/> @@ -61,7 +60,6 @@ <command id="cmd_desktop-notificationToggle" oncommand="onRadioClick('desktop-notification');"/> <command id="cmd_installToggle" oncommand="onRadioClick('install');"/> <command id="cmd_geoToggle" oncommand="onRadioClick('geo');"/> - <command id="cmd_indexedDBToggle" oncommand="onRadioClick('indexedDB');"/> <command id="cmd_pluginsToggle" oncommand="onPluginRadioClick(event);"/> </commandset> @@ -366,27 +364,6 @@ </radiogroup> </hbox> </vbox> - <vbox class="permission" id="permIndexedDBRow"> - <label class="permissionLabel" id="permIndexedDBLabel" - value="&permIndexedDB;" control="indexedDBRadioGroup"/> - <hbox id="permIndexedDBBox" role="group" aria-labelledby="permIndexedDBLabel"> - <checkbox id="indexedDBDef" command="cmd_indexedDBDef" label="&permUseDefault;"/> - <spacer flex="1"/> - <radiogroup id="indexedDBRadioGroup" orient="horizontal"> - <radio id="indexedDB#0" command="cmd_indexedDBToggle" label="&permAskAlways;"/> - <radio id="indexedDB#1" command="cmd_indexedDBToggle" label="&permAllow;"/> - <radio id="indexedDB#2" command="cmd_indexedDBToggle" label="&permBlock;"/> - </radiogroup> - </hbox> - <hbox id="permIndexedDBExtras"> - <spacer flex="1"/> - <vbox id="permIndexedDBStatusBox" pack="center"> - <label id="indexedDBStatus" control="indexedDBClear" hidden="true"/> - </vbox> - <button id="indexedDBClear" label="&permClearStorage;" hidden="true" - accesskey="&permClearStorage.accesskey;" onclick="onIndexedDBClear();"/> - </hbox> - </vbox> <vbox class="permission" id="permPluginsRow"> <label class="permissionLabel" id="permPluginsLabel" value="&permPlugins;" control="pluginsRadioGroup"/> diff --git a/application/palemoon/base/content/pageinfo/permissions.js b/application/palemoon/base/content/pageinfo/permissions.js index e0fb01f76..4f8382f66 100644 --- a/application/palemoon/base/content/pageinfo/permissions.js +++ b/application/palemoon/base/content/pageinfo/permissions.js @@ -12,8 +12,6 @@ const IMAGE_DENY = 2; const COOKIE_DENY = 2; const COOKIE_SESSION = 2; -const nsIQuotaManagerService = Components.interfaces.nsIQuotaManagerService; - var gPermURI; var gPermPrincipal; var gPrefs; @@ -65,13 +63,6 @@ var gPermObj = { } return ALLOW; }, - indexedDB: function getIndexedDBDefaultPermissions() - { - if (!gPrefs.getBoolPref("dom.indexedDB.enabled")) { - return DENY; - } - return UNKNOWN; - }, plugins: function getPluginsDefaultPermissions() { return UNKNOWN; @@ -161,10 +152,6 @@ function initRow(aPartId) perm = gPermObj[aPartId](); } setRadioState(aPartId, perm); - - if (aPartId == "indexedDB") { - initIndexedDBRow(); - } } function onCheckboxClick(aPartId) @@ -211,65 +198,6 @@ function setRadioState(aPartId, aValue) radio.radioGroup.selectedItem = radio; } -function initIndexedDBRow() -{ - let row = document.getElementById("permIndexedDBRow"); - let extras = document.getElementById("permIndexedDBExtras"); - - row.appendChild(extras); - - var quotaManagerService = - Components.classes["@mozilla.org/dom/quota-manager-service;1"] - .getService(nsIQuotaManagerService); - - gUsageRequest = - quotaManagerService.getUsageForPrincipal(gPermPrincipal, - onIndexedDBUsageCallback); - - var status = document.getElementById("indexedDBStatus"); - var button = document.getElementById("indexedDBClear"); - - status.value = ""; - status.setAttribute("hidden", "true"); - button.setAttribute("hidden", "true"); -} - -function onIndexedDBClear() -{ - Components.classes["@mozilla.org/dom/quota-manager-service;1"] - .getService(nsIQuotaManagerService) - .clearStoragesForPrincipal(gPermPrincipal); - - var permissionManager = Components.classes[PERMISSION_CONTRACTID] - .getService(nsIPermissionManager); - permissionManager.remove(gPermURI, "indexedDB"); - initIndexedDBRow(); -} - -function onIndexedDBUsageCallback(request) -{ - let uri = request.principal.URI; - if (!uri.equals(gPermURI)) { - 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"); - } - - var status = document.getElementById("indexedDBStatus"); - var button = document.getElementById("indexedDBClear"); - - status.value = - gBundle.getFormattedString("indexedDBUsage", - DownloadUtils.convertByteUnits(usage)); - status.removeAttribute("hidden"); - button.removeAttribute("hidden"); - } -} - // XXX copied this from browser-plugins.js - is there a way to share? function makeNicePluginName(aName) { if (aName == "Shockwave Flash") @@ -289,14 +217,20 @@ function fillInPluginPermissionTemplate(aPermissionString, aPluginObject) { .cloneNode(true); permPluginTemplate.setAttribute("permString", aPermissionString); permPluginTemplate.setAttribute("tooltiptext", aPluginObject.description); - let attrs = [ - [ ".permPluginTemplateLabel", "value", aPluginObject.name ], - [ ".permPluginTemplateRadioGroup", "id", aPermissionString + "RadioGroup" ], - [ ".permPluginTemplateRadioDefault", "id", aPermissionString + "#0" ], - [ ".permPluginTemplateRadioAsk", "id", aPermissionString + "#3" ], - [ ".permPluginTemplateRadioAllow", "id", aPermissionString + "#1" ], - [ ".permPluginTemplateRadioBlock", "id", aPermissionString + "#2" ] - ]; + let attrs = []; + attrs.push([".permPluginTemplateLabel", "value", aPluginObject.name]); + attrs.push([".permPluginTemplateRadioGroup", "id", aPermissionString + "RadioGroup"]); + attrs.push([".permPluginTemplateRadioDefault", "id", aPermissionString + "#0"]); + let permPluginTemplateRadioAsk = ".permPluginTemplateRadioAsk"; + if (Services.prefs.getBoolPref("plugins.click_to_play") || + aPluginObject.vulnerable) { + attrs.push([permPluginTemplateRadioAsk, "id", aPermissionString + "#3"]); + } else { + permPluginTemplate.querySelector(permPluginTemplateRadioAsk) + .setAttribute("disabled", "true"); + } + attrs.push([".permPluginTemplateRadioAllow", "id", aPermissionString + "#1"]); + attrs.push([".permPluginTemplateRadioBlock", "id", aPermissionString + "#2"]); for (let attr of attrs) { permPluginTemplate.querySelector(attr[0]).setAttribute(attr[1], attr[2]); @@ -336,13 +270,16 @@ function initPluginsRow() { } let permString = pluginHost.getPermissionStringForType(mimeType); if (!permissionMap.has(permString)) { - var name = makeNicePluginName(plugin.name) + " " + plugin.version; + let name = makeNicePluginName(plugin.name) + " " + plugin.version; + let vulnerable = false; if (permString.startsWith("plugin-vulnerable:")) { name += " \u2014 " + vulnerableLabel; + vulnerable = true; } permissionMap.set(permString, { "name": name, "description": plugin.description, + "vulnerable": vulnerable }); } } diff --git a/application/palemoon/base/content/palemoon.xhtml b/application/palemoon/base/content/palemoon.xhtml new file mode 100644 index 000000000..96757052c --- /dev/null +++ b/application/palemoon/base/content/palemoon.xhtml @@ -0,0 +1,66 @@ +<!DOCTYPE html +[ + <!ENTITY % mozillaDTD SYSTEM "chrome://browser/locale/palemoon.dtd" > + %mozillaDTD; + <!ENTITY % directionDTD SYSTEM "chrome://global/locale/global.dtd" > + %directionDTD; +]> + +<!-- 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/. --> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset='utf-8' /> + <title>&chronicles.title.55.2;</title> + +<style type="text/css"> +html { + background: #333399 radial-gradient( circle at 75% 25%, #6666b0 0%, #333399 40%, #111177 80%) center center / cover no-repeat; + color: white; + font-style: italic; + text-rendering: optimizeLegibility; + min-height: 100%; +} + +#moztext { + margin-top: 15%; + font-size: 1.1em; + font-family: serif; + text-align: center; + line-height: 1.5; +} + +#from { + font-size: 1.95em; + font-family: serif; + text-align: right; +} + +em { + font-size: 1.3em; + line-height: 0; +} + +a { + text-decoration: none; + color: white; +} +</style> +</head> + +<body dir="&locale.dir;"> + +<section> + <p id="moztext"> + &chronicles.quote.55.2; + </p> + + <p id="from"> + &chronicles.from.55.2; + </p> +</section> + +</body> +</html> diff --git a/application/palemoon/base/content/sanitize.js b/application/palemoon/base/content/sanitize.js index f2eb24a55..0c85fa215 100644 --- a/application/palemoon/base/content/sanitize.js +++ b/application/palemoon/base/content/sanitize.js @@ -11,7 +11,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "FormHistory", XPCOMUtils.defineLazyModuleGetter(this, "Downloads", "resource://gre/modules/Downloads.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Promise", - "resource:///modules/promise.js"); + "resource://gre/modules/Promise.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "console", @@ -257,13 +257,18 @@ Sanitizer.prototype = { .getService(Components.interfaces.nsIWindowMediator); var windows = windowManager.getEnumerator("navigator:browser"); while (windows.hasMoreElements()) { - let currentDocument = windows.getNext().document; + let currentWindow = windows.getNext(); + let currentDocument = currentWindow.document; let searchBar = currentDocument.getElementById("searchbar"); if (searchBar) searchBar.textbox.reset(); - let findBar = currentDocument.getElementById("FindToolbar"); - if (findBar) - findBar.clear(); + let tabBrowser = currentWindow.gBrowser; + for (let tab of tabBrowser.tabs) { + if (tabBrowser.isFindBarInitialized(tab)) + tabBrowser.getFindBar(tab).clear(); + } + // Clear any saved find value + tabBrowser._lastFindValue = ""; } let change = { op: "remove" }; @@ -279,7 +284,8 @@ Sanitizer.prototype = { .getService(Components.interfaces.nsIWindowMediator); var windows = windowManager.getEnumerator("navigator:browser"); while (windows.hasMoreElements()) { - let currentDocument = windows.getNext().document; + let currentWindow = windows.getNext(); + let currentDocument = currentWindow.document; let searchBar = currentDocument.getElementById("searchbar"); if (searchBar) { let transactionMgr = searchBar.textbox.editor.transactionManager; @@ -290,8 +296,12 @@ Sanitizer.prototype = { return false; } } - let findBar = currentDocument.getElementById("FindToolbar"); - if (findBar && findBar.canClear) { + let tabBrowser = currentWindow.gBrowser; + let findBarCanClear = Array.some(tabBrowser.tabs, function (aTab) { + return tabBrowser.isFindBarInitialized(aTab) && + tabBrowser.getFindBar(aTab).canClear; + }); + if (findBarCanClear) { aCallback("formdata", true, aArg); return false; } diff --git a/application/palemoon/base/content/sync/quota.js b/application/palemoon/base/content/sync/quota.js index 454052754..1285a8d54 100644 --- a/application/palemoon/base/content/sync/quota.js +++ b/application/palemoon/base/content/sync/quota.js @@ -193,10 +193,15 @@ var gUsageTreeView = { return; } - toremove = [this._byname[coll].title for each (coll in toremove)]; - toremove = toremove.join(gSyncQuota.bundle.getString("quota.list.separator")); + // Tycho: toremove = [this._byname[coll].title for each (coll in toremove)]; + let toremovetitles = []; + for (let coll in toremove) { + toremovetitles.push(this._byname[coll].title); + } + + toremovetitles = toremovetitles.join(gSyncQuota.bundle.getString("quota.list.separator")); caption.firstChild.nodeValue = gSyncQuota.bundle.getFormattedString( - "quota.removal.label", [toremove]); + "quota.removal.label", [toremovetitles]); if (freeup) caption.firstChild.nodeValue += gSyncQuota.bundle.getFormattedString( "quota.freeup.label", gSyncQuota.convertKB(freeup)); @@ -208,7 +213,14 @@ var gUsageTreeView = { * disabled. */ getEnginesToDisable: function getEnginesToDisable() { - return [coll.name for each (coll in this._collections) if (!coll.enabled)]; + // Tycho: return [coll.name for each (coll in this._collections) if (!coll.enabled)]; + let engines = []; + for each (let coll in this._collections) { + if (!coll.enabled) { + engines.push(coll.name); + } + } + return engines; }, // nsITreeView diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index 10f109ce8..ea68d00ad 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -128,6 +128,10 @@ false </field> + <field name="_lastFindValue"> + "" + </field> + <property name="_numPinnedTabs" readonly="true"> <getter><![CDATA[ for (var i = 0; i < this.tabs.length; i++) { @@ -154,6 +158,43 @@ ]]></getter> </property> + <method name="isFindBarInitialized"> + <parameter name="aTab"/> + <body><![CDATA[ + return (aTab || this.selectedTab)._findBar != undefined; + ]]></body> + </method> + + <method name="getFindBar"> + <parameter name="aTab"/> + <body><![CDATA[ + if (!aTab) + aTab = this.selectedTab; + + if (aTab._findBar) + return aTab._findBar; + + let findBar = document.createElementNS(this.namespaceURI, "findbar"); + let browser = this.getBrowserForTab(aTab); + let browserContainer = this.getBrowserContainer(browser); + browserContainer.appendChild(findBar); + + // Force a style flush to ensure that our binding is attached. + findBar.clientTop; + + findBar.browser = browser; + findBar._findField.value = this._lastFindValue; + + aTab._findBar = findBar; + + let event = document.createEvent("Events"); + event.initEvent("TabFindInitialized", true, false); + aTab.dispatchEvent(event); + + return findBar; + ]]></body> + </method> + <method name="updateWindowResizers"> <body><![CDATA[ if (!window.gShowPageResizers) @@ -1063,9 +1104,11 @@ this.mCurrentTab.removeAttribute("unread"); this.selectedTab.lastAccessed = Date.now(); - // Bug 666816 - TypeAheadFind support for e10s - if (!gMultiProcessBrowser) - this._fastFind.setDocShell(this.mCurrentBrowser.docShell); + let oldFindBar = oldTab._findBar; + if (oldFindBar && + oldFindBar.findMode == oldFindBar.FIND_NORMAL && + !oldFindBar.hidden) + this._lastFindValue = oldFindBar._findField.value; this.updateTitlebar(); @@ -1116,6 +1159,11 @@ // Adjust focus oldBrowser._urlbarFocused = (gURLBar && gURLBar.focused); + if (this.isFindBarInitialized(oldTab)) { + let findBar = this.getFindBar(oldTab); + oldTab._findBarFocused = (!findBar.hidden && + findBar._findField.getAttribute("focused") == "true"); + } do { // When focus is in the tab bar, retain it there. if (document.activeElement == oldTab) { @@ -1151,11 +1199,12 @@ } } - // If the find bar is focused, keep it focused. - if (gFindBarInitialized && - !gFindBar.hidden && - gFindBar.getElement("findbar-textbox").getAttribute("focused") == "true") + // Focus the find bar if it was previously focused for that tab. + if (gFindBarInitialized && !gFindBar.hidden && + this.selectedTab._findBarFocused) { + gFindBar._findField.focus(); break; + } // Otherwise, focus the content area. let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager); @@ -1445,9 +1494,6 @@ t.setAttribute("label", aURI); t.setAttribute("crop", "end"); - t.style.maxWidth = this.tabContainer.mTabMaxWidth + "px"; - t.style.minWidth = this.tabContainer.mTabMinWidth + "px"; - t.width = 0; t.setAttribute("validate", "never"); //PMed t.setAttribute("onerror", "this.removeAttribute('image');"); t.className = "tabbrowser-tab"; @@ -1561,7 +1607,6 @@ this.mTabListeners[position] = tabListener; this.mTabFilters[position] = filter; - b._fastFind = this.fastFind; b.droppedLinkHandler = handleDroppedLink; // If we just created a new tab that loads the default @@ -1672,8 +1717,22 @@ var tabsToClose; switch (aCloseTabs) { case this.closingTabsEnum.ALL: - tabsToClose = this.tabs.length - this._removingTabs.length - - gBrowser._numPinnedTabs; + // If there are multiple windows, pinned tabs will be closed, so + // we warn about them, too; if there is just one window, pinned + // tabs should come back on restart, so exclude them from warning. + var numberOfWindows = 0; + var browserEnum = Services.wm.getEnumerator("navigator:browser"); + while (browserEnum.hasMoreElements() && numberOfWindows < 2) { + numberOfWindows++; + browserEnum.getNext(); + } + if (numberOfWindows > 1) { + tabsToClose = this.tabs.length - this._removingTabs.length + } + else { + tabsToClose = this.tabs.length - this._removingTabs.length - + gBrowser._numPinnedTabs; + } break; case this.closingTabsEnum.OTHER: tabsToClose = this.visibleTabs.length - 1 - gBrowser._numPinnedTabs; @@ -2225,6 +2284,17 @@ this._swapBrowserDocShells(aOurTab, otherBrowser); } + // Handle findbar data (if any) + let otherFindBar = aOtherTab._findBar; + if (otherFindBar && + otherFindBar.findMode == otherFindBar.FIND_NORMAL) { + let ourFindBar = this.getFindBar(aOurTab); + ourFindBar._findField.value = otherFindBar._findField.value; + if (!otherFindBar.hidden) { + ourFindBar.onFindCommand(); + } + } + // Finish tearing down the tab that's going away. remoteBrowser._endRemoveTab(aOtherTab); @@ -2777,21 +2847,6 @@ onget="return this.mCurrentBrowser.currentURI;" readonly="true"/> - <field name="_fastFind">null</field> - <property name="fastFind" - readonly="true"> - <getter> - <![CDATA[ - if (!this._fastFind) { - this._fastFind = Components.classes["@mozilla.org/typeaheadfind;1"] - .createInstance(Components.interfaces.nsITypeAheadFind); - this._fastFind.init(this.docShell); - } - return this._fastFind; - ]]> - </getter> - </property> - <field name="_lastSearchString">null</field> <field name="_lastSearchHighlight">false</field> @@ -3096,13 +3151,27 @@ break; } case "Findbar:Keypress": - if (!gFindBarInitialized) { - // If the find bar for this tab is not yet alive, change that, - // and make sure we return the result: - return gFindBar.receiveMessage(aMessage); + let tab = this.getTabForBrowser(browser); + // If the find bar for this tab is not yet alive, only initialize + // it if there's a possibility FindAsYouType will be used. + // There's no point in doing it for most random keypresses. + if (!this.isFindBarInitialized(tab) && + aMessage.data.shouldFastFind) { + let shouldFastFind = this._findAsYouType; + if (!shouldFastFind) { + // Please keep in sync with toolkit/content/widgets/findbar.xml + const FAYT_LINKS_KEY = "'"; + const FAYT_TEXT_KEY = "/"; + let charCode = aMessage.data.fakeEvent.charCode; + let key = charCode ? String.fromCharCode(charCode) : null; + shouldFastFind = key == FAYT_LINKS_KEY || key == FAYT_TEXT_KEY; + } + if (shouldFastFind) { + // Make sure we return the result. + return this.getFindBar(tab).receiveMessage(aMessage); + } } break; - } ]]></body> </method> @@ -3169,6 +3238,10 @@ this.mCurrentBrowser); } messageManager.addMessageListener("DOMWebNotificationClicked", this); + + // To correctly handle keypresses for potential FindAsYouType, while + // the tab's find bar is not yet initialized. + this._findAsYouType = Services.prefs.getBoolPref("accessibility.typeaheadfind"); messageManager.addMessageListener("Findbar:Keypress", this); ]]> </constructor> @@ -3413,8 +3486,6 @@ <implementation implements="nsIDOMEventListener"> <constructor> <![CDATA[ - this.mTabMinWidth = Services.prefs.getIntPref("browser.tabs.tabMinWidth"); - this.mTabMaxWidth = Services.prefs.getIntPref("browser.tabs.tabMaxWidth"); this.mTabClipWidth = Services.prefs.getIntPref("browser.tabs.tabClipWidth"); this.mCloseButtons = Services.prefs.getIntPref("browser.tabs.closeButtons"); this._closeWindowWithLastTab = Services.prefs.getBoolPref("browser.tabs.closeWindowWithLastTab"); @@ -3422,13 +3493,11 @@ var tab = this.firstChild; tab.setAttribute("label", this.tabbrowser.mStringBundle.getString("tabs.emptyTabTitle")); - tab.style.minWidth = this.mTabMinWidth + "px"; - tab.style.maxWidth = this.mTabMaxWidth + "px"; - tab.width = 0; tab.setAttribute("crop", "end"); tab.setAttribute("onerror", "this.removeAttribute('image');"); this.adjustTabstrip(); + Services.prefs.addObserver("accessibility.typeaheadfind", this._prefObserver, false); Services.prefs.addObserver("browser.tabs.", this._prefObserver, false); window.addEventListener("resize", this, false); window.addEventListener("load", this, false); @@ -3444,6 +3513,7 @@ <destructor> <![CDATA[ + Services.prefs.removeObserver("accessibility.typeaheadfind", this._prefObserver); Services.prefs.removeObserver("browser.tabs.", this._prefObserver); ]]> </destructor> @@ -3509,6 +3579,9 @@ observe: function (subject, topic, data) { switch (data) { + case "accessibility.typeaheadfind": + this._findAsYouType = Services.prefs.getBoolPref(data); + break; case "browser.tabs.closeButtons": this.tabContainer.mCloseButtons = Services.prefs.getIntPref(data); this.tabContainer.adjustTabstrip(); diff --git a/application/palemoon/base/content/utilityOverlay.js b/application/palemoon/base/content/utilityOverlay.js index 633cb8853..63488e209 100644 --- a/application/palemoon/base/content/utilityOverlay.js +++ b/application/palemoon/base/content/utilityOverlay.js @@ -9,6 +9,9 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); Components.utils.import("resource:///modules/RecentWindow.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "ShellService", + "resource:///modules/ShellService.jsm"); + XPCOMUtils.defineLazyGetter(this, "BROWSER_NEW_TAB_URL", function () { const PREF = "browser.newtab.url"; @@ -247,6 +250,10 @@ function openLinkIn(url, where, params) { aRelatedToCurrent = false; } + // We can only do this after we're sure of what |w| will be the rest of this function. + // Note that if |w| is null we might have no current browser (we'll open a new window). + var aCurrentBrowser = params.currentBrowser || (w && w.gBrowser.selectedBrowser); + if (!w || where == "window") { // This propagates to window.arguments. // Strip referrer data when opening a new private window, to prevent @@ -325,6 +332,7 @@ function openLinkIn(url, where, params) { // result in a new frontmost window (e.g. "javascript:window.open('');"). w.focus(); + let browserUsedForLoad = null; switch (where) { case "current": let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE; @@ -343,27 +351,35 @@ function openLinkIn(url, where, params) { referrerPolicy: aReferrerPolicy, postData: aPostData, }); + browserUsedForLoad = aCurrentBrowser; break; case "tabshifted": loadInBackground = !loadInBackground; // fall through case "tab": let browser = w.gBrowser; - browser.loadOneTab(url, { - referrerURI: aReferrerURI, - referrerPolicy: aReferrerPolicy, - charset: aCharset, - postData: aPostData, - inBackground: loadInBackground, - allowThirdPartyFixup: aAllowThirdPartyFixup, - relatedToCurrent: aRelatedToCurrent}); + let tabUsedForLoad = browser.loadOneTab(url, { + referrerURI: aReferrerURI, + referrerPolicy: aReferrerPolicy, + charset: aCharset, + postData: aPostData, + inBackground: loadInBackground, + allowThirdPartyFixup: aAllowThirdPartyFixup, + relatedToCurrent: aRelatedToCurrent}); + browserUsedForLoad = tabUsedForLoad.linkedBrowser; break; } - w.gBrowser.selectedBrowser.focus(); + // Focus the content, but only if the browser used for the load is selected. + if (browserUsedForLoad && + browserUsedForLoad == browserUsedForLoad.getTabBrowser().selectedBrowser) { + browserUsedForLoad.focus(); + } if (!loadInBackground && w.isBlankPageURL(url)) - w.focusAndSelectUrlBar(); + if (!w.focusAndSelectUrlBar()) { + console.error("Unable to focus and select address bar.") + } } // Used as an onclick handler for UI elements with link-like behavior. @@ -448,15 +464,10 @@ function gatherTextUnder ( root ) return text; } +// This function exists for legacy reasons. function getShellService() { - var shell = null; - try { - shell = Components.classes["@mozilla.org/browser/shell-service;1"] - .getService(Components.interfaces.nsIShellService); - } catch (e) { - } - return shell; + return ShellService; } function isBidiEnabled() { diff --git a/application/palemoon/base/jar.mn b/application/palemoon/base/jar.mn index 622d8e0da..d8c3f4b21 100644 --- a/application/palemoon/base/jar.mn +++ b/application/palemoon/base/jar.mn @@ -69,7 +69,8 @@ browser.jar: content/browser/padlock_classic_https.png (content/padlock_classic_https.png) content/browser/padlock_classic_low.png (content/padlock_classic_low.png) content/browser/padlock_classic_broken.png (content/padlock_classic_broken.png) - content/browser/newtab/newTab.xul (content/newtab/newTab.xul) + content/browser/palemoon.xhtml (content/palemoon.xhtml) + content/browser/newtab/newTab.xhtml (content/newtab/newTab.xhtml) * content/browser/newtab/newTab.js (content/newtab/newTab.js) content/browser/newtab/newTab.css (content/newtab/newTab.css) * content/browser/pageinfo/pageInfo.xul (content/pageinfo/pageInfo.xul) diff --git a/application/palemoon/branding/shared/pref/preferences.inc b/application/palemoon/branding/shared/pref/preferences.inc index a3cfcd138..721c2c90e 100644 --- a/application/palemoon/branding/shared/pref/preferences.inc +++ b/application/palemoon/branding/shared/pref/preferences.inc @@ -6,33 +6,15 @@ pref("startup.homepage_welcome_url","http://www.palemoon.org/firstrun.shtml"); pref("app.vendorURL", "http://www.palemoon.org/"); -pref("app.support.baseURL", "http://www.palemoon.org/support/"); -pref("browser.getdevtools.url","https://@APO_AM_URL@/external/devtools"); + // User Interface -pref("browser.tabs.insertRelatedAfterCurrent", false); //use old method of tabbed browsing instead of "Chrome" style -pref("browser.download.useDownloadDir", false); //don not use default download location as standard. ASK. -pref("browser.search.context.loadInBackground", true); //don not swap focus to the context search tab. -pref("browser.ctrlTab.previews", true); -pref("browser.allTabs.previews", true); -pref("browser.urlbar.trimURLs", false); //stop being a derp, Mozilla! pref("browser.identity.ssl_domain_display", 1); //show domain verified SSL (blue) -pref("browser.urlbar.autoFill", true); -pref("browser.urlbar.autoFill.typed", true); - -//Set tabs NOT on top -pref("browser.tabs.onTop",false); - -// Download manager -pref("browser.download.manager.flashCount", 10); -pref("browser.download.manager.scanWhenDone", false); //NIB, make sure to disable to prevent hangups -pref("browser.altClickSave", true); //SBaD,M! (#2) // ============================================================================ // ===| Application Update Service |=========================================== -pref("app.update.auto", false); pref("app.update.url", "https://aus.palemoon.org/?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&buildid=%BUILD_ID%&channel=%CHANNEL%"); // The time interval between the downloading of mar file chunks in the @@ -42,35 +24,17 @@ pref("app.update.download.backgroundInterval", 600); // Give the user x seconds to react before showing the big UI. default=48 hours pref("app.update.promptWaitTime", 172800); -// Additional Update fixes -pref("app.update.cert.requireBuiltIn", false); - // ============================================================================ // ===| Add-ons Manager |====================================================== // Add-on window fixes -pref("extensions.getAddons.browseAddons", "https://addons.mozilla.org/%LOCALE%/firefox"); -pref("extensions.getAddons.recommended.browseURL", "https://@APO_AM_URL@/external/recommended"); -pref("extensions.getAddons.recommended.url", "https://@APO_AM_URL@/internal/recommended?locale=%LOCALE%&os=%OS%"); -pref("extensions.getAddons.search.browseURL", "https://@APO_AM_URL@/external/search?q=%TERMS%"); -pref("extensions.getAddons.search.url", "https://@APO_AM_URL@/internal/search?q=%TERMS%&locale=%LOCALE%&os=%OS%&version=%VERSION%"); pref("extensions.getMoreThemesURL", "https://@APO_AM_URL@/external/themes"); -pref("extensions.webservice.discoverURL","http://@APO_AM_URL@/internal/discover/"); -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%"); - -// Add-on updates: hard-code base Firefox version number. -pref("extensions.update.background.url","https://@APO_AM_URL@/internal/update?@APO_AUS_ARGS@"); -pref("extensions.update.url","https://@APO_AM_URL@/internal/update?@APO_AUS_ARGS@"); // Extensions Blocklist pref("extensions.blocklist.url","http://blocklist.palemoon.org/%VERSION%/blocklist.xml"); pref("extensions.blocklist.itemURL", "http://blocklist.palemoon.org/info/?id=%blockID%"); -// Search engine fixes -pref("browser.search.searchEnginesURL", "https://@APO_AM_URL@/external/searchplugins"); - // Dictionary URL pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/"); @@ -82,7 +46,6 @@ pref("extensions.getAddons.cache.enabled", false); // ===| DOM |================================================================== -pref("dom.disable_window_status_change", false); //Allow status feedback by default // Set max script runtimes to sane values pref("dom.max_chrome_script_run_time", 90); //Some addons need ample time! pref("dom.max_script_run_time", 20); //Should be plenty for a page script to do what it needs @@ -110,10 +73,21 @@ pref("image.mem.decode_bytes_at_a_time", 65536); //larger chunks // ============================================================================ -// ===| Misc. |================================================================ +// ===| Sync |================================================================= + +// Pale Moon Sync server URLs +pref("services.sync.serverURL","https://pmsync.palemoon.org/sync/index.php/"); +pref("services.sync.jpake.serverURL","https://keyserver.palemoon.org/"); +pref("services.sync.termsURL", "http://www.palemoon.org/sync/terms.shtml"); +pref("services.sync.privacyURL", "http://www.palemoon.org/sync/privacy.shtml"); +pref("services.sync.statusURL", "https://pmsync.palemoon.org/status/"); +pref("services.sync.syncKeyHelpURL", "http://www.palemoon.org/sync/help/recoverykey.shtml"); + +pref("services.sync.APILevel", 1); // FSyncMS doesn't support 'info/configuration' requests -// store sessions less frequently to prevent redundant mem usage by storing too much -pref("browser.sessionstore.interval",60000); //every minute instead of every 10 seconds +// ============================================================================ + +// ===| Misc. |================================================================ // Make sure we shortcut out of a11y to save walking unnecessary code pref("accessibility.force_disabled", 1); diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc index db9ccaffa..e5e727ee5 100644 --- a/application/palemoon/branding/shared/pref/uaoverrides.inc +++ b/application/palemoon/branding/shared/pref/uaoverrides.inc @@ -43,11 +43,6 @@ pref("@GUAO_PREF@.players.brightcove.net","Mozilla/5.0 (Windows NT 6.1; Trident/ pref("@GUAO_PREF@.facebook.com","Mozilla/5.0 (@OS_SLICE@ rv:99.9) @GK_SLICE@ Firefox/99.9 (Pale Moon)");
pref("@GUAO_PREF@.fbcdn.net","Mozilla/5.0 (@OS_SLICE@ rv:99.9) @GK_SLICE@ Firefox/99.9 (Pale Moon)");
-#ifdef XP_UNIX
-// Google Fonts forces unicode ranges unless it is being told the browser is Firefox 43 or below.
-// They do NOT test for unicode-ranges CSS support.
-pref("@GUAO_PREF@.fonts.googleapis.com","Mozilla/5.0 (@OS_SLICE@ rv:43.0) @GK_SLICE@ Firefox/43.0");
-#endif
// UA-Sniffing domains below are pending responses from their operators - temp workaround
pref("@GUAO_PREF@.chase.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@");
@@ -61,6 +56,8 @@ pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (@OS_SLICE@ rv:52.0) @GK_SLICE@ // The following requires native mode. Or it blocks.. "too old firefox", breakage, etc.
pref("@GUAO_PREF@.deviantart.com","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
pref("@GUAO_PREF@.deviantart.net","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
+pref("@GUAO_PREF@.altibox.dk","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
+pref("@GUAO_PREF@.altibox.no","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
// UA-Sniffing domains below have indicated no interest in supporting Pale Moon (BOO!)
pref("@GUAO_PREF@.humblebundle.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)");
diff --git a/application/palemoon/branding/unstable/pref/palemoon-branding.js b/application/palemoon/branding/unstable/pref/palemoon-branding.js index dda6f86a5..2cd64fadb 100644 --- a/application/palemoon/branding/unstable/pref/palemoon-branding.js +++ b/application/palemoon/branding/unstable/pref/palemoon-branding.js @@ -12,7 +12,7 @@ pref("general.useragent.compatMode.gecko", true); pref("general.useragent.compatMode.firefox", true);
// ========================= updates ========================
-#if defined(XP_WIN)
+#if defined(XP_WIN) || defined(XP_LINUX)
// Enable auto-updates for this channel
pref("app.update.auto", true);
@@ -26,13 +26,21 @@ pref("app.update.promptWaitTime", 86400); // URL user can browse to manually if for some reason all update installation
// attempts fail.
+#ifndef XP_LINUX
pref("app.update.url.manual", "http://www.palemoon.org/unstable/");
-
+#else
+pref("app.update.url.manual", "http://linux.palemoon.org/download/unstable/");
+#endif
// A default value for the "More information about this update" link
// supplied in the "An update is available" page of the update wizard.
+#ifndef XP_LINUX
pref("app.update.url.details", "http://www.palemoon.org/unstable/");
#else
-// Updates disabled (Linux, etc.)
+pref("app.update.url.details", "http://linux.palemoon.org/download/unstable/");
+#endif
+
+#else
+// Updates disabled (Mac, etc.)
pref("app.update.enabled", false);
pref("app.update.url", "");
#endif
diff --git a/application/palemoon/components/about/AboutRedirector.cpp b/application/palemoon/components/about/AboutRedirector.cpp index 27f6540b2..fbcad6094 100644 --- a/application/palemoon/components/about/AboutRedirector.cpp +++ b/application/palemoon/components/about/AboutRedirector.cpp @@ -53,16 +53,16 @@ static RedirEntry kRedirMap[] = { nsIAboutModule::ALLOW_SCRIPT }, { - "newtab", "chrome://browser/content/newtab/newTab.xul", + "newtab", "chrome://browser/content/newtab/newTab.xhtml", nsIAboutModule::ALLOW_SCRIPT }, { - "palemoon", "chrome://global/content/memoriam.xhtml", + "palemoon", "chrome://browser/content/palemoon.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::HIDE_FROM_ABOUTABOUT }, { - "permissions", "chrome://browser/content/preferences/aboutPermissions.xul", + "permissions", "chrome://browser/content/permissions/aboutPermissions.xul", nsIAboutModule::ALLOW_SCRIPT }, { @@ -70,12 +70,7 @@ static RedirEntry kRedirMap[] = { nsIAboutModule::ALLOW_SCRIPT }, { - "rights", -#ifdef MOZ_OFFICIAL_BRANDING - "chrome://global/content/aboutRights.xhtml", -#else - "chrome://global/content/aboutRights-unbranded.xhtml", -#endif + "rights", "chrome://global/content/aboutRights.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::MAKE_LINKABLE | nsIAboutModule::ALLOW_SCRIPT diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm index c6614e780..bd5d55a73 100644 --- a/application/palemoon/components/downloads/DownloadsCommon.jsm +++ b/application/palemoon/components/downloads/DownloadsCommon.jsm @@ -77,8 +77,7 @@ const nsIDM = Ci.nsIDownloadManager; const kDownloadsStringBundleUrl = "chrome://browser/locale/downloads/downloads.properties"; -const kPrefBdmScanWhenDone = "browser.download.manager.scanWhenDone"; -const kPrefBdmAlertOnExeOpen = "browser.download.manager.alertOnEXEOpen"; +const kPrefConfirmOpenExe = "browser.download.confirmOpenExecutable"; const kDownloadsStringsRequiringFormatting = { sizeWithUnits: true, @@ -518,21 +517,22 @@ this.DownloadsCommon = { if (!(aOwnerWindow instanceof Ci.nsIDOMWindow)) throw new Error("aOwnerWindow must be a dom-window object"); +#ifdef XP_WIN + // On Windows, the system will provide a native confirmation prompt + // for .exe files. Exclude this from our prompt, but prompt on other + // executable types. + let isWindowsExe = aFile.leafName.toLowerCase().endsWith(".exe"); +#else + let isWindowsExe = false; +#endif + // Confirm opening executable files if required. - if (aFile.isExecutable()) { + if (aFile.isExecutable() && !isWindowsExe) { let showAlert = true; try { - showAlert = Services.prefs.getBoolPref(kPrefBdmAlertOnExeOpen); - } catch (ex) { } - - // On Vista and above, we rely on native security prompting for - // downloaded content unless it's disabled. - if (DownloadsCommon.isWinVistaOrHigher) { - try { - if (Services.prefs.getBoolPref(kPrefBdmScanWhenDone)) { - showAlert = false; - } - } catch (ex) { } + showAlert = Services.prefs.getBoolPref(kPrefConfirmOpenExe); + } catch (ex) { + // If the preference does not exist, continue with the prompt. } if (showAlert) { @@ -541,18 +541,11 @@ this.DownloadsCommon = { DownloadsCommon.strings.fileExecutableSecurityWarning(name, name); let title = DownloadsCommon.strings.fileExecutableSecurityWarningTitle; - let dontAsk = - DownloadsCommon.strings.fileExecutableSecurityWarningDontAsk; - let checkbox = { value: false }; - let open = Services.prompt.confirmCheck(aOwnerWindow, title, message, - dontAsk, checkbox); + let open = Services.prompt.confirm(aOwnerWindow, title, message); if (!open) { return; } - - Services.prefs.setBoolPref(kPrefBdmAlertOnExeOpen, - !checkbox.value); } } diff --git a/application/palemoon/components/downloads/moz.build b/application/palemoon/components/downloads/moz.build index 3bebfd6d1..61d8c0f62 100644 --- a/application/palemoon/components/downloads/moz.build +++ b/application/palemoon/components/downloads/moz.build @@ -13,7 +13,10 @@ EXTRA_COMPONENTS += [ ] EXTRA_JS_MODULES += [ - 'DownloadsCommon.jsm', 'DownloadsLogger.jsm', 'DownloadsTaskbar.jsm', -]
\ No newline at end of file +] + +EXTRA_PP_JS_MODULES += [ + 'DownloadsCommon.jsm', +] diff --git a/application/palemoon/components/moz.build b/application/palemoon/components/moz.build index 6e83936a9..397bf5142 100644 --- a/application/palemoon/components/moz.build +++ b/application/palemoon/components/moz.build @@ -12,6 +12,7 @@ DIRS += [ 'feeds', 'fuel', 'places', + 'permissions', 'preferences', 'privatebrowsing', 'search', diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index aa24d88ef..720d1165c 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -1207,7 +1207,7 @@ BrowserGlue.prototype = { }, _migrateUI: function BG__migrateUI() { - const UI_VERSION = 17; + const UI_VERSION = 19; const BROWSER_DOCURL = "chrome://browser/content/browser.xul#"; let currentUIVersion = 0; try { @@ -1412,6 +1412,36 @@ BrowserGlue.prototype = { delete this._rdf; delete this._dataSource; + if (currentUIVersion < 18) { + // Make sure the doNotTrack value conforms to the conversion from + // three-state to two-state. (This reverts a setting of "please track me" + // to the default "don't say anything"). + try { + if (Services.prefs.getBoolPref("privacy.donottrackheader.enabled") && + Services.prefs.getIntPref("privacy.donottrackheader.value") != 1) { + Services.prefs.clearUserPref("privacy.donottrackheader.enabled"); + Services.prefs.clearUserPref("privacy.donottrackheader.value"); + } + } + catch (ex) {} + } + +#ifndef MOZ_JXR + // Until JPEG-XR decoder is implemented (UXP #144) + if (currentUIVersion < 19) { + try { + let ihaPref = "image.http.accept"; + let ihaValue = Services.prefs.getCharPref(ihaPref); + if (ihaValue.includes("image/jxr,")) { + Services.prefs.setCharPref(ihaPref, ihaValue.replace("image/jxr,", "")); + } else if (ihaValue.includes("image/jxr")) { + Services.prefs.clearUserPref(ihaPref); + } + } + catch (ex) {} + } +#endif + // Update the migration version. Services.prefs.setIntPref("browser.migration.version", UI_VERSION); }, diff --git a/application/palemoon/components/preferences/aboutPermissions.css b/application/palemoon/components/permissions/aboutPermissions.css index cec82a030..d73b6a879 100644 --- a/application/palemoon/components/preferences/aboutPermissions.css +++ b/application/palemoon/components/permissions/aboutPermissions.css @@ -3,9 +3,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ .site { - -moz-binding: url("chrome://browser/content/preferences/aboutPermissions.xml#site"); + -moz-binding: url("chrome://browser/content/permissions/aboutPermissions.xml#site"); } .pluginPermission { - -moz-binding: url("chrome://browser/content/preferences/aboutPermissions.xml#pluginPermission"); + -moz-binding: url("chrome://browser/content/permissions/aboutPermissions.xml#pluginPermission"); } diff --git a/application/palemoon/components/preferences/aboutPermissions.js b/application/palemoon/components/permissions/aboutPermissions.js index 9fb12d081..6a02daa29 100644 --- a/application/palemoon/components/preferences/aboutPermissions.js +++ b/application/palemoon/components/permissions/aboutPermissions.js @@ -77,7 +77,7 @@ Site.prototype = { * @param aCallback * A callback function that takes a favicon image URL as a parameter. */ - getFavicon: function Site_getFavicon(aCallback) { + getFavicon: function(aCallback) { function invokeCallback(aFaviconURI) { try { // Use getFaviconLinkForIcon to get image data from the database instead @@ -102,7 +102,7 @@ Site.prototype = { * @param aCallback * A function that takes the visit count (a number) as a parameter. */ - getVisitCount: function Site_getVisitCount(aCallback) { + getVisitCount: function(aCallback) { // XXX This won't be a very reliable system, as it will count both http: and https: visits // Unfortunately, I don't think that there is a much better way to do it right now. let rev_host = this.principal.URI.host.split("").reverse().join("") + "."; @@ -130,13 +130,13 @@ Site.prototype = { * * @param aType * The permission type string stored in permission manager. - * e.g. "cookie", "geo", "indexedDB", "popup", "image" + * e.g. "cookie", "geo", "popup", "image" * @param aResultObj * An object that stores the permission value set for aType. * * @return A boolean indicating whether or not a permission is set. */ - getPermission: function Site_getPermission(aType, aResultObj) { + getPermission: function(aType, aResultObj) { // Password saving isn't a nsIPermissionManager permission type, so handle // it seperately. if (aType == "password") { @@ -169,12 +169,12 @@ Site.prototype = { * * @param aType * The permission type string stored in permission manager. - * e.g. "cookie", "geo", "indexedDB", "popup", "image" + * e.g. "cookie", "geo", "popup", "image" * @param aPerm * The permission value to set for the permission type. This should * be one of the constants defined in nsIPermissionManager. */ - setPermission: function Site_setPermission(aType, aPerm) { + setPermission: function(aType, aPerm) { // Password saving isn't a nsIPermissionManager permission type, so handle // it seperately. if (aType == "password") { @@ -196,9 +196,9 @@ Site.prototype = { * * @param aType * The permission type string stored in permission manager. - * e.g. "cookie", "geo", "indexedDB", "popup", "image" + * e.g. "cookie", "geo", "popup", "image" */ - clearPermission: function Site_clearPermission(aType) { + clearPermission: function(aType) { Services.perms.removeFromPrincipal(this.principal, aType); }, @@ -254,7 +254,7 @@ Site.prototype = { while (enumerator.hasMoreElements()) { let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2); if (cookie.host.hasRootDomain( - AboutPermissions.domainFromHost(this.host))) { + AboutPermissions.domainFromHost(this.principal.URI.host))) { cookies.push(cookie); } } @@ -264,16 +264,17 @@ Site.prototype = { /** * Removes a set of specific cookies from the browser. */ - clearCookies: function Site_clearCookies() { + clearCookies: function() { this.cookies.forEach(function(aCookie) { - Services.cookies.remove(aCookie.host, aCookie.name, aCookie.path, false); + Services.cookies.remove(aCookie.host, aCookie.name, aCookie.path, false, + aCookie.originAttributes); }); }, /** * Removes all data from the browser corresponding to the site. */ - forgetSite: function Site_forgetSite() { + forgetSite: function() { // XXX This removes data for an entire domain, rather than just // an origin. This may produce confusing results, as data will // be cleared for the http:// as well as the https:// domain @@ -404,20 +405,6 @@ var PermissionDefaults = { let value = (aValue != this.DENY); Services.prefs.setBoolPref("geo.enabled", value); }, - - get indexedDB() { - if (!Services.prefs.getBoolPref("dom.indexedDB.enabled")) { - return this.DENY; - } - // We always ask for permission to enable indexedDB storage for a specific - // site, so there is no global ALLOW. - return this.UNKNOWN; - }, - set indexedDB(aValue) { - let value = (aValue != this.DENY); - Services.prefs.setBoolPref("dom.indexedDB.enabled", value); - }, - } /** @@ -464,12 +451,12 @@ var AboutPermissions = { * Potential future additions: "sts/use", "sts/subd" */ _supportedPermissions: ["password", "image", "popup", "cookie", - "desktop-notification", "install", "geo", "indexedDB"], + "desktop-notification", "install", "geo"], /** * Permissions that don't have a global "Allow" option. */ - _noGlobalAllow: ["desktop-notification", "geo", "indexedDB"], + _noGlobalAllow: ["desktop-notification", "geo"], /** * Permissions that don't have a global "Deny" option. @@ -480,7 +467,7 @@ var AboutPermissions = { .createBundle("chrome://browser/locale/browser.properties"), _stringBundleAboutPermissions: Services.strings.createBundle( - "chrome://browser/locale/preferences/aboutPermissions.properties"), + "chrome://browser/locale/permissions/aboutPermissions.properties"), _initPart1: function() { this.initPluginList(); @@ -514,7 +501,6 @@ var AboutPermissions = { Services.prefs.addObserver("dom.webnotifications.enabled", this, false); Services.prefs.addObserver("xpinstall.whitelist.required", this, false); Services.prefs.addObserver("geo.enabled", this, false); - Services.prefs.addObserver("dom.indexedDB.enabled", this, false); Services.prefs.addObserver("plugins.click_to_play", this, false); Services.prefs.addObserver("permissions.places-sites-limit", this, false); @@ -586,13 +572,7 @@ var AboutPermissions = { permissionEntry.setAttribute("id", permString + "-entry"); // If the plugin is disabled, it makes no sense to change its // click-to-play status, so don't add it. - // If the click-to-play pref is not set and the plugin is not - // click-to-play blocklisted, again click-to-play doesn't apply, - // so don't add it. - if (plugin.disabled || - (!Services.prefs.getBoolPref("plugins.click_to_play") && - (pluginHost.getStateForType(mimeType) - != Ci.nsIPluginTag.STATE_CLICKTOPLAY))) { + if (plugin.disabled) { permissionEntry.hidden = true; } else { permissionEntry.hidden = false; @@ -602,10 +582,13 @@ var AboutPermissions = { this._noGlobalDeny.push(permString); Object.defineProperty(PermissionDefaults, permString, { get: function() { - return this.isClickToPlay() - ? PermissionDefaults.UNKNOWN - : PermissionDefaults.ALLOW; - }.bind(permissionEntry), + if ((Services.prefs.getBoolPref("plugins.click_to_play") && + plugin.clicktoplay) || + permString.startsWith("plugin-vulnerable:")) { + return PermissionDefaults.UNKNOWN; + } + return PermissionDefaults.ALLOW; + }, set: function(aValue) { this.clicktoplay = (aValue == PermissionDefaults.UNKNOWN); }.bind(plugin), @@ -664,7 +647,6 @@ var AboutPermissions = { Services.prefs.removeObserver("dom.webnotifications.enabled", this, false); Services.prefs.removeObserver("xpinstall.whitelist.required", this, false); Services.prefs.removeObserver("geo.enabled", this, false); - Services.prefs.removeObserver("dom.indexedDB.enabled", this, false); Services.prefs.removeObserver("plugins.click_to_play", this, false); Services.prefs.removeObserver("permissions.places-sites-limit", this, false); @@ -1029,7 +1011,7 @@ var AboutPermissions = { * * @param aType * The permission type string stored in permission manager. - * e.g. "cookie", "geo", "indexedDB", "popup", "image" + * e.g. "cookie", "geo", "popup", "image" */ updatePermission: function(aType) { let allowItem = document.getElementById( @@ -1066,21 +1048,24 @@ var AboutPermissions = { // which is reserved for site-specific preferences only. document.getElementById(aType + "-9").hidden = true; } else if (aType.startsWith("plugin")) { - if (!Services.prefs.getBoolPref("plugins.click_to_play")) { - // It is reserved for site-specific preferences only. - document.getElementById(aType + "-0").disabled = true; - } pluginPermissionEntry = document.getElementById(aType + "-entry"); pluginPermissionEntry.setAttribute("vulnerable", ""); + let vulnerable = false; if (pluginPermissionEntry.isBlocklisted()) { permissionMenulist.disabled = true; permissionMenulist.setAttribute("tooltiptext", AboutPermissions._stringBundleAboutPermissions .GetStringFromName("pluginBlocklisted")); + vulnerable = true; } else { permissionMenulist.disabled = false; permissionMenulist.setAttribute("tooltiptext", ""); } + if (Services.prefs.getBoolPref("plugins.click_to_play") || vulnerable) { + document.getElementById(aType + "-0").disabled = false; + } else { + document.getElementById(aType + "-0").disabled = true; + } } } else { let _visibility = "visible"; @@ -1094,14 +1079,20 @@ var AboutPermissions = { } else if (aType == "cookie") { document.getElementById(aType + "-9").hidden = false; } else if (aType.startsWith("plugin")) { - document.getElementById(aType + "-0").disabled = false; pluginPermissionEntry = document.getElementById(aType + "-entry"); let permString = pluginPermissionEntry.getAttribute("permString"); + let vulnerable = false; if (permString.startsWith("plugin-vulnerable:")) { let nameVulnerable = " \u2014 " + AboutPermissions._stringBundleBrowser .GetStringFromName("pluginActivateVulnerable.label"); pluginPermissionEntry.setAttribute("vulnerable", nameVulnerable); + vulnerable = true; + } + if (Services.prefs.getBoolPref("plugins.click_to_play") || vulnerable) { + document.getElementById(aType + "-0").disabled = false; + } else { + document.getElementById(aType + "-0").disabled = true; } permissionMenulist.disabled = false; permissionMenulist.setAttribute("tooltiptext", ""); @@ -1320,7 +1311,7 @@ var AboutPermissions = { } // See toolkit/forgetaboutsite/ForgetAboutSite.jsm -String.prototype.hasRootDomain = function hasRootDomain(aDomain) { +String.prototype.hasRootDomain = function(aDomain) { let index = this.indexOf(aDomain); if (index == -1) { return false; diff --git a/application/palemoon/components/preferences/aboutPermissions.xml b/application/palemoon/components/permissions/aboutPermissions.xml index 4df0d964d..2932ea08c 100644 --- a/application/palemoon/components/preferences/aboutPermissions.xml +++ b/application/palemoon/components/permissions/aboutPermissions.xml @@ -4,7 +4,7 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <!DOCTYPE bindings [ -<!ENTITY % aboutPermissionsDTD SYSTEM "chrome://browser/locale/preferences/aboutPermissions.dtd" > +<!ENTITY % aboutPermissionsDTD SYSTEM "chrome://browser/locale/permissions/aboutPermissions.dtd" > %aboutPermissionsDTD; ]> diff --git a/application/palemoon/components/preferences/aboutPermissions.xul b/application/palemoon/components/permissions/aboutPermissions.xul index 56d6cfbbf..afd98247b 100644 --- a/application/palemoon/components/preferences/aboutPermissions.xul +++ b/application/palemoon/components/permissions/aboutPermissions.xul @@ -4,13 +4,13 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> -<?xml-stylesheet href="chrome://browser/content/preferences/aboutPermissions.css"?> -<?xml-stylesheet href="chrome://browser/skin/preferences/aboutPermissions.css"?> +<?xml-stylesheet href="chrome://browser/content/permissions/aboutPermissions.css"?> +<?xml-stylesheet href="chrome://browser/skin/permissions/aboutPermissions.css"?> <!DOCTYPE page [ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" > %brandDTD; -<!ENTITY % aboutPermissionsDTD SYSTEM "chrome://browser/locale/preferences/aboutPermissions.dtd" > +<!ENTITY % aboutPermissionsDTD SYSTEM "chrome://browser/locale/permissions/aboutPermissions.dtd" > %aboutPermissionsDTD; ]> @@ -23,7 +23,7 @@ role="application"> <script type="application/javascript" - src="chrome://browser/content/preferences/aboutPermissions.js"/> + src="chrome://browser/content/permissions/aboutPermissions.js"/> <keyset> <key key="&focusSearch.key;" modifiers="accel" oncommand="AboutPermissions.focusFilterBox();"/> @@ -298,35 +298,6 @@ </vbox> </hbox> - <!-- IndexedDB Storage --> - <hbox id="indexedDB-pref-item" - class="pref-item" align="top"> - <image class="pref-icon" type="indexedDB"/> - <vbox> - <hbox> - <label class="pref-title" value="&indexedDB.label;"/> - <label id="indexedDB-default" class="pref-default" value="*"/> - </hbox> - <hbox> - <menulist id="indexedDB-menulist" - class="pref-menulist" - type="indexedDB" - oncommand="AboutPermissions.onPermissionCommand(event, false);"> - <menupopup> - <menuitem id="indexedDB-0" value="0" label="&permission.alwaysAsk;"/> - <menuitem id="indexedDB-1" value="1" label="&permission.allow;"/> - <menuitem id="indexedDB-2" value="2" label="&permission.block;"/> - </menupopup> - </menulist> - <button id="indexedDB-set-default" - class="pref-set-default" - label="&permission.default;" - type="indexedDB" - oncommand="AboutPermissions.onPermissionCommand(event, true);"/> - </hbox> - </vbox> - </hbox> - <!-- Opt-in activation of Plug-ins --> <hbox id="plugins-pref-item" class="pref-item" align="top"> diff --git a/application/palemoon/components/permissions/jar.mn b/application/palemoon/components/permissions/jar.mn new file mode 100644 index 000000000..53fb2b41e --- /dev/null +++ b/application/palemoon/components/permissions/jar.mn @@ -0,0 +1,9 @@ +# 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/. + +browser.jar: + content/browser/permissions/aboutPermissions.xul + content/browser/permissions/aboutPermissions.js + content/browser/permissions/aboutPermissions.css + content/browser/permissions/aboutPermissions.xml diff --git a/application/palemoon/components/permissions/moz.build b/application/palemoon/components/permissions/moz.build new file mode 100644 index 000000000..a4c26de89 --- /dev/null +++ b/application/palemoon/components/permissions/moz.build @@ -0,0 +1,8 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + + +JAR_MANIFESTS += ['jar.mn'] diff --git a/application/palemoon/components/places/PlacesUIUtils.jsm b/application/palemoon/components/places/PlacesUIUtils.jsm index dd0695f78..f62535613 100644 --- a/application/palemoon/components/places/PlacesUIUtils.jsm +++ b/application/palemoon/components/places/PlacesUIUtils.jsm @@ -1136,6 +1136,33 @@ this.PlacesUIUtils = { } } return queryName; + }, + + /** + * Returns the passed URL with a #moz-resolution fragment + * for the specified dimensions and devicePixelRatio. + * + * @param aWindow + * A window from where we want to get the device + * pixel Ratio + * + * @param aURL + * The URL where we should add the fragment + * + * @param aWidth + * The target image width + * + * @param aHeight + * The target image height + * + * @return The URL with the fragment at the end + */ + getImageURLForResolution: + function PUIU_getImageURLForResolution(aWindow, aURL, aWidth = 16, aHeight = 16) { + let width = Math.round(aWidth * aWindow.devicePixelRatio); + let height = Math.round(aHeight * aWindow.devicePixelRatio); + return aURL + (aURL.includes("#") ? "&" : "#") + + "-moz-resolution=" + width + "," + height; } }; diff --git a/application/palemoon/components/places/content/browserPlacesViews.js b/application/palemoon/components/places/content/browserPlacesViews.js index 4ab80cac6..eec7274a4 100644 --- a/application/palemoon/components/places/content/browserPlacesViews.js +++ b/application/palemoon/components/places/content/browserPlacesViews.js @@ -338,7 +338,8 @@ PlacesViewBase.prototype = { let icon = aPlacesNode.icon; if (icon) - element.setAttribute("image", icon); + element.setAttribute("image", + PlacesUIUtils.getImageURLForResolution(window, icon)); } element._placesNode = aPlacesNode; @@ -464,7 +465,8 @@ PlacesViewBase.prototype = { if (!icon) elt.removeAttribute("image"); else if (icon != elt.getAttribute("image")) - elt.setAttribute("image", icon); + elt.setAttribute("image", + PlacesUIUtils.getImageURLForResolution(window, icon)); }, nodeAnnotationChanged: @@ -966,7 +968,8 @@ PlacesToolbar.prototype = { button.setAttribute("label", aChild.title || ""); let icon = aChild.icon; if (icon) - button.setAttribute("image", icon); + button.setAttribute("image", + PlacesUIUtils.getImageURLForResolution(window, icon)); if (PlacesUtils.containerTypes.indexOf(type) != -1) { button.setAttribute("type", "menu"); diff --git a/application/palemoon/components/preferences/cookies.js b/application/palemoon/components/preferences/cookies.js index 4ef30d48e..4fa47ee4e 100644 --- a/application/palemoon/components/preferences/cookies.js +++ b/application/palemoon/components/preferences/cookies.js @@ -540,6 +540,8 @@ var gCookiesWindow = { onCookieSelected: function () { var properties, item; var seln = this._tree.view.selection; + var hasRows = this._tree.view.rowCount > 0; + var hasSelection = seln.count > 0; if (!this._view._filtered) item = this._view._getItemAtIndex(seln.currentIndex); else @@ -570,7 +572,7 @@ var gCookiesWindow = { removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel) .replace("#1", selectedCookieCount); - removeSelectedCookies.disabled = !(seln.count > 0); + removeSelectedCookies.disabled = !hasRows || !hasSelection; }, performDeletion: function gCookiesWindow_performDeletion(deleteItems) { @@ -786,7 +788,9 @@ var gCookiesWindow = { this._view._invalidateCache(0); this._view.selection.clearSelection(); - this._view.selection.select(0); + if (this._view.rowCount > 0) { + this._view.selection.select(0); + } this._tree.treeBoxObject.invalidate(); this._tree.treeBoxObject.ensureRowIsVisible(0); diff --git a/application/palemoon/components/preferences/jar.mn b/application/palemoon/components/preferences/jar.mn index 798a2dae4..2e2949306 100644 --- a/application/palemoon/components/preferences/jar.mn +++ b/application/palemoon/components/preferences/jar.mn @@ -3,10 +3,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/preferences/aboutPermissions.xul - content/browser/preferences/aboutPermissions.js - content/browser/preferences/aboutPermissions.css - content/browser/preferences/aboutPermissions.xml * content/browser/preferences/advanced.xul * content/browser/preferences/advanced.js content/browser/preferences/applications.xul diff --git a/application/palemoon/components/preferences/privacy.js b/application/palemoon/components/preferences/privacy.js index 18e38395d..05c2f9b8a 100644 --- a/application/palemoon/components/preferences/privacy.js +++ b/application/palemoon/components/preferences/privacy.js @@ -151,42 +151,6 @@ var gPrivacyPane = { }, /** - * Update the Tracking preferences based on controls. - */ - setTrackingPrefs: function PPP_setTrackingPrefs() - { - let dntRadioGroup = document.getElementById("doNotTrackSelection"), - dntValuePref = document.getElementById("privacy.donottrackheader.value"), - dntEnabledPref = document.getElementById("privacy.donottrackheader.enabled"); - - // if the selected radio button says "no preference", set on/off pref to - // false and don't change the value pref. - if (dntRadioGroup.selectedItem.value == -1) { - dntEnabledPref.value = false; - return dntValuePref.value; - } - - dntEnabledPref.value = true; - return dntRadioGroup.selectedItem.value; - }, - - /** - * Obtain the tracking preference value and reflect it in the UI. - */ - getTrackingPrefs: function PPP_getTrackingPrefs() - { - let dntValuePref = document.getElementById("privacy.donottrackheader.value"), - dntEnabledPref = document.getElementById("privacy.donottrackheader.enabled"); - - // if DNT is enbaled, select the value from the selected radio - // button, otherwise choose the "no preference" radio button - if (dntEnabledPref.value) - return dntValuePref.value; - - return document.getElementById("dntnopref").value; - }, - - /** * Update the private browsing auto-start pref and the history mode * micro-management prefs based on the history mode menulist */ diff --git a/application/palemoon/components/preferences/privacy.xul b/application/palemoon/components/preferences/privacy.xul index 057d549a9..bdb227c63 100644 --- a/application/palemoon/components/preferences/privacy.xul +++ b/application/palemoon/components/preferences/privacy.xul @@ -30,9 +30,6 @@ <preference id="privacy.donottrackheader.enabled" name="privacy.donottrackheader.enabled" type="bool"/> - <preference id="privacy.donottrackheader.value" - name="privacy.donottrackheader.value" - type="int"/> <!-- XXX button prefs --> <preference id="pref.privacy.disable_button.cookie_exceptions" @@ -239,17 +236,11 @@ <!-- Tracking --> <tabpanel id="trackingPanel" orient="vertical"> - <radiogroup id="doNotTrackSelection" orient="vertical" - preference="privacy.donottrackheader.value" - onsynctopreference="return gPrivacyPane.setTrackingPrefs()" - onsyncfrompreference="return gPrivacyPane.getTrackingPrefs()"> - <radio id="dntnotrack" value="1" label="&dntTrackingNotOkay.label2;" - accesskey="&dntTrackingNotOkay.accesskey;" /> - <radio id="dntdotrack" value="0" label="&dntTrackingOkay.label2;" - accesskey="&dntTrackingOkay.accesskey;" /> - <radio id="dntnopref" value="-1" label="&dntTrackingNopref.label2;" - accesskey="&dntTrackingNopref.accesskey;" /> - </radiogroup> + <checkbox id="privacyDoNotTrackCheckbox" + label="&dntTrackingNotOkay.label2;" + accesskey="&dntTrackingNotOkay.accesskey;" + preference="privacy.donottrackheader.enabled"/> + <separator class="thin"/> <label class="text-link" id="doNotTrackInfo" href="https://www.mozilla.org/dnt" value="&doNotTrackInfo.label;"/> diff --git a/application/palemoon/components/preferences/security.xul b/application/palemoon/components/preferences/security.xul index 43352b926..d3d321b16 100644 --- a/application/palemoon/components/preferences/security.xul +++ b/application/palemoon/components/preferences/security.xul @@ -43,8 +43,8 @@ <!-- Security Protocols --> - <preference id="network.stricttransportsecurity.enabled" - name="network.stricttransportsecurity.enabled" + <preference id="network.stricttransportsecurity.preloadlist" + name="network.stricttransportsecurity.preloadlist" type="bool"/> <preference id="security.cert_pinning.enforcement_level" name="security.cert_pinning.enforcement_level" @@ -137,7 +137,7 @@ <checkbox id="enableHSTS" label="&enableHSTS.label;" accesskey="&enableHSTS.accesskey;" - preference="network.stricttransportsecurity.enabled" /> + preference="network.stricttransportsecurity.preloadlist" /> <checkbox id="enableHPKP" label="&enableHPKP.label;" accesskey="&enableHPKP.accesskey;" diff --git a/application/palemoon/components/sessionstore/SessionStore.jsm b/application/palemoon/components/sessionstore/SessionStore.jsm index 4f95f10a7..c5e55321c 100644 --- a/application/palemoon/components/sessionstore/SessionStore.jsm +++ b/application/palemoon/components/sessionstore/SessionStore.jsm @@ -3598,38 +3598,70 @@ var SessionStoreInternal = { var _this = this; function win_(aName) { return _this._getWindowDimension(win, aName); } - // find available space on the screen where this window is being placed + // Find available space on the screen where this window is being placed let screen = gScreenManager.screenForRect(aLeft, aTop, aWidth, aHeight); if (screen && !this._prefBranch.getBoolPref("sessionstore.exactPos")) { let screenLeft = {}, screenTop = {}, screenWidth = {}, screenHeight = {}; screen.GetAvailRectDisplayPix(screenLeft, screenTop, screenWidth, screenHeight); - // constrain the dimensions to the actual space available - if (aWidth > screenWidth.value) { - aWidth = screenWidth.value; + + // Screen X/Y are based on the origin of the screen's desktop-pixel coordinate space + let screenLeftCss = screenLeft.value; + let screenTopCss = screenTop.value; + + // Convert the screen's device pixel dimensions to CSS px dimensions + screen.GetAvailRect(screenLeft, screenTop, screenWidth, screenHeight); + let cssToDevScale = screen.defaultCSSScaleFactor; + let screenRightCss = screenLeftCss + screenWidth.value / cssToDevScale; + let screenBottomCss = screenTopCss + screenHeight.value / cssToDevScale; + + // Pull the window within the screen's bounds. + // First, ensure the left edge is on-screen + if (aLeft < screenLeftCss) { + aLeft = screenLeftCss; } - if (aHeight > screenHeight.value) { - aHeight = screenHeight.value; + // Then check the resulting right edge, and reduce it if necessary. + let right = aLeft + aWidth; + if (right > screenRightCss) { + right = screenRightCss; + // See if we can move the left edge leftwards to maintain width. + if (aLeft > screenLeftCss) { + aLeft = Math.max(right - aWidth, screenLeftCss); + } } - // and then pull the window within the screen's bounds - if (aLeft < screenLeft.value) { - aLeft = screenLeft.value; - } else if (aLeft + aWidth > screenLeft.value + screenWidth.value) { - aLeft = screenLeft.value + screenWidth.value - aWidth; + // Finally, update aWidth to account for the adjusted left and right edges. + aWidth = right - aLeft; + + // Do the same in the vertical dimension. + // First, ensure the top edge is on-screen + if (aTop < screenTopCss) { + aTop = screenTopCss; } - if (aTop < screenTop.value) { - aTop = screenTop.value; - } else if (aTop + aHeight > screenTop.value + screenHeight.value) { - aTop = screenTop.value + screenHeight.value - aHeight; + // Then check the resulting right edge, and reduce it if necessary. + let bottom = aTop + aHeight; + if (bottom > screenBottomCss) { + bottom = screenBottomCss; + // See if we can move the top edge upwards to maintain height. + if (aTop > screenTopCss) { + aTop = Math.max(bottom - aHeight, screenTopCss); + } } + // Finally, update aHeight to account for the adjusted top and bottom edges. + aHeight = bottom - aTop; } - // only modify those aspects which aren't correct yet - if (aWidth && aHeight && (aWidth != win_("width") || aHeight != win_("height"))) { - aWindow.resizeTo(aWidth, aHeight); - } + // Only modify those aspects which aren't correct yet if (!isNaN(aLeft) && !isNaN(aTop) && (aLeft != win_("screenX") || aTop != win_("screenY"))) { aWindow.moveTo(aLeft, aTop); } + if (aWidth && aHeight && (aWidth != win_("width") || aHeight != win_("height"))) { + // Don't resize the window if it's currently maximized and we would + // maximize it again shortly after. + if (aSizeMode != "maximized" || win_("sizemode") != "maximized") { + aWindow.resizeTo(aWidth, aHeight); + } + } + + // Restore window state if (aSizeMode && win_("sizemode") != aSizeMode) { switch (aSizeMode) diff --git a/application/palemoon/components/sessionstore/content/aboutSessionRestore.js b/application/palemoon/components/sessionstore/content/aboutSessionRestore.js index 2459b67f5..2b6f9eaeb 100644 --- a/application/palemoon/components/sessionstore/content/aboutSessionRestore.js +++ b/application/palemoon/components/sessionstore/content/aboutSessionRestore.js @@ -134,6 +134,9 @@ function onListClick(aEvent) { if (aEvent.button == 2) return; + if (!treeView.treeBox) { + return; + } var cell = treeView.treeBox.getCellAt(aEvent.clientX, aEvent.clientY); if (cell.col) { // Restore this specific tab in the same window for middle/double/accel clicking diff --git a/application/palemoon/config/version.txt b/application/palemoon/config/version.txt index da03daefe..abc7f476b 100644 --- a/application/palemoon/config/version.txt +++ b/application/palemoon/config/version.txt @@ -1 +1 @@ -28.0.0a2
\ No newline at end of file +28.0.0b3
\ No newline at end of file diff --git a/application/palemoon/confvars.sh b/application/palemoon/confvars.sh index 5109c0829..830523778 100644 --- a/application/palemoon/confvars.sh +++ b/application/palemoon/confvars.sh @@ -47,7 +47,7 @@ MOZ_PHOENIX=1 MOZ_BROWSER_STATUSBAR=1 # Browser Feature: Profile Migration Component -MOZ_PROFILE_MIGRATOR=1 +MOZ_PROFILE_MIGRATOR= # Platform Feature: Application Update Service # MAR_CHANNEL_ID must not contained the follow 3 characters: ",\t" @@ -103,5 +103,3 @@ MOZ_MAINTENANCE_SERVICE= MOZ_SERVICES_HEALTHREPORT= MOZ_ADDON_SIGNING=0 MOZ_REQUIRE_SIGNING=0 -MOZ_PROFILE_MIGRATOR= - diff --git a/application/palemoon/installer/package-manifest.in b/application/palemoon/installer/package-manifest.in index fb5441832..e63af4013 100644 --- a/application/palemoon/installer/package-manifest.in +++ b/application/palemoon/installer/package-manifest.in @@ -56,7 +56,7 @@ @RESPATH@/hyphenation/* @RESPATH@/browser/@PREF_DIR@/palemoon-l10n.js @RESPATH@/browser/searchplugins/* -#ifdef HAVE_MAKENSISU +#ifdef XP_WIN32 @BINPATH@/uninstall/helper.exe #endif #ifdef MOZ_UPDATER @@ -117,7 +117,7 @@ @BINPATH@/browser/VisualElements/VisualElements_150.png @BINPATH@/browser/VisualElements/VisualElements_70.png #else -@BINPATH@/@MOZ_APP_NAME@-bin +@RESPATH@/@MOZ_APP_NAME@-bin @BINPATH@/@MOZ_APP_NAME@ #endif @RESPATH@/application.ini @@ -212,6 +212,7 @@ @RESPATH@/browser/chrome/icons/default/default48.png #endif +#ifdef MOZ_DEVTOOLS ; [Webide Files] @RESPATH@/browser/chrome/webide@JAREXT@ @RESPATH@/browser/chrome/webide.manifest @@ -221,6 +222,7 @@ @RESPATH@/browser/chrome/devtools@JAREXT@ @RESPATH@/browser/chrome/devtools.manifest @RESPATH@/browser/@PREF_DIR@/devtools.js +#endif ; shell icons #ifdef XP_UNIX diff --git a/application/palemoon/installer/windows/Makefile.in b/application/palemoon/installer/windows/Makefile.in index 8c434c54f..7ba70d912 100644 --- a/application/palemoon/installer/windows/Makefile.in +++ b/application/palemoon/installer/windows/Makefile.in @@ -32,12 +32,12 @@ include $(topsrcdir)/config/config.mk ifdef LOCALE_MERGEDIR PPL_LOCALE_ARGS = \ - --l10n-dir=$(LOCALE_MERGEDIR)/browser/installer \ - --l10n-dir=$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer \ - --l10n-dir=$(topsrcdir)/browser/locales/en-US/installer \ + --l10n-dir=$(LOCALE_MERGEDIR)/application/palemoon/installer \ + --l10n-dir=$(call EXPAND_LOCALE_SRCDIR,application/palemoon/locales)/installer \ + --l10n-dir=$(topsrcdir)/application/palemoon/locales/en-US/installer \ $(NULL) else -PPL_LOCALE_ARGS=$(call EXPAND_LOCALE_SRCDIR,browser/locales)/installer +PPL_LOCALE_ARGS=$(call EXPAND_LOCALE_SRCDIR,application/palemoon/locales)/installer endif OVERRIDE_DEFAULT_GOAL := installer diff --git a/application/palemoon/locales/Makefile.in b/application/palemoon/locales/Makefile.in index 5720a76df..c81329a9a 100644 --- a/application/palemoon/locales/Makefile.in +++ b/application/palemoon/locales/Makefile.in @@ -124,6 +124,9 @@ libs-%: @$(MAKE) -C ../../../services/sync/locales AB_CD=$* XPI_NAME=locale-$* @$(MAKE) -C ../../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* @$(MAKE) -C ../../../intl/locales AB_CD=$* XPI_NAME=locale-$* +ifdef MOZ_DEVTOOLS + @$(MAKE) -C ../../../devtools/client/locales AB_CD=$* XPI_NAME=locale-$* +endif @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR) @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$* diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.dtd b/application/palemoon/locales/en-US/chrome/browser/browser.dtd index 3d5f22b33..2d80c8078 100644 --- a/application/palemoon/locales/en-US/chrome/browser/browser.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/browser.dtd @@ -204,67 +204,12 @@ These should match what Safari and other Apple applications use on OS X Lion. -- <!ENTITY webDeveloperMenu.label "Web Developer"> <!ENTITY webDeveloperMenu.accesskey "W"> -<!ENTITY devtoolsConnect.label "Connect…"> -<!ENTITY devtoolsConnect.accesskey "e"> - <!ENTITY errorConsoleCmd.label "Error Console"> <!ENTITY errorConsoleCmd.accesskey "C"> -<!ENTITY remoteWebConsoleCmd.label "Remote Web Console"> - -<!ENTITY browserConsoleCmd.label "Browser Console"> -<!ENTITY browserConsoleCmd.commandkey "j"> -<!ENTITY browserConsoleCmd.accesskey "B"> - <!ENTITY inspectContextMenu.label "Inspect Element"> <!ENTITY inspectContextMenu.accesskey "Q"> -<!ENTITY responsiveDesignTool.label "Responsive Design View"> -<!ENTITY responsiveDesignTool.accesskey "R"> -<!ENTITY responsiveDesignTool.commandkey "M"> - -<!ENTITY eyedropper.label "Eyedropper"> -<!ENTITY eyedropper.accesskey "Y"> - -<!-- LOCALIZATION NOTE (scratchpad.label): This menu item label appears - - in the Tools menu. See bug 653093. - - The Scratchpad is intended to provide a simple text editor for creating - - and evaluating bits of JavaScript code for the purposes of function - - prototyping, experimentation and convenient scripting. - - - - It's quite possible that you won't have a good analogue for the word - - "Scratchpad" in your locale. You should feel free to find a close - - approximation to it or choose a word (or words) that means - - "simple discardable text editor". --> -<!ENTITY scratchpad.label "Scratchpad"> -<!ENTITY scratchpad.accesskey "s"> -<!ENTITY scratchpad.keycode "VK_F4"> -<!ENTITY scratchpad.keytext "F4"> - -<!-- LOCALIZATION NOTE (chromeDebuggerMenu.label): This is the label for the - - application menu item that opens the browser debugger UI in the Tools menu. --> -<!ENTITY chromeDebuggerMenu.label "Browser Debugger"> - -<!ENTITY devToolbarCloseButton.tooltiptext "Close Developer Toolbar"> -<!ENTITY devToolbarMenu.label "Developer Toolbar"> -<!ENTITY devToolbarMenu.accesskey "v"> -<!ENTITY devAppMgrMenu.label "App Manager"> -<!ENTITY devAppMgrMenu.accesskey "A"> -<!ENTITY webide.label "WebIDE"> -<!ENTITY webide.accesskey "W"> -<!ENTITY webide.keycode "VK_F8"> -<!ENTITY webide.keytext "F8"> -<!ENTITY devToolbar.keycode "VK_F2"> -<!ENTITY devToolbar.keytext "F2"> -<!ENTITY devToolboxMenuItem.label "Toggle Tools"> -<!ENTITY devToolboxMenuItem.accesskey "T"> - -<!ENTITY devToolbarToolsButton.tooltip "Toggle developer tools"> -<!ENTITY devToolbarOtherToolsButton.label "More Tools"> - -<!ENTITY getMoreDevtoolsCmd.label "Get More Tools"> -<!ENTITY getMoreDevtoolsCmd.accesskey "M"> - <!ENTITY fileMenu.label "File"> <!ENTITY fileMenu.accesskey "F"> <!ENTITY newNavigatorCmd.label "New Window"> diff --git a/application/palemoon/locales/en-US/chrome/browser/newTab.dtd b/application/palemoon/locales/en-US/chrome/browser/newTab.dtd index ce9e3e4b0..5853557ef 100644 --- a/application/palemoon/locales/en-US/chrome/browser/newTab.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/newTab.dtd @@ -3,8 +3,9 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <!-- These strings are used in the about:newtab page --> -<!ENTITY newtab.pageTitle "New Tab"> +<!ENTITY newtab.pageTitle "Quickdial"> <!ENTITY newtab.undo.removedLabel "Thumbnail removed."> <!ENTITY newtab.undo.undoButton "Undo."> <!ENTITY newtab.undo.restoreButton "Restore All."> <!ENTITY newtab.undo.closeTooltip "Hide"> +<!ENTITY newtab.searchEngineButton.label "Search"> diff --git a/application/palemoon/locales/en-US/chrome/browser/newTab.properties b/application/palemoon/locales/en-US/chrome/browser/newTab.properties index a249356f5..922aa5847 100644 --- a/application/palemoon/locales/en-US/chrome/browser/newTab.properties +++ b/application/palemoon/locales/en-US/chrome/browser/newTab.properties @@ -5,5 +5,3 @@ newtab.pin=Pin this site at its current position newtab.unpin=Unpin this site newtab.block=Remove this site -newtab.show=Show the new tab page -newtab.hide=Hide the new tab page diff --git a/application/palemoon/locales/en-US/chrome/browser/pageInfo.dtd b/application/palemoon/locales/en-US/chrome/browser/pageInfo.dtd index 70c2bbc13..50382a11a 100644 --- a/application/palemoon/locales/en-US/chrome/browser/pageInfo.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/pageInfo.dtd @@ -67,10 +67,6 @@ <!ENTITY permGeo "Share Location"> <!ENTITY permPlugins "Activate Plugins"> -<!ENTITY permIndexedDB "Maintain Offline Storage"> -<!ENTITY permClearStorage "Clear Storage"> -<!ENTITY permClearStorage.accesskey "C"> - <!ENTITY securityTab "Security"> <!ENTITY securityTab.accesskey "S"> <!ENTITY securityHeader "Security information for this page"> diff --git a/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd b/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd new file mode 100644 index 000000000..038d8eb75 --- /dev/null +++ b/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd @@ -0,0 +1,14 @@ +<!-- 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/. --> + +<!ENTITY chronicles.title.55.2 +'The Chronicles of the Pale Moon, 55:2'> + +<!ENTITY chronicles.quote.55.2 +'And so, our focus was drawn through time and space to the <em>emerging dragon</em> who would not abandon hope.<br/> +Its resilience, stubbornness and spirit unbroken, and searching for long hours to find those willing to <em>join</em> its cause.<br/> +The old nest abandoned, the death throes of the Beast ignored, and more determined than ever to find glory in the future.'> + +<!ENTITY chronicles.from.55.2 +'from <strong>The Chronicles of the Pale Moon,</strong> 55:2'> diff --git a/application/palemoon/locales/en-US/chrome/browser/preferences/aboutPermissions.dtd b/application/palemoon/locales/en-US/chrome/browser/permissions/aboutPermissions.dtd index 14412607a..2030d4f59 100644 --- a/application/palemoon/locales/en-US/chrome/browser/preferences/aboutPermissions.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/permissions/aboutPermissions.dtd @@ -45,10 +45,6 @@ <!ENTITY plugins.label "Plugins"> -<!-- LOCALIZATION NOTE (indexedDB.label): This is describing indexedDB storage - using the same language used for the permIndexedDB string in browser/pageInfo.dtd --> -<!ENTITY indexedDB.label "Maintain Offline Storage"> - <!ENTITY popup.label "Open Pop-up Windows"> <!ENTITY focusSearch.key "f"> diff --git a/application/palemoon/locales/en-US/chrome/browser/preferences/aboutPermissions.properties b/application/palemoon/locales/en-US/chrome/browser/permissions/aboutPermissions.properties index ca90a6cfb..ca90a6cfb 100644 --- a/application/palemoon/locales/en-US/chrome/browser/preferences/aboutPermissions.properties +++ b/application/palemoon/locales/en-US/chrome/browser/permissions/aboutPermissions.properties diff --git a/application/palemoon/locales/en-US/chrome/browser/preferences/privacy.dtd b/application/palemoon/locales/en-US/chrome/browser/preferences/privacy.dtd index 92ebf93c4..ef3303b94 100644 --- a/application/palemoon/locales/en-US/chrome/browser/preferences/privacy.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/preferences/privacy.dtd @@ -4,12 +4,8 @@ <!ENTITY tracking.label "Tracking"> -<!ENTITY dntTrackingNopref.label2 "Do not tell sites anything about my tracking preferences"> -<!ENTITY dntTrackingNopref.accesskey "o"> <!ENTITY dntTrackingNotOkay.label2 "Tell sites that I do not want to be tracked"> <!ENTITY dntTrackingNotOkay.accesskey "n"> -<!ENTITY dntTrackingOkay.label2 "Tell sites that I want to be tracked"> -<!ENTITY dntTrackingOkay.accesskey "t"> <!ENTITY doNotTrackInfo.label "Learn More"> <!ENTITY history.label "History"> diff --git a/application/palemoon/locales/en-US/chrome/overrides/netError.dtd b/application/palemoon/locales/en-US/chrome/overrides/netError.dtd index c97bd1b59..04bfe9925 100644 --- a/application/palemoon/locales/en-US/chrome/overrides/netError.dtd +++ b/application/palemoon/locales/en-US/chrome/overrides/netError.dtd @@ -226,16 +226,6 @@ functionality specific to firefox. --> <button id='exceptionDialogButton'>&securityOverride.exceptionButtonLabel;</button> "> -<!ENTITY errorReporting.title "Report this error"> -<!ENTITY errorReporting.longDesc "Reporting the address and certificate information for <span id='hostname'></span> will help us identify and block malicious sites. Thanks for helping create a safer web!"> -<!ENTITY errorReporting.automatic "Automatically report errors in the future"> -<!ENTITY errorReporting.automatic2 "Report errors like this to help Mozilla identify and block malicious sites"> -<!ENTITY errorReporting.learnMore "Learn more…"> -<!ENTITY errorReporting.sending "Sending report"> -<!ENTITY errorReporting.sent "Report sent"> -<!ENTITY errorReporting.report "Report"> -<!ENTITY errorReporting.tryAgain "Try again"> - <!ENTITY remoteXUL.title "Remote XUL"> <!ENTITY remoteXUL.longDesc "<p><ul><li>Please contact the website owners to inform them of this problem.</li></ul></p>"> diff --git a/application/palemoon/locales/jar.mn b/application/palemoon/locales/jar.mn index f2b9ddeb2..8d88e16fd 100644 --- a/application/palemoon/locales/jar.mn +++ b/application/palemoon/locales/jar.mn @@ -28,6 +28,7 @@ locale/browser/openLocation.properties (%chrome/browser/openLocation.properties) locale/browser/pageInfo.dtd (%chrome/browser/pageInfo.dtd) locale/browser/pageInfo.properties (%chrome/browser/pageInfo.properties) + locale/browser/palemoon.dtd (%chrome/browser/palemoon.dtd) locale/browser/quitDialog.properties (%chrome/browser/quitDialog.properties) locale/browser/safeMode.dtd (%chrome/browser/safeMode.dtd) locale/browser/sanitize.dtd (%chrome/browser/sanitize.dtd) @@ -55,8 +56,8 @@ locale/browser/places/moveBookmarks.dtd (%chrome/browser/places/moveBookmarks.dtd) locale/browser/feeds/subscribe.dtd (%chrome/browser/feeds/subscribe.dtd) locale/browser/feeds/subscribe.properties (%chrome/browser/feeds/subscribe.properties) - locale/browser/preferences/aboutPermissions.dtd (%chrome/browser/preferences/aboutPermissions.dtd) - locale/browser/preferences/aboutPermissions.properties (%chrome/browser/preferences/aboutPermissions.properties) + locale/browser/permissions/aboutPermissions.dtd (%chrome/browser/permissions/aboutPermissions.dtd) + locale/browser/permissions/aboutPermissions.properties (%chrome/browser/permissions/aboutPermissions.properties) locale/browser/preferences/advanced.dtd (%chrome/browser/preferences/advanced.dtd) locale/browser/preferences/applicationManager.dtd (%chrome/browser/preferences/applicationManager.dtd) locale/browser/preferences/applicationManager.properties (%chrome/browser/preferences/applicationManager.properties) diff --git a/application/palemoon/modules/moz.build b/application/palemoon/modules/moz.build index 67fd22338..8032930b2 100644 --- a/application/palemoon/modules/moz.build +++ b/application/palemoon/modules/moz.build @@ -5,9 +5,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. -# XXX: Include this until we convert browser/ to use toolkit promises directly -EXTRA_JS_MODULES += [ 'promise.js' ] - EXTRA_JS_MODULES += [ 'AutoCompletePopup.jsm', 'BrowserNewTabPreloader.jsm', diff --git a/application/palemoon/modules/promise.js b/application/palemoon/modules/promise.js deleted file mode 100644 index 74065c8db..000000000 --- a/application/palemoon/modules/promise.js +++ /dev/null @@ -1,118 +0,0 @@ -/* 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/. - */ - -'use strict'; - -/* - * Uses `Promise.jsm` as a core implementation, with additional sugar - * from previous implementation, with inspiration from `Q` and `when` - * - * https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm - * https://github.com/cujojs/when - * https://github.com/kriskowal/q - */ -const PROMISE_URI = 'resource://gre/modules/Promise.jsm'; - -getEnvironment.call(this, function ({ require, exports, module, Cu }) { - -const Promise = Cu.import(PROMISE_URI, {}).Promise; -const { Debugging, defer, resolve, all, reject, race } = Promise; - -module.metadata = { - 'stability': 'unstable' -}; - -var promised = (function() { - // Note: Define shortcuts and utility functions here in order to avoid - // slower property accesses and unnecessary closure creations on each - // call of this popular function. - - var call = Function.call; - var concat = Array.prototype.concat; - - // Utility function that does following: - // execute([ f, self, args...]) => f.apply(self, args) - function execute (args) call.apply(call, args) - - // Utility function that takes promise of `a` array and maybe promise `b` - // as arguments and returns promise for `a.concat(b)`. - function promisedConcat(promises, unknown) { - return promises.then(function (values) { - return resolve(unknown) - .then(function (value) values.concat([value])); - }); - } - - return function promised(f, prototype) { - /** - Returns a wrapped `f`, which when called returns a promise that resolves to - `f(...)` passing all the given arguments to it, which by the way may be - promises. Optionally second `prototype` argument may be provided to be used - a prototype for a returned promise. - - ## Example - - var promise = promised(Array)(1, promise(2), promise(3)) - promise.then(console.log) // => [ 1, 2, 3 ] - **/ - - return function promised(...args) { - // create array of [ f, this, args... ] - return [f, this, ...args]. - // reduce it via `promisedConcat` to get promised array of fulfillments - reduce(promisedConcat, resolve([], prototype)). - // finally map that to promise of `f.apply(this, args...)` - then(execute); - }; - }; -})(); - -exports.promised = promised; -exports.all = all; -exports.defer = defer; -exports.resolve = resolve; -exports.reject = reject; -exports.race = race; -exports.Promise = Promise; -exports.Debugging = Debugging; -}); - -function getEnvironment (callback) { - let Cu, _exports, _module, _require; - - // CommonJS / SDK - if (typeof(require) === 'function') { - Cu = require('chrome').Cu; - _exports = exports; - _module = module; - _require = require; - } - // JSM - else if (String(this).indexOf('BackstagePass') >= 0) { - Cu = this['Components'].utils; - _exports = this.Promise = {}; - _module = { uri: __URI__, id: 'promise/core' }; - _require = uri => { - let imports = {}; - Cu.import(uri, imports); - return imports; - }; - this.EXPORTED_SYMBOLS = ['Promise']; - // mozIJSSubScriptLoader.loadSubscript - } else if (~String(this).indexOf('Sandbox')) { - Cu = this['Components'].utils; - _exports = this; - _module = { id: 'promise/core' }; - _require = uri => {}; - } - - callback({ - Cu: Cu, - exports: _exports, - module: _module, - require: _require - }); -} - diff --git a/application/palemoon/themes/linux/browser.css b/application/palemoon/themes/linux/browser.css index 9a08ea4d8..987406264 100644 --- a/application/palemoon/themes/linux/browser.css +++ b/application/palemoon/themes/linux/browser.css @@ -1223,8 +1223,7 @@ toolbar[iconsize="small"] #webrtc-status-button { list-style-image: url(chrome://global/skin/icons/question-64.png); } -.popup-notification-icon[popupid="password-save"], -.popup-notification-icon[popupid="password-change"] { +.popup-notification-icon[popupid="password"] { list-style-image: url(chrome://mozapps/skin/passwordmgr/key-64.png); } @@ -1571,6 +1570,12 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- background-color: Window; } +.browserContainer > findbar { + background-color: -moz-dialog; + color: -moz-DialogText; + text-shadow: none; +} + /* Throbber */ #navigator-throbber { width: 16px; diff --git a/application/palemoon/themes/linux/jar.mn b/application/palemoon/themes/linux/jar.mn index 570bbb153..8b2e9dc77 100644 --- a/application/palemoon/themes/linux/jar.mn +++ b/application/palemoon/themes/linux/jar.mn @@ -76,9 +76,10 @@ browser.jar: skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) - skin/classic/browser/newtab/newTab.css (newtab/newTab.css) - skin/classic/browser/newtab/controls.png (newtab/controls.png) - skin/classic/browser/newtab/noise.png (newtab/noise.png) +* skin/classic/browser/newtab/newTab.css (newtab/newTab.css) + skin/classic/browser/newtab/controls.png (../shared/newtab/controls.png) + skin/classic/browser/newtab/noise.png (../shared/newtab/noise.png) + skin/classic/browser/newtab/pinned.png (../shared/newtab/pinned.png) skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) skin/classic/browser/places/calendar.png (places/calendar.png) @@ -97,6 +98,7 @@ browser.jar: skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) skin/classic/browser/places/downloads.png (places/downloads.png) + skin/classic/browser/permissions/aboutPermissions.css (permissions/aboutPermissions.css) skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) skin/classic/browser/preferences/mail.png (preferences/mail.png) skin/classic/browser/preferences/Options.png (preferences/Options.png) @@ -105,7 +107,6 @@ browser.jar: #endif * skin/classic/browser/preferences/preferences.css (preferences/preferences.css) skin/classic/browser/preferences/applications.css (preferences/applications.css) - skin/classic/browser/preferences/aboutPermissions.css (preferences/aboutPermissions.css) #ifdef MOZ_BROWSER_STATUSBAR skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) * skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) diff --git a/application/palemoon/themes/linux/newtab/newTab.css b/application/palemoon/themes/linux/newtab/newTab.css index 9c132892e..357b3139b 100644 --- a/application/palemoon/themes/linux/newtab/newTab.css +++ b/application/palemoon/themes/linux/newtab/newTab.css @@ -2,33 +2,7 @@ * 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/. */ -:root { - -moz-appearance: none; - font-size: 75%; - background-color: transparent; -} - -/* SCROLLBOX */ -#newtab-scrollbox:not([page-disabled]) { - background-color: rgb(229,229,229); - background-image: url(chrome://browser/skin/newtab/noise.png), - linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.2)); - background-attachment: fixed; -} - -/* UNDO */ -#newtab-undo-container { - padding: 4px 3px; - border: 1px solid; - border-color: rgba(8,22,37,.12) rgba(8,22,37,.14) rgba(8,22,37,.16); - background-color: rgba(255,255,255,.4); - color: #525e69; -} - -#newtab-undo-label { - margin-top: 0; - margin-bottom: 0; -} +%include ../../shared/newtab/newTab.css.inc .newtab-undo-button { -moz-appearance: none; @@ -42,14 +16,6 @@ min-width: 0; } -.newtab-undo-button:hover { - text-decoration: underline; -} - -.newtab-undo-button:-moz-focusring { - outline: 1px dotted; -} - #newtab-undo-close-button { padding: 0; border: none; @@ -59,129 +25,3 @@ #newtab-undo-close-button > .toolbarbutton-icon { margin: -4px; } - -#newtab-undo-close-button > .toolbarbutton-text { - display: none; -} - -#newtab-undo-close-button:-moz-focusring { - outline: 1px dotted; -} - -/* TOGGLE */ -#newtab-toggle { - width: 16px; - height: 16px; - padding: 0; - border: none; - background: -216px 0 transparent url(chrome://browser/skin/newtab/controls.png); -} - -#newtab-toggle[page-disabled] { - background-position: -232px 0; -} - -/* ROWS */ -.newtab-row { - margin-bottom: 20px; -} - -.newtab-row:last-child { - margin-bottom: 0; -} - -/* CELLS */ -.newtab-cell { - -moz-margin-end: 20px; - background-color: rgba(255,255,255,.2); - border: 1px solid; - border-color: rgba(8,22,37,.12) rgba(8,22,37,.14) rgba(8,22,37,.16); - border-radius: 1px; - transition: border-color 100ms ease-out; -} - -.newtab-cell:empty { - border: 1px dashed; - border-color: rgba(8,22,37,.15) rgba(8,22,37,.17) rgba(8,22,37,.19); -} - -.newtab-cell:last-child { - -moz-margin-end: 0; -} - -.newtab-cell:hover:not(:empty):not([dragged]) { - border-color: rgba(8,22,37,.25) rgba(8,22,37,.27) rgba(8,22,37,.3); -} - -/* SITES */ -.newtab-site { - text-decoration: none; - transition-property: top, left, opacity, box-shadow, background-color; -} - -.newtab-site:hover, -.newtab-site[dragged] { - box-shadow: 0 0 10px rgba(8,22,37,.3); -} - -.newtab-site[dragged] { - transition-property: box-shadow, background-color; - background-color: rgb(242,242,242); -} - -/* THUMBNAILS */ -.newtab-thumbnail { - background-origin: padding-box; - background-clip: padding-box; - background-repeat: no-repeat; - background-size: cover; -} - -/* TITLES */ -.newtab-title { - padding: 0 8px; - background-color: rgba(248,249,251,.95); - color: #1f364c; - line-height: 24px; -} - -/* CONTROLS */ -.newtab-control { - width: 24px; - height: 24px; - padding: 1px 2px 3px; - border: none; - background: transparent url(chrome://browser/skin/newtab/controls.png); -} - -.newtab-control-pin:hover { - background-position: -24px 0; -} - -.newtab-control-pin:active { - background-position: -48px 0; -} - -.newtab-control-pin[pinned] { - background-position: -72px 0; -} - -.newtab-control-pin[pinned]:hover { - background-position: -96px 0; -} - -.newtab-control-pin[pinned]:active { - background-position: -120px 0; -} - -.newtab-control-block { - background-position: -144px 0; -} - -.newtab-control-block:hover { - background-position: -168px 0; -} - -.newtab-control-block:active { - background-position: -192px 0; -} diff --git a/application/palemoon/themes/linux/preferences/aboutPermissions.css b/application/palemoon/themes/linux/permissions/aboutPermissions.css index 2ad833fb2..f4fd3d0ba 100644 --- a/application/palemoon/themes/linux/preferences/aboutPermissions.css +++ b/application/palemoon/themes/linux/permissions/aboutPermissions.css @@ -98,9 +98,6 @@ .pref-icon[type="geo"] { list-style-image: url(chrome://browser/skin/Geolocation-64.png); } -.pref-icon[type="indexedDB"] { - list-style-image: url(chrome://global/skin/icons/question-64.png); -} .pref-icon[type="plugins"] { list-style-image: url(chrome://mozapps/skin/plugins/pluginGeneric.png); } diff --git a/application/palemoon/themes/osx/browser.css b/application/palemoon/themes/osx/browser.css index 485ed9115..400ace3f8 100644 --- a/application/palemoon/themes/osx/browser.css +++ b/application/palemoon/themes/osx/browser.css @@ -27,6 +27,11 @@ border-top: none; } +#main-window { + -moz-appearance: none; + background-color: #eeeeee; +} + #navigator-toolbox::after { content: ""; display: -moz-box; @@ -79,7 +84,7 @@ /* ::::: titlebar ::::: */ -#main-window[sizemode="normal"] > #titlebar { +#main-window[sizemode="normal"]:not([privatebrowsingmode=temporary]) > #titlebar { -moz-appearance: -moz-window-titlebar; } @@ -127,11 +132,16 @@ } /* ensure extra titlebar doesn't appear on normal (e.g. non-privacy) windows */ -#titlebar-buttonbox-container, -#main-window:not([drawintitlebar=true]) > #titlebar { +#main-window:not([privatebrowsingmode=temporary]):not(:-moz-lwtheme) > #titlebar > #titlebar-content > #titlebar-buttonbox-container, +#main-window:not([drawintitlebar=true]):not(:-moz-lwtheme) > #titlebar { display: none; } +#titlebar-buttonbox-container { + margin-left: 7px; + margin-top: 3px; +} + /* ::::: bookmark toolbar ::::: */ #personal-bookmarks { @@ -1348,6 +1358,12 @@ richlistitem[type~="action"][actiontype="switchtab"][selected="true"] > .ac-url- -moz-padding-start: 0px; } +.browserContainer > findbar { + background-color: -moz-dialog; + color: -moz-DialogText; + text-shadow: none; +} + /* ::::: throbber ::::: */ #navigator-throbber { @@ -1908,8 +1924,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] { list-style-image: url(chrome://global/skin/icons/question-64.png); } -.popup-notification-icon[popupid="password-save"], -.popup-notification-icon[popupid="password-change"] { +.popup-notification-icon[popupid="password"] { list-style-image: url(chrome://mozapps/skin/passwordmgr/key-64.png); } @@ -2400,19 +2415,56 @@ toolbar[brighttext] #addonbar-closebutton { right: auto; } -#main-window[privatebrowsingmode=temporary] #toolbar-menubar { - background-image: url("chrome://browser/skin/privatebrowsing-dark.png"); - background-position: top right; - background-repeat: no-repeat; +#main-window[privatebrowsingmode=temporary] { + background-image: url("chrome://browser/skin/privatebrowsing-mask.png"); + background-position: top right; + background-repeat: no-repeat; + background-color: moz-mac-chrome-active; } -#main-window[privatebrowsingmode=temporary] #toolbar-menubar:-moz-locale-dir(rtl) { - background-position: top left; +@media (min-resolution: 2dppx) { + #main-window[privatebrowsingmode=temporary] { + background-image: url("chrome://browser/skin/privatebrowsing-mask@2x.png"); + background-size: 38px; + } } -#main-window[privatebrowsingmode=temporary] #appmenu-button > .button-box > .box-inherit > .button-icon { - list-style-image: url("chrome://browser/skin/privatebrowsing-light.png"); - width: 20px; - height: 16px; +#main-window[privatebrowsingmode=temporary] { + background-position: top right 40px; +} + +#main-window[privatebrowsingmode=temporary][inFullscreen] { + background-position: top right 10px; +} + +#main-window[privatebrowsingmode=temporary]:-moz-locale-dir(rtl) { + background-position: top left 70px; } +#main-window[privatebrowsingmode=temporary][inFullscreen]:-moz-locale-dir(rtl) { + background-position: top left 10px; +} + +#main-window[privatebrowsingmode=temporary]:-moz-window-inactive { + background-color: -moz-mac-chrome-inactive; +} + +#main-window[privatebrowsingmode=temporary][inFullscreen] #nav-bar[tabsontop=false] { + -moz-padding-end: 50px !important; +} + +@media (-moz-mac-lion-theme) { + #main-window[privatebrowsingmode=temporary][inFullscreen] #TabsToolbar[tabsontop=true] { + -moz-padding-end: 50px; + } +} + +@media not all and (-moz-mac-lion-theme) { + #main-window[privatebrowsingmode=temporary] { + background-position: top right 10px; + } + + #main-window[privatebrowsingmode=temporary][inFullscreen][tabsontop=true] #window-controls { + -moz-padding-end: 50px; + } +} diff --git a/application/palemoon/themes/osx/jar.mn b/application/palemoon/themes/osx/jar.mn index 28d779985..8f1ed0341 100644 --- a/application/palemoon/themes/osx/jar.mn +++ b/application/palemoon/themes/osx/jar.mn @@ -50,6 +50,8 @@ browser.jar: skin/classic/browser/Privacy-16.png skin/classic/browser/Privacy-32.png skin/classic/browser/Privacy-48.png + skin/classic/browser/privatebrowsing-mask.png + skin/classic/browser/privatebrowsing-mask@2x.png skin/classic/browser/privatebrowsing-light.png skin/classic/browser/privatebrowsing-dark.png skin/classic/browser/reload-stop-go.png @@ -93,9 +95,10 @@ browser.jar: skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) - skin/classic/browser/newtab/newTab.css (newtab/newTab.css) - skin/classic/browser/newtab/controls.png (newtab/controls.png) - skin/classic/browser/newtab/noise.png (newtab/noise.png) +* skin/classic/browser/newtab/newTab.css (newtab/newTab.css) + skin/classic/browser/newtab/controls.png (../shared/newtab/controls.png) + skin/classic/browser/newtab/noise.png (../shared/newtab/noise.png) + skin/classic/browser/newtab/pinned.png (../shared/newtab/pinned.png) skin/classic/browser/places/places.css (places/places.css) * skin/classic/browser/places/organizer.css (places/organizer.css) skin/classic/browser/places/editBookmark.png (places/editBookmark.png) @@ -123,6 +126,7 @@ browser.jar: skin/classic/browser/places/livemark-item.png (places/livemark-item.png) skin/classic/browser/places/expander-closed.png (places/expander-closed.png) skin/classic/browser/places/expander-open.png (places/expander-open.png) + skin/classic/browser/permissions/aboutPermissions.css (permissions/aboutPermissions.css) skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) skin/classic/browser/preferences/application.png (preferences/application.png) skin/classic/browser/preferences/mail.png (preferences/mail.png) @@ -133,7 +137,6 @@ browser.jar: skin/classic/browser/preferences/saveFile.png (preferences/saveFile.png) * skin/classic/browser/preferences/preferences.css (preferences/preferences.css) skin/classic/browser/preferences/applications.css (preferences/applications.css) - skin/classic/browser/preferences/aboutPermissions.css (preferences/aboutPermissions.css) #ifdef MOZ_BROWSER_STATUSBAR skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) * skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) diff --git a/application/palemoon/themes/osx/newtab/controls.png b/application/palemoon/themes/osx/newtab/controls.png Binary files differdeleted file mode 100644 index 14f382fbd..000000000 --- a/application/palemoon/themes/osx/newtab/controls.png +++ /dev/null diff --git a/application/palemoon/themes/osx/newtab/newTab.css b/application/palemoon/themes/osx/newtab/newTab.css index d0403004a..b8b0fd699 100644 --- a/application/palemoon/themes/osx/newtab/newTab.css +++ b/application/palemoon/themes/osx/newtab/newTab.css @@ -2,33 +2,7 @@ * 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/. */ -:root { - -moz-appearance: none; - font-size: 75%; - background-color: transparent; -} - -/* SCROLLBOX */ -#newtab-scrollbox:not([page-disabled]) { - background-color: rgb(229,229,229); - background-image: url(chrome://browser/skin/newtab/noise.png), - linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.2)); - background-attachment: fixed; -} - -/* UNDO */ -#newtab-undo-container { - padding: 4px 3px; - border: 1px solid; - border-color: rgba(8,22,37,.12) rgba(8,22,37,.14) rgba(8,22,37,.16); - background-color: rgba(255,255,255,.4); - color: #525e69; -} - -#newtab-undo-label { - margin-top: 0; - margin-bottom: 0; -} +%include ../../shared/newtab/newTab.css.inc .newtab-undo-button { -moz-appearance: none; @@ -43,14 +17,6 @@ min-width: 0; } -.newtab-undo-button:hover { - text-decoration: underline; -} - -.newtab-undo-button:-moz-focusring { - outline: 1px dotted; -} - .newtab-undo-button > .button-box { padding: 0; } @@ -61,129 +27,3 @@ border: none; -moz-user-focus: normal; } - -#newtab-undo-close-button > .toolbarbutton-text { - display: none; -} - -#newtab-undo-close-button:-moz-focusring { - outline: 1px dotted; -} - -/* TOGGLE */ -#newtab-toggle { - width: 16px; - height: 16px; - padding: 0; - border: none; - background: -216px 0 transparent url(chrome://browser/skin/newtab/controls.png); -} - -#newtab-toggle[page-disabled] { - background-position: -232px 0; -} - -/* ROWS */ -.newtab-row { - margin-bottom: 20px; -} - -.newtab-row:last-child { - margin-bottom: 0; -} - -/* CELLS */ -.newtab-cell { - -moz-margin-end: 20px; - background-color: rgba(255,255,255,.2); - border: 1px solid; - border-color: rgba(8,22,37,.12) rgba(8,22,37,.14) rgba(8,22,37,.16); - border-radius: 1px; - transition: border-color 100ms ease-out; -} - -.newtab-cell:empty { - border: 1px dashed; - border-color: rgba(8,22,37,.15) rgba(8,22,37,.17) rgba(8,22,37,.19); -} - -.newtab-cell:last-child { - -moz-margin-end: 0; -} - -.newtab-cell:hover:not(:empty):not([dragged]) { - border-color: rgba(8,22,37,.25) rgba(8,22,37,.27) rgba(8,22,37,.3); -} - -/* SITES */ -.newtab-site { - text-decoration: none; - transition-property: top, left, opacity, box-shadow, background-color; -} - -.newtab-site:hover, -.newtab-site[dragged] { - box-shadow: 0 0 10px rgba(8,22,37,.3); -} - -.newtab-site[dragged] { - transition-property: box-shadow, background-color; - background-color: rgb(242,242,242); -} - -/* THUMBNAILS */ -.newtab-thumbnail { - background-origin: padding-box; - background-clip: padding-box; - background-repeat: no-repeat; - background-size: cover; -} - -/* TITLES */ -.newtab-title { - padding: 0 8px; - background-color: rgba(248,249,251,.95); - color: #1f364c; - line-height: 24px; -} - -/* CONTROLS */ -.newtab-control { - width: 24px; - height: 24px; - padding: 1px 2px 3px; - border: none; - background: transparent url(chrome://browser/skin/newtab/controls.png); -} - -.newtab-control-pin:hover { - background-position: -24px 0; -} - -.newtab-control-pin:active { - background-position: -48px 0; -} - -.newtab-control-pin[pinned] { - background-position: -72px 0; -} - -.newtab-control-pin[pinned]:hover { - background-position: -96px 0; -} - -.newtab-control-pin[pinned]:active { - background-position: -120px 0; -} - -.newtab-control-block { - background-position: -144px 0; -} - -.newtab-control-block:hover { - background-position: -168px 0; -} - -.newtab-control-block:active { - background-position: -192px 0; -} diff --git a/application/palemoon/themes/osx/newtab/noise.png b/application/palemoon/themes/osx/newtab/noise.png Binary files differdeleted file mode 100644 index 01d340aaa..000000000 --- a/application/palemoon/themes/osx/newtab/noise.png +++ /dev/null diff --git a/application/palemoon/themes/osx/preferences/aboutPermissions.css b/application/palemoon/themes/osx/permissions/aboutPermissions.css index de636f5c4..406bb9204 100644 --- a/application/palemoon/themes/osx/preferences/aboutPermissions.css +++ b/application/palemoon/themes/osx/permissions/aboutPermissions.css @@ -101,9 +101,6 @@ .pref-icon[type="geo"] { list-style-image: url(chrome://browser/skin/Geolocation-64.png); } -.pref-icon[type="indexedDB"] { - list-style-image: url(chrome://global/skin/icons/question-64.png); -} .pref-icon[type="plugins"] { list-style-image: url(chrome://mozapps/skin/plugins/pluginGeneric.png); } diff --git a/application/palemoon/themes/osx/privatebrowsing-mask.png b/application/palemoon/themes/osx/privatebrowsing-mask.png Binary files differnew file mode 100644 index 000000000..92f60e29f --- /dev/null +++ b/application/palemoon/themes/osx/privatebrowsing-mask.png diff --git a/application/palemoon/themes/osx/privatebrowsing-mask@2x.png b/application/palemoon/themes/osx/privatebrowsing-mask@2x.png Binary files differnew file mode 100644 index 000000000..ec1cf7452 --- /dev/null +++ b/application/palemoon/themes/osx/privatebrowsing-mask@2x.png diff --git a/application/palemoon/themes/linux/newtab/controls.png b/application/palemoon/themes/shared/newtab/controls.png Binary files differindex 14f382fbd..14f382fbd 100644 --- a/application/palemoon/themes/linux/newtab/controls.png +++ b/application/palemoon/themes/shared/newtab/controls.png diff --git a/application/palemoon/themes/shared/newtab/newTab.css.inc b/application/palemoon/themes/shared/newtab/newTab.css.inc new file mode 100644 index 000000000..3341ba7e5 --- /dev/null +++ b/application/palemoon/themes/shared/newtab/newTab.css.inc @@ -0,0 +1,203 @@ +/* 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/. */ + +:root { + -moz-appearance: none; + font-size: 75%; + background-color: transparent; +} + +body { + background: linear-gradient(to top,#DFF3FF,#F9F9F9) fixed; +} + +/* SCROLLBOX */ +#newtab-scrollbox:not([page-disabled]) { + background-color: rgb(229,229,229); + background-image: url(chrome://browser/skin/newtab/noise.png), + linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.2)); + background-attachment: fixed; +} + +/* UNDO */ +#newtab-undo-container { + padding: 4px 3px; + border: 1px solid; + border-color: rgba(8,22,37,.12) rgba(8,22,37,.14) rgba(8,22,37,.16); + background-color: rgba(255,255,255,.4); + color: #525e69; +} + +#newtab-undo-label { + margin-top: 0; + margin-bottom: 0; +} + + +.newtab-undo-button:hover { + text-decoration: underline; +} + +.newtab-undo-button:-moz-focusring { + outline: 1px dotted; +} + + +#newtab-undo-close-button > .toolbarbutton-text { + display: none; +} + +#newtab-undo-close-button:-moz-focusring { + outline: 1px dotted; +} + +/* TOGGLE */ +#newtab-toggle { + width: 16px; + height: 16px; + padding: 0; + border: none; + background: -216px 0 transparent url(chrome://browser/skin/newtab/controls.png); +} + +#newtab-toggle[page-disabled] { + background-position: -232px 0; +} + +/* ROWS */ +.newtab-row { + margin-bottom: 20px; +} + +.newtab-row:last-child { + margin-bottom: 0; +} + +/* CELLS */ +.newtab-cell { + -moz-margin-end: 20px; + background-color: rgba(255,255,255,.2); + border: 1px solid; + border-color: rgba(8,22,37,.12) rgba(8,22,37,.14) rgba(8,22,37,.16); + border-radius: 1px; + transition: border-color 100ms ease-out; +} + +.newtab-cell:empty { + border: 1px dashed; + border-color: rgba(8,22,37,.15) rgba(8,22,37,.17) rgba(8,22,37,.19); +} + +.newtab-cell:last-child { + -moz-margin-end: 0; +} + +.newtab-cell:hover:not(:empty):not([dragged]) { + border-color: rgba(8,22,37,.25) rgba(8,22,37,.27) rgba(8,22,37,.3); +} + +/* SITES */ +.newtab-site { + text-decoration: none; + transition-property: top, left, opacity, box-shadow, background-color; +} + +.newtab-site:hover, +.newtab-site[dragged] { + box-shadow: 0 3px 6px 1px rgba(8,20,37,.6); +} + +.newtab-site[dragged] { + transition-property: box-shadow, background-color; + background-color: rgb(242,242,242); +} + +/* THUMBNAILS */ +.newtab-thumbnail { + background-origin: padding-box; + background-clip: padding-box; + background-repeat: no-repeat; + background-size: cover; +} + +/* TITLES */ +.newtab-title { + padding: 0 8px 1px; + background-color: rgba(248,249,251,.95); + color: #1f364c; + line-height: 24px; +} + +.newtab-site[pinned] .newtab-title { + padding-inline-start: 16px; +} + +.newtab-site[pinned] .newtab-title::before { + background-image: url(chrome://browser/skin/newtab/pinned.png); + content: ""; + left: 2px; + top: 2px; + position: absolute; + width: 12px; + height: 20px; +} + +.newtab-site[pinned] .newtab-title:dir(rtl)::before { + left: auto; + right: 2px; +} + +/* CONTROLS */ +.newtab-control { + background-color: transparent; + background-size: 24px; + border: none; + height: 24px; + width: 24px; + top: 4px; + background: transparent url(chrome://browser/skin/newtab/controls.png); +} + +.newtab-control-pin:dir(ltr), +.newtab-control-block:dir(rtl) { + left: 4px; +} + +.newtab-control-block:dir(ltr), +.newtab-control-pin:dir(rtl) { + right: 4px; +} + +.newtab-control-pin:hover { + background-position: -24px 0; +} + +.newtab-control-pin:active { + background-position: -48px 0; +} + +.newtab-site[pinned] .newtab-control-pin { + background-position: -72px 0; +} + +.newtab-site[pinned] .newtab-control-pin:hover { + background-position: -96px 0; +} + +.newtab-site[pinned] .newtab-control-pin:active { + background-position: -120px 0; +} + +.newtab-control-block { + background-position: -144px 0; +} + +.newtab-control-block:hover { + background-position: -168px 0; +} + +.newtab-control-block:active { + background-position: -192px 0; +} + diff --git a/application/palemoon/themes/linux/newtab/noise.png b/application/palemoon/themes/shared/newtab/noise.png Binary files differindex 01d340aaa..01d340aaa 100644 --- a/application/palemoon/themes/linux/newtab/noise.png +++ b/application/palemoon/themes/shared/newtab/noise.png diff --git a/application/palemoon/themes/shared/newtab/pinned.png b/application/palemoon/themes/shared/newtab/pinned.png Binary files differnew file mode 100644 index 000000000..ddd731bc6 --- /dev/null +++ b/application/palemoon/themes/shared/newtab/pinned.png diff --git a/application/palemoon/themes/windows/browser.css b/application/palemoon/themes/windows/browser.css index db60a6fa7..1aefa428c 100644 --- a/application/palemoon/themes/windows/browser.css +++ b/application/palemoon/themes/windows/browser.css @@ -1788,6 +1788,12 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- -moz-padding-start: 0px; } +.browserContainer > findbar { + background-color: -moz-dialog; + color: -moz-DialogText; + text-shadow: none; +} + /* ::::: throbber ::::: */ #navigator-throbber { @@ -2015,7 +2021,7 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- } .tab-close-button:-moz-lwtheme-brighttext { - list-style-image: url("chrome://global/skin/icons/close-inverted.png"); + list-style-image: url("chrome://global/skin/icons/close-inverted.svg"); } /* Tab scrollbox arrow, tabstrip new tab and all-tabs buttons */ @@ -2163,7 +2169,7 @@ toolbar[brighttext] #alltabs-button[type="menu"] { } toolbar[brighttext] .tabs-closebutton { - list-style-image: url("chrome://global/skin/icons/close-inverted.png"); + list-style-image: url("chrome://global/skin/icons/close-inverted.svg"); } .tabs-closebutton > .toolbarbutton-icon { @@ -2395,8 +2401,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] { list-style-image: url(chrome://global/skin/icons/question-64.png); } -.popup-notification-icon[popupid="password-save"], -.popup-notification-icon[popupid="password-change"] { +.popup-notification-icon[popupid="password"] { list-style-image: url(chrome://mozapps/skin/passwordmgr/key-64.png); } @@ -2697,7 +2702,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] { /* Make sure the allTab previews always have regular close buttons */ #allTabs-tab-close-button:-moz-lwtheme-brighttext { - list-style-image: url("chrome://global/skin/icons/close.png"); + list-style-image: url("chrome://global/skin/icons/close.svg"); } .allTabs-favicon[src] { @@ -2770,7 +2775,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] { } toolbar[brighttext] #addonbar-closebutton { - list-style-image: url("chrome://global/skin/icons/close-inverted.png"); + list-style-image: url("chrome://global/skin/icons/close-inverted.svg"); } /* Status panel */ @@ -3416,7 +3421,13 @@ toolbar[brighttext] #addonbar-closebutton { border-radius: var(--toolbarbutton-border-radius); color: black; } - + + :-moz-any(#toolbar-menubar, #TabsToolbar[tabsontop=true], #nav-bar[tabsontop=false]) .toolbarbutton-1 > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme), + :-moz-any(#toolbar-menubar, #TabsToolbar[tabsontop=true], #nav-bar[tabsontop=false]) .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme), + #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child .toolbarbutton-1 > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme), + #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme) { + list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow-inverted.png"); + } } /* ==== Windows 8/10 (flat color) styling ==== */ @@ -3454,6 +3465,10 @@ toolbar[brighttext] #addonbar-closebutton { border-right-style: none !important; } + #main-menubar > menu:not(:-moz-lwtheme) { + color: inherit; + } + :-moz-any(#toolbar-menubar, #nav-bar[tabsontop=false]) :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme), :-moz-any(#toolbar-menubar, #nav-bar[tabsontop=false]) :-moz-any(@primaryToolbarButtons@) > toolbarbutton > .toolbarbutton-icon:not(:-moz-lwtheme), #TabsToolbar[tabsontop=true] :-moz-any(@primaryToolbarButtons@):not(:-moz-any(#alltabs-button,#new-tab-button,#sync-button[status])) > .toolbarbutton-icon:not(:-moz-lwtheme), @@ -3462,13 +3477,6 @@ toolbar[brighttext] #addonbar-closebutton { #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child :-moz-any(@primaryToolbarButtons@) > toolbarbutton > .toolbarbutton-icon:not(:-moz-lwtheme) { list-style-image: var(--toolbarbutton-glass-image); } - - :-moz-any(#toolbar-menubar, #TabsToolbar[tabsontop=true], #nav-bar[tabsontop=false]) .toolbarbutton-1 > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme), - :-moz-any(#toolbar-menubar, #TabsToolbar[tabsontop=true], #nav-bar[tabsontop=false]) .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme), - #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child .toolbarbutton-1 > .toolbarbutton-menu-dropmarker:not(:-moz-lwtheme), - #nav-bar + #customToolbars + #PersonalToolbar[collapsed=true] + #TabsToolbar[tabsontop=false]:last-child .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker:not(:-moz-lwtheme) { - list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow-inverted.png"); - } /* Show toolbar borders on vista through win8, but not on win10 and later: */ @media (-moz-os-version: windows-vista), diff --git a/application/palemoon/themes/windows/jar.mn b/application/palemoon/themes/windows/jar.mn index ce4627e21..0a4342d40 100644 --- a/application/palemoon/themes/windows/jar.mn +++ b/application/palemoon/themes/windows/jar.mn @@ -95,9 +95,10 @@ browser.jar: skin/classic/browser/feeds/feed-icons-16.png (feeds/feed-icons-16.png) skin/classic/browser/feeds/subscribe.css (feeds/subscribe.css) skin/classic/browser/feeds/subscribe-ui.css (feeds/subscribe-ui.css) - skin/classic/browser/newtab/newTab.css (newtab/newTab.css) - skin/classic/browser/newtab/controls.png (newtab/controls.png) - skin/classic/browser/newtab/noise.png (newtab/noise.png) +* skin/classic/browser/newtab/newTab.css (newtab/newTab.css) + skin/classic/browser/newtab/controls.png (../shared/newtab/controls.png) + skin/classic/browser/newtab/noise.png (../shared/newtab/noise.png) + skin/classic/browser/newtab/pinned.png (../shared/newtab/pinned.png) skin/classic/browser/places/places.css (places/places.css) * skin/classic/browser/places/organizer.css (places/organizer.css) skin/classic/browser/places/editBookmark.png (places/editBookmark.png) @@ -117,6 +118,7 @@ browser.jar: skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) skin/classic/browser/places/downloads.png (places/downloads.png) skin/classic/browser/places/livemark-item.png (places/livemark-item.png) + skin/classic/browser/permissions/aboutPermissions.css (permissions/aboutPermissions.css) skin/classic/browser/preferences/alwaysAsk.png (preferences/alwaysAsk.png) skin/classic/browser/preferences/application.png (preferences/application.png) skin/classic/browser/preferences/mail.png (preferences/mail.png) @@ -127,7 +129,6 @@ browser.jar: skin/classic/browser/preferences/saveFile.png (preferences/saveFile.png) * skin/classic/browser/preferences/preferences.css (preferences/preferences.css) skin/classic/browser/preferences/applications.css (preferences/applications.css) - skin/classic/browser/preferences/aboutPermissions.css (preferences/aboutPermissions.css) #ifdef MOZ_BROWSER_STATUSBAR skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) * skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) diff --git a/application/palemoon/themes/windows/newtab/controls.png b/application/palemoon/themes/windows/newtab/controls.png Binary files differdeleted file mode 100644 index 14f382fbd..000000000 --- a/application/palemoon/themes/windows/newtab/controls.png +++ /dev/null diff --git a/application/palemoon/themes/windows/newtab/newTab.css b/application/palemoon/themes/windows/newtab/newTab.css index d0403004a..b8b0fd699 100644 --- a/application/palemoon/themes/windows/newtab/newTab.css +++ b/application/palemoon/themes/windows/newtab/newTab.css @@ -2,33 +2,7 @@ * 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/. */ -:root { - -moz-appearance: none; - font-size: 75%; - background-color: transparent; -} - -/* SCROLLBOX */ -#newtab-scrollbox:not([page-disabled]) { - background-color: rgb(229,229,229); - background-image: url(chrome://browser/skin/newtab/noise.png), - linear-gradient(rgba(255,255,255,.5), rgba(255,255,255,.2)); - background-attachment: fixed; -} - -/* UNDO */ -#newtab-undo-container { - padding: 4px 3px; - border: 1px solid; - border-color: rgba(8,22,37,.12) rgba(8,22,37,.14) rgba(8,22,37,.16); - background-color: rgba(255,255,255,.4); - color: #525e69; -} - -#newtab-undo-label { - margin-top: 0; - margin-bottom: 0; -} +%include ../../shared/newtab/newTab.css.inc .newtab-undo-button { -moz-appearance: none; @@ -43,14 +17,6 @@ min-width: 0; } -.newtab-undo-button:hover { - text-decoration: underline; -} - -.newtab-undo-button:-moz-focusring { - outline: 1px dotted; -} - .newtab-undo-button > .button-box { padding: 0; } @@ -61,129 +27,3 @@ border: none; -moz-user-focus: normal; } - -#newtab-undo-close-button > .toolbarbutton-text { - display: none; -} - -#newtab-undo-close-button:-moz-focusring { - outline: 1px dotted; -} - -/* TOGGLE */ -#newtab-toggle { - width: 16px; - height: 16px; - padding: 0; - border: none; - background: -216px 0 transparent url(chrome://browser/skin/newtab/controls.png); -} - -#newtab-toggle[page-disabled] { - background-position: -232px 0; -} - -/* ROWS */ -.newtab-row { - margin-bottom: 20px; -} - -.newtab-row:last-child { - margin-bottom: 0; -} - -/* CELLS */ -.newtab-cell { - -moz-margin-end: 20px; - background-color: rgba(255,255,255,.2); - border: 1px solid; - border-color: rgba(8,22,37,.12) rgba(8,22,37,.14) rgba(8,22,37,.16); - border-radius: 1px; - transition: border-color 100ms ease-out; -} - -.newtab-cell:empty { - border: 1px dashed; - border-color: rgba(8,22,37,.15) rgba(8,22,37,.17) rgba(8,22,37,.19); -} - -.newtab-cell:last-child { - -moz-margin-end: 0; -} - -.newtab-cell:hover:not(:empty):not([dragged]) { - border-color: rgba(8,22,37,.25) rgba(8,22,37,.27) rgba(8,22,37,.3); -} - -/* SITES */ -.newtab-site { - text-decoration: none; - transition-property: top, left, opacity, box-shadow, background-color; -} - -.newtab-site:hover, -.newtab-site[dragged] { - box-shadow: 0 0 10px rgba(8,22,37,.3); -} - -.newtab-site[dragged] { - transition-property: box-shadow, background-color; - background-color: rgb(242,242,242); -} - -/* THUMBNAILS */ -.newtab-thumbnail { - background-origin: padding-box; - background-clip: padding-box; - background-repeat: no-repeat; - background-size: cover; -} - -/* TITLES */ -.newtab-title { - padding: 0 8px; - background-color: rgba(248,249,251,.95); - color: #1f364c; - line-height: 24px; -} - -/* CONTROLS */ -.newtab-control { - width: 24px; - height: 24px; - padding: 1px 2px 3px; - border: none; - background: transparent url(chrome://browser/skin/newtab/controls.png); -} - -.newtab-control-pin:hover { - background-position: -24px 0; -} - -.newtab-control-pin:active { - background-position: -48px 0; -} - -.newtab-control-pin[pinned] { - background-position: -72px 0; -} - -.newtab-control-pin[pinned]:hover { - background-position: -96px 0; -} - -.newtab-control-pin[pinned]:active { - background-position: -120px 0; -} - -.newtab-control-block { - background-position: -144px 0; -} - -.newtab-control-block:hover { - background-position: -168px 0; -} - -.newtab-control-block:active { - background-position: -192px 0; -} diff --git a/application/palemoon/themes/windows/newtab/noise.png b/application/palemoon/themes/windows/newtab/noise.png Binary files differdeleted file mode 100644 index 01d340aaa..000000000 --- a/application/palemoon/themes/windows/newtab/noise.png +++ /dev/null diff --git a/application/palemoon/themes/windows/preferences/aboutPermissions.css b/application/palemoon/themes/windows/permissions/aboutPermissions.css index c985150de..fb28ef02a 100644 --- a/application/palemoon/themes/windows/preferences/aboutPermissions.css +++ b/application/palemoon/themes/windows/permissions/aboutPermissions.css @@ -101,9 +101,6 @@ .pref-icon[type="geo"] { list-style-image: url(chrome://browser/skin/Geolocation-64.png); } -.pref-icon[type="indexedDB"] { - list-style-image: url(chrome://global/skin/icons/question-48.png); -} .pref-icon[type="plugins"] { list-style-image: url(chrome://mozapps/skin/plugins/pluginGeneric-48.png); } |