diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-10 11:39:27 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-10 11:39:27 +0100 |
commit | 974a481d12bf430891725bd3662876358e57e11a (patch) | |
tree | cad011151456251fef2f1b8d02ef4b4e45fad61a /application | |
parent | 6bd66b1728eeddb058066edda740aaeb2ceaec23 (diff) | |
parent | 736d25cbec4541186ed46c935c117ce4d1c7f3bb (diff) | |
download | UXP-974a481d12bf430891725bd3662876358e57e11a.tar UXP-974a481d12bf430891725bd3662876358e57e11a.tar.gz UXP-974a481d12bf430891725bd3662876358e57e11a.tar.lz UXP-974a481d12bf430891725bd3662876358e57e11a.tar.xz UXP-974a481d12bf430891725bd3662876358e57e11a.zip |
Merge branch 'master' into js-modules
# Conflicts:
# modules/libpref/init/all.js
Diffstat (limited to 'application')
590 files changed, 16413 insertions, 35466 deletions
diff --git a/application/basilisk/Makefile.in b/application/basilisk/Makefile.in index 2eb9e708f..92527eaa8 100644 --- a/application/basilisk/Makefile.in +++ b/application/basilisk/Makefile.in @@ -10,7 +10,4 @@ ifdef MAKENSISU # uninstaller is included with the application for mar file generation. libs:: $(MAKE) -C installer/windows uninstaller -ifdef MOZ_MAINTENANCE_SERVICE - $(MAKE) -C installer/windows maintenanceservice_installer -endif endif diff --git a/application/basilisk/app/Makefile.in b/application/basilisk/app/Makefile.in index 4a3b9758e..b0c1570f6 100644 --- a/application/basilisk/app/Makefile.in +++ b/application/basilisk/app/Makefile.in @@ -75,20 +75,22 @@ MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_A .PHONY: repackage tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) - $(MKDIR) -p $(dist_dest)/Contents/MacOS - $(MKDIR) -p $(dist_dest)/$(LPROJ) - rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents $(dist_dest) --exclude English.lproj - rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(dist_dest)/$(LPROJ) - sed -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' -e 's/%MOZ_MACBUNDLE_ID%/$(MOZ_MACBUNDLE_ID)/' -e 's/%MAC_BUNDLE_VERSION%/$(MAC_BUNDLE_VERSION)/' $(srcdir)/macbuild/Contents/Info.plist.in > $(dist_dest)/Contents/Info.plist - sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(dist_dest)/$(LPROJ)/InfoPlist.strings - rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ $(dist_dest)/Contents/Resources - rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ $(dist_dest)/Contents/MacOS - $(RM) $(dist_dest)/Contents/MacOS/$(MOZ_APP_NAME) - rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) $(dist_dest)/Contents/MacOS - cp -RL $(DIST)/branding/firefox.icns $(dist_dest)/Contents/Resources/firefox.icns - cp -RL $(DIST)/branding/document.icns $(dist_dest)/Contents/Resources/document.icns - $(MKDIR) -p $(dist_dest)/Contents/Library/LaunchServices - mv -f $(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater $(dist_dest)/Contents/Library/LaunchServices - ln -s ../../../../Library/LaunchServices/org.mozilla.updater $(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater - printf APPLMOZB > $(dist_dest)/Contents/PkgInfo + $(MKDIR) -p '$(dist_dest)/Contents/MacOS' + $(MKDIR) -p '$(dist_dest)/$(LPROJ)' + rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents '$(dist_dest)' --exclude English.lproj + rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ '$(dist_dest)/$(LPROJ)' + sed -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' -e 's/%MOZ_MACBUNDLE_ID%/$(MOZ_MACBUNDLE_ID)/' -e 's/%MAC_BUNDLE_VERSION%/$(MAC_BUNDLE_VERSION)/' $(srcdir)/macbuild/Contents/Info.plist.in > '$(dist_dest)/Contents/Info.plist' + sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > '$(dist_dest)/$(LPROJ)/InfoPlist.strings' + rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ '$(dist_dest)/Contents/Resources' + rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS' + $(RM) '$(dist_dest)/Contents/MacOS/$(MOZ_APP_NAME)' + rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(dist_dest)/Contents/MacOS' + cp -RL $(DIST)/branding/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns' + cp -RL $(DIST)/branding/document.icns '$(dist_dest)/Contents/Resources/document.icns' +ifdef MOZ_UPDATER + $(MKDIR) -p '$(dist_dest)/Contents/Library/LaunchServices' + mv -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices' + ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' +endif + printf APPLMOZB > '$(dist_dest)/Contents/PkgInfo' endif diff --git a/application/basilisk/app/blocklist.xml b/application/basilisk/app/blocklist.xml index 239fe43a4..435d0e78f 100644 --- a/application/basilisk/app/blocklist.xml +++ b/application/basilisk/app/blocklist.xml @@ -1,6 +1,8 @@ <?xml version='1.0' encoding='UTF-8'?> -<blocklist lastupdate="1521130300000" xmlns="http://www.mozilla.org/2006/addons-blocklist"> +<blocklist lastupdate="1547041082000" xmlns="http://www.mozilla.org/2006/addons-blocklist"> <emItems> + <!-- Basilisk --> + <!-- Inherited malware items --> <emItem blockID="i988" id="{b12785f5-d8d0-4530-a3ea-5c4263b85bef}"> <prefs/> <versionRange minVersion="0" maxVersion="*" severity="1"/> diff --git a/application/basilisk/app/macbuild/Contents/Info.plist.in b/application/basilisk/app/macbuild/Contents/Info.plist.in index d6902fffd..3f9380606 100644 --- a/application/basilisk/app/macbuild/Contents/Info.plist.in +++ b/application/basilisk/app/macbuild/Contents/Info.plist.in @@ -143,7 +143,7 @@ </dict> </array> <key>CFBundleExecutable</key> - <string>firefox</string> + <string>basilisk</string> <key>CFBundleGetInfoString</key> <string>%MAC_APP_NAME% %APP_VERSION%</string> <key>CFBundleIconFile</key> @@ -213,7 +213,7 @@ <key>LSFileQuarantineEnabled</key> <true/> <key>LSMinimumSystemVersion</key> - <string>10.9.0</string> + <string>10.7.0</string> <key>NSSupportsAutomaticGraphicsSwitching</key> <true/> <key>NSPrincipalClass</key> diff --git a/application/basilisk/app/permissions b/application/basilisk/app/permissions index cf0aa22fb..cc5535f21 100644 --- a/application/basilisk/app/permissions +++ b/application/basilisk/app/permissions @@ -7,6 +7,8 @@ # See nsPermissionManager.cpp for more...
# XPInstall
+origin install 1 http://addons.basilisk-browser.org
+origin install 1 https://addons.basilisk-browser.org
origin install 1 https://addons.mozilla.org
origin install 1 https://testpilot.firefox.com
diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index 2df95a97f..a773bc60e 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -36,24 +36,24 @@ pref("extensions.minCompatibleAppVersion", "4.0"); pref("xpinstall.customConfirmationUI", true); +#define AM_DOMAIN addons.basilisk-browser.org +#define AM_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% + // Preferences for AMO integration pref("extensions.getAddons.cache.enabled", false); -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://discovery.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"); -pref("extensions.getAddons.link.url", "https://addons.mozilla.org/%LOCALE%/firefox/"); +pref("extensions.getAddons.maxResults", 10); +pref("extensions.getAddons.get.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%"); +pref("extensions.getAddons.getWithPerformance.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%"); +pref("extensions.getAddons.search.browseURL", "https://@AM_DOMAIN@/search/?terms=%TERMS%"); +pref("extensions.getAddons.search.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=search&q=%TERMS%&locale=%LOCALE%&os=%OS%&version=%VERSION%"); +pref("extensions.webservice.discoverURL", "http://@AM_DOMAIN@/?component=discover"); +pref("extensions.getAddons.recommended.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=recommended&locale=%LOCALE%&os=%OS%"); +pref("extensions.getAddons.browseAddons", "http://@AM_DOMAIN@/"); +pref("extensions.getAddons.recommended.browseURL", "https://@AM_DOMAIN@/?component=integration&type=external&request=recommended"); pref("extensions.update.autoUpdateDefault", true); -pref("extensions.hotfix.id", "firefox-hotfix@mozilla.org"); -pref("extensions.hotfix.cert.checkAttributes", true); -pref("extensions.hotfix.certs.1.sha1Fingerprint", "91:53:98:0C:C1:86:DF:47:8F:35:22:9E:11:C9:A7:31:04:49:A1:AA"); -pref("extensions.hotfix.certs.2.sha1Fingerprint", "39:E7:2B:7A:5B:CF:37:78:F9:5D:4A:E0:53:2D:2F:3D:68:53:C5:60"); - +// Also, leave this for the moment... // Check AUS for system add-on updates. pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/SystemAddons/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml"); @@ -66,11 +66,14 @@ pref("extensions.webextensions.base-content-security-policy", "script-src 'self' pref("extensions.webextensions.default-content-security-policy", "script-src 'self'; object-src 'self';"); // Require signed add-ons by default -pref("xpinstall.signatures.required", true); +pref("xpinstall.signatures.required", false); pref("xpinstall.signatures.devInfoURL", "https://wiki.mozilla.org/Addons/Extension_Signing"); // Dictionary download preference -pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/"); +pref("browser.dictionaries.download.url", "http://@AM_DOMAIN@/dictionaries/"); + +// Get More Tools link URL +pref("browser.getdevtools.url","https://@AM_DOMAIN@/?component=integration&type=external&request=devtools"); // At startup, should we check to see if the installation // date is older than some threshold @@ -135,17 +138,15 @@ pref("app.update.url", "https://aus5.mozilla.org/update/6/%PRODUCT%/%VERSION%/%B // app.update.url.manual is in branding section // app.update.url.details is in branding section +// User-settable override to app.update.url for testing purposes. +//pref("app.update.url.override", ""); + // app.update.interval is in branding section // 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); -// Whether or not to attempt using the service for updates. -#ifdef MOZ_MAINTENANCE_SERVICE -pref("app.update.service.enabled", true); -#endif - // Symmetric (can be overridden by individual extensions) update preferences. // e.g. // extensions.{GUID}.update.enabled @@ -153,8 +154,8 @@ pref("app.update.service.enabled", true); // .. 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=52.9&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=52.9&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%¤tAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%"); +pref("extensions.update.url", "https://@AM_DOMAIN@/?component=aus&@AM_AUS_ARGS@"); +pref("extensions.update.background.url", "https://@AM_DOMAIN@/?component=aus&@AM_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 @@ -166,7 +167,7 @@ pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name", "chrome://browser pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description", "chrome://browser/locale/browser.properties"); pref("lightweightThemes.update.enabled", true); -pref("lightweightThemes.getMoreURL", "https://addons.mozilla.org/%LOCALE%/firefox/themes"); +pref("lightweightThemes.getMoreURL", "http://@AM_DOMAIN@/personas/"); pref("lightweightThemes.recommendedThemes", "[{\"id\":\"recommended-1\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/a-web-browser-renaissance/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.header.jpg\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.footer.jpg\",\"textcolor\":\"#000000\",\"accentcolor\":\"#f2d9b1\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.preview.jpg\",\"author\":\"Sean.Martell\",\"version\":\"0\"},{\"id\":\"recommended-2\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/space-fantasy/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.header.jpg\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.footer.jpg\",\"textcolor\":\"#ffffff\",\"accentcolor\":\"#d9d9d9\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.preview.jpg\",\"author\":\"fx5800p\",\"version\":\"1.0\"},{\"id\":\"recommended-3\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/linen-light/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.footer.png\",\"accentcolor\":\"#ada8a8\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.icon.png\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.preview.png\",\"author\":\"DVemer\",\"version\":\"1.0\"},{\"id\":\"recommended-4\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/pastel-gradient/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.footer.png\",\"textcolor\":\"#000000\",\"accentcolor\":\"#000000\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.icon.png\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.preview.png\",\"author\":\"darrinhenein\",\"version\":\"1.0\"},{\"id\":\"recommended-5\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/carbon-light/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.footer.png\",\"textcolor\":\"#3b3b3b\",\"accentcolor\":\"#2e2e2e\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.preview.jpg\",\"author\":\"Jaxivo\",\"version\":\"1.0\"}]"); #if defined(MOZ_ADOBE_EME) || defined(MOZ_WIDEVINE_EME) @@ -329,7 +330,7 @@ pref("browser.helperApps.deleteTempFileOnExit", true); #endif // search engines URL -pref("browser.search.searchEnginesURL", "https://addons.mozilla.org/%LOCALE%/firefox/search-engines/"); +pref("browser.search.searchEnginesURL", "https://@AM_DOMAIN@/search-plugins/"); // pointer to the default engine name pref("browser.search.defaultenginename", "chrome://browser-region/locale/region.properties"); @@ -339,18 +340,6 @@ pref("browser.search.order.1", "chrome://browser-region/locale/re pref("browser.search.order.2", "chrome://browser-region/locale/region.properties"); pref("browser.search.order.3", "chrome://browser-region/locale/region.properties"); -// Market-specific search defaults -// This is disabled globally, and then enabled for individual locales -// in firefox-l10n.js (eg. it's enabled for en-US). -pref("browser.search.geoSpecificDefaults", false); -pref("browser.search.geoSpecificDefaults.url", "https://search.services.mozilla.com/1/%APP%/%VERSION%/%CHANNEL%/%LOCALE%/%REGION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%"); - -// US specific default (used as a fallback if the geoSpecificDefaults request fails). -pref("browser.search.defaultenginename.US", "data:text/plain,browser.search.defaultenginename.US=Google"); -pref("browser.search.order.US.1", "data:text/plain,browser.search.order.US.1=Google"); -pref("browser.search.order.US.2", "data:text/plain,browser.search.order.US.2=Yahoo"); -pref("browser.search.order.US.3", "data:text/plain,browser.search.order.US.3=Bing"); - // search bar results always open in a new tab pref("browser.search.openintab", false); @@ -543,9 +532,10 @@ pref("browser.gesture.tap", "cmd_fullZoomReset"); pref("browser.snapshots.limit", 0); // 0: Nothing happens -// 1: Scrolling contents +// 1: Scroll contents // 2: Go back or go forward, in your history -// 3: Zoom in or out. +// 3: Zoom in or out +// 4: Scroll contents with X and Y swapped #ifdef XP_MACOSX // On OS X, if the wheel has one axis only, shift+wheel comes through as a // horizontal scroll event. Thus, we can't assign anything other than normal @@ -579,6 +569,10 @@ pref("network.captive-portal-service.enabled", true); // If true, network link events will change the value of navigator.onLine pref("network.manage-offline-status", true); +// Enable opportunistic encryption by default +pref("network.http.altsvc.oe", true); +pref("network.http.upgrade-insecure-requests", true); + // We want to make sure mail URLs are handled externally... pref("network.protocol-handler.external.mailto", true); // for mail pref("network.protocol-handler.external.news", true); // for news @@ -1015,12 +1009,7 @@ pref("services.sync.syncedTabs.showRemoteIcons", true); pref("services.sync.sendTabToDevice.enabled", true); -// Developer edition preferences -#ifdef MOZ_DEV_EDITION -sticky_pref("lightweightThemes.selectedThemeID", "firefox-devedition@mozilla.org"); -#else sticky_pref("lightweightThemes.selectedThemeID", ""); -#endif // Whether the character encoding menu is under the main Firefox button. This // preference is a string so that localizers can alter it. @@ -1040,11 +1029,8 @@ pref("browser.newtabpage.introShown", false); // Toggles the content of 'about:newtab'. Shows the grid when enabled. pref("browser.newtabpage.enabled", true); -// Toggles the enhanced content of 'about:newtab'. Shows sponsored tiles. -sticky_pref("browser.newtabpage.enhanced", false); - -// enables Activity Stream inspired layout -pref("browser.newtabpage.compact", false); +// Disables capturing of page thumbnails +pref("browser.pagethumbnails.capturing_disabled", false); // enables showing basic placeholders for missing thumbnails pref("browser.newtabpage.thumbnailPlaceholder", false); @@ -1156,53 +1142,11 @@ pref("browser.uiCustomization.debug", false); // CustomizableUI state of the browser's user interface pref("browser.uiCustomization.state", ""); -// The remote content URL shown for FxA signup. Must use HTTPS. -pref("identity.fxaccounts.remote.signup.uri", "https://accounts.firefox.com/signup?service=sync&context=fx_desktop_v3"); - -// The URL where remote content that forces re-authentication for Firefox Accounts -// should be fetched. Must use HTTPS. -pref("identity.fxaccounts.remote.force_auth.uri", "https://accounts.firefox.com/force_auth?service=sync&context=fx_desktop_v3"); - -// The remote content URL shown for signin in. Must use HTTPS. -pref("identity.fxaccounts.remote.signin.uri", "https://accounts.firefox.com/signin?service=sync&context=fx_desktop_v3"); - -// The remote content URL where FxAccountsWebChannel messages originate. -pref("identity.fxaccounts.remote.webchannel.uri", "https://accounts.firefox.com/"); - -// The value of the context query parameter passed in some fxa requests when config -// discovery is enabled. -pref("identity.fxaccounts.contextParam", "fx_desktop_v3"); - -// The URL we take the user to when they opt to "manage" their Firefox Account. -// Note that this will always need to be in the same TLD as the -// "identity.fxaccounts.remote.signup.uri" pref. -pref("identity.fxaccounts.settings.uri", "https://accounts.firefox.com/settings?service=sync&context=fx_desktop_v3"); - -// The remote URL of the FxA Profile Server -pref("identity.fxaccounts.remote.profile.uri", "https://profile.accounts.firefox.com/v1"); - -// The remote URL of the FxA OAuth Server -pref("identity.fxaccounts.remote.oauth.uri", "https://oauth.accounts.firefox.com/v1"); - -// Whether we display profile images in the UI or not. -pref("identity.fxaccounts.profile_image.enabled", true); - -// Token server used by the FxA Sync identity. -pref("identity.sync.tokenserver.uri", "https://token.services.mozilla.com/1.0/sync/1.5"); - // URLs for promo links to mobile browsers. Note that consumers are expected to // append a value for utm_campaign. pref("identity.mobilepromo.android", "https://www.mozilla.org/firefox/android/?utm_source=firefox-browser&utm_medium=firefox-browser&utm_campaign="); pref("identity.mobilepromo.ios", "https://www.mozilla.org/firefox/ios/?utm_source=firefox-browser&utm_medium=firefox-browser&utm_campaign="); -// Migrate any existing Firefox Account data from the default profile to the -// Developer Edition profile. -#ifdef MOZ_DEV_EDITION -pref("identity.fxaccounts.migrateToDevEdition", true); -#else -pref("identity.fxaccounts.migrateToDevEdition", false); -#endif - // On GTK, we now default to showing the menubar only when alt is pressed: #ifdef MOZ_WIDGET_GTK pref("ui.key.menuAccessKeyFocuses", true); @@ -1265,13 +1209,6 @@ pref("media.gmp-widevinecdm.enabled", true); // -1 means no experiment is run and we use the preferred value for frecency (6h) pref("browser.cache.frecency_experiment", 0); -pref("browser.translation.detectLanguage", false); -pref("browser.translation.neverForLanguages", ""); -// Show the translation UI bits, like the info bar, notification icon and preferences. -pref("browser.translation.ui.show", false); -// Allows to define the translation engine. Bing is default, Yandex may optionally switched on. -pref("browser.translation.engine", "bing"); - // Telemetry settings. // Determines if Telemetry pings can be archived locally. pref("toolkit.telemetry.archive.enabled", true); @@ -1285,17 +1222,6 @@ pref("privacy.trackingprotection.ui.enabled", true); pref("privacy.trackingprotection.ui.enabled", false); #endif -// Enable Contextual Identity Containers -#ifdef NIGHTLY_BUILD -pref("privacy.userContext.enabled", true); -pref("privacy.userContext.ui.enabled", true); -pref("privacy.usercontext.about_newtab_segregation.enabled", true); -#else -pref("privacy.userContext.enabled", false); -pref("privacy.userContext.ui.enabled", false); -pref("privacy.usercontext.about_newtab_segregation.enabled", false); -#endif - #ifndef RELEASE_OR_BETA // At the moment, autostart.2 is used, while autostart.1 is unused. // We leave it here set to false to reset users' defaults and allow @@ -1430,3 +1356,11 @@ pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); // controlling validation are located in /services/sync/services-sync.js pref("services.sync.validation.enabled", true); #endif + +// When a user cancels this number of authentication dialogs coming from +// a single web page (eTLD+1) in a row, all following authentication dialogs +// will be blocked (automatically canceled) for that page. +// This counter is per-tab and per-domain to minimize false positives. +// The counter resets when the page is reloaded from the UI +// (content-reloads do NOT clear this to mitigate reloading tricks). +pref("prompts.authentication_dialog_abuse_limit", 3); diff --git a/application/basilisk/base/content/aboutNetError.xhtml b/application/basilisk/base/content/aboutNetError.xhtml index 3296600c8..5ff79ea12 100644 --- a/application/basilisk/base/content/aboutNetError.xhtml +++ b/application/basilisk/base/content/aboutNetError.xhtml @@ -362,7 +362,7 @@ // First, find the index of the <a> tag we care about, being // careful not to use an over-greedy regex. var re = /<a id="cert_domain_link" title="([^"]+)">/; - var result = domainRe.exec(desc); + var result = re.exec(desc); if (!result) return; diff --git a/application/basilisk/base/content/aboutRobots-icon.png b/application/basilisk/base/content/aboutRobots-icon.png Binary files differdeleted file mode 100644 index 1c4899aaf..000000000 --- a/application/basilisk/base/content/aboutRobots-icon.png +++ /dev/null diff --git a/application/basilisk/base/content/aboutRobots-widget-left.png b/application/basilisk/base/content/aboutRobots-widget-left.png Binary files differdeleted file mode 100644 index 3a1e48d5f..000000000 --- a/application/basilisk/base/content/aboutRobots-widget-left.png +++ /dev/null diff --git a/application/basilisk/base/content/aboutRobots.xhtml b/application/basilisk/base/content/aboutRobots.xhtml deleted file mode 100644 index 23fe3ba17..000000000 --- a/application/basilisk/base/content/aboutRobots.xhtml +++ /dev/null @@ -1,108 +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/. --> - -<!DOCTYPE html [ - <!ENTITY % htmlDTD - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "DTD/xhtml1-strict.dtd"> - %htmlDTD; - <!ENTITY % netErrorDTD - SYSTEM "chrome://global/locale/netError.dtd"> - %netErrorDTD; - <!ENTITY % globalDTD - SYSTEM "chrome://global/locale/global.dtd"> - %globalDTD; - <!ENTITY % aboutrobotsDTD - SYSTEM "chrome://browser/locale/aboutRobots.dtd"> - %aboutrobotsDTD; -]> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>&robots.pagetitle;</title> - <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" /> - <link rel="icon" type="image/png" id="favicon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACGFjVEwAAAASAAAAAJNtBPIAAAAaZmNUTAAAAAAAAAAQAAAAEAAAAAAAAAAALuAD6AABhIDeugAAALhJREFUOI2Nk8sNxCAMRDlGohauXFOMpfTiAlxICqAELltHLqlgctg1InzMRhpFAc%2BLGWTnmoeZYamt78zXdZmaQtQMADlnU0OIAlbmJUBEcO4bRKQY2rUXIPmAGnDuG%2FBx3%2FfvOPVaDUg%2BoAPUf1PArIMCSD5glMEsUGaG%2BkyAFWIBaCsKuA%2BHGCNijLgP133XgOEtaPFMy2vUolEGJoCIzBmoRUR9%2B7rxj16DZaW%2FmgtmxnJ8V3oAnApQwNS5zpcAAAAaZmNUTAAAAAEAAAAQAAAAEAAAAAAAAAAAAB4D6AIB52fclgAAACpmZEFUAAAAAjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9WF%2Bu8QAAABpmY1RMAAAAAwAAABAAAAAQAAAAAAAAAAAAHgPoAgEK8Q9%2FAAAAFmZkQVQAAAAEOI1jYBgFo2AUjAIIAAAEEAAB0xIn4wAAABpmY1RMAAAABQAAABAAAAAQAAAAAAAAAAAAHgPoAgHnO30FAAAAQGZkQVQAAAAGOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVfozYcAAAABpmY1RMAAAABwAAABAAAAAQAAAAAAAAAAAAHgPoAgEKra7sAAAAFmZkQVQAAAAIOI1jYBgFo2AUjAIIAAAEEAABM9s3hAAAABpmY1RMAAAACQAAABAAAAAQAAAAAAAAAAAAHgPoAgHn3p%2BwAAAAKmZkQVQAAAAKOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F1BhPl6AAAAGmZjVEwAAAALAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQpITFkAAAAWZmRBVAAAAAw4jWNgGAWjYBSMAggAAAQQAAHaszpmAAAAGmZjVEwAAAANAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeeCPiMAAABAZmRBVAAAAA44jWNgGJ5gpxrDf2LEcIL%2FpzAVYxPDavP%2FUwz%2FpW79%2F%2F%2F%2FFMP%2FnWoQjC5GOxcgu4QYsVEwCmAAAOE0KxUmBL0KAAAAGmZjVEwAAAAPAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQoU7coAAAAWZmRBVAAAABA4jWNgGAWjYBSMAggAAAQQAAEpOBELAAAAGmZjVEwAAAARAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeYVWtoAAAAqZmRBVAAAABI4jWNgGAVYQXNz839ixHBq3qnG8B9ZAzYx2rlgFIwCcgAA8psX%2FWvpAecAAAAaZmNUTAAAABMAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC4OJMwAAABZmZEFUAAAAFDiNY2AYBaNgFIwCCAAABBAAAcBQHOkAAAAaZmNUTAAAABUAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5kn7SQAAAEBmZEFUAAAAFjiNY2AYnmCnGsN%2FYsRwgv%2BnMBVjE8Nq8%2F9TDP%2Blbv3%2F%2F%2F8Uw%2F%2BdahCMLkY7FyC7hBixUTAKYAAA4TQrFc%2BcEoQAAAAaZmNUTAAAABcAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC98ooAAAABZmZEFUAAAAGDiNY2AYBaNgFIwCCAAABBAAASCZDI4AAAAaZmNUTAAAABkAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5qwZ%2FAAAACpmZEFUAAAAGjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9cjJWbAAAABpmY1RMAAAAGwAAABAAAAAQAAAAAAAAAAAAHgPoAgELOsoVAAAAFmZkQVQAAAAcOI1jYBgFo2AUjAIIAAAEEAAByfEBbAAAABpmY1RMAAAAHQAAABAAAAAQAAAAAAAAAAAAHgPoAgHm8LhvAAAAQGZkQVQAAAAeOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVlxR3%2FgAAABpmY1RMAAAAHwAAABAAAAAQAAAAAAAAAAAAHgPoAgELZmuGAAAAFmZkQVQAAAAgOI1jYBgFo2AUjAIIAAAEEAABHP5cFQAAABpmY1RMAAAAIQAAABAAAAAQAAAAAAAAAAAAHgPoAgHlgtAOAAAAKmZkQVQAAAAiOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F0%2FMvDdAAAAAElFTkSuQmCC"/> - - <script type="application/javascript"><![CDATA[ - var buttonClicked = false; - function robotButton() - { - var button = document.getElementById('errorTryAgain'); - if (buttonClicked) { - button.style.visibility = "hidden"; - } else { - var newLabel = button.getAttribute("label2"); - button.textContent = newLabel; - buttonClicked = true; - } - } - ]]></script> - - <style type="text/css"><![CDATA[ - #errorPageContainer { - background-image: none; - } - - #errorPageContainer:before { - content: url('chrome://browser/content/aboutRobots-icon.png'); - position: absolute; - } - - body[dir=rtl] #icon, - body[dir=rtl] #errorPageContainer:before { - transform: scaleX(-1); - } - ]]></style> - </head> - - <body dir="&locale.dir;"> - - <!-- PAGE CONTAINER (for styling purposes only) --> - <div id="errorPageContainer"> - - <!-- Error Title --> - <div id="errorTitle"> - <h1 id="errorTitleText">&robots.errorTitleText;</h1> - </div> - - <!-- LONG CONTENT (the section most likely to require scrolling) --> - <div id="errorLongContent"> - - <!-- Short Description --> - <div id="errorShortDesc"> - <p id="errorShortDescText">&robots.errorShortDescText;</p> - </div> - - <!-- Long Description (Note: See netError.dtd for used XHTML tags) --> - <div id="errorLongDesc"> - <ul> - <li>&robots.errorLongDesc1;</li> - <li>&robots.errorLongDesc2;</li> - <li>&robots.errorLongDesc3;</li> - <li>&robots.errorLongDesc4;</li> - </ul> - </div> - - <!-- Short Description --> - <div id="errorTrailerDesc"> - <p id="errorTrailerDescText">&robots.errorTrailerDescText;</p> - </div> - - </div> - - <!-- Button --> - <button id="errorTryAgain" - label2="&robots.dontpress;" - onclick="robotButton();">&retry.label;</button> - - <img src="chrome://browser/content/aboutRobots-widget-left.png" - style="position: absolute; bottom: -12px; left: -10px;"/> - <img src="chrome://browser/content/aboutRobots-widget-left.png" - style="position: absolute; bottom: -12px; right: -10px; transform: scaleX(-1);"/> - </div> - - </body> -</html> diff --git a/application/basilisk/base/content/aboutaccounts/aboutaccounts.css b/application/basilisk/base/content/aboutaccounts/aboutaccounts.css deleted file mode 100644 index a2c5cb8f0..000000000 --- a/application/basilisk/base/content/aboutaccounts/aboutaccounts.css +++ /dev/null @@ -1,24 +0,0 @@ -html, body { - height: 100%; -} - -#remote { - width: 100%; - height: 100%; - border: 0; - display: none; -} - -#networkError, #manage, #intro, #stage, #configError { - display: none; -} - -#oldsync { - background: none; - border: 0; - color: #0095dd; -} - -#oldsync:focus { - outline: 1px dotted #0095dd; -} diff --git a/application/basilisk/base/content/aboutaccounts/aboutaccounts.js b/application/basilisk/base/content/aboutaccounts/aboutaccounts.js deleted file mode 100644 index a05c1ea75..000000000 --- a/application/basilisk/base/content/aboutaccounts/aboutaccounts.js +++ /dev/null @@ -1,543 +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"; - -var {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/FxAccounts.jsm"); - -var fxAccountsCommon = {}; -Cu.import("resource://gre/modules/FxAccountsCommon.js", fxAccountsCommon); - -// for master-password utilities -Cu.import("resource://services-sync/util.js"); - -const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash"; -const PREF_SYNC_SHOW_CUSTOMIZATION = "services.sync-setup.ui.showCustomizationDialog"; - -const ACTION_URL_PARAM = "action"; - -const OBSERVER_TOPICS = [ - fxAccountsCommon.ONVERIFIED_NOTIFICATION, - fxAccountsCommon.ONLOGOUT_NOTIFICATION, -]; - -function log(msg) { - // dump("FXA: " + msg + "\n"); -} - -function error(msg) { - console.log("Firefox Account Error: " + msg + "\n"); -} - -function getPreviousAccountNameHash() { - try { - return Services.prefs.getComplexValue(PREF_LAST_FXA_USER, Ci.nsISupportsString).data; - } catch (_) { - return ""; - } -} - -function setPreviousAccountNameHash(acctName) { - let string = Cc["@mozilla.org/supports-string;1"] - .createInstance(Ci.nsISupportsString); - string.data = sha256(acctName); - Services.prefs.setComplexValue(PREF_LAST_FXA_USER, Ci.nsISupportsString, string); -} - -function needRelinkWarning(acctName) { - let prevAcctHash = getPreviousAccountNameHash(); - return prevAcctHash && prevAcctHash != sha256(acctName); -} - -// Given a string, returns the SHA265 hash in base64 -function sha256(str) { - let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] - .createInstance(Ci.nsIScriptableUnicodeConverter); - converter.charset = "UTF-8"; - // Data is an array of bytes. - let data = converter.convertToByteArray(str, {}); - let hasher = Cc["@mozilla.org/security/hash;1"] - .createInstance(Ci.nsICryptoHash); - hasher.init(hasher.SHA256); - hasher.update(data, data.length); - - return hasher.finish(true); -} - -function promptForRelink(acctName) { - let sb = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties"); - let continueLabel = sb.GetStringFromName("continue.label"); - let title = sb.GetStringFromName("relinkVerify.title"); - let description = sb.formatStringFromName("relinkVerify.description", - [acctName], 1); - let body = sb.GetStringFromName("relinkVerify.heading") + - "\n\n" + description; - let ps = Services.prompt; - let buttonFlags = (ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING) + - (ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL) + - ps.BUTTON_POS_1_DEFAULT; - let pressed = Services.prompt.confirmEx(window, title, body, buttonFlags, - continueLabel, null, null, null, - {}); - return pressed == 0; // 0 is the "continue" button -} - -// If the last fxa account used for sync isn't this account, we display -// a modal dialog checking they really really want to do this... -// (This is sync-specific, so ideally would be in sync's identity module, -// but it's a little more seamless to do here, and sync is currently the -// only fxa consumer, so... -function shouldAllowRelink(acctName) { - return !needRelinkWarning(acctName) || promptForRelink(acctName); -} - -function updateDisplayedEmail(user) { - let emailDiv = document.getElementById("email"); - if (emailDiv && user) { - emailDiv.textContent = user.email; - } -} - -var wrapper = { - iframe: null, - - init: function (url, urlParams) { - // If a master-password is enabled, we want to encourage the user to - // unlock it. Things still work if not, but the user will probably need - // to re-auth next startup (in which case we will get here again and - // re-prompt) - Utils.ensureMPUnlocked(); - - let iframe = document.getElementById("remote"); - this.iframe = iframe; - this.iframe.QueryInterface(Ci.nsIFrameLoaderOwner); - let docShell = this.iframe.frameLoader.docShell; - docShell.QueryInterface(Ci.nsIWebProgress); - docShell.addProgressListener(this.iframeListener, Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT); - iframe.addEventListener("load", this); - - // Ideally we'd just merge urlParams with new URL(url).searchParams, but our - // URLSearchParams implementation doesn't support iteration (bug 1085284). - let urlParamStr = urlParams.toString(); - if (urlParamStr) { - url += (url.includes("?") ? "&" : "?") + urlParamStr; - } - this.url = url; - // Set the iframe's location with loadURI/LOAD_FLAGS_REPLACE_HISTORY to - // avoid having a new history entry being added. REPLACE_HISTORY is used - // to replace the current entry, which is `about:blank`. - let webNav = iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation); - webNav.loadURI(url, Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY, null, null, null); - }, - - retry: function () { - let webNav = this.iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation); - webNav.loadURI(this.url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null); - }, - - iframeListener: { - QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener, - Ci.nsISupportsWeakReference, - Ci.nsISupports]), - - onStateChange: function(aWebProgress, aRequest, aState, aStatus) { - let failure = false; - - // Captive portals sometimes redirect users - if ((aState & Ci.nsIWebProgressListener.STATE_REDIRECTING)) { - failure = true; - } else if ((aState & Ci.nsIWebProgressListener.STATE_STOP)) { - if (aRequest instanceof Ci.nsIHttpChannel) { - try { - failure = aRequest.responseStatus != 200; - } catch (e) { - failure = aStatus != Components.results.NS_OK; - } - } - } - - // Calling cancel() will raise some OnStateChange notifications by itself, - // so avoid doing that more than once - if (failure && aStatus != Components.results.NS_BINDING_ABORTED) { - aRequest.cancel(Components.results.NS_BINDING_ABORTED); - setErrorPage("networkError"); - } - }, - - onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) { - if (aRequest && aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_ERROR_PAGE) { - aRequest.cancel(Components.results.NS_BINDING_ABORTED); - setErrorPage("networkError"); - } - }, - - onProgressChange: function() {}, - onStatusChange: function() {}, - onSecurityChange: function() {}, - }, - - handleEvent: function (evt) { - switch (evt.type) { - case "load": - this.iframe.contentWindow.addEventListener("FirefoxAccountsCommand", this); - this.iframe.removeEventListener("load", this); - break; - case "FirefoxAccountsCommand": - this.handleRemoteCommand(evt); - break; - } - }, - - /** - * onLogin handler receives user credentials from the jelly after a - * sucessful login and stores it in the fxaccounts service - * - * @param accountData the user's account data and credentials - */ - onLogin: function (accountData) { - log("Received: 'login'. Data:" + JSON.stringify(accountData)); - - if (accountData.customizeSync) { - Services.prefs.setBoolPref(PREF_SYNC_SHOW_CUSTOMIZATION, true); - } - delete accountData.customizeSync; - // sessionTokenContext is erroneously sent by the content server. - // https://github.com/mozilla/fxa-content-server/issues/2766 - // To avoid having the FxA storage manager not knowing what to do with - // it we delete it here. - delete accountData.sessionTokenContext; - - // We need to confirm a relink - see shouldAllowRelink for more - let newAccountEmail = accountData.email; - // The hosted code may have already checked for the relink situation - // by sending the can_link_account command. If it did, then - // it will indicate we don't need to ask twice. - if (!accountData.verifiedCanLinkAccount && !shouldAllowRelink(newAccountEmail)) { - // we need to tell the page we successfully received the message, but - // then bail without telling fxAccounts - this.injectData("message", { status: "login" }); - // after a successful login we return to preferences - openPrefs(); - return; - } - delete accountData.verifiedCanLinkAccount; - - // Remember who it was so we can log out next time. - setPreviousAccountNameHash(newAccountEmail); - - // A sync-specific hack - we want to ensure sync has been initialized - // before we set the signed-in user. - let xps = Cc["@mozilla.org/weave/service;1"] - .getService(Ci.nsISupports) - .wrappedJSObject; - xps.whenLoaded().then(() => { - updateDisplayedEmail(accountData); - return fxAccounts.setSignedInUser(accountData); - }).then(() => { - // If the user data is verified, we want it to immediately look like - // they are signed in without waiting for messages to bounce around. - if (accountData.verified) { - openPrefs(); - } - this.injectData("message", { status: "login" }); - // until we sort out a better UX, just leave the jelly page in place. - // If the account email is not yet verified, it will tell the user to - // go check their email, but then it will *not* change state after - // the verification completes (the browser will begin syncing, but - // won't notify the user). If the email has already been verified, - // the jelly will say "Welcome! You are successfully signed in as - // EMAIL", but it won't then say "syncing started". - }, (err) => this.injectData("message", { status: "error", error: err }) - ); - }, - - onCanLinkAccount: function(accountData) { - // We need to confirm a relink - see shouldAllowRelink for more - let ok = shouldAllowRelink(accountData.email); - this.injectData("message", { status: "can_link_account", data: { ok: ok } }); - }, - - /** - * onSignOut handler erases the current user's session from the fxaccounts service - */ - onSignOut: function () { - log("Received: 'sign_out'."); - - fxAccounts.signOut().then( - () => this.injectData("message", { status: "sign_out" }), - (err) => this.injectData("message", { status: "error", error: err }) - ); - }, - - handleRemoteCommand: function (evt) { - log('command: ' + evt.detail.command); - let data = evt.detail.data; - - switch (evt.detail.command) { - case "login": - this.onLogin(data); - break; - case "can_link_account": - this.onCanLinkAccount(data); - break; - case "sign_out": - this.onSignOut(data); - break; - default: - log("Unexpected remote command received: " + evt.detail.command + ". Ignoring command."); - break; - } - }, - - injectData: function (type, content) { - return fxAccounts.promiseAccountsSignUpURI().then(authUrl => { - let data = { - type: type, - content: content - }; - this.iframe.contentWindow.postMessage(data, authUrl); - }) - .catch(e => { - console.log("Failed to inject data", e); - setErrorPage("configError"); - }); - }, -}; - - -// Button onclick handlers -function handleOldSync() { - let chromeWin = window - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebNavigation) - .QueryInterface(Ci.nsIDocShellTreeItem) - .rootTreeItem - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindow) - .QueryInterface(Ci.nsIDOMChromeWindow); - let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "old-sync"; - chromeWin.switchToTabHavingURI(url, true); -} - -function getStarted() { - show("remote"); -} - -function retry() { - show("remote"); - wrapper.retry(); -} - -function openPrefs() { - // Bug 1199303 calls for this tab to always be replaced with Preferences - // rather than it opening in a different tab. - window.location = "about:preferences#sync"; -} - -function init() { - fxAccounts.getSignedInUser().then(user => { - // tests in particular might cause the window to start closing before - // getSignedInUser has returned. - if (window.closed) { - return Promise.resolve(); - } - - updateDisplayedEmail(user); - - // Ideally we'd use new URL(document.URL).searchParams, but for about: URIs, - // searchParams is empty. - let urlParams = new URLSearchParams(document.URL.split("?")[1] || ""); - let action = urlParams.get(ACTION_URL_PARAM); - urlParams.delete(ACTION_URL_PARAM); - - switch (action) { - case "signin": - if (user) { - // asking to sign-in when already signed in just shows manage. - show("stage", "manage"); - } else { - return fxAccounts.promiseAccountsSignInURI().then(url => { - show("remote"); - wrapper.init(url, urlParams); - }); - } - break; - case "signup": - if (user) { - // asking to sign-up when already signed in just shows manage. - show("stage", "manage"); - } else { - return fxAccounts.promiseAccountsSignUpURI().then(url => { - show("remote"); - wrapper.init(url, urlParams); - }); - } - break; - case "reauth": - // ideally we would only show this when we know the user is in a - // "must reauthenticate" state - but we don't. - // As the email address will be included in the URL returned from - // promiseAccountsForceSigninURI, just always show it. - return fxAccounts.promiseAccountsForceSigninURI().then(url => { - show("remote"); - wrapper.init(url, urlParams); - }); - default: - // No action specified. - if (user) { - show("stage", "manage"); - } else { - // Attempt a migration if enabled or show the introductory page - // otherwise. - return migrateToDevEdition(urlParams).then(migrated => { - if (!migrated) { - show("stage", "intro"); - // load the remote frame in the background - return fxAccounts.promiseAccountsSignUpURI().then(uri => - wrapper.init(uri, urlParams)); - } - return Promise.resolve(); - }); - } - break; - } - return Promise.resolve(); - }).catch(err => { - console.log("Configuration or sign in error", err); - setErrorPage("configError"); - }); -} - -function setErrorPage(errorType) { - show("stage", errorType); -} - -// Causes the "top-level" element with |id| to be shown - all other top-level -// elements are hidden. Optionally, ensures that only 1 "second-level" element -// inside the top-level one is shown. -function show(id, childId) { - // top-level items are either <div> or <iframe> - let allTop = document.querySelectorAll("body > div, iframe"); - for (let elt of allTop) { - if (elt.getAttribute("id") == id) { - elt.style.display = 'block'; - } else { - elt.style.display = 'none'; - } - } - if (childId) { - // child items are all <div> - let allSecond = document.querySelectorAll("#" + id + " > div"); - for (let elt of allSecond) { - if (elt.getAttribute("id") == childId) { - elt.style.display = 'block'; - } else { - elt.style.display = 'none'; - } - } - } -} - -// Migrate sync data from the default profile to the dev-edition profile. -// Returns a promise of a true value if migration succeeded, or false if it -// failed. -function migrateToDevEdition(urlParams) { - let defaultProfilePath; - try { - defaultProfilePath = window.getDefaultProfilePath(); - } catch (e) {} // no default profile. - let migrateSyncCreds = false; - if (defaultProfilePath) { - try { - migrateSyncCreds = Services.prefs.getBoolPref("identity.fxaccounts.migrateToDevEdition"); - } catch (e) {} - } - - if (!migrateSyncCreds) { - return Promise.resolve(false); - } - - Cu.import("resource://gre/modules/osfile.jsm"); - let fxAccountsStorage = OS.Path.join(defaultProfilePath, fxAccountsCommon.DEFAULT_STORAGE_FILENAME); - return OS.File.read(fxAccountsStorage, { encoding: "utf-8" }).then(text => { - let accountData = JSON.parse(text).accountData; - updateDisplayedEmail(accountData); - return fxAccounts.setSignedInUser(accountData); - }).then(() => { - return fxAccounts.promiseAccountsForceSigninURI().then(url => { - show("remote"); - wrapper.init(url, urlParams); - }); - }).then(null, error => { - log("Failed to migrate FX Account: " + error); - show("stage", "intro"); - // load the remote frame in the background - fxAccounts.promiseAccountsSignUpURI().then(uri => { - wrapper.init(uri, urlParams) - }).catch(e => { - console.log("Failed to load signup page", e); - setErrorPage("configError"); - }); - }).then(() => { - // Reset the pref after migration. - Services.prefs.setBoolPref("identity.fxaccounts.migrateToDevEdition", false); - return true; - }).then(null, err => { - Cu.reportError("Failed to reset the migrateToDevEdition pref: " + err); - return false; - }); -} - -// Helper function that returns the path of the default profile on disk. Will be -// overridden in tests. -function getDefaultProfilePath() { - let defaultProfile = Cc["@mozilla.org/toolkit/profile-service;1"] - .getService(Ci.nsIToolkitProfileService) - .defaultProfile; - return defaultProfile.rootDir.path; -} - -document.addEventListener("DOMContentLoaded", function onload() { - document.removeEventListener("DOMContentLoaded", onload, true); - init(); - var buttonGetStarted = document.getElementById('buttonGetStarted'); - buttonGetStarted.addEventListener('click', getStarted); - - var buttonRetry = document.getElementById('buttonRetry'); - buttonRetry.addEventListener('click', retry); - - var oldsync = document.getElementById('oldsync'); - oldsync.addEventListener('click', handleOldSync); - - var buttonOpenPrefs = document.getElementById('buttonOpenPrefs') - buttonOpenPrefs.addEventListener('click', openPrefs); -}, true); - -function initObservers() { - function observe(subject, topic, data) { - log("about:accounts observed " + topic); - if (topic == fxAccountsCommon.ONLOGOUT_NOTIFICATION) { - // All about:account windows get changed to action=signin on logout. - window.location = "about:accounts?action=signin"; - return; - } - - // must be onverified - we want to open preferences. - openPrefs(); - } - - for (let topic of OBSERVER_TOPICS) { - Services.obs.addObserver(observe, topic, false); - } - window.addEventListener("unload", function(event) { - log("about:accounts unloading") - for (let topic of OBSERVER_TOPICS) { - Services.obs.removeObserver(observe, topic); - } - }); -} -initObservers(); diff --git a/application/basilisk/base/content/aboutaccounts/aboutaccounts.xhtml b/application/basilisk/base/content/aboutaccounts/aboutaccounts.xhtml deleted file mode 100644 index 475f0e86f..000000000 --- a/application/basilisk/base/content/aboutaccounts/aboutaccounts.xhtml +++ /dev/null @@ -1,112 +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/. --> -<!DOCTYPE html [ - <!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> - %htmlDTD; - <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> - %brandDTD; - <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd"> - %globalDTD; - <!ENTITY % aboutAccountsDTD SYSTEM "chrome://browser/locale/aboutAccounts.dtd"> - %aboutAccountsDTD; - <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd"> - %syncBrandDTD; -]> - -<html xmlns="http://www.w3.org/1999/xhtml" dir="&locale.dir;"> - <head> - <title>&syncBrand.fullName.label;</title> - <meta name="viewport" content="width=device-width"/> - - - <link rel="icon" type="image/png" id="favicon" - href="chrome://branding/content/icon32.png"/> - <link rel="stylesheet" - href="chrome://browser/content/aboutaccounts/normalize.css" - type="text/css" /> - <link rel="stylesheet" - href="chrome://browser/content/aboutaccounts/main.css" - type="text/css" /> - <link rel="stylesheet" - href="chrome://browser/content/aboutaccounts/aboutaccounts.css" - type="text/css" /> - </head> - <body> - <div id="stage"> - - <div id="manage"> - <header> - <h1>&aboutAccounts.connected;</h1> - <div id="email"></div> - </header> - - <section> - <div class="graphic graphic-sync-intro"> </div> - - <div class="button-row"> - <button id="buttonOpenPrefs" class="button" href="#" tabindex="0">&aboutAccountsConfig.syncPreferences.label;</button> - </div> - </section> - </div> - - <div id="intro"> - <header> - <h1>&aboutAccounts.welcome;</h1> - </header> - - <section> - <div class="graphic graphic-sync-intro"> </div> - - <div class="description">&aboutAccountsConfig.description;</div> - - <div class="button-row"> - <button id="buttonGetStarted" class="button" tabindex="1">&aboutAccountsConfig.startButton.label;</button> - </div> - - <div class="links"> - <button id="oldsync" tabindex="2">&aboutAccountsConfig.useOldSync.label;</button> - </div> - </section> - </div> - - <div id="networkError"> - <header> - <h1>&aboutAccounts.noConnection.title;</h1> - </header> - - <section> - <div class="graphic graphic-sync-intro"> </div> - - <div class="description">&aboutAccounts.noConnection.description;</div> - - <div class="button-row"> - <button id="buttonRetry" class="button" tabindex="3">&aboutAccounts.noConnection.retry;</button> - </div> - </section> - </div> - - <div id="configError"> - <header> - <h1>&aboutAccounts.badConfig.title;</h1> - </header> - - <section> - <div class="graphic graphic-sync-intro"> </div> - - <div class="description">&aboutAccounts.badConfig.description;</div> - - </section> - </div> - - </div> - - <iframe mozframetype="content" id="remote" /> - - <script type="application/javascript;version=1.8" - src="chrome://browser/content/utilityOverlay.js"/> - <script type="text/javascript;version=1.8" - src="chrome://browser/content/aboutaccounts/aboutaccounts.js" /> - </body> -</html> diff --git a/application/basilisk/base/content/aboutaccounts/images/fox.png b/application/basilisk/base/content/aboutaccounts/images/fox.png Binary files differdeleted file mode 100644 index 83af78d6c..000000000 --- a/application/basilisk/base/content/aboutaccounts/images/fox.png +++ /dev/null diff --git a/application/basilisk/base/content/aboutaccounts/images/graphic_sync_intro.png b/application/basilisk/base/content/aboutaccounts/images/graphic_sync_intro.png Binary files differdeleted file mode 100644 index ff5f482f0..000000000 --- a/application/basilisk/base/content/aboutaccounts/images/graphic_sync_intro.png +++ /dev/null diff --git a/application/basilisk/base/content/aboutaccounts/images/graphic_sync_intro@2x.png b/application/basilisk/base/content/aboutaccounts/images/graphic_sync_intro@2x.png Binary files differdeleted file mode 100644 index 89fda0681..000000000 --- a/application/basilisk/base/content/aboutaccounts/images/graphic_sync_intro@2x.png +++ /dev/null diff --git a/application/basilisk/base/content/aboutaccounts/main.css b/application/basilisk/base/content/aboutaccounts/main.css deleted file mode 100644 index 8f4c3b34e..000000000 --- a/application/basilisk/base/content/aboutaccounts/main.css +++ /dev/null @@ -1,166 +0,0 @@ -*, -*:before, -*:after { - box-sizing: border-box; -} - -html { - background-color: #F2F2F2; - height: 100%; -} - -body { - color: #424f59; - font: message-box; - font-size: 14px; - height: 100%; -} - -a { - color: #0095dd; - cursor: pointer; /* Use the correct cursor for anchors without an href */ -} - -a:active { - outline: none; -} - -a:focus { - outline: 1px dotted #0095dd; -} - - -a.no-underline { - text-decoration: none; -} - -#stage { - background:#fff; - border-radius: 5px; - box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.25); - margin: 0 auto; - min-height: 300px; - padding: 60px 40px 40px 40px; - position: relative; - text-align: center; - top: 80px; - width: 420px; -} - -header h1 -{ - font-size: 24px; - font-weight: 200; - line-height: 1em; -} - -#intro header h1 { - margin: 0 0 32px 0; -} - -#manage header h1 { - margin: 0 0 12px 0; -} - -#manage header #email { - margin-bottom: 23px; - color: rgb(138, 155, 168); - font-size: 19px; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -} - -.description { - font-size: 18px; -} - -.button-row { - margin-top: 45px; - margin-bottom:20px; -} - -.button-row button, -.button-row a.button { - background: #0095dd; - border: none; - border-radius: 5px; - color: #FFFFFF; - cursor: pointer; - font-size: 24px; - padding: 15px 0; - transition-duration: 150ms; - transition-property: background-color; - width: 100%; -} - -.button-row a.button { - display: inline-block; - text-decoration: none; -} - -.button-row a.button:active, -.button-row a.button:hover, -.button-row a.button:focus, -.button-row button:active, -.button-row button:hover, -.button-row button:focus { - background: #08c; -} - - -.graphic-sync-intro { - background-image: url(images/graphic_sync_intro.png); - background-repeat: no-repeat; - background-size: 150px 195px; - height: 195px; - margin: 0 auto; - overflow: hidden; - text-indent: 100%; - white-space: nowrap; - width: 150px; -} - -.description, -.button-row { - margin-top: 30px; -} - -.links { - margin: 20px 0; -} - -@media only screen and (max-width: 500px) { - html { - background: #fff; - } - - #stage { - box-shadow: none; - margin: 30px auto 0 auto; - min-height: none; - min-width: 320px; - padding: 0 10px; - width: 100%; - } - - .button-row { - margin-top: 20px; - } - - .button-row button, - .button-row a.button { - padding: 10px 0; - } - -} - -/* Retina */ -@media -only screen and (min-device-pixel-ratio: 2), -only screen and ( min-resolution: 192dpi), -only screen and ( min-resolution: 2dppx) { - .graphic-sync-intro { - background-image: url(images/graphic_sync_intro@2x.png); - } -} diff --git a/application/basilisk/base/content/aboutaccounts/normalize.css b/application/basilisk/base/content/aboutaccounts/normalize.css deleted file mode 100644 index c02ab25de..000000000 --- a/application/basilisk/base/content/aboutaccounts/normalize.css +++ /dev/null @@ -1,402 +0,0 @@ -/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
-
-/* ==========================================================================
- HTML5 display definitions
- ========================================================================== */
-
-/**
- * Correct `block` display not defined in IE 8/9.
- */
-
-article,
-aside,
-details,
-figcaption,
-figure,
-footer,
-header,
-hgroup,
-main,
-nav,
-section,
-summary {
- display: block;
-}
-
-/**
- * Correct `inline-block` display not defined in IE 8/9.
- */
-
-audio,
-canvas,
-video {
- display: inline-block;
-}
-
-/**
- * Prevent modern browsers from displaying `audio` without controls.
- * Remove excess height in iOS 5 devices.
- */
-
-audio:not([controls]) {
- display: none;
- height: 0;
-}
-
-/**
- * Address `[hidden]` styling not present in IE 8/9.
- * Hide the `template` element in IE, Safari, and Firefox < 22.
- */
-
-[hidden],
-template {
- display: none;
-}
-
-/* ==========================================================================
- Base
- ========================================================================== */
-
-/**
- * 1. Set default font family to sans-serif.
- * 2. Prevent iOS text size adjust after orientation change, without disabling
- * user zoom.
- */
-
-html {
- font-family: sans-serif; /* 1 */
- -ms-text-size-adjust: 100%; /* 2 */
- -webkit-text-size-adjust: 100%; /* 2 */
-}
-
-/**
- * Remove default margin.
- */
-
-body {
- margin: 0;
-}
-
-/* ==========================================================================
- Links
- ========================================================================== */
-
-/**
- * Remove the gray background color from active links in IE 10.
- */
-
-a {
- background: transparent;
-}
-
-/**
- * Address `outline` inconsistency between Chrome and other browsers.
- */
-
-a:focus {
- outline: thin dotted;
-}
-
-/**
- * Improve readability when focused and also mouse hovered in all browsers.
- */
-
-a:active,
-a:hover {
- outline: 0;
-}
-
-/* ==========================================================================
- Typography
- ========================================================================== */
-
-/**
- * Address variable `h1` font-size and margin within `section` and `article`
- * contexts in Firefox 4+, Safari 5, and Chrome.
- */
-
-h1 {
- font-size: 2em;
- margin: 0.67em 0;
-}
-
-/**
- * Address styling not present in IE 8/9, Safari 5, and Chrome.
- */
-
-abbr[title] {
- border-bottom: 1px dotted;
-}
-
-/**
- * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
- */
-
-b,
-strong {
- font-weight: bold;
-}
-
-/**
- * Address styling not present in Safari 5 and Chrome.
- */
-
-dfn {
- font-style: italic;
-}
-
-/**
- * Address differences between Firefox and other browsers.
- */
-
-hr {
- box-sizing: content-box;
- height: 0;
-}
-
-/**
- * Address styling not present in IE 8/9.
- */
-
-mark {
- background: #ff0;
- color: #000;
-}
-
-/**
- * Correct font family set oddly in Safari 5 and Chrome.
- */
-
-code,
-kbd,
-pre,
-samp {
- font-family: monospace, serif;
- font-size: 1em;
-}
-
-/**
- * Improve readability of pre-formatted text in all browsers.
- */
-
-pre {
- white-space: pre-wrap;
-}
-
-/**
- * Set consistent quote types.
- */
-
-q {
- quotes: "\201C" "\201D" "\2018" "\2019";
-}
-
-/**
- * Address inconsistent and variable font size in all browsers.
- */
-
-small {
- font-size: 80%;
-}
-
-/**
- * Prevent `sub` and `sup` affecting `line-height` in all browsers.
- */
-
-sub,
-sup {
- font-size: 75%;
- line-height: 0;
- position: relative;
- vertical-align: baseline;
-}
-
-sup {
- top: -0.5em;
-}
-
-sub {
- bottom: -0.25em;
-}
-
-/* ==========================================================================
- Embedded content
- ========================================================================== */
-
-/**
- * Remove border when inside `a` element in IE 8/9.
- */
-
-img {
- border: 0;
-}
-
-/**
- * Correct overflow displayed oddly in IE 9.
- */
-
-svg:not(:root) {
- overflow: hidden;
-}
-
-/* ==========================================================================
- Figures
- ========================================================================== */
-
-/**
- * Address margin not present in IE 8/9 and Safari 5.
- */
-
-figure {
- margin: 0;
-}
-
-/* ==========================================================================
- Forms
- ========================================================================== */
-
-/**
- * Define consistent border, margin, and padding.
- */
-
-fieldset {
- border: 1px solid #c0c0c0;
- margin: 0 2px;
- padding: 0.35em 0.625em 0.75em;
-}
-
-/**
- * 1. Correct `color` not being inherited in IE 8/9.
- * 2. Remove padding so people aren't caught out if they zero out fieldsets.
- */
-
-legend {
- border: 0; /* 1 */
- padding: 0; /* 2 */
-}
-
-/**
- * 1. Correct font family not being inherited in all browsers.
- * 2. Correct font size not being inherited in all browsers.
- * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
- */
-
-button,
-input,
-select,
-textarea {
- font-family: inherit; /* 1 */
- font-size: 100%; /* 2 */
- margin: 0; /* 3 */
-}
-
-/**
- * Address Firefox 4+ setting `line-height` on `input` using `!important` in
- * the UA stylesheet.
- */
-
-button,
-input {
- line-height: normal;
-}
-
-/**
- * Address inconsistent `text-transform` inheritance for `button` and `select`.
- * All other form control elements do not inherit `text-transform` values.
- * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
- * Correct `select` style inheritance in Firefox 4+ and Opera.
- */
-
-button,
-select {
- text-transform: none;
-}
-
-/**
- * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
- * and `video` controls.
- * 2. Correct inability to style clickable `input` types in iOS.
- * 3. Improve usability and consistency of cursor style between image-type
- * `input` and others.
- */
-
-button,
-html input[type="button"], /* 1 */
-input[type="reset"],
-input[type="submit"] {
- -webkit-appearance: button; /* 2 */
- cursor: pointer; /* 3 */
-}
-
-/**
- * Re-set default cursor for disabled elements.
- */
-
-button[disabled],
-html input[disabled] {
- cursor: default;
-}
-
-/**
- * 1. Address box sizing set to `content-box` in IE 8/9/10.
- * 2. Remove excess padding in IE 8/9/10.
- */
-
-input[type="checkbox"],
-input[type="radio"] {
- box-sizing: border-box; /* 1 */
- padding: 0; /* 2 */
-}
-
-/**
- * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
- * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome.
- */
-
-input[type="search"] {
- -webkit-appearance: textfield; /* 1 */
- box-sizing: content-box; /* 2 */
-}
-
-/**
- * Remove inner padding and search cancel button in Safari 5 and Chrome
- * on OS X.
- */
-
-input[type="search"]::-webkit-search-cancel-button,
-input[type="search"]::-webkit-search-decoration {
- -webkit-appearance: none;
-}
-
-/**
- * Remove inner padding and border in Firefox 4+.
- */
-
-button::-moz-focus-inner,
-input::-moz-focus-inner {
- border: 0;
- padding: 0;
-}
-
-/**
- * 1. Remove default vertical scrollbar in IE 8/9.
- * 2. Improve readability and alignment in all browsers.
- */
-
-textarea {
- overflow: auto; /* 1 */
- vertical-align: top; /* 2 */
-}
-
-/* ==========================================================================
- Tables
- ========================================================================== */
-
-/**
- * Remove most spacing between table cells.
- */
-
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
diff --git a/application/basilisk/base/content/abouthome/aboutHome.css b/application/basilisk/base/content/abouthome/aboutHome.css index bc3f9882c..86f74727f 100644 --- a/application/basilisk/base/content/abouthome/aboutHome.css +++ b/application/basilisk/base/content/abouthome/aboutHome.css @@ -283,9 +283,11 @@ body[narrow] #restorePreviousSession { content: url("chrome://browser/content/abouthome/addons.png"); } +%ifdef MOZ_SERVICES_SYNC #sync::before { content: url("chrome://browser/content/abouthome/sync.png"); } +%endif #settings::before { content: url("chrome://browser/content/abouthome/settings.png"); @@ -369,9 +371,11 @@ body[narrow] #restorePreviousSession::before { content: url("chrome://browser/content/abouthome/addons@2x.png"); } +%ifdef MOZ_SERVICES_SYNC #sync::before { content: url("chrome://browser/content/abouthome/sync@2x.png"); } +%endif #settings::before { content: url("chrome://browser/content/abouthome/settings@2x.png"); diff --git a/application/basilisk/base/content/abouthome/aboutHome.xhtml b/application/basilisk/base/content/abouthome/aboutHome.xhtml index 22bf2e7e8..90daad2dc 100644 --- a/application/basilisk/base/content/abouthome/aboutHome.xhtml +++ b/application/basilisk/base/content/abouthome/aboutHome.xhtml @@ -54,7 +54,9 @@ <button class="launchButton" id="bookmarks">&abouthome.bookmarksButton.label;</button> <button class="launchButton" id="history">&abouthome.historyButton.label;</button> <button class="launchButton" id="addons">&abouthome.addonsButton.label;</button> +#ifdef MOZ_SERVICES_SYNC <button class="launchButton" id="sync">&abouthome.syncButton.label;</button> +#endif #ifdef XP_WIN <button class="launchButton" id="settings">&abouthome.preferencesButtonWin.label;</button> #else diff --git a/application/basilisk/base/content/browser-addons.js b/application/basilisk/base/content/browser-addons.js index 1d881536a..733114ba9 100644 --- a/application/basilisk/base/content/browser-addons.js +++ b/application/basilisk/base/content/browser-addons.js @@ -145,10 +145,6 @@ const gXPInstallObserver = { for (let install of installInfo.installs) install.install(); installInfo = null; - - Services.telemetry - .getHistogramById("SECURITY_UI") - .add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL_CLICK_THROUGH); }; break; } @@ -208,10 +204,6 @@ const gXPInstallObserver = { options); removeNotificationOnEnd(popup, installInfo.installs); - - Services.telemetry - .getHistogramById("SECURITY_UI") - .add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL); }, observe: function (aSubject, aTopic, aData) @@ -262,8 +254,6 @@ const gXPInstallObserver = { messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage", [brandShortName]); - let secHistogram = Components.classes["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry).getHistogramById("SECURITY_UI"); - secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED); let popup = PopupNotifications.show(browser, notificationID, messageString, anchorID, null, null, options); @@ -273,17 +263,14 @@ const gXPInstallObserver = { messageString = gNavigatorBundle.getFormattedString("xpinstallPromptMessage", [brandShortName]); - let secHistogram = Components.classes["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry).getHistogramById("SECURITY_UI"); action = { label: gNavigatorBundle.getString("xpinstallPromptAllowButton"), accessKey: gNavigatorBundle.getString("xpinstallPromptAllowButton.accesskey"), callback: function() { - secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED_CLICK_THROUGH); installInfo.install(); } }; - secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_ADDON_ASKING_PREVENTED); let popup = PopupNotifications.show(browser, notificationID, messageString, anchorID, action, null, options); diff --git a/application/basilisk/base/content/browser-context.inc b/application/basilisk/base/content/browser-context.inc index 36e0478af..d400cd0b2 100644 --- a/application/basilisk/base/content/browser-context.inc +++ b/application/basilisk/base/content/browser-context.inc @@ -51,23 +51,11 @@ label="&openLinkCmdInCurrent.label;" accesskey="&openLinkCmdInCurrent.accesskey;" oncommand="gContextMenu.openLinkInCurrent();"/> -# label and data-usercontextid are dynamically set. - <menuitem id="context-openlinkincontainertab" - accesskey="&openLinkCmdInTab.accesskey;" - oncommand="gContextMenu.openLinkInTab(event);"/> +# label is dynamically set. <menuitem id="context-openlinkintab" label="&openLinkCmdInTab.label;" accesskey="&openLinkCmdInTab.accesskey;" - data-usercontextid="0" - oncommand="gContextMenu.openLinkInTab(event);"/> - - <menu id="context-openlinkinusercontext-menu" - label="&openLinkCmdInContainerTab.label;" - accesskey="&openLinkCmdInContainerTab.accesskey;" - hidden="true"> - <menupopup oncommand="gContextMenu.openLinkInTab(event);" - onpopupshowing="return gContextMenu.createContainerMenu(event);" /> - </menu> + oncommand="gContextMenu.openLinkInTab();"/> <menuitem id="context-openlink" label="&openLinkCmd.label;" @@ -261,13 +249,6 @@ accesskey="&savePageCmd.accesskey2;" oncommand="gContextMenu.savePageAs();"/> <menuseparator id="context-sep-sendpagetodevice" hidden="true"/> - <menu id="context-sendpagetodevice" - label="&sendPageToDevice.label;" - accesskey="&sendPageToDevice.accesskey;" - hidden="true"> - <menupopup id="context-sendpagetodevice-popup" - onpopupshowing="(() => { let browser = gBrowser || getPanelBrowser(); gFxAccounts.populateSendTabToDevicesMenu(event.target, browser.currentURI.spec, browser.contentTitle); })()"/> - </menu> <menuseparator id="context-sep-viewbgimage"/> <menuitem id="context-viewbgimage" label="&viewBGImageCmd.label;" @@ -308,13 +289,6 @@ <menuitem id="context-searchselect" oncommand="BrowserSearch.loadSearchFromContext(this.searchTerms);"/> <menuseparator id="context-sep-sendlinktodevice" hidden="true"/> - <menu id="context-sendlinktodevice" - label="&sendLinkToDevice.label;" - accesskey="&sendLinkToDevice.accesskey;" - hidden="true"> - <menupopup id="context-sendlinktodevice-popup" - onpopupshowing="gFxAccounts.populateSendTabToDevicesMenu(event.target, gContextMenu.linkURL, gContextMenu.linkTextStr);"/> - </menu> <menuseparator id="frame-sep"/> <menu id="frame" label="&thisFrameMenu.label;" accesskey="&thisFrameMenu.accesskey;"> <menupopup> diff --git a/application/basilisk/base/content/browser-devedition.js b/application/basilisk/base/content/browser-devedition.js deleted file mode 100644 index 0dc1e94da..000000000 --- a/application/basilisk/base/content/browser-devedition.js +++ /dev/null @@ -1,142 +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/. */ - -/** - * Listeners for the DevEdition theme. This adds an extra stylesheet - * to browser.xul if a pref is set and no other themes are applied. - */ -var DevEdition = { - _devtoolsThemePrefName: "devtools.theme", - styleSheetLocation: "chrome://browser/skin/devedition.css", - styleSheet: null, - initialized: false, - - get isStyleSheetEnabled() { - return this.styleSheet && !this.styleSheet.sheet.disabled; - }, - - get isThemeCurrentlyApplied() { - let theme = LightweightThemeManager.currentTheme; - return theme && theme.id == "firefox-devedition@mozilla.org"; - }, - - init: function () { - this.initialized = true; - Services.prefs.addObserver(this._devtoolsThemePrefName, this, false); - Services.obs.addObserver(this, "lightweight-theme-styling-update", false); - Services.obs.addObserver(this, "lightweight-theme-window-updated", false); - this._updateDevtoolsThemeAttribute(); - - if (this.isThemeCurrentlyApplied) { - this._toggleStyleSheet(true); - } - }, - - createStyleSheet: function() { - let styleSheetAttr = `href="${this.styleSheetLocation}" type="text/css"`; - this.styleSheet = document.createProcessingInstruction( - "xml-stylesheet", styleSheetAttr); - this.styleSheet.addEventListener("load", this); - document.insertBefore(this.styleSheet, document.documentElement); - this.styleSheet.sheet.disabled = true; - }, - - observe: function (subject, topic, data) { - if (topic == "lightweight-theme-styling-update") { - let newTheme = JSON.parse(data); - if (newTheme && newTheme.id == "firefox-devedition@mozilla.org") { - this._toggleStyleSheet(true); - } else { - this._toggleStyleSheet(false); - } - } else if (topic == "lightweight-theme-window-updated" && subject == window) { - this._updateLWTBrightness(); - } - - if (topic == "nsPref:changed" && data == this._devtoolsThemePrefName) { - this._updateDevtoolsThemeAttribute(); - } - }, - - _inferBrightness: function() { - ToolbarIconColor.inferFromText(); - // Get an inverted full screen button if the dark theme is applied. - if (this.isStyleSheetEnabled && - document.documentElement.getAttribute("devtoolstheme") == "dark") { - document.documentElement.setAttribute("brighttitlebarforeground", "true"); - } else { - document.documentElement.removeAttribute("brighttitlebarforeground"); - } - }, - - _updateLWTBrightness() { - if (this.isThemeCurrentlyApplied) { - let devtoolsTheme = Services.prefs.getCharPref(this._devtoolsThemePrefName); - let textColor = devtoolsTheme == "dark" ? "bright" : "dark"; - document.documentElement.setAttribute("lwthemetextcolor", textColor); - } - }, - - _updateDevtoolsThemeAttribute: function() { - // Set an attribute on root element to make it possible - // to change colors based on the selected devtools theme. - let devtoolsTheme = Services.prefs.getCharPref(this._devtoolsThemePrefName); - if (devtoolsTheme != "dark") { - devtoolsTheme = "light"; - } - document.documentElement.setAttribute("devtoolstheme", devtoolsTheme); - this._updateLWTBrightness(); - this._inferBrightness(); - }, - - handleEvent: function(e) { - if (e.type === "load") { - this.styleSheet.removeEventListener("load", this); - this.refreshBrowserDisplay(); - } - }, - - refreshBrowserDisplay: function() { - // Don't touch things on the browser if gBrowserInit.onLoad hasn't - // yet fired. - if (this.initialized) { - gBrowser.tabContainer._positionPinnedTabs(); - this._inferBrightness(); - } - }, - - _toggleStyleSheet: function(deveditionThemeEnabled) { - let wasEnabled = this.isStyleSheetEnabled; - if (deveditionThemeEnabled && !wasEnabled) { - // The stylesheet may not have been created yet if it wasn't - // needed on initial load. Make it now. - if (!this.styleSheet) { - this.createStyleSheet(); - } - this.styleSheet.sheet.disabled = false; - this.refreshBrowserDisplay(); - } else if (!deveditionThemeEnabled && wasEnabled) { - this.styleSheet.sheet.disabled = true; - this.refreshBrowserDisplay(); - } - }, - - uninit: function () { - Services.prefs.removeObserver(this._devtoolsThemePrefName, this); - Services.obs.removeObserver(this, "lightweight-theme-styling-update", false); - Services.obs.removeObserver(this, "lightweight-theme-window-updated", false); - if (this.styleSheet) { - this.styleSheet.removeEventListener("load", this); - } - this.styleSheet = null; - } -}; - -// If the DevEdition theme is going to be applied in gBrowserInit.onLoad, -// then preload it now. This prevents a flash of unstyled content where the -// normal theme is applied while the DevEdition stylesheet is loading. -if (!AppConstants.RELEASE_OR_BETA && - this != Services.appShell.hiddenDOMWindow && DevEdition.isThemeCurrentlyApplied) { - DevEdition.createStyleSheet(); -} diff --git a/application/basilisk/base/content/browser-doctype.inc b/application/basilisk/base/content/browser-doctype.inc index ad08f4b03..30d70ccea 100644 --- a/application/basilisk/base/content/browser-doctype.inc +++ b/application/basilisk/base/content/browser-doctype.inc @@ -19,7 +19,9 @@ #endif <!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd"> %aboutHomeDTD; +#ifdef MOZ_SERVICES_SYNC <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd"> %syncBrandDTD; +#endif ]> diff --git a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js index dbc9478c1..b26a31f78 100644 --- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js +++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js @@ -322,15 +322,9 @@ var FullScreen = { document.addEventListener("popuphidden", this._setPopupOpen, false); // 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()) { - let rect = gBrowser.mPanelContainer.getBoundingClientRect(); - this._mouseTargetRect = { - top: rect.top + 50, - bottom: rect.bottom, - left: rect.left, - right: rect.right - }; - MousePosTracker.addListener(this); + if (gPrefService.getBoolPref("browser.fullscreen.autohide")) { + gBrowser.mPanelContainer.addEventListener("mousemove", + this._collapseCallback, false); } // In DOM fullscreen mode, we hide toolbars with CSS if (!document.fullscreenElement) @@ -379,12 +373,10 @@ var FullScreen = { let topWin = event.target.ownerGlobal.top; browser = gBrowser.getBrowserForContentWindow(topWin); } - TelemetryStopwatch.start("FULLSCREEN_CHANGE_MS"); this.enterDomFullscreen(browser); break; } case "MozDOMFullscreen:Exited": - TelemetryStopwatch.start("FULLSCREEN_CHANGE_MS"); this.cleanupDomFullscreen(); break; } @@ -410,7 +402,6 @@ var FullScreen = { } case "DOMFullscreen:Painted": { Services.obs.notifyObservers(window, "fullscreen-painted", ""); - TelemetryStopwatch.finish("FULLSCREEN_CHANGE_MS"); break; } } @@ -471,7 +462,8 @@ var FullScreen = { cleanup: function () { if (!window.fullScreen) { - MousePosTracker.removeListener(this); + gBrowser.mPanelContainer.removeEventListener("mousemove", + this._collapseCallback, false); document.removeEventListener("keypress", this._keyToggleCallback, false); document.removeEventListener("popupshown", this._setPopupOpen, false); document.removeEventListener("popuphidden", this._setPopupOpen, false); @@ -500,17 +492,12 @@ var FullScreen = { .getInterface(Ci.nsIDOMWindowUtils); }, - getMouseTargetRect: function() - { - return this._mouseTargetRect; - }, - // Event callbacks _expandCallback: function() { FullScreen.showNavToolbox(); }, - onMouseEnter: function() + _collapseCallback: function() { FullScreen.hideNavToolbox(); }, @@ -591,14 +578,8 @@ var FullScreen = { // Track whether mouse is near the toolbox if (trackMouse && !this.useLionFullScreen) { - let rect = gBrowser.mPanelContainer.getBoundingClientRect(); - this._mouseTargetRect = { - top: rect.top + 50, - bottom: rect.bottom, - left: rect.left, - right: rect.right - }; - MousePosTracker.addListener(this); + gBrowser.mPanelContainer.addEventListener("mousemove", + this._collapseCallback, false); } this._isChromeCollapsed = false; @@ -625,7 +606,8 @@ var FullScreen = { gNavToolbox.style.marginTop = -gNavToolbox.getBoundingClientRect().height + "px"; this._isChromeCollapsed = true; - MousePosTracker.removeListener(this); + gBrowser.mPanelContainer.removeEventListener("mousemove", + this._collapseCallback, false); }, _updateToolbars: function (aEnterFS) { diff --git a/application/basilisk/base/content/browser-fxaccounts.js b/application/basilisk/base/content/browser-fxaccounts.js deleted file mode 100644 index 0bbce3e26..000000000 --- a/application/basilisk/base/content/browser-fxaccounts.js +++ /dev/null @@ -1,459 +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/. */ - -var gFxAccounts = { - - SYNC_MIGRATION_NOTIFICATION_TITLE: "fxa-migration", - - _initialized: false, - _inCustomizationMode: false, - _cachedProfile: null, - - get weave() { - delete this.weave; - return this.weave = Cc["@mozilla.org/weave/service;1"] - .getService(Ci.nsISupports) - .wrappedJSObject; - }, - - get topics() { - // Do all this dance to lazy-load FxAccountsCommon. - delete this.topics; - return this.topics = [ - "weave:service:ready", - "weave:service:login:change", - "weave:service:setup-complete", - "weave:service:sync:error", - "weave:ui:login:error", - "fxa-migration:state-changed", - this.FxAccountsCommon.ONLOGIN_NOTIFICATION, - this.FxAccountsCommon.ONLOGOUT_NOTIFICATION, - this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION, - ]; - }, - - get panelUIFooter() { - delete this.panelUIFooter; - return this.panelUIFooter = document.getElementById("PanelUI-footer-fxa"); - }, - - get panelUIStatus() { - delete this.panelUIStatus; - return this.panelUIStatus = document.getElementById("PanelUI-fxa-status"); - }, - - get panelUIAvatar() { - delete this.panelUIAvatar; - return this.panelUIAvatar = document.getElementById("PanelUI-fxa-avatar"); - }, - - get panelUILabel() { - delete this.panelUILabel; - return this.panelUILabel = document.getElementById("PanelUI-fxa-label"); - }, - - get panelUIIcon() { - delete this.panelUIIcon; - return this.panelUIIcon = document.getElementById("PanelUI-fxa-icon"); - }, - - get strings() { - delete this.strings; - return this.strings = Services.strings.createBundle( - "chrome://browser/locale/accounts.properties" - ); - }, - - get loginFailed() { - // Referencing Weave.Service will implicitly initialize sync, and we don't - // want to force that - so first check if it is ready. - let service = Cc["@mozilla.org/weave/service;1"] - .getService(Components.interfaces.nsISupports) - .wrappedJSObject; - if (!service.ready) { - return false; - } - // LOGIN_FAILED_LOGIN_REJECTED explicitly means "you must log back in". - // All other login failures are assumed to be transient and should go - // away by themselves, so aren't reflected here. - return Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED; - }, - - get sendTabToDeviceEnabled() { - return Services.prefs.getBoolPref("services.sync.sendTabToDevice.enabled"); - }, - - get remoteClients() { - return Weave.Service.clientsEngine.remoteClients - .sort((a, b) => a.name.localeCompare(b.name)); - }, - - init: function () { - // Bail out if we're already initialized and for pop-up windows. - if (this._initialized || !window.toolbar.visible) { - return; - } - - for (let topic of this.topics) { - Services.obs.addObserver(this, topic, false); - } - - gNavToolbox.addEventListener("customizationstarting", this); - gNavToolbox.addEventListener("customizationending", this); - - EnsureFxAccountsWebChannel(); - this._initialized = true; - - this.updateUI(); - }, - - uninit: function () { - if (!this._initialized) { - return; - } - - for (let topic of this.topics) { - Services.obs.removeObserver(this, topic); - } - - this._initialized = false; - }, - - observe: function (subject, topic, data) { - switch (topic) { - case "fxa-migration:state-changed": - this.onMigrationStateChanged(data, subject); - break; - case this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION: - this._cachedProfile = null; - // Fallthrough intended - default: - this.updateUI(); - break; - } - }, - - onMigrationStateChanged: function () { - // Since we nuked most of the migration code, this notification will fire - // once after legacy Sync has been disconnected (and should never fire - // again) - let nb = window.document.getElementById("global-notificationbox"); - - let msg = this.strings.GetStringFromName("autoDisconnectDescription") - let signInLabel = this.strings.GetStringFromName("autoDisconnectSignIn.label"); - let signInAccessKey = this.strings.GetStringFromName("autoDisconnectSignIn.accessKey"); - let learnMoreLink = this.fxaMigrator.learnMoreLink; - - let buttons = [ - { - label: signInLabel, - accessKey: signInAccessKey, - callback: () => { - this.openPreferences(); - } - } - ]; - - let fragment = document.createDocumentFragment(); - let msgNode = document.createTextNode(msg); - fragment.appendChild(msgNode); - if (learnMoreLink) { - let link = document.createElement("label"); - link.className = "text-link"; - link.setAttribute("value", learnMoreLink.text); - link.href = learnMoreLink.href; - fragment.appendChild(link); - } - - nb.appendNotification(fragment, - this.SYNC_MIGRATION_NOTIFICATION_TITLE, - undefined, - nb.PRIORITY_WARNING_LOW, - buttons); - - // ensure the hamburger menu reflects the newly disconnected state. - this.updateAppMenuItem(); - }, - - handleEvent: function (event) { - this._inCustomizationMode = event.type == "customizationstarting"; - this.updateAppMenuItem(); - }, - - updateUI: function () { - // It's possible someone signed in to FxA after seeing our notification - // about "Legacy Sync migration" (which now is actually "Legacy Sync - // auto-disconnect") so kill that notification if it still exists. - let nb = window.document.getElementById("global-notificationbox"); - let n = nb.getNotificationWithValue(this.SYNC_MIGRATION_NOTIFICATION_TITLE); - if (n) { - nb.removeNotification(n, true); - } - - this.updateAppMenuItem(); - }, - - // Note that updateAppMenuItem() returns a Promise that's only used by tests. - updateAppMenuItem: function () { - let profileInfoEnabled = false; - try { - profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled"); - } catch (e) { } - - // Bail out if FxA is disabled. - if (!this.weave.fxAccountsEnabled) { - return Promise.resolve(); - } - - this.panelUIFooter.hidden = false; - - // Make sure the button is disabled in customization mode. - if (this._inCustomizationMode) { - this.panelUIStatus.setAttribute("disabled", "true"); - this.panelUILabel.setAttribute("disabled", "true"); - this.panelUIAvatar.setAttribute("disabled", "true"); - this.panelUIIcon.setAttribute("disabled", "true"); - } else { - this.panelUIStatus.removeAttribute("disabled"); - this.panelUILabel.removeAttribute("disabled"); - this.panelUIAvatar.removeAttribute("disabled"); - this.panelUIIcon.removeAttribute("disabled"); - } - - let defaultLabel = this.panelUIStatus.getAttribute("defaultlabel"); - let errorLabel = this.panelUIStatus.getAttribute("errorlabel"); - let unverifiedLabel = this.panelUIStatus.getAttribute("unverifiedlabel"); - // The localization string is for the signed in text, but it's the default text as well - let defaultTooltiptext = this.panelUIStatus.getAttribute("signedinTooltiptext"); - - let updateWithUserData = (userData) => { - // Window might have been closed while fetching data. - if (window.closed) { - return; - } - - // Reset the button to its original state. - this.panelUILabel.setAttribute("label", defaultLabel); - this.panelUIStatus.setAttribute("tooltiptext", defaultTooltiptext); - this.panelUIFooter.removeAttribute("fxastatus"); - this.panelUIFooter.removeAttribute("fxaprofileimage"); - this.panelUIAvatar.style.removeProperty("list-style-image"); - let showErrorBadge = false; - if (userData) { - // At this point we consider the user as logged-in (but still can be in an error state) - if (this.loginFailed) { - let tooltipDescription = this.strings.formatStringFromName("reconnectDescription", [userData.email], 1); - this.panelUIFooter.setAttribute("fxastatus", "error"); - this.panelUILabel.setAttribute("label", errorLabel); - this.panelUIStatus.setAttribute("tooltiptext", tooltipDescription); - showErrorBadge = true; - } else if (!userData.verified) { - let tooltipDescription = this.strings.formatStringFromName("verifyDescription", [userData.email], 1); - this.panelUIFooter.setAttribute("fxastatus", "error"); - this.panelUIFooter.setAttribute("unverified", "true"); - this.panelUILabel.setAttribute("label", unverifiedLabel); - this.panelUIStatus.setAttribute("tooltiptext", tooltipDescription); - showErrorBadge = true; - } else { - this.panelUIFooter.setAttribute("fxastatus", "signedin"); - this.panelUILabel.setAttribute("label", userData.email); - } - if (profileInfoEnabled) { - this.panelUIFooter.setAttribute("fxaprofileimage", "enabled"); - } - } - if (showErrorBadge) { - gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_FXA, "fxa-needs-authentication"); - } else { - gMenuButtonBadgeManager.removeBadge(gMenuButtonBadgeManager.BADGEID_FXA); - } - } - - let updateWithProfile = (profile) => { - if (profileInfoEnabled) { - if (profile.displayName) { - this.panelUILabel.setAttribute("label", profile.displayName); - } - if (profile.avatar) { - this.panelUIFooter.setAttribute("fxaprofileimage", "set"); - let bgImage = "url(\"" + profile.avatar + "\")"; - this.panelUIAvatar.style.listStyleImage = bgImage; - - let img = new Image(); - img.onerror = () => { - // Clear the image if it has trouble loading. Since this callback is asynchronous - // we check to make sure the image is still the same before we clear it. - if (this.panelUIAvatar.style.listStyleImage === bgImage) { - this.panelUIFooter.removeAttribute("fxaprofileimage"); - this.panelUIAvatar.style.removeProperty("list-style-image"); - } - }; - img.src = profile.avatar; - } - } - } - - return fxAccounts.getSignedInUser().then(userData => { - // userData may be null here when the user is not signed-in, but that's expected - updateWithUserData(userData); - // unverified users cause us to spew log errors fetching an OAuth token - // to fetch the profile, so don't even try in that case. - if (!userData || !userData.verified || !profileInfoEnabled) { - return null; // don't even try to grab the profile. - } - if (this._cachedProfile) { - return this._cachedProfile; - } - return fxAccounts.getSignedInUserProfile().catch(err => { - // Not fetching the profile is sad but the FxA logs will already have noise. - return null; - }); - }).then(profile => { - if (!profile) { - return; - } - updateWithProfile(profile); - this._cachedProfile = profile; // Try to avoid fetching the profile on every UI update - }).catch(error => { - // This is most likely in tests, were we quickly log users in and out. - // The most likely scenario is a user logged out, so reflect that. - // Bug 995134 calls for better errors so we could retry if we were - // sure this was the failure reason. - this.FxAccountsCommon.log.error("Error updating FxA account info", error); - updateWithUserData(null); - }); - }, - - onMenuPanelCommand: function () { - - switch (this.panelUIFooter.getAttribute("fxastatus")) { - case "signedin": - this.openPreferences(); - break; - case "error": - if (this.panelUIFooter.getAttribute("unverified")) { - this.openPreferences(); - } else { - this.openSignInAgainPage("menupanel"); - } - break; - default: - this.openPreferences(); - break; - } - - PanelUI.hide(); - }, - - openPreferences: function () { - openPreferences("paneSync", { urlParams: { entrypoint: "menupanel" } }); - }, - - openAccountsPage: function (action, urlParams={}) { - let params = new URLSearchParams(); - if (action) { - params.set("action", action); - } - for (let name in urlParams) { - if (urlParams[name] !== undefined) { - params.set(name, urlParams[name]); - } - } - let url = "about:accounts?" + params; - switchToTabHavingURI(url, true, { - replaceQueryString: true - }); - }, - - openSignInAgainPage: function (entryPoint) { - this.openAccountsPage("reauth", { entrypoint: entryPoint }); - }, - - sendTabToDevice: function (url, clientId, title) { - Weave.Service.clientsEngine.sendURIToClientForDisplay(url, clientId, title); - }, - - populateSendTabToDevicesMenu: function (devicesPopup, url, title) { - // remove existing menu items - while (devicesPopup.hasChildNodes()) { - devicesPopup.removeChild(devicesPopup.firstChild); - } - - const fragment = document.createDocumentFragment(); - - const onTargetDeviceCommand = (event) => { - const clientId = event.target.getAttribute("clientId"); - const clients = clientId - ? [clientId] - : this.remoteClients.map(client => client.id); - - clients.forEach(clientId => this.sendTabToDevice(url, clientId, title)); - } - - function addTargetDevice(clientId, name) { - const targetDevice = document.createElement("menuitem"); - targetDevice.addEventListener("command", onTargetDeviceCommand, true); - targetDevice.setAttribute("class", "sendtab-target"); - targetDevice.setAttribute("clientId", clientId); - targetDevice.setAttribute("label", name); - fragment.appendChild(targetDevice); - } - - const clients = this.remoteClients; - for (let client of clients) { - addTargetDevice(client.id, client.name); - } - - // "All devices" menu item - if (clients.length > 1) { - const separator = document.createElement("menuseparator"); - fragment.appendChild(separator); - const allDevicesLabel = this.strings.GetStringFromName("sendTabToAllDevices.menuitem"); - addTargetDevice("", allDevicesLabel); - } - - devicesPopup.appendChild(fragment); - }, - - updateTabContextMenu: function (aPopupMenu) { - if (!this.sendTabToDeviceEnabled) { - return; - } - - const remoteClientPresent = this.remoteClients.length > 0; - ["context_sendTabToDevice", "context_sendTabToDevice_separator"] - .forEach(id => { document.getElementById(id).hidden = !remoteClientPresent }); - }, - - initPageContextMenu: function (contextMenu) { - if (!this.sendTabToDeviceEnabled) { - return; - } - - const remoteClientPresent = this.remoteClients.length > 0; - // showSendLink and showSendPage are mutually exclusive - const showSendLink = remoteClientPresent - && (contextMenu.onSaveableLink || contextMenu.onPlainTextLink); - const showSendPage = !showSendLink && remoteClientPresent - && !(contextMenu.isContentSelected || - contextMenu.onImage || contextMenu.onCanvas || - contextMenu.onVideo || contextMenu.onAudio || - contextMenu.onLink || contextMenu.onTextInput); - - ["context-sendpagetodevice", "context-sep-sendpagetodevice"] - .forEach(id => contextMenu.showItem(id, showSendPage)); - ["context-sendlinktodevice", "context-sep-sendlinktodevice"] - .forEach(id => contextMenu.showItem(id, showSendLink)); - } -}; - -XPCOMUtils.defineLazyGetter(gFxAccounts, "FxAccountsCommon", function () { - return Cu.import("resource://gre/modules/FxAccountsCommon.js", {}); -}); - -XPCOMUtils.defineLazyModuleGetter(gFxAccounts, "fxaMigrator", - "resource://services-sync/FxaMigrator.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "EnsureFxAccountsWebChannel", - "resource://gre/modules/FxAccountsWebChannel.jsm"); diff --git a/application/basilisk/base/content/browser-gestureSupport.js b/application/basilisk/base/content/browser-gestureSupport.js index f472e5c9a..6c21a6ad5 100644 --- a/application/basilisk/base/content/browser-gestureSupport.js +++ b/application/basilisk/base/content/browser-gestureSupport.js @@ -1001,13 +1001,10 @@ var gHistorySwipeAnimation = { ctx.DRAWWINDOW_ASYNC_DECODE_IMAGES | ctx.DRAWWINDOW_USE_WIDGET_LAYERS); - TelemetryStopwatch.start("FX_GESTURE_INSTALL_SNAPSHOT_OF_PAGE"); try { this._installCurrentPageSnapshot(canvas); this._assignSnapshotToCurrentBrowser(canvas); - } finally { - TelemetryStopwatch.finish("FX_GESTURE_INSTALL_SNAPSHOT_OF_PAGE"); - } + } catch (e) {} }, /** @@ -1058,7 +1055,6 @@ var gHistorySwipeAnimation = { return; } - TelemetryStopwatch.start("FX_GESTURE_COMPRESS_SNAPSHOT_OF_PAGE"); try { let browser = gBrowser.selectedBrowser; let snapshots = browser.snapshots; @@ -1072,9 +1068,7 @@ var gHistorySwipeAnimation = { } }, "image/png" ); - } finally { - TelemetryStopwatch.finish("FX_GESTURE_COMPRESS_SNAPSHOT_OF_PAGE"); - } + } catch (e) {} }, /** diff --git a/application/basilisk/base/content/browser-menubar.inc b/application/basilisk/base/content/browser-menubar.inc index 41734711c..b6ab23be5 100644 --- a/application/basilisk/base/content/browser-menubar.inc +++ b/application/basilisk/base/content/browser-menubar.inc @@ -11,19 +11,12 @@ style="border:0px;padding:0px;margin:0px;-moz-appearance:none"> <menu id="file-menu" label="&fileMenu.label;" accesskey="&fileMenu.accesskey;"> - <menupopup id="menu_FilePopup" - onpopupshowing="updateUserContextUIVisibility();"> + <menupopup id="menu_FilePopup"> <menuitem id="menu_newNavigatorTab" label="&tabCmd.label;" command="cmd_newNavigatorTab" key="key_newNavigatorTab" accesskey="&tabCmd.accesskey;"/> - <menu id="menu_newUserContext" - label="&newUserContext.label;" - accesskey="&newUserContext.accesskey;" - hidden="true"> - <menupopup onpopupshowing="return createUserContextMenu(event);" /> - </menu> <menuitem id="menu_newNavigator" label="&newNavigatorCmd.label;" accesskey="&newNavigatorCmd.accesskey;" @@ -202,9 +195,6 @@ key="key_gotoHistory" observes="viewHistorySidebar" label="&historyButton.label;"/> - <menuitem id="menu_tabsSidebar" - observes="viewTabsSidebar" - label="&syncedTabs.sidebar.label;"/> </menupopup> </menu> <menuseparator/> @@ -324,11 +314,13 @@ key="key_sanitize" command="Tools:Sanitize"/> <menuseparator id="sanitizeSeparator"/> +#ifdef MOZ_SERVICES_SYNC <menuitem id="sync-tabs-menuitem" class="syncTabsMenuItem" - label="&syncTabsMenu3.label;" + label="&syncTabsMenu2.label;" oncommand="BrowserOpenSyncTabs();" - hidden="true"/> + disabled="true"/> +#endif <menuitem id="historyRestoreLastSession" label="&historyRestoreLastSession.label;" command="Browser:RestoreLastSession"/> @@ -447,11 +439,10 @@ accesskey="&toolsMenu.accesskey;" onpopupshowing="mirrorShow(this)"> <menupopup id="menu_ToolsPopup" -# We have to use setTimeout() here to avoid a flickering menu bar when opening -# the Tools menu, see bug 970769. This can be removed once we got rid of the -# event loop spinning in Weave.Status._authManager. - onpopupshowing="setTimeout(() => gSyncUI.updateUI());" - > +#ifdef MOZ_SERVICES_SYNC + onpopupshowing="gSyncUI.updateUI();" +#endif + > <menuitem id="menu_openDownloads" label="&downloads.label;" accesskey="&downloads.accesskey;" @@ -462,23 +453,19 @@ accesskey="&addons.accesskey;" key="key_openAddons" command="Tools:Addons"/> - - <!-- only one of sync-setup, sync-syncnowitem or sync-reauthitem will be showing at once --> +#ifdef MOZ_SERVICES_SYNC + <!-- only one of sync-setup or sync-menu will be showing at once --> <menuitem id="sync-setup" - label="&syncSignIn.label;" - accesskey="&syncSignIn.accesskey;" + label="&syncSetup.label;" + accesskey="&syncSetup.accesskey;" observes="sync-setup-state" - oncommand="gSyncUI.openSetup(null, 'menubar')"/> + oncommand="gSyncUI.openSetup()"/> <menuitem id="sync-syncnowitem" label="&syncSyncNowItem.label;" accesskey="&syncSyncNowItem.accesskey;" observes="sync-syncnow-state" oncommand="gSyncUI.doSync(event);"/> - <menuitem id="sync-reauthitem" - label="&syncReAuthItem.label;" - accesskey="&syncReAuthItem.accesskey;" - observes="sync-reauth-state" - oncommand="gSyncUI.openSignInAgainPage('menubar');"/> +#endif <menuseparator id="devToolsSeparator"/> <menu id="webDeveloperMenu" label="&webDeveloperMenu.label;" diff --git a/application/basilisk/base/content/browser-places.js b/application/basilisk/base/content/browser-places.js index 83c737977..87734140f 100644 --- a/application/basilisk/base/content/browser-places.js +++ b/application/basilisk/base/content/browser-places.js @@ -804,18 +804,29 @@ HistoryMenu.prototype = { }, toggleTabsFromOtherComputers: function PHM_toggleTabsFromOtherComputers() { + // This is a no-op if MOZ_SERVICES_SYNC isn't defined +#ifdef MOZ_SERVICES_SYNC // Enable/disable the Tabs From Other Computers menu. Some of the menus handled // by HistoryMenu do not have this menuitem. let menuitem = this._rootElt.getElementsByClassName("syncTabsMenuItem")[0]; if (!menuitem) return; - if (!PlacesUIUtils.shouldShowTabsFromOtherComputersMenuitem()) { + // If Sync isn't configured yet, then don't show the menuitem. + if (Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED || + Weave.Svc.Prefs.get("firstSync", "") == "notReady") { menuitem.setAttribute("hidden", true); return; } + // The tabs engine might never be inited (if services.sync.registerEngines + // is modified), so make sure we avoid undefined errors. + let enabled = Weave.Service.isLoggedIn && + Weave.Service.engineManager.get("tabs") && + Weave.Service.engineManager.get("tabs").enabled; + menuitem.setAttribute("disabled", !enabled); menuitem.setAttribute("hidden", false); +#endif }, _onPopupShowing: function HM__onPopupShowing(aEvent) { diff --git a/application/basilisk/base/content/browser-sets.inc b/application/basilisk/base/content/browser-sets.inc index 6ea057d93..d6a9310ed 100644 --- a/application/basilisk/base/content/browser-sets.inc +++ b/application/basilisk/base/content/browser-sets.inc @@ -163,16 +163,13 @@ <!-- A broadcaster of a number of attributes suitable for "sync now" UI - A 'syncstatus' attribute is set while actively syncing, and the label attribute which changes from "sync now" to "syncing" etc. --> +#ifdef MOZ_SERVICES_SYNC <broadcaster id="sync-status"/> <!-- broadcasters of the "hidden" attribute to reflect setup state for menus --> <broadcaster id="sync-setup-state"/> <broadcaster id="sync-syncnow-state" hidden="true"/> - <broadcaster id="sync-reauth-state" hidden="true"/> - <broadcaster id="viewTabsSidebar" autoCheck="false" sidebartitle="&syncedTabs.sidebar.label;" - type="checkbox" group="sidebar" - sidebarurl="chrome://browser/content/syncedtabs/sidebar.xhtml" - oncommand="SidebarUI.toggle('viewTabsSidebar');"/> +#endif <broadcaster id="workOfflineMenuitemState"/> <broadcaster id="devtoolsMenuBroadcaster_ErrorConsole" diff --git a/application/basilisk/base/content/browser-syncui.js b/application/basilisk/base/content/browser-syncui.js index 51bcb15d5..f57472658 100644 --- a/application/basilisk/base/content/browser-syncui.js +++ b/application/basilisk/base/content/browser-syncui.js @@ -1,62 +1,37 @@ -/* 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/. */ +# 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/. -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); - -#ifdef MOZ_SERVICES_CLOUDSYNC -XPCOMUtils.defineLazyModuleGetter(this, "CloudSync", - "resource://gre/modules/CloudSync.jsm"); -#endif - -XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts", - "resource://gre/modules/FxAccounts.jsm"); - -const MIN_STATUS_ANIMATION_DURATION = 1600; - -// gSyncUI handles updating the tools menu and displaying notifications. +// gSyncUI handles updating the tools menu var gSyncUI = { _obs: ["weave:service:sync:start", - "weave:service:sync:finish", - "weave:service:sync:error", + "weave:service:sync:delayed", + "weave:service:quota:remaining", "weave:service:setup-complete", "weave:service:login:start", "weave:service:login:finish", - "weave:service:login:error", "weave:service:logout:finish", "weave:service:start-over", - "weave:service:start-over:finish", "weave:ui:login:error", "weave:ui:sync:error", "weave:ui:sync:finish", "weave:ui:clear-error", - "weave:engine:sync:finish" ], _unloaded: false, - // The last sync start time. Used to calculate the leftover animation time - // once syncing completes (bug 1239042). - _syncStartTime: 0, - _syncAnimationTimer: 0, - - init: function () { - Cu.import("resource://services-common/stringbundle.js"); + init: function SUI_init() { // Proceed to set up the UI if Sync has already started up. // Otherwise we'll do it when Sync is firing up. - if (this.weaveService.ready) { + let xps = Components.classes["@mozilla.org/weave/service;1"] + .getService(Components.interfaces.nsISupports) + .wrappedJSObject; + if (xps.ready) { this.initUI(); return; } - // Sync isn't ready yet, but we can still update the UI with an initial - // state - we haven't called initUI() yet, but that's OK - that's more - // about observers for state changes, and will be called once Sync is - // ready to start sending notifications. - this.updateUI(); - Services.obs.addObserver(this, "weave:service:ready", true); - Services.obs.addObserver(this, "quit-application", true); // Remove the observer if the window is closed before the observer // was triggered. @@ -64,7 +39,6 @@ var gSyncUI = { gSyncUI._unloaded = true; window.removeEventListener("unload", onUnload, false); Services.obs.removeObserver(gSyncUI, "weave:service:ready"); - Services.obs.removeObserver(gSyncUI, "quit-application"); if (Weave.Status.ready) { gSyncUI._obs.forEach(function(topic) { @@ -84,161 +58,136 @@ var gSyncUI = { Services.obs.addObserver(this, topic, true); }, this); - // initial label for the sync buttons. - let broadcaster = document.getElementById("sync-status"); - broadcaster.setAttribute("label", this._stringBundle.GetStringFromName("syncnow.label")); - - this.maybeMoveSyncedTabsButton(); - + if (gBrowser && Weave.Notifications.notifications.length) { + this.initNotifications(); + } this.updateUI(); }, + initNotifications: function SUI_initNotifications() { + const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; + let notificationbox = document.createElementNS(XULNS, "notificationbox"); + notificationbox.id = "sync-notifications"; + notificationbox.setAttribute("flex", "1"); - // Returns a promise that resolves with true if Sync needs to be configured, - // false otherwise. - _needsSetup() { - // If Sync is configured for FxAccounts then we do that promise-dance. - if (this.weaveService.fxAccountsEnabled) { - return fxAccounts.getSignedInUser().then(user => { - // We want to treat "account needs verification" as "needs setup". - return !(user && user.verified); - }); - } - // We are using legacy sync - check that. - let firstSync = ""; - try { - firstSync = Services.prefs.getCharPref("services.sync.firstSync"); - } catch (e) { } - - return Promise.resolve(Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED || - firstSync == "notReady"); + let bottombox = document.getElementById("browser-bottombox"); + bottombox.insertBefore(notificationbox, bottombox.firstChild); + + // Force a style flush to ensure that our binding is attached. + notificationbox.clientTop; + + // notificationbox will listen to observers from now on. + Services.obs.removeObserver(this, "weave:notification:added"); }, - // Returns a promise that resolves with true if the user currently signed in - // to Sync needs to be verified, false otherwise. - _needsVerification() { - // For callers who care about the distinction between "needs setup" and - // "needs verification" - if (this.weaveService.fxAccountsEnabled) { - return fxAccounts.getSignedInUser().then(user => { - // If there is no user, they can't be in a "needs verification" state. - if (!user) { - return false; - } - return !user.verified; - }); - } + _wasDelayed: false, - // Otherwise we are configured for legacy Sync, which has no verification - // concept. - return Promise.resolve(false); + _needsSetup: function SUI__needsSetup() { + let firstSync = Services.prefs.getCharPref("services.sync.firstSync", ""); + return Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED || + firstSync == "notReady"; }, - // Note that we don't show login errors in a notification bar here, but do - // still need to track a login-failed state so the "Tools" menu updates - // with the correct state. - _loginFailed: function () { - // If Sync isn't already ready, we don't want to force it to initialize - // by referencing Weave.Status - and it isn't going to be accurate before - // Sync is ready anyway. - if (!this.weaveService.ready) { - this.log.debug("_loginFailed has sync not ready, so returning false"); - return false; + updateUI: function SUI_updateUI() { + let needsSetup = this._needsSetup(); + document.getElementById("sync-setup-state").hidden = !needsSetup; + document.getElementById("sync-syncnow-state").hidden = needsSetup; + + if (!gBrowser) { + return; } - this.log.debug("_loginFailed has sync state=${sync}", - { sync: Weave.Status.login}); - return Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED; - }, - // Kick off an update of the UI - does *not* return a promise. - updateUI() { - this._promiseUpdateUI().catch(err => { - this.log.error("updateUI failed", err); - }) - }, + let button = document.getElementById("sync-button"); + if (!button) { + return; + } - // Updates the UI - returns a promise. - _promiseUpdateUI() { - return this._needsSetup().then(needsSetup => { - if (!gBrowser) - return Promise.resolve(); - - let loginFailed = this._loginFailed(); - - // Start off with a clean slate - document.getElementById("sync-reauth-state").hidden = true; - document.getElementById("sync-setup-state").hidden = true; - document.getElementById("sync-syncnow-state").hidden = true; - -#ifdef MOZ_SERVICES_CLOUDSYNC - if (CloudSync && CloudSync.ready && CloudSync().adapters.count) { - document.getElementById("sync-syncnow-state").hidden = false; - } else if (loginFailed) { -#else - if (loginFailed) { -#endif - // unhiding this element makes the menubar show the login failure state. - document.getElementById("sync-reauth-state").hidden = false; - } else if (needsSetup) { - document.getElementById("sync-setup-state").hidden = false; - } else { - document.getElementById("sync-syncnow-state").hidden = false; - } + button.removeAttribute("status"); + + this._updateLastSyncTime(); - return this._updateSyncButtonsTooltip(); - }); + if (needsSetup) { + button.removeAttribute("tooltiptext"); + button.setAttribute("label", this._stringBundle.GetStringFromName("setupsync.label")); + } else { + button.setAttribute("label", this._stringBundle.GetStringFromName("syncnow.label")); + } }, + // Functions called by observers - onActivityStart() { + onActivityStart: function SUI_onActivityStart() { if (!gBrowser) return; - this.log.debug("onActivityStart"); + let button = document.getElementById("sync-button"); + if (!button) + return; - clearTimeout(this._syncAnimationTimer); - this._syncStartTime = Date.now(); + button.setAttribute("status", "active"); + button.setAttribute("label", this._stringBundle.GetStringFromName("syncing2.label")); + }, - let broadcaster = document.getElementById("sync-status"); - broadcaster.setAttribute("syncstatus", "active"); - broadcaster.setAttribute("label", this._stringBundle.GetStringFromName("syncing2.label")); - broadcaster.setAttribute("disabled", "true"); + onSyncDelay: function SUI_onSyncDelay() { + // basically, we want to just inform users that stuff is going to take a while + let title = this._stringBundle.GetStringFromName("error.sync.no_node_found.title"); + let description = this._stringBundle.GetStringFromName("error.sync.no_node_found"); + let buttons = [new Weave.NotificationButton( + this._stringBundle.GetStringFromName("error.sync.serverStatusButton.label"), + this._stringBundle.GetStringFromName("error.sync.serverStatusButton.accesskey"), + function() { gSyncUI.openServerStatus(); return true; } + )]; + let notification = new Weave.Notification( + title, description, null, Weave.Notifications.PRIORITY_INFO, buttons); + Weave.Notifications.replaceTitle(notification); + this._wasDelayed = true; + }, - this.updateUI(); + onLoginFinish: function SUI_onLoginFinish() { + // Clear out any login failure notifications + let title = this._stringBundle.GetStringFromName("error.login.title"); + this.clearError(title); }, - _updateSyncStatus() { - if (!gBrowser) - return; - let broadcaster = document.getElementById("sync-status"); - broadcaster.removeAttribute("syncstatus"); - broadcaster.removeAttribute("disabled"); - broadcaster.setAttribute("label", this._stringBundle.GetStringFromName("syncnow.label")); - this.updateUI(); + onSetupComplete: function SUI_onSetupComplete() { + this.onLoginFinish(); }, - onActivityStop() { - if (!gBrowser) + onLoginError: function SUI_onLoginError() { + // if login fails, any other notifications are essentially moot + Weave.Notifications.removeAll(); + + // if we haven't set up the client, don't show errors + if (this._needsSetup()) { + this.updateUI(); return; - this.log.debug("onActivityStop"); + } - let now = Date.now(); - let syncDuration = now - this._syncStartTime; + let title = this._stringBundle.GetStringFromName("error.login.title"); - if (syncDuration < MIN_STATUS_ANIMATION_DURATION) { - let animationTime = MIN_STATUS_ANIMATION_DURATION - syncDuration; - clearTimeout(this._syncAnimationTimer); - this._syncAnimationTimer = setTimeout(() => this._updateSyncStatus(), animationTime); + let description; + if (Weave.Status.sync == Weave.PROLONGED_SYNC_FAILURE) { + // Convert to days + let lastSync = + Services.prefs.getIntPref("services.sync.errorhandler.networkFailureReportTimeout") / 86400; + description = + this._stringBundle.formatStringFromName("error.sync.prolonged_failure", [lastSync], 1); } else { - this._updateSyncStatus(); + let reason = Weave.Utils.getErrorString(Weave.Status.login); + description = + this._stringBundle.formatStringFromName("error.sync.description", [reason], 1); } - }, - onLoginError: function SUI_onLoginError() { - this.log.debug("onLoginError: login=${login}, sync=${sync}", Weave.Status); + let buttons = []; + buttons.push(new Weave.NotificationButton( + this._stringBundle.GetStringFromName("error.login.prefs.label"), + this._stringBundle.GetStringFromName("error.login.prefs.accesskey"), + function() { gSyncUI.openPrefs(); return true; } + )); - // We don't show any login errors here; browser-fxaccounts shows them in - // the hamburger menu. + let notification = new Weave.Notification(title, description, null, + Weave.Notifications.PRIORITY_WARNING, buttons); + Weave.Notifications.replaceTitle(notification); this.updateUI(); }, @@ -246,40 +195,45 @@ var gSyncUI = { this.updateUI(); }, - _getAppName: function () { - let brand = new StringBundle("chrome://branding/locale/brand.properties"); - return brand.get("brandShortName"); + onStartOver: function SUI_onStartOver() { + this.clearError(); + }, + + onQuotaNotice: function onQuotaNotice(subject, data) { + let title = this._stringBundle.GetStringFromName("warning.sync.quota.label"); + let description = this._stringBundle.GetStringFromName("warning.sync.quota.description"); + let buttons = []; + buttons.push(new Weave.NotificationButton( + this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.label"), + this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.accesskey"), + function() { gSyncUI.openQuotaDialog(); return true; } + )); + + let notification = new Weave.Notification( + title, description, null, Weave.Notifications.PRIORITY_WARNING, buttons); + Weave.Notifications.replaceTitle(notification); + }, + + openServerStatus: function () { + let statusURL = Services.prefs.getCharPref("services.sync.statusURL"); + window.openUILinkIn(statusURL, "tab"); }, // Commands - // doSync forces a sync - it *does not* return a promise as it is called - // via the various UI components. - doSync() { - this._needsSetup().then(needsSetup => { - if (!needsSetup) { - setTimeout(() => Weave.Service.errorHandler.syncAndReportErrors(), 0); - } - Services.obs.notifyObservers(null, "cloudsync:user-sync", null); - }).catch(err => { - this.log.error("Failed to force a sync", err); - }); + doSync: function SUI_doSync() { + setTimeout(function() Weave.Service.errorHandler.syncAndReportErrors(), 0); }, - // Handle clicking the toolbar button - which either opens the Sync setup - // pages or forces a sync now. Does *not* return a promise as it is called - // via the UI. - handleToolbarButton() { - this._needsSetup().then(needsSetup => { - if (needsSetup || this._loginFailed()) { - this.openSetup(); - } else { - this.doSync(); - } - }).catch(err => { - this.log.error("Failed to handle toolbar button command", err); - }); + handleToolbarButton: function SUI_handleStatusbarButton() { + if (this._needsSetup()) + this.openSetup(); + else + this.doSync(); }, + //XXXzpao should be part of syncCommon.js - which we might want to make a module... + // To be fixed in a followup (bug 583366) + /** * Invoke the Sync setup wizard. * @@ -288,26 +242,19 @@ var gSyncUI = { * null -- regular set up wizard * "pair" -- pair a device first * "reset" -- reset sync - * @param entryPoint - * Indicates the entrypoint from where this method was called. */ - openSetup: function SUI_openSetup(wizardType, entryPoint = "syncbutton") { - if (this.weaveService.fxAccountsEnabled) { - this.openPrefs(entryPoint); - } else { - let win = Services.wm.getMostRecentWindow("Weave:AccountSetup"); - if (win) - win.focus(); - else { - window.openDialog("chrome://browser/content/sync/setup.xul", - "weaveSetup", "centerscreen,chrome,resizable=no", - wizardType); - } + openSetup: function SUI_openSetup(wizardType) { + let win = Services.wm.getMostRecentWindow("Weave:AccountSetup"); + if (win) + win.focus(); + else { + window.openDialog("chrome://browser/content/sync/setup.xul", + "weaveSetup", "centerscreen,chrome,resizable=no", + wizardType); } }, - // Open the legacy-sync device pairing UI. Note used for FxA Sync. openAddDevice: function () { if (!Weave.Utils.ensureMPUnlocked()) return; @@ -320,188 +267,181 @@ var gSyncUI = { "syncAddDevice", "centerscreen,chrome,resizable=no"); }, - openPrefs: function (entryPoint) { - openPreferences("paneSync", { urlParams: { entrypoint: entryPoint } }); + openQuotaDialog: function SUI_openQuotaDialog() { + let win = Services.wm.getMostRecentWindow("Sync:ViewQuota"); + if (win) + win.focus(); + else + Services.ww.activeWindow.openDialog( + "chrome://browser/content/sync/quota.xul", "", + "centerscreen,chrome,dialog,modal"); }, - openSignInAgainPage: function (entryPoint = "syncbutton") { - gFxAccounts.openSignInAgainPage(entryPoint); + openPrefs: function SUI_openPrefs() { + openPreferences("paneSync"); }, - openSyncedTabsPanel() { - let placement = CustomizableUI.getPlacementOfWidget("sync-button"); - let area = placement ? placement.area : CustomizableUI.AREA_NAVBAR; - let anchor = document.getElementById("sync-button") || - document.getElementById("PanelUI-menu-button"); - if (area == CustomizableUI.AREA_PANEL) { - // The button is in the panel, so we need to show the panel UI, then our - // subview. - PanelUI.show().then(() => { - PanelUI.showSubView("PanelUI-remotetabs", anchor, area); - }).catch(Cu.reportError); - } else { - // It is placed somewhere else - just try and show it. - PanelUI.showSubView("PanelUI-remotetabs", anchor, area); - } - }, + // Helpers + _updateLastSyncTime: function SUI__updateLastSyncTime() { + if (!gBrowser) + return; - /* After Sync is initialized we perform a once-only check for the sync - button being in "customize purgatory" and if so, move it to the panel. - This is done primarily for profiles created before SyncedTabs landed, - where the button defaulted to being in that purgatory. - We use a preference to ensure we only do it once, so people can still - customize it away and have it stick. - */ - maybeMoveSyncedTabsButton() { - const prefName = "browser.migrated-sync-button"; - let migrated = false; - try { - migrated = Services.prefs.getBoolPref(prefName); - } catch (_) {} - if (migrated) { + let syncButton = document.getElementById("sync-button"); + if (!syncButton) + return; + + let lastSync = Services.prefs.getCharPref("services.sync.lastSync", ""); + if (!lastSync || this._needsSetup()) { + syncButton.removeAttribute("tooltiptext"); return; } - if (!CustomizableUI.getPlacementOfWidget("sync-button")) { - CustomizableUI.addWidgetToArea("sync-button", CustomizableUI.AREA_PANEL); - } - Services.prefs.setBoolPref(prefName, true); + + // Show the day-of-week and time (HH:MM) of last sync + let lastSyncDate = new Date(lastSync).toLocaleFormat("%a %H:%M"); + let lastSyncLabel = + this._stringBundle.formatStringFromName("lastSync2.label", [lastSyncDate], 1); + + syncButton.setAttribute("tooltiptext", lastSyncLabel); }, - /* Update the tooltip for the sync-status broadcaster (which will update the - Sync Toolbar button and the Sync spinner in the FxA hamburger area.) - If Sync is configured, the tooltip is when the last sync occurred, - otherwise the tooltip reflects the fact that Sync needs to be - (re-)configured. - */ - _updateSyncButtonsTooltip: Task.async(function* () { - if (!gBrowser) - return; + clearError: function SUI_clearError(errorString) { + Weave.Notifications.removeAll(errorString); + this.updateUI(); + }, - let email; - try { - email = Services.prefs.getCharPref("services.sync.username"); - } catch (ex) {} - - let needsSetup = yield this._needsSetup(); - let needsVerification = yield this._needsVerification(); - let loginFailed = this._loginFailed(); - // This is a little messy as the Sync buttons are 1/2 Sync related and - // 1/2 FxA related - so for some strings we use Sync strings, but for - // others we reach into gFxAccounts for strings. - let tooltiptext; - if (needsVerification) { - // "needs verification" - tooltiptext = gFxAccounts.strings.formatStringFromName("verifyDescription", [email], 1); - } else if (needsSetup) { - // "needs setup". - tooltiptext = this._stringBundle.GetStringFromName("signInToSync.description"); - } else if (loginFailed) { - // "need to reconnect/re-enter your password" - tooltiptext = gFxAccounts.strings.formatStringFromName("reconnectDescription", [email], 1); - } else { - // Sync appears configured - format the "last synced at" time. - try { - let lastSync = new Date(Services.prefs.getCharPref("services.sync.lastSync")); - tooltiptext = this.formatLastSyncDate(lastSync); - } - catch (e) { - // pref doesn't exist (which will be the case until we've seen the - // first successful sync) or is invalid (which should be impossible!) - // Just leave tooltiptext as the empty string in these cases, which - // will cause the tooltip to be removed below. - } + onSyncFinish: function SUI_onSyncFinish() { + let title = this._stringBundle.GetStringFromName("error.sync.title"); + + // Clear out sync failures on a successful sync + this.clearError(title); + + if (this._wasDelayed && Weave.Status.sync != Weave.NO_SYNC_NODE_FOUND) { + title = this._stringBundle.GetStringFromName("error.sync.no_node_found.title"); + this.clearError(title); + this._wasDelayed = false; } + }, - // We've done all our promise-y work and ready to update the UI - make - // sure it hasn't been torn down since we started. - if (!gBrowser) - return; + onSyncError: function SUI_onSyncError() { + let title = this._stringBundle.GetStringFromName("error.sync.title"); - let broadcaster = document.getElementById("sync-status"); - if (broadcaster) { - if (tooltiptext) { - broadcaster.setAttribute("tooltiptext", tooltiptext); - } else { - broadcaster.removeAttribute("tooltiptext"); - } + if (Weave.Status.login != Weave.LOGIN_SUCCEEDED) { + this.onLoginError(); + return; } - }), - - formatLastSyncDate: function(date) { - let dateFormat; - let sixDaysAgo = (() => { - let date = new Date(); - date.setDate(date.getDate() - 6); - date.setHours(0, 0, 0, 0); - return date; - })(); - // It may be confusing for the user to see "Last Sync: Monday" when the last sync was a indeed a Monday but 3 weeks ago - if (date < sixDaysAgo) { - dateFormat = {month: 'long', day: 'numeric'}; + + let description; + if (Weave.Status.sync == Weave.PROLONGED_SYNC_FAILURE) { + // Convert to days + let lastSync = + Services.prefs.getIntPref("services.sync.errorhandler.networkFailureReportTimeout") / 86400; + description = + this._stringBundle.formatStringFromName("error.sync.prolonged_failure", [lastSync], 1); } else { - dateFormat = {weekday: 'long', hour: 'numeric', minute: 'numeric'}; + let error = Weave.Utils.getErrorString(Weave.Status.sync); + description = + this._stringBundle.formatStringFromName("error.sync.description", [error], 1); + } + let priority = Weave.Notifications.PRIORITY_WARNING; + let buttons = []; + + // Check if the client is outdated in some way + let outdated = Weave.Status.sync == Weave.VERSION_OUT_OF_DATE; + for (let [engine, reason] in Iterator(Weave.Status.engines)) + outdated = outdated || reason == Weave.VERSION_OUT_OF_DATE; + + if (outdated) { + description = this._stringBundle.GetStringFromName( + "error.sync.needUpdate.description"); + buttons.push(new Weave.NotificationButton( + this._stringBundle.GetStringFromName("error.sync.needUpdate.label"), + this._stringBundle.GetStringFromName("error.sync.needUpdate.accesskey"), + function() { + window.openUILinkIn(Services.prefs.getCharPref("services.sync.outdated.url"), "tab"); + return true; + } + )); + } + else if (Weave.Status.sync == Weave.OVER_QUOTA) { + description = this._stringBundle.GetStringFromName( + "error.sync.quota.description"); + buttons.push(new Weave.NotificationButton( + this._stringBundle.GetStringFromName( + "error.sync.viewQuotaButton.label"), + this._stringBundle.GetStringFromName( + "error.sync.viewQuotaButton.accesskey"), + function() { gSyncUI.openQuotaDialog(); return true; } ) + ); + } + else if (Weave.Status.enforceBackoff) { + priority = Weave.Notifications.PRIORITY_INFO; + buttons.push(new Weave.NotificationButton( + this._stringBundle.GetStringFromName("error.sync.serverStatusButton.label"), + this._stringBundle.GetStringFromName("error.sync.serverStatusButton.accesskey"), + function() { gSyncUI.openServerStatus(); return true; } + )); + } + else { + priority = Weave.Notifications.PRIORITY_INFO; + buttons.push(new Weave.NotificationButton( + this._stringBundle.GetStringFromName("error.sync.tryAgainButton.label"), + this._stringBundle.GetStringFromName("error.sync.tryAgainButton.accesskey"), + function() { gSyncUI.doSync(); return true; } + )); } - let lastSyncDateString = date.toLocaleDateString(undefined, dateFormat); - return this._stringBundle.formatStringFromName("lastSync2.label", [lastSyncDateString], 1); - }, - onClientsSynced: function() { - let broadcaster = document.getElementById("sync-syncnow-state"); - if (broadcaster) { - if (Weave.Service.clientsEngine.stats.numClients > 1) { - broadcaster.setAttribute("devices-status", "multi"); - } else { - broadcaster.setAttribute("devices-status", "single"); - } + let notification = + new Weave.Notification(title, description, null, priority, buttons); + Weave.Notifications.replaceTitle(notification); + + if (this._wasDelayed && Weave.Status.sync != Weave.NO_SYNC_NODE_FOUND) { + title = this._stringBundle.GetStringFromName("error.sync.no_node_found.title"); + Weave.Notifications.removeAll(title); + this._wasDelayed = false; } + + this.updateUI(); }, observe: function SUI_observe(subject, topic, data) { - this.log.debug("observed", topic); if (this._unloaded) { Cu.reportError("SyncUI observer called after unload: " + topic); return; } - // Unwrap, just like Svc.Obs, but without pulling in that dependency. - if (subject && typeof subject == "object" && - ("wrappedJSObject" in subject) && - ("observersModuleSubjectWrapper" in subject.wrappedJSObject)) { - subject = subject.wrappedJSObject.object; - } - - // First handle "activity" only. switch (topic) { case "weave:service:sync:start": this.onActivityStart(); break; - case "weave:service:sync:finish": - case "weave:service:sync:error": - this.onActivityStop(); - break; - } - // Now non-activity state (eg, enabled, errors, etc) - // Note that sync uses the ":ui:" notifications for errors because sync. - switch (topic) { case "weave:ui:sync:finish": - // Do nothing. + this.onSyncFinish(); break; case "weave:ui:sync:error": + this.onSyncError(); + break; + case "weave:service:sync:delayed": + this.onSyncDelay(); + break; + case "weave:service:quota:remaining": + this.onQuotaNotice(); + break; case "weave:service:setup-complete": - case "weave:service:login:finish": + this.onSetupComplete(); + break; case "weave:service:login:start": - case "weave:service:start-over": - this.updateUI(); + this.onActivityStart(); + break; + case "weave:service:login:finish": + this.onLoginFinish(); break; case "weave:ui:login:error": - case "weave:service:login:error": this.onLoginError(); break; case "weave:service:logout:finish": this.onLogout(); break; - case "weave:service:start-over:finish": - this.updateUI(); + case "weave:service:start-over": + this.onStartOver(); break; case "weave:service:ready": this.initUI(); @@ -509,16 +449,8 @@ var gSyncUI = { case "weave:notification:added": this.initNotifications(); break; - case "weave:engine:sync:finish": - if (data != "clients") { - return; - } - this.onClientsSynced(); - break; - case "quit-application": - // Stop the animation timer on shutdown, since we can't update the UI - // after this. - clearTimeout(this._syncAnimationTimer); + case "weave:ui:clear-error": + this.clearError(); break; } }, @@ -530,19 +462,10 @@ var gSyncUI = { }; XPCOMUtils.defineLazyGetter(gSyncUI, "_stringBundle", function() { - // XXXzpao these strings should probably be moved from /services to /browser... (bug 583381) + //XXXzpao these strings should probably be moved from /services to /browser... (bug 583381) // but for now just make it work return Cc["@mozilla.org/intl/stringbundle;1"]. getService(Ci.nsIStringBundleService). createBundle("chrome://weave/locale/services/sync.properties"); }); -XPCOMUtils.defineLazyGetter(gSyncUI, "log", function() { - return Log.repository.getLogger("browserwindow.syncui"); -}); - -XPCOMUtils.defineLazyGetter(gSyncUI, "weaveService", function() { - return Components.classes["@mozilla.org/weave/service;1"] - .getService(Components.interfaces.nsISupports) - .wrappedJSObject; -}); diff --git a/application/basilisk/base/content/browser.css b/application/basilisk/base/content/browser.css index e951985dc..a2c2559d6 100644 --- a/application/basilisk/base/content/browser.css +++ b/application/basilisk/base/content/browser.css @@ -687,6 +687,18 @@ window[chromehidden~="toolbar"] toolbar:not(#nav-bar):not(#TabsToolbar):not(#pri min-width: 1px; } +%ifdef MOZ_SERVICES_SYNC +/* Sync notification UI */ +#sync-notifications { + -moz-binding: url("chrome://browser/content/sync/notification.xml#notificationbox"); + overflow-y: visible !important; +} + +#sync-notifications notification { + -moz-binding: url("chrome://browser/content/sync/notification.xml#notification"); +} +%endif + /* History Swipe Animation */ #historySwipeAnimationContainer { @@ -933,11 +945,6 @@ html|*#gcli-output-frame, transition: none; } -/* Translation */ -notification[value="translation"] { - -moz-binding: url("chrome://browser/content/translation-infobar.xml#translationbar"); -} - /** See bug 872317 for why the following rule is necessary. */ #downloads-button { diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index 031144dfd..bbd240e69 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/base/content/browser.js @@ -8,7 +8,6 @@ var Cu = Components.utils; var Cc = Components.classes; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/ContextualIdentityService.jsm"); Cu.import("resource://gre/modules/NotificationDB.jsm"); // lazy module getters @@ -45,11 +44,8 @@ Cu.import("resource://gre/modules/NotificationDB.jsm"); ["SitePermissions", "resource:///modules/SitePermissions.jsm"], ["TabCrashHandler", "resource:///modules/ContentCrashHandlers.jsm"], ["Task", "resource://gre/modules/Task.jsm"], - ["TelemetryStopwatch", "resource://gre/modules/TelemetryStopwatch.jsm"], - ["Translation", "resource:///modules/translation/Translation.jsm"], ["UpdateUtils", "resource://gre/modules/UpdateUtils.jsm"], ["Weave", "resource://services-sync/main.js"], - ["fxAccounts", "resource://gre/modules/FxAccounts.jsm"], #ifdef MOZ_DEVTOOLS // Note: Do not delete! It is used for: base/content/nsContextMenu.js ["gDevTools", "resource://devtools/client/framework/gDevTools.jsm"], @@ -106,6 +102,12 @@ XPCOMUtils.defineLazyGetter(this, "PageMenuParent", function() { return new tmp.PageMenuParent(); }); +#ifdef MOZ_SERVICES_SYNC +XPCOMUtils.defineLazyModuleGetter(this, "Weave", + "resource://services-sync/main.js"); +#endif + + XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () { let tmp = {}; Cu.import("resource://gre/modules/PopupNotifications.jsm", tmp); @@ -211,6 +213,10 @@ var gInitialPages = [ "about:logopage" ]; +#ifdef MOZ_SERVICES_SYNC +#include browser-syncui.js +#endif + function* browserWindows() { let windows = Services.wm.getEnumerator("navigator:browser"); while (windows.hasMoreElements()) @@ -829,10 +835,6 @@ function _loadURIWithFlags(browser, uri, params) { } try { if (!mustChangeProcess) { - if (params.userContextId) { - browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId: params.userContextId }); - } - browser.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy, postData, null, null, triggeringPrincipal); @@ -858,10 +860,6 @@ function _loadURIWithFlags(browser, uri, params) { postData: postData } - if (params.userContextId) { - loadParams.userContextId = params.userContextId; - } - LoadInOtherProcess(browser, loadParams); } } catch (e) { @@ -874,10 +872,6 @@ function _loadURIWithFlags(browser, uri, params) { Cu.reportError(e); gBrowser.updateBrowserRemotenessByURL(browser, uri); - if (params.userContextId) { - browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId: params.userContextId }); - } - browser.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy, postData, null, null, triggeringPrincipal); } else { @@ -941,16 +935,6 @@ addEventListener("DOMContentLoaded", function onDCL() { let initBrowser = document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser"); - // The window's first argument is a tab if and only if we are swapping tabs. - // We must set the browser's usercontextid before updateBrowserRemoteness(), - // so that the newly created remote tab child has the correct usercontextid. - if (window.arguments) { - let tabToOpen = window.arguments[0]; - if (tabToOpen instanceof XULElement && tabToOpen.hasAttribute("usercontextid")) { - initBrowser.setAttribute("usercontextid", tabToOpen.getAttribute("usercontextid")); - } - } - gBrowser.updateBrowserRemoteness(initBrowser, gMultiProcessBrowser); }); @@ -970,10 +954,8 @@ var gBrowserInit = { // the listener is registered. DOMLinkHandler.init(); gPageStyleMenu.init(); - LanguageDetectionListener.init(); BrowserOnClick.init(); FeedHandler.init(); - DevEdition.init(); AboutPrivateBrowsingListener.init(); TrackingProtection.init(); RefreshBlocker.init(); @@ -1136,13 +1118,6 @@ var gBrowserInit = { // make sure it has a docshell gBrowser.docShell; - // We must set usercontextid before updateBrowserRemoteness() - // so that the newly created remote tab child has correct usercontextid - if (tabToOpen.hasAttribute("usercontextid")) { - let usercontextid = tabToOpen.getAttribute("usercontextid"); - gBrowser.selectedBrowser.setAttribute("usercontextid", usercontextid); - } - // If the browser that we're swapping in was remote, then we'd better // be able to support remote browsers, and then make our selectedTab // remote. @@ -1168,9 +1143,8 @@ var gBrowserInit = { // [3]: postData (nsIInputStream) // [4]: allowThirdPartyFixup (bool) // [5]: referrerPolicy (int) - // [6]: userContextId (int) - // [7]: originPrincipal (nsIPrincipal) - // [8]: triggeringPrincipal (nsIPrincipal) + // [6]: originPrincipal (nsIPrincipal) + // [7]: triggeringPrincipal (nsIPrincipal) else if (window.arguments.length >= 3) { let referrerURI = window.arguments[2]; if (typeof(referrerURI) == "string") { @@ -1182,13 +1156,11 @@ var gBrowserInit = { } let referrerPolicy = (window.arguments[5] != undefined ? window.arguments[5] : Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT); - let userContextId = (window.arguments[6] != undefined ? - window.arguments[6] : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID); loadURI(uriToLoad, referrerURI, window.arguments[3] || null, - window.arguments[4] || false, referrerPolicy, userContextId, + window.arguments[4] || false, referrerPolicy, // pass the origin principal (if any) and force its use to create // an initial about:blank viewer if present: - window.arguments[7], !!window.arguments[7], window.arguments[8]); + window.arguments[6], !!window.arguments[6], window.arguments[7]); window.focus(); } // Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3. @@ -1280,7 +1252,7 @@ var gBrowserInit = { // Setup click-and-hold gestures access to the session history // menus if global click-and-hold isn't turned on - if (!getBoolPref("ui.click_hold_context_menus", false)) + if (!Services.prefs.getBoolPref("ui.click_hold_context_menus", false)) SetClickAndHoldHandlers(); let NP = {}; @@ -1341,13 +1313,14 @@ var gBrowserInit = { FullScreen.init(); PointerLock.init(); - // initialize the sync UI - gSyncUI.init(); - gFxAccounts.init(); - if (AppConstants.MOZ_DATA_REPORTING) gDataNotificationInfoBar.init(); +#ifdef MOZ_SERVICES_SYNC + // initialize the sync UI + gSyncUI.init(); +#endif + gBrowserThumbnails.init(); gMenuButtonBadgeManager.init(); @@ -1481,8 +1454,6 @@ var gBrowserInit = { FullScreen.uninit(); - gFxAccounts.uninit(); - Services.obs.removeObserver(gPluginHandler.NPAPIPluginCrashed, "plugin-crashed"); try { @@ -1507,8 +1478,6 @@ var gBrowserInit = { FeedHandler.uninit(); - DevEdition.uninit(); - TrackingProtection.uninit(); RefreshBlocker.uninit(); @@ -1643,8 +1612,10 @@ if (AppConstants.platform == "macosx") { // initialize the private browsing UI gPrivateBrowsingUI.init(); +#ifdef MOZ_SERVICES_SYNC // initialize the sync UI gSyncUI.init(); +#endif }; gBrowserInit.nonBrowserWindowShutdown = function() { @@ -1871,7 +1842,7 @@ function BrowserGoHome(aEvent) { case "tabshifted": case "tab": urls = homePage.split("|"); - var loadInBackground = getBoolPref("browser.tabs.loadBookmarksInBackground", false); + var loadInBackground = Services.prefs.getBoolPref("browser.tabs.loadBookmarksInBackground", false); gBrowser.loadTabs(urls, loadInBackground); break; case "window": @@ -2073,7 +2044,7 @@ function BrowserTryToCloseWindow() } function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy, - userContextId, originPrincipal, forceAboutBlankViewerInCurrent, + originPrincipal, forceAboutBlankViewerInCurrent, triggeringPrincipal) { try { openLinkIn(uri, "current", @@ -2081,7 +2052,6 @@ function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy, referrerPolicy: referrerPolicy, postData: postData, allowThirdPartyFixup: allowThirdPartyFixup, - userContextId: userContextId, originPrincipal, triggeringPrincipal, forceAboutBlankViewerInCurrent, @@ -2616,15 +2586,9 @@ var gMenuButtonUpdateBadge = { cancelObserverRegistered: false, init: function () { - try { - this.enabled = Services.prefs.getBoolPref("app.update.badge"); - } catch (e) {} + this.enabled = Services.prefs.getBoolPref("app.update.badge", false); if (this.enabled) { - try { - this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime"); - } catch (e) { - this.badgeWaitTime = 345600; // 4 days - } + this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime", 345600); // 4 days Services.obs.addObserver(this, "update-staged", false); Services.obs.addObserver(this, "update-downloaded", false); } @@ -2841,15 +2805,10 @@ var BrowserOnClick = { }, onCertError: function (browser, elementId, isTopFrame, location, securityInfoAsString) { - let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI"); let securityInfo; switch (elementId) { case "exceptionDialogButton": - if (isTopFrame) { - secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_CLICK_ADD_EXCEPTION); - } - securityInfo = getSecurityInfo(securityInfoAsString); let sslStatus = securityInfo.QueryInterface(Ci.nsISSLStatusProvider) .SSLStatus; @@ -2877,64 +2836,27 @@ var BrowserOnClick = { break; case "returnButton": - if (isTopFrame) { - secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_GET_ME_OUT_OF_HERE); - } goBackFromErrorPage(); break; - - case "advancedButton": - if (isTopFrame) { - secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_UNDERSTAND_RISKS); - } - - break; } }, onAboutBlocked: function (elementId, reason, isTopFrame, location) { // Depending on what page we are displaying here (malware/phishing/unwanted) // use the right strings and links for each. - let bucketName = ""; - let sendTelemetry = false; - if (reason === 'malware') { - sendTelemetry = true; - bucketName = "WARNING_MALWARE_PAGE_"; - } else if (reason === 'phishing') { - sendTelemetry = true; - bucketName = "WARNING_PHISHING_PAGE_"; - } else if (reason === 'unwanted') { - sendTelemetry = true; - bucketName = "WARNING_UNWANTED_PAGE_"; - } - let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI"); - let nsISecTel = Ci.nsISecurityUITelemetry; - bucketName += isTopFrame ? "TOP_" : "FRAME_"; switch (elementId) { case "getMeOutButton": - if (sendTelemetry) { - secHistogram.add(nsISecTel[bucketName + "GET_ME_OUT_OF_HERE"]); - } getMeOutOfHere(); break; case "reportButton": // This is the "Why is this site blocked" button. We redirect // to the generic page describing phishing/malware protection. - - // We log even if malware/phishing/unwanted info URL couldn't be found: - // the measurement is for how many users clicked the WHY BLOCKED button - if (sendTelemetry) { - secHistogram.add(nsISecTel[bucketName + "WHY_BLOCKED"]); - } openHelpLink("phishing-malware", false, "current"); break; case "ignoreWarningButton": if (gPrefService.getBoolPref("browser.safebrowsing.allowOverride")) { - if (sendTelemetry) { - secHistogram.add(nsISecTel[bucketName + "IGNORE_WARNING"]); - } this.ignoreWarningButton(reason); } break; @@ -3097,6 +3019,11 @@ function getWebNavigation() } function BrowserReloadWithFlags(reloadFlags) { + + // Reset DOS mitigation for auth prompts when user initiates a reload. + let browser = gBrowser.selectedBrowser; + delete browser.authPromptCounter; + let url = gBrowser.currentURI.spec; if (gBrowser.updateBrowserRemotenessByURL(gBrowser.selectedBrowser, url)) { // If the remoteness has changed, the new browser doesn't have any @@ -3213,12 +3140,14 @@ var PrintPreviewListener = { this._chromeState.globalNotificationsOpen = !globalNotificationBox.notificationsHidden; globalNotificationBox.notificationsHidden = true; +#ifdef MOZ_SERVICES_SYNC this._chromeState.syncNotificationsOpen = false; var syncNotifications = document.getElementById("sync-notifications"); if (syncNotifications) { this._chromeState.syncNotificationsOpen = !syncNotifications.notificationsHidden; syncNotifications.notificationsHidden = true; } +#endif }, _showChrome: function () { if (this._chromeState.notificationsOpen) @@ -3230,8 +3159,10 @@ var PrintPreviewListener = { if (this._chromeState.globalNotificationsOpen) document.getElementById("global-notificationbox").notificationsHidden = false; +#ifdef MOZ_SERVICES_SYNC if (this._chromeState.syncNotificationsOpen) document.getElementById("sync-notifications").notificationsHidden = false; +#endif if (this._chromeState.sidebarOpen) SidebarUI.show(this._sidebarCommand); @@ -3818,8 +3749,6 @@ function toOpenWindowByType(inType, uri, features) function OpenBrowserWindow(options) { - var telemetryObj = {}; - TelemetryStopwatch.start("FX_NEW_WINDOW_MS", telemetryObj); function newDocumentShown(doc, topic, data) { if (topic == "document-shown" && @@ -3827,7 +3756,6 @@ function OpenBrowserWindow(options) doc.defaultView == win) { Services.obs.removeObserver(newDocumentShown, "document-shown"); Services.obs.removeObserver(windowClosed, "domwindowclosed"); - TelemetryStopwatch.finish("FX_NEW_WINDOW_MS", telemetryObj); } } @@ -3952,66 +3880,6 @@ function updateEditUIVisibility() } /** - * Opens a new tab with the userContextId specified as an attribute of - * sourceEvent. This attribute is propagated to the top level originAttributes - * living on the tab's docShell. - * - * @param event - * A click event on a userContext File Menu option - */ -function openNewUserContextTab(event) -{ - openUILinkIn(BROWSER_NEW_TAB_URL, "tab", { - userContextId: parseInt(event.target.getAttribute('data-usercontextid')), - }); -} - -/** - * Updates File Menu User Context UI visibility depending on - * privacy.userContext.enabled pref state. - */ -function updateUserContextUIVisibility() -{ - let menu = document.getElementById("menu_newUserContext"); - menu.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled"); - if (PrivateBrowsingUtils.isWindowPrivate(window)) { - menu.setAttribute("disabled", "true"); - } -} - -/** - * Updates the User Context UI indicators if the browser is in a non-default context - */ -function updateUserContextUIIndicator() -{ - let hbox = document.getElementById("userContext-icons"); - - let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid"); - if (!userContextId) { - hbox.setAttribute("data-identity-color", ""); - hbox.hidden = true; - return; - } - - let identity = ContextualIdentityService.getIdentityFromId(userContextId); - if (!identity) { - hbox.setAttribute("data-identity-color", ""); - hbox.hidden = true; - return; - } - - hbox.setAttribute("data-identity-color", identity.color); - - let label = document.getElementById("userContext-label"); - label.setAttribute("value", ContextualIdentityService.getUserContextLabel(userContextId)); - - let indicator = document.getElementById("userContext-indicator"); - indicator.setAttribute("data-identity-icon", identity.icon); - - hbox.hidden = false; -} - -/** * Makes the Character Encoding menu enabled or disabled as appropriate. * To be called when the View menu or the app menu is opened. */ @@ -4623,25 +4491,6 @@ var TabsProgressListener = { _startedLoadTimer: new WeakSet(), onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) { - // Collect telemetry data about tab load times. - if (aWebProgress.isTopLevel && (!aRequest.originalURI || aRequest.originalURI.spec.scheme != "about")) { - if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) { - if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) { - this._startedLoadTimer.add(aBrowser); - TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser); - Services.telemetry.getHistogramById("FX_TOTAL_TOP_VISITS").add(true); - } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP && - this._startedLoadTimer.has(aBrowser)) { - this._startedLoadTimer.delete(aBrowser); - TelemetryStopwatch.finish("FX_PAGE_LOAD_MS", aBrowser); - } - } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP && - aStatus == Cr.NS_BINDING_ABORTED && - this._startedLoadTimer.has(aBrowser)) { - this._startedLoadTimer.delete(aBrowser); - TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS", aBrowser); - } - } // We used to listen for clicks in the browser here, but when that // became unnecessary, removing the code below caused focus issues. @@ -4710,7 +4559,6 @@ nsBrowserAccess.prototype = { _openURIInNewTab: function(aURI, aReferrer, aReferrerPolicy, aIsPrivate, aIsExternal, aForceNotRemote=false, - aUserContextId=Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID, aOpener = null, aTriggeringPrincipal = null) { let win, needToFocusWin; @@ -4739,7 +4587,6 @@ nsBrowserAccess.prototype = { triggeringPrincipal: aTriggeringPrincipal, referrerURI: aReferrer, referrerPolicy: aReferrerPolicy, - userContextId: aUserContextId, fromExternal: aIsExternal, inBackground: loadInBackground, forceNotRemote: aForceNotRemote, @@ -4816,13 +4663,10 @@ nsBrowserAccess.prototype = { // will do the job of shuttling off the newly opened browser to run in // the right process once it starts loading a URI. let forceNotRemote = !!aOpener; - let userContextId = aOpener && aOpener.document - ? aOpener.document.nodePrincipal.originAttributes.userContextId - : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID; let openerWindow = (aFlags & Ci.nsIBrowserDOMWindow.OPEN_NO_OPENER) ? null : aOpener; let browser = this._openURIInNewTab(aURI, referrer, referrerPolicy, isPrivate, isExternal, - forceNotRemote, userContextId, + forceNotRemote, openerWindow, triggeringPrincipal); if (browser) newWindow = browser.contentWindow; @@ -4854,16 +4698,10 @@ nsBrowserAccess.prototype = { var isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL); - var userContextId = aParams.openerOriginAttributes && - ("userContextId" in aParams.openerOriginAttributes) - ? aParams.openerOriginAttributes.userContextId - : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID - let browser = this._openURIInNewTab(aURI, aParams.referrer, aParams.referrerPolicy, aParams.isPrivate, isExternal, false, - userContextId, null, aParams.triggeringPrincipal); if (browser) return browser.QueryInterface(Ci.nsIFrameLoaderOwner); @@ -5420,11 +5258,6 @@ function handleLinkClick(event, href, linkNode) { triggeringPrincipal: doc.nodePrincipal, }; - // The new tab/window must use the same userContextId - if (doc.nodePrincipal.originAttributes.userContextId) { - params.userContextId = doc.nodePrincipal.originAttributes.userContextId; - } - openLinkIn(href, where, params); event.preventDefault(); return true; @@ -5496,8 +5329,6 @@ function handleDroppedLink(event, urlOrLinks, name) let lastLocationChange = gBrowser.selectedBrowser.lastLocationChange; - let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid"); - // event is null if links are dropped in content process. // inBackground should be false, as it's loading into current browser. let inBackground = false; @@ -5521,7 +5352,6 @@ function handleDroppedLink(event, urlOrLinks, name) replace: true, allowThirdPartyFixup: false, postDatas, - userContextId, }); } }); @@ -5703,16 +5533,6 @@ function setStyleDisabled(disabled) { gPageStyleMenu.disableStyle(); } - -var LanguageDetectionListener = { - init: function() { - window.messageManager.addMessageListener("Translation:DocumentState", msg => { - Translation.documentStateReceived(msg.target, msg.data); - }); - } -}; - - var BrowserOffline = { _inited: false, @@ -6381,9 +6201,14 @@ function checkEmptyPageOrigin(browser = gBrowser.selectedBrowser, return ssm.isSystemPrincipal(contentPrincipal); } +#ifdef MOZ_SERVICES_SYNC function BrowserOpenSyncTabs() { - gSyncUI.openSyncedTabsPanel(); + if (gSyncUI._needsSetup()) + gSyncUI.openSetup(); + else + switchToTabHavingURI("about:sync-tabs", true); } +#endif /** * Format a URL @@ -7683,8 +7508,6 @@ var TabContextMenu = { this.contextTab.addEventListener("TabAttrModified", this, false); aPopupMenu.addEventListener("popuphiding", this, false); - - gFxAccounts.updateTabContextMenu(aPopupMenu); }, handleEvent(aEvent) { switch (aEvent.type) { diff --git a/application/basilisk/base/content/browser.xul b/application/basilisk/base/content/browser.xul index 982edfcd9..91299de29 100644 --- a/application/basilisk/base/content/browser.xul +++ b/application/basilisk/base/content/browser.xul @@ -8,7 +8,6 @@ <?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?> <?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?> -<?xml-stylesheet href="chrome://browser/content/usercontext/usercontext.css" type="text/css"?> #ifdef MOZ_DEVTOOLS <?xml-stylesheet href="chrome://devtools/skin/devtools-browser.css" type="text/css"?> #endif @@ -101,11 +100,6 @@ tbattr="tabbrowser-multiple" oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/> <menuseparator id="context_sendTabToDevice_separator" hidden="true"/> - <menu id="context_sendTabToDevice" label="&sendTabToDevice.label;" - accesskey="&sendTabToDevice.accesskey;" hidden="true"> - <menupopup id="context_sendTabToDevicePopupMenu" - onpopupshowing="gFxAccounts.populateSendTabToDevicesMenu(event.target, TabContextMenu.contextTab.linkedBrowser.currentURI.spec, TabContextMenu.contextTab.linkedBrowser.contentTitle);"/> - </menu> <menuseparator/> <menuitem id="context_reloadAllTabs" label="&reloadAllTabs.label;" accesskey="&reloadAllTabs.accesskey;" tbattr="tabbrowser-multiple-visible" @@ -391,59 +385,6 @@ <tooltip id="dynamic-shortcut-tooltip" onpopupshowing="UpdateDynamicShortcutTooltipText(this);"/> - - <menupopup id="SyncedTabsSidebarContext"> - <menuitem label="&syncedTabs.context.open.label;" - accesskey="&syncedTabs.context.open.accesskey;" - id="syncedTabsOpenSelected" where="current"/> - <menuitem label="&syncedTabs.context.openInNewTab.label;" - accesskey="&syncedTabs.context.openInNewTab.accesskey;" - id="syncedTabsOpenSelectedInTab" where="tab"/> - <menuitem label="&syncedTabs.context.openInNewWindow.label;" - accesskey="&syncedTabs.context.openInNewWindow.accesskey;" - id="syncedTabsOpenSelectedInWindow" where="window"/> - <menuitem label="&syncedTabs.context.openInNewPrivateWindow.label;" - accesskey="&syncedTabs.context.openInNewPrivateWindow.accesskey;" - id="syncedTabsOpenSelectedInPrivateWindow" where="window" private="true"/> - <menuseparator/> - <menuitem label="&syncedTabs.context.bookmarkSingleTab.label;" - accesskey="&syncedTabs.context.bookmarkSingleTab.accesskey;" - id="syncedTabsBookmarkSelected"/> - <menuitem label="&syncedTabs.context.copy.label;" - accesskey="&syncedTabs.context.copy.accesskey;" - id="syncedTabsCopySelected"/> - <menuseparator/> - <menuitem label="&syncSyncNowItem.label;" - accesskey="&syncSyncNowItem.accesskey;" - id="syncedTabsRefresh"/> - </menupopup> - <menupopup id="SyncedTabsSidebarTabsFilterContext" - class="textbox-contextmenu"> - <menuitem label="&undoCmd.label;" - accesskey="&undoCmd.accesskey;" - cmd="cmd_undo"/> - <menuseparator/> - <menuitem label="&cutCmd.label;" - accesskey="&cutCmd.accesskey;" - cmd="cmd_cut"/> - <menuitem label="©Cmd.label;" - accesskey="©Cmd.accesskey;" - cmd="cmd_copy"/> - <menuitem label="&pasteCmd.label;" - accesskey="&pasteCmd.accesskey;" - cmd="cmd_paste"/> - <menuitem label="&deleteCmd.label;" - accesskey="&deleteCmd.accesskey;" - cmd="cmd_delete"/> - <menuseparator/> - <menuitem label="&selectAllCmd.label;" - accesskey="&selectAllCmd.accesskey;" - cmd="cmd_selectAll"/> - <menuseparator/> - <menuitem label="&syncSyncNowItem.label;" - accesskey="&syncSyncNowItem.accesskey;" - id="syncedTabsRefreshFilter"/> - </menupopup> </popupset> #ifdef CAN_DRAW_IN_TITLEBAR @@ -521,8 +462,7 @@ tabbrowser="content" flex="1" setfocus="false" - tooltip="tabbrowser-tab-tooltip" - stopwatchid="FX_TAB_CLICK_MS"> + tooltip="tabbrowser-tab-tooltip"> <tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/> </tabs> @@ -552,12 +492,7 @@ key="key_undoCloseTab" label="&undoCloseTab.label;" observes="History:UndoCloseTab"/> - <menuseparator id="alltabs-popup-separator-1"/> - <menu id="alltabs_containersTab" - label="&newUserContext.label;"> - <menupopup id="alltabs_containersMenuTab" /> - </menu> - <menuseparator id="alltabs-popup-separator-2"/> + <menuseparator id="alltabs-popup-separator"/> </menupopup> </toolbarbutton> @@ -676,10 +611,6 @@ tooltiptext="&urlbar.webRTCShareScreenNotificationAnchor.tooltip;"/> <image id="servicesInstall-notification-icon" class="notification-anchor-icon service-icon" role="button" tooltiptext="&urlbar.servicesNotificationAnchor.tooltip;"/> - <image id="translate-notification-icon" class="notification-anchor-icon translation-icon" role="button" - tooltiptext="&urlbar.translateNotificationAnchor.tooltip;"/> - <image id="translated-notification-icon" class="notification-anchor-icon translation-icon in-use" role="button" - tooltiptext="&urlbar.translatedNotificationAnchor.tooltip;"/> <image id="eme-notification-icon" class="notification-anchor-icon drm-icon" role="button" tooltiptext="&urlbar.emeNotificationAnchor.tooltip;"/> </box> @@ -975,6 +906,18 @@ type="checkbox" label="&fullScreenCmd.label;" tooltip="dynamic-shortcut-tooltip"/> + +#ifdef MOZ_SERVICES_SYNC + <toolbarbutton id="sync-button" + class="toolbarbutton-1 chromeclass-toolbar-additional" + label="&syncToolbarButton.label;" + oncommand="gSyncUI.handleToolbarButton();"/>> + + <toolbarbutton id="sync-tabs-button" + class="toolbarbutton-1 chromeclass-toolbar-additional" + label="&syncTabsToolbarButton.label;" + oncommand="BrowserOpenSyncTabs();"/> +#endif </toolbarpalette> </toolbox> @@ -1002,7 +945,8 @@ contentcontextmenu="contentAreaContextMenu" autocompletepopup="PopupAutoComplete" selectmenulist="ContentSelectDropdown" - datetimepicker="DateTimePickerPanel"/> + datetimepicker="DateTimePickerPanel" + authdosprotected="true" /> </vbox> <vbox id="browser-border-end" hidden="true" layer="true"/> </hbox> diff --git a/application/basilisk/base/content/content.js b/application/basilisk/base/content/content.js index 5accbdf7b..d2a70ba11 100644 --- a/application/basilisk/base/content/content.js +++ b/application/basilisk/base/content/content.js @@ -162,9 +162,6 @@ var handleContentContextMenu = function (event) { let selectionInfo = BrowserUtils.getSelectionDetails(content); - let loadContext = docShell.QueryInterface(Ci.nsILoadContext); - let userContextId = loadContext.originAttributes.userContextId; - if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) { let editFlags = SpellCheckHelper.isEditable(event.target, content); let spellInfo; @@ -188,7 +185,7 @@ var handleContentContextMenu = function (event) { principal, docLocation, charSet, baseURI, referrer, referrerPolicy, contentType, contentDisposition, frameOuterWindowID, selectionInfo, disableSetDesktopBg, - loginFillInfo, parentAllowsMixedContent, userContextId }, + loginFillInfo, parentAllowsMixedContent }, { event, popupNode: event.target }); } else { @@ -212,7 +209,6 @@ var handleContentContextMenu = function (event) { disableSetDesktopBackground: disableSetDesktopBg, loginFillInfo, parentAllowsMixedContent, - userContextId, }; } } diff --git a/application/basilisk/base/content/global-scripts.inc b/application/basilisk/base/content/global-scripts.inc index eef21e15e..6edb11214 100644 --- a/application/basilisk/base/content/global-scripts.inc +++ b/application/basilisk/base/content/global-scripts.inc @@ -14,7 +14,6 @@ <script type="application/javascript" src="chrome://browser/content/browser-captivePortal.js"/> <script type="application/javascript" src="chrome://browser/content/browser-ctrlTab.js"/> <script type="application/javascript" src="chrome://browser/content/browser-customization.js"/> -<script type="application/javascript" src="chrome://browser/content/browser-devedition.js"/> <script type="application/javascript" src="chrome://browser/content/browser-feeds.js"/> <script type="application/javascript" src="chrome://browser/content/browser-fullScreenAndPointerLock.js"/> <script type="application/javascript" src="chrome://browser/content/browser-fullZoom.js"/> @@ -27,7 +26,6 @@ <script type="application/javascript" src="chrome://browser/content/browser-safebrowsing.js"/> #endif <script type="application/javascript" src="chrome://browser/content/browser-sidebar.js"/> -<script type="application/javascript" src="chrome://browser/content/browser-syncui.js"/> <script type="application/javascript" src="chrome://browser/content/browser-tabsintitlebar.js"/> <script type="application/javascript" src="chrome://browser/content/browser-thumbnails.js"/> <script type="application/javascript" src="chrome://browser/content/browser-trackingprotection.js"/> @@ -36,4 +34,3 @@ <script type="application/javascript" src="chrome://browser/content/browser-data-submission-info-bar.js"/> #endif -<script type="application/javascript" src="chrome://browser/content/browser-fxaccounts.js"/> diff --git a/application/basilisk/base/content/newtab/alternativeDefaultSites.json b/application/basilisk/base/content/newtab/alternativeDefaultSites.json deleted file mode 100644 index 018d3edcc..000000000 --- a/application/basilisk/base/content/newtab/alternativeDefaultSites.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "directory": [ - { - "bgColor": "#ffffff", - "directoryId": 10000000, - "imageURI": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAIX0lEQVR4nO1afXDbZh1+sxbWsbGvsrLbuBt36766sR3sOEgiuU4kx2vTpFGKm0SKsyyOlI8laUZTulLojQEHx4CyAaNnt72yrivklo1YSpxcW7YVbKXHgCvduCvroDt6o6OtLSWN1MRWX/5I4imyJMu2bPNHnrvfSZbf6P09z+/jfV+3ACxhCUsoAEouNWGlMRLri5GuZwUSe1Ug8bcFEjsjUPgHAoX/UyCxkyKJjQoU/iOhCd8WJSvW/8vpXFFsx7PGeaJsVaytul+g8KMiic+IFA7NTNB/rggk/jeRcu26RGFris3JEqIUtkFsdo2KFK6kI52pCSR2UmirZgY9YFmxeaYg1uyqFSj8lMXI5mofRb3rOwEAJcXmDS72ex8QvO43skjv3MeT2DtRX2150cgLzVUDIonF8xBh64KQ2FWRwncPejyFK4tYq/Nmoa1mPE/pnZ1ILe4TFxpdd+SdvOhxrhabXaeLTVjfsHfzSj5K4V8QKfyjnGs3P2UiCt/v/1LeyAsNlXebkbeRSOZ/Q+JCrBH/Yt7IX+qlbhS96dM+Y+dJLC6S+BWRwmazFizf5AEAQPRtHLEhukqMwo8KTfg2oamy8t+e0uvUczwDwDWxhopHBBLvElrc+wUSm/r/IN9a3ZtrbYqUe9eHTc7PZDLvoAcsi/lq2wQSO1M88k93r7ayjzdI76sxEv/5hdryT+foRknM696q9qMg5AEAQHx83WhWtU5i56PtG1E7fYkO+B4SKNd7AoWLBSEv9G3Asol8zOs+ddFTeWc+fDrXgq2MNmEP5+PdKZB/XR4RvRnWe8tjJ8+1ECsL4mA+EQ+vcCg8gHHuPjjZvc5S6guU6/3/POG5rdi+24IEv+KwEgFQ4QFU/rAKTu90pal5fCY60PlQsf22BefHwfUKD2YVfl6ACIAKfx2UX0QNBYj6arqL7bdtSIQBnYy+2iIAzg49Cid9bm3qv11sn21FggeHUwSILGQCgIljd8Kpreq+4Koqts+2QuGBmBL9FLsFSj+sgAKFnyq2v7ZCDoO7dKOvvc7fS3vcW4rts61I8OBxXdI6/UCJADgVvmGVHfMSAelgfUA6VBeQDqmv2nuzZ3rf6Y2r3SM7DB1RwmCnOsLaiGuenbWD/JwAcqI+IEPCL8H6gAwX7omADIn5z/Wqe0Iz1sgI3edSv6EjcR78OEk4jQiJCNhnlwD1ATlBmDqdCUHzcYRf3mXoSCIMXjdK95SeEAbfslUAk4iaEc1EsLnx0vNmAhw3q3mNAFvtFCBd2i8i4bdWAgYCDBkLwIMJw8antTDos12ARSTNM8JK5Amd8URAPmosQAS8Zdr41N/lIQOS0Z2/pkZe0iWoS35+rIY8rPfLvzcWgAdDljMgAr5tlwCEWgArjUxnnJXSmX8eMnQkPrH8OasCJMJgfyEE0KZxMrJ+i2WgyZq6gHTQ0BGFv+abujs//ab4gV0CqEvAar1n0gQXizj9PUNHEmHgTSFt1At4O3eCH+8D0tW2YUmoMkKvfyQzwC/vMHREegN8Tpe4zjIY55fD14+X9tgiwC8mV2ZrHS/LGOGXRd3y8aeKVee/3GrqjBIGMcMsmL/GJu6AW4+1QZRl/mKHADmipD4gz1jJHCIgw9oXJ+8zfVsi/ImXU7bDquvfI2ugZ7wHoiwDUY6BTrbTWRie+ti0d7rGrHTU5UD45StpX5iILPMZrQTD4Q0QG+2GKMckzcF28AXgaYiv7ZNesdokCb90PO0LP2TBpxQezKpFkPmb4Q/ebFlEHOWYZBY8FtriKwDXFDAHhLvr/bJi9TzQtPeycQNUI3HihkML5M9NfB4+caRTl/jHRsvtb333gTzzTUHDPonNZFkkfjVl7Zfr+MRtiMID+McICqtDvfrE2cWfHRxz2j321K155pxE84HLLWb7BK0odX75TEYTBI43hB1ch0HE554h7GJhKrkn/4wPMjfliXMSO4alcsIvx/UanZE17pcGMppkU2iL2zDt9QSZtwqu66/Okdbb88Qd7PydVFYfkGVthLWHHk1JyOteuHRjxpNh3JNjRtE3EgDlGIiwzLlqrq/MbvKtLwkewi/PalPc8PyQPDdIP8lqQvdw92qEZWbNyBqJgnD0VTTI7H74Je/1uRL/8mDr7VWjfYeJkecgdfC/6c8JavPL0+6fitn3JtdIzxbdqLPqiNMmwtAxR7BzZ+mgL2MnHGzHPQhL/wzlmCsLc64PbYPU4Xd1zwN6WdCwT/p61uQXsH6sL5TS/dOUgY4QCZRlxsuD9EDZsM/x4KDnk5ppSsqGfHehw3QjytHfQVj6HaP+U8F1wZbhMf1Dkerzpr3Sn4Ad/5/Yc2T7TQ6OOW2YBWZimAsVRzlaRoL0DMLRV/WW19SVh05+v5nbAxsPCPpZ4Jclwj95b87kF+BgO+5Bg8yFFHKZZkO68XqimoyvGd0FqUNnU/pA1yvTdbaRXwDCtj2CsszFjFLfSjZoRbEiqEqoqtE+6H2VT5LfvPfydtvJJ0V4jb537QhzxjLRdMSsimIhq5q538DNgSnbfqs0FoHrusUd6j2ScdTNyGZTNovfHa8Z6/fmnbwaTq5r+1wj0ziZrjlmvIKYP3ew9Hvk+NOPFpT8AjxHd6ypGOl607Z+YDUL5s4iChpkdq8b7b22KOTVQIPtGxet3bmQtVA6eKhnyBP6hvnPW8UAwvpq1nIdoeS6bpWY0fK3aMfJTCMc/csqtuf+YvNMi68Mt38WDTJPoSx9DGHpmaxLI8hcqBzpCiDB9ibnM87lxeaVLUrKg+1fRVimby3LPItw9G9Rlj6Bssw/EI4+i3DM+0iQPomy9JiD69hdztI7SoPtTWWvddry7w5LWIIx/gdCuvcjoZqlLQAAAABJRU5ErkJggg==", - "type": "affiliate", - "title": "Google", - "url": "https://www.google.com/" - }, - { - "bgColor": "#E62117", - "directoryId": 10000001, - "imageURI": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAACd0lEQVR4nO3av0tVYRzH8WOIBEVDUUIGCa32FwQ5OrS42NKeRUOTdGmoqUGiLVBqa5UG+7WUREGiEqhTDkVJEA2iYZBkxKvhHumo96o3uM9z0ucNZ7zn834+XO59znm+WZZIJBKJRCKRSGwCx3AWfbiIaxjEPYzgOd7gLWbwIb8WsFjjWrU9q3U+u1C4/0yeOZ47jOROg6jkrn25e3uji27NbzC9A9n/hWnVNbVut/hOTMZ1bSqT6Ky3+A58jOsXhE/o2Lj4FryILBaSF2gpFtAT2ygCPcUCHse2icDTtcW3YSW2TQRW0JahK7ZJRLoy9Ma2iEhvhoHYFhEZyDAU2yIiwxkeBgj6FSDjXxjN8CpA0A1cxucAWY0wkeFdgKBK/pe7H1fxNUDmTpjLMB8gqLJh631A9dF6IUD2Vsxn+BYgaF0BhSIO4WYgh1osZVgOEFSzgEIRh3EL3wO4FFnOAgVtWUChiKO4gx+BvJSqgEIRx3EXP5stVsoCCkWcxH1N3EeUuoBCEafwshlipS8AJzTxW1DaAnAEtzX5B7F0BeAgrmMphFhpClB9M3UFXwI5oQQFYB8u4H0gl3VE3QninOoxVyyWozwL4AxeB8jdjqWgT4M4jUcB8nbKfKj3AUN4gN8BshphLtQbobIyEeqdYFkZzTAc2yIiw+lcQDoZSmeDe/t0ON+gPIltE4Fnxa3pnp8QacFYbKOAjCnOCOUldKhOUO12Nk+JFUroxFRkwWYypd6cYKGEVvTbfZOil2w3KVqjjHZ047xqKRWbZ4XHVed2Z/2d5a0167vYgHC9z6/df9bWs8L9uXO3RmeFE4lEIpFIJPYKfwAcall+TY3q/wAAAABJRU5ErkJggg==", - "type": "affiliate", - "title": "YouTube", - "url": "https://www.youtube.com/" - }, - { - "directoryId": 10000002, - "imageURI": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAACT0lEQVR4nO3bzWsTQRgG8PlPHMVLqRVMoQiFehJyUBAFtRCFHspExaaSoFg8CMGPSg+R3kQhh3osIbOlMVrbGKtrsbYESTbB0gqNVGu1WCkWutnXg+ihQjqxi7Oz8w481533+V32iyGEEEIZ76Rho0SZ4ewOG+D3UMatXSx9nPwqb5ySPZC0dPMzhDJelD6IrDCjQijjtvRBJIWGeY3IHkJ2EED2ALKDALIHkB2lAJoujkIwnoNQwoQL96aha3AKQgkTTtyZhKM383D4+gQEoll/AQRiWbg1XILZ+VWwaw6IrE3bgZbejNoAe8+PwEC6DOsbm0Klt679lxQGCESzMD335Z+KKw+wrzcDpcVvOyqvNMCwubjj8soCnBx44Up5ZQGeFZf1BWi7/BhqjthtzpcAseRsQwVrjgNzS9/hZWUFJq3Pf6U5MqoWQHJ8Qbh8aqoKB688cWVfzwBMvP0kVN6srMCec+7t6xmAmfmvQgCRBzOu7usZgHJ1TQjgyI283gCHrj3VG6C9bwwBEAABEEAtgAPRR9A3VKibpdUfQgD9KWvba529+8pbAMF4TqicW+th/r3eAP0pS2+Anvtv9AY4dvu53gCtMfGfI74DWN+wG5rNdwDl6preAGOFj3oDJMcXvAfQHMlAKGHWTeWD2KPw1aFC3et0NPi9wDPvAq/fif0LDMZzru6LALKLIwACIAACIAACIAACIAACIAACIAACIAACIMD/BvDKwUkZAJRx2zNHZyUBFAntTp+WXV4iQCf5c3yecUsXAMq49bv8Txsl6ZCTabOAAAAAAElFTkSuQmCC", - "title": "Facebook", - "type": "affiliate", - "url": "https://www.facebook.com/" - }, - { - "bgColor": "#ffffff", - "directoryId": 10000003, - "imageURI": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAA/CAYAAABQHc7KAAAEyUlEQVRoge2abYhVRRjHf7veVqSFhIQwa7E3ojXNpSiNgl0S+tAHKUjohbQohUgqKKwMSXpbsATdqOgFU4zKpAzMioploxI/WFBZmhRlL/S2lbpsudvd24dzjve5c58558ycey9B84MB95x5/vM/d+bMzDNHCAQCgUAgEAgE/rf0AOd6lJmKVrdDfI8SfxawIKNcEscfa8TOzBFrlj6Aimd5XnmAbx01TD5xiL3IiH3Y8zm4DXgaGALGMip/DDwHDACXKQ9wA/AiMJyi8T3wAnCvEr841t9tiR2JY/uB443YC4BHgA3ApyntTxD90FuAlaaBU4EfLIHvKIZtnAT8ZtE5O6fGCiNuFJiTM7YNWKe0PQScmRV8ncX4+zkbT1hq0bkyZ/wyI+5ux/bPM+I/ACbnCSyhv8tloMvBQAnYr+h8mDP+PRHzGXCMQ9sA14j4ceAMl+A70HtvjaMJ22jqy4i70Kh/sWO7AO+K+Jdcg6cCh6k3/gfQ6aBTAr5UdN7OiHtL1H3NxXhMN9Fkl2jM89BgPXrv3eKoc71Fx2ZqvqhTJv+kKRkQGjs94gE4PTZgGt9DNMvmpQR8pehst9R/Q9TZ5OG7EzgkNK720DjKNvTeu9RRZ4miMUH9bnCeuH8EOMXD881C40egw0PjKL3oP8Cbjjq2FWGrUW+HuDfg6XmP0NA2W060GYKy97odtbQVoQzMiu+fL66PACd4+O0VGqPANA+NOm5CHwVPOeqUgH2Kzub4/uvi2gOeXrcU8GdlCtG7ZBr/C5juqHWtojMOXCX+HgaO8/B5YqyV6GjZpjf3oI+C+x11JgF7FZ1/xL/v9PS4WmgMempYsW2MfsdtYwTRsqT9mBXgANGIc6WD2lG60EMjk0fRTS931GkHPrdo3ejpbZHQ2B+30XC6iNZm0/Q3RBOcC7Yc4WRPb0NC43ZPjVxsRDe+yFHHHLJJWevhabaIP0z0ujaNWdQmGUn5yEPrPkVnBPe1+0kRv97DhzPb0UdBr6OObZv9kIOGnJzLRPlL0+lFN+6yPe5BH0kV4E/yD+PlIm6bQ/uF2Um98Qlgbs74V5V4WVbl0GgDvsB/BBbiCnTj2lG5yVyqvX+QaOSYOsNk7y8WiPo+c1Ah2tFPesbJTmFfEfX7qU2BZVmRoSPnkMU+D1EUW5L0WErMHKq9P0o149NeqZ+w7wq7qO77f02p11Qmo6/laWnoVlFvnbh+uaJTAW616Dwo6rjmIw3lLnTjminZ+38DM8Q92yv1HfUnOh3AL/H9I7hnpA1lKrXnb0nRkqSXxf0nFC3bK7XMqCdT6o2NeIiirEE3Lvfks6kesI6hf1m2nTt8TW2uIeeLhub8vsxAT5IOUB2+8qTm2RStlYqOnOV7xLXBRj5EUWxJ0hKic/2k98dJ367azh32Es0Tz4hrTcn5fZE9I8s+ajc6m20CgrUWrdVEK0yFJub8RRhEN56UMjk+TVO7xtuK6yFMS1hIuuk82+SETSk6h3A/hmsJ7egfPypEh555ej/hHOzZYktyfl9keiqLzzc+LUlqWc7vSyfRJ3Rpegw4zUOrj/ofoKU5vy/91Jp+vIDWLkPL/J9h/0mmAT9TXa58vvIkzKe6ydpQ3FogEAgEAoFAIBCI+Rf5q90lTPZHIwAAAABJRU5ErkJggg==", - "title": "Wikipedia", - "type": "affiliate", - "url": "https://www.wikipedia.org/" - }, - { - "bgColor": "#400090", - "directoryId": 10000004, - "imageURI": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAD3ElEQVR4nO3bS4xecxjH8WmLBVVEx63JBIkEISkhJqURpAsZQioWqpeNSxraYlKpSwiDIRY0aSakqgS9qHRBIhKxYdFFFxWXIGkilYZEUCKj4zLzsfi/LN55zpiZc/lr+/6Ss3nfc57ze77n9r88/y7swxaswgLM7jpMhTlYiNWtnPd1Ga9RfIVtuB+L0J3b/FSFeejDQ9iBvRhrTzYCUKTv8RFewlrcgAtxQsYk5+Ii3IQHsBm78ONkk5oKgIn0Mz7BO3gBA7gHS3EtLsXZre1UnITj2pI5vvV7D85BL67DCvRjEJvwHj7HcBXGqwJwyKoDILeB3OoAyG0gt8oAGMYj0qdnJ17DY3i2vK1CPYmn8Cq2YwgP4rfpBix7BwwE3+aZ2F0ybqQPMSM439NlgpYFMILzAlO9glZXCf2F+cF5LsafZQJX8Q4oujKbK4j9j4aC+EdhT9nAVb0Ebw8MduNABbF/wMlB/LUVxK4MwE84JTC5uoLYK4O48/BrBbEr/Qy+XnCbfloi5h7MCuJurcSxagGMYWFg9qr/SbxQVTeEiq7Ym9OI9UYQ52ipJ1iZ6mgJ3h0Y7zG17usvOC2I01+12ToAHBCMIGHdFGKsCo4/QwJTqerqC2wMEjgGX0zi2KLH6JU6jNYFYBSXBElc/R/HjaE3OO4y1bYs/1WdvcFd4hbilgmOie6cGa1Ytaju7vDSIKHTxc9yUYtvWZ0G6wawH8cGSa0J9r0t2G92K0ZtamJA5PEgsfaOTNHjMlC3uSYADKMnSG6B9GIr6uqehYN1m2tqSGxre4KtJDdhfcF/O5ow1hSAMVweJNmNOcHvlbb3J1KTg6K7MTO62m3Jz1LBQMdk1fSo8IpJALizSUNNA/jWBNPvOFGahG1MOeYFnpgAwHNNm8kB4CDODJI/F380bSbXzNAzAYD1OYzkAjAYABjKYaQDIMdJxQDqnFMsVC4A6wIAgzmMdADkOKkYwKM5jOQCcFcAYCqjxpUpF4Bovu+IB3BfDiO5AIzrFWJlDiO5ACzpABgP4I4cRnIBWBwAWJLDSC4AfR0A4wHcksNILgCLAgB9OYzkAnDFkQ5gDZbj3ta2XCp5bVydYuncBnKrAyC3gdzqAMhtILfqBDCCb6SZ3velatGXsUFa5NC+vdjatrf2/QAfSyUyv9dlsgyAEXyGt/G8VBl+PS7A3PaGTllJCy7n40Zp8GQD3sWXSgCaDIBRqcBxGx7GYmll57hixlySaojPx83SuqW3pLXC0wKwX7oF+3GloILjUJE03X6NtAh8J76LAOzFRtwqKGY63CStX14mLen5+m9Vgqdbrd+9cgAAAABJRU5ErkJggg==", - "title": "Yahoo!", - "type": "affiliate", - "url": "https://www.yahoo.com/" - }, - { - "directoryId": 10000005, - "imageURI": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAJdklEQVR4nO1ba1QTZwL9iCY8hCDxDUpYOIUDBOVZAlJ5NQXRFlEQ8YGiRaqESlhxeRQ3FAWURRC6FYglqBHTEaI8Eg+CRMRatfKwLNL6oqer1h57XEWYbwJK9sdKixiSmRCCbrnn3D8w351770wy3zd8ADCJSUxiPMHhcPS3bdv2/tq1a9MWL16MODs7t5iamt4zMjLq0dfX76VSqU8sLCzueHt7S+3t7QtjYmLWJyYmzp1o32NGSUmJd0BAQLmRkVEPAEBOhCQS6bm3t7c0MjIyHACgMyEB1AGCILTY2NgUOzu7fwGCoUfj/Pnz/x0XF/fXgoICXW3nIYTs7Owlpqam94CGgo+ktbX1j4mJiY7azIQbMTExu3V0dF6AcQo/RF1dXYggSIj2kuFAfHx8Lhjn4ODVElCxWOygpXjKkZWVxQZaDD9EOp3eXV9fb6yVkKOho6Njgb6+fp8ig9pgfHx8gjZyjgYdX1/fhtHMqSKJRHpOJpNl6o4HAMidnJxatJJUEWpraz3xmBxOExOT30JDQ/+elpZmD14+26uqqubExcVFzJs3T53H5uCJEydMtZN4BKKiovKJmA0KChLu3bt3zmh6Bw4c0F+3bl0BEU0AgLygoCByXAKqgq2tbSdek0FBQTV4dZlM5kW8ugAAOZPJ/IeGIuHH9evXp+no6DzHa7K+vt4Lr3ZiYuIOvLoAALmnp6dQQ7HwIzc31xqvQRsbmy5AYC6fnJzsjlcbACD38/M7p5lUBBEeHp5lbm7+E4lEUnonREdHpxPRLSwsNFWmN5Kurq5XNZNITfj4+EwtLCw0dXFxcebz+UFhYWFbmExm6qZNm/IjIiKyampqDIjonTp1ajp4mwrQNP70BfD5/D9PAcXFxQZcLteOwWCw9u/f/3FwcHC6paVlOfg/K4CUlpbmEB0dvSEkJCTLxsamwtnZuXXmzJmPAACDgEBYRXxjC8jJyfFYtmzZYWNj48dgjCGV8Y0qICsryyQiIiKVTqf/BMYxNHgTC8jPz/+ISqU+AVoKDt6kAnbs2MGeMmXKANByePAmFBAbG5utyJi2OKEFJCcnx+MxqYizZs361d/fvyw9PX0bg8FgZWRk2FZVVc1pampaQERnwgoQi8VLVK0DRpJMJstWrlx5hMPhvMflckmKdN+amSDRdbuenl5fRkaGnyrdt6KAsrKyD4iYpFKpTy9cuPAuHu23ogAmk9lIxGRCQsLneLVLS0tnEdHWegFisXgu0b8ANTc3W+LVT0pKsiSirfUCDh06tJyIQSsrq5tE9PPy8jyI6Gu9gMDAQA5Bg9VE9Hfu3BlFRJ/BYHSMPRUBsNnsfUQMksnkciL6q1ev5hHRNzQ07AHa3D9A9N19QEAA7lfiAAAdOp3eTUQfACBHEMR87MlwgmgBZmZm9wHOK1RUVLSFiPYQd+/eHaOheKrB4XCyiBrk8XguqnTb29vNDAwMeolqAwDkCxcuvKbBiMoREhLyKVGDy5cvr1Cm2d3dPd3Ly+sCUd3h3LNnT7xGg46GoqKiQHUMbt68uZjL5VJG6qWkpPjS6fS76miO4Ivm5maVd9qYUV5ePlPdtb+FhUV3cHBwkbm5efrGjRvz7O3tr2og+O90dHRslUqlUxX5lkq5U7HmJEtUsnTxwG0kEJ7b4Cer32ArlXIVHq8ULBarVpPGNcng4GDP4V6xloxArNq3oq+M9hTlUeSvsfwvPxMuoKGhwWO8N0RRKBSM6Bg6nf4jgiC0zk6Egl3czsYQhxsKQ48g4QIAAMDf3//0eIWn0WiPjh075jx79uyHeMfY2dl1IAgyFwAAZA1rjqE8ihw9rPscrXRp7xO5lckaN6X0t+dt7m/LiYanPI+iPPLgmApoa2t75+W7fY2GX7RoUcvx48fpAAAgEom88NwJLBbr65ycnGlD3gZuli15VhfC6JZy9Ubzj1W6to6pAAAAEAgEDsbGxv/RVHh3d/ezEomEOvwcqamp6crGsNns/NHeLg0HPPOhV98Pf2ynQRHG+ZcFDKpdAAAAFBcX+6qzF3gkly5dqjCIVCrVs7e3v6RozKpVqw6q8idrybCFonfrUB5FDqsWfzv0c1jh2IHyKHIotL0J+lsyY7CqJXmyO4hamw/Ly8vnhIeH51Op1KdEQtNotN9WrFjxpVAodFOmv337dkMmk1k9NI5CoWCZmZk7EQSZouj4bilfT/ZtUjhW4yNCDxv0ozyKHJaZ9Mq+S1sDAACdnQgF8o1RlEeRy5picsDA3dPv9QnMHqI88iAUudYNdJV4q1NEXFyc7q5duzZ4eXmdtLKyukUikV6ZL1Cp1CeOjo6tHh4eRVwudwWfzx/1MzoSXC53alRUVCaLxapjs9kBio55fC3bGPvm0wRUQL/3yjc9n9Yz0HX090zolTSP//2OPIjdEVkDAAB42nmYJjsbWjo0CEMcfoCNkXvR5lh3BAlT2LQqhIWFTZFIJFSJRELdunUrWR0NVXhc/zdj9MxHa6B4qRAemfHasx6rYUnQjn8uGD5G9k3CHpRHkcvqQk+8Joh1lX2AHl9wf+RkAWtYvx9eSvaWSn2Iz5w0jId1O6fJLn8Wila6iVCe/oCiZ3sff8YT7CLnE6BgJQoRhxtoqcmz3l8vK9629+xW6Sx4dnUmLJv55DXxo3MeQ8ThDKxlfS77Pm8F1pxkqegkmsItSZxu75nAhf1NMZFY47ov4MlFzejLz69ClhrB/vObc3uuZM5QpIf9fM4K5VHk/W25sSpP3tdaaArPrBSgJbovlM6m+LQeWO13HqtwO4i1Zn0CRZ5+2Hf7bB5cK8a9P6hbytfDOgqsMJErC7vyWRw87VUERR5X0VJDiGc2h/IocljL+rr3Klfpv9pg9xttsLOrVIcfDtltEQOtcP0CFZg/wGvmjysyvQ8VmP8ChTa3McThBiZya8NEbm3YSUYXFNrcRgXmv8Ay2jOUp0tMd9gdidWHFsiuH2QQCqUOuFwuSXY5ZT1a6dyullkNEiKMLky6NaYTeX2JrRXILqcslIkDk2GFYyP6lSE27oGPzHiKVTiJZdV+qf2dh50mJPRo6Jby9bBLycvRSpcCeNLpe7SEovw7Aw+/MpDBUx5XsNqAbHgp2buzc4KutDp4dHGXEVq3xh02fbwFq2Htg5WuQljlcwFWLOqAJ97p7hOYPewTmD2EQuu76Emn67DauxmtdEawap8ceH5TNFofznxQs5XQBstJTGISk1AX/wUPVWOeSpK50AAAAABJRU5ErkJggg==", - "title": "Amazon", - "type": "affiliate", - "url": "https://www.amazon.com/" - } - ] -} diff --git a/application/basilisk/base/content/newtab/customize.js b/application/basilisk/base/content/newtab/customize.js index 39724fa91..bc4903f6c 100644 --- a/application/basilisk/base/content/newtab/customize.js +++ b/application/basilisk/base/content/newtab/customize.js @@ -9,7 +9,6 @@ var gCustomize = { "blank", "button", "classic", - "enhanced", "panel", "overlay", "learn" @@ -83,13 +82,10 @@ var gCustomize = { } switch (event.currentTarget.id) { case "newtab-customize-blank": - sendAsyncMessage("NewTab:Customize", {enabled: false, enhanced: false}); + sendAsyncMessage("NewTab:Customize", {enabled: false}); break; case "newtab-customize-classic": - sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: false}); - break; - case "newtab-customize-enhanced": - sendAsyncMessage("NewTab:Customize", {enabled: true, enhanced: !gAllPages.enhanced}); + sendAsyncMessage("NewTab:Customize", {enabled: true}); break; case "newtab-customize-learn": this.showLearn(); diff --git a/application/basilisk/base/content/newtab/grid.js b/application/basilisk/base/content/newtab/grid.js index b6f98fa17..726150a6c 100644 --- a/application/basilisk/base/content/newtab/grid.js +++ b/application/basilisk/base/content/newtab/grid.js @@ -9,7 +9,6 @@ */ const GRID_BOTTOM_EXTRA = 7; // title's line-height extends 7px past the margin const GRID_WIDTH_EXTRA = 1; // provide 1px buffer to allow for rounding error -const SPONSORED_TAG_BUFFER = 2; // 2px buffer to clip off top of sponsored tag /** * This singleton represents the grid that contains all sites. @@ -142,13 +141,9 @@ var gGrid = { // 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; - } } } @@ -157,9 +152,6 @@ var gGrid = { this._gridDefaultContent.nextSibling.remove(); } this._node.appendChild(fragment); - - document.getElementById("topsites-heading").textContent = - hasHistoryTiles ? "Your Top Sites" : "Top Sites"; }, /** @@ -182,18 +174,15 @@ var gGrid = { // Create the site's inner HTML code. site.innerHTML = - '<span class="newtab-sponsored">' + newTabString("sponsored.button") + '</span>' + '<a class="newtab-link">' + ' <span class="newtab-thumbnail placeholder"/>' + ' <span class="newtab-thumbnail thumbnail"/>' + - ' <span class="newtab-thumbnail enhanced-content"/>' + ' <span class="newtab-title"/>' + '</a>' + '<input type="button" title="' + newTabString("pin") + '"' + ' class="newtab-control newtab-control-pin"/>' + '<input type="button" title="' + newTabString("block") + '"' + - ' class="newtab-control newtab-control-block"/>' + - '<span class="newtab-suggested"/>'; + ' class="newtab-control newtab-control-block"/>'; this._siteFragment = document.createDocumentFragment(); this._siteFragment.appendChild(site); @@ -274,6 +263,6 @@ var gGrid = { this._node.style.maxWidth = gGridPrefs.gridColumns * this._cellWidth + GRID_WIDTH_EXTRA + "px"; this._node.style.height = this._computeHeight() + "px"; - this._node.style.maxHeight = this._computeHeight(gridRows) - SPONSORED_TAG_BUFFER + "px"; + this._node.style.maxHeight = this._computeHeight(gridRows) + "px"; } }; diff --git a/application/basilisk/base/content/newtab/newTab.css b/application/basilisk/base/content/newtab/newTab.css index 658ad2ed3..64b3ed7ef 100644 --- a/application/basilisk/base/content/newtab/newTab.css +++ b/application/basilisk/base/content/newtab/newTab.css @@ -122,10 +122,6 @@ input[type=button] { pointer-events: none; } -body:not(.compact) #topsites-heading { - display: none; -} - /* * If you change the sizes here, make sure you * change the preferences: @@ -140,12 +136,6 @@ body:not(.compact) #topsites-heading { width: 290px; } -body.compact .newtab-cell { - width: 110px; - height: 110px; - margin: 12px; -} - /* SITES */ .newtab-site { position: relative; @@ -175,16 +165,13 @@ body.compact .newtab-cell { } /* TITLES */ -.newtab-sponsored, -.newtab-title, -.newtab-suggested { +.newtab-title { overflow: hidden; position: absolute; right: 0; text-align: center; } -.newtab-sponsored, .newtab-title { bottom: 0; white-space: nowrap; @@ -192,103 +179,11 @@ body.compact .newtab-cell { vertical-align: middle; } -.newtab-suggested { - border: 1px solid transparent; - border-radius: 2px; - font-size: 12px; - height: 17px; - line-height: 17px; - margin-bottom: -1px; - padding: 2px 8px; - display: none; - margin-left: auto; - margin-right: auto; - left: 0; - top: 215px; - -moz-user-select: none; -} - -.newtab-suggested-bounds { - max-height: 34px; /* 34 / 17 = 2 lines maximum */ -} - .newtab-title { left: 0; padding: 0 4px; } -.newtab-sponsored { - background-color: #FFFFFF; - border: 1px solid #E2E2E2; - border-radius: 3px; - color: #4A4A4A; - cursor: pointer; - display: none; - font-family: Arial; - font-size: 9px; - height: 17px; - left: 0; - line-height: 6px; - padding: 4px; - right: auto; - top: -15px; -} - -.newtab-site[suggested=true] > .newtab-sponsored { - background-color: #E2E2E2; - border: none; -} - -.newtab-site > .newtab-sponsored:-moz-any(:hover, [active]) { - background-color: #4A90E2; - border: 0; - color: white; -} - -.newtab-site > .newtab-sponsored[active] { - background-color: #000000; -} - -.newtab-sponsored:dir(rtl) { - right: 0; - left: auto; -} - -.newtab-site:-moz-any([type=enhanced], [type=sponsored], [suggested]) .newtab-sponsored { - display: block; -} - -.newtab-site[suggested] .newtab-suggested { - display: table; -} - -.sponsored-explain, -.sponsored-explain a, -.suggested-explain, -.suggested-explain a { - color: white; -} - -.sponsored-explain, -.suggested-explain { - background-color: rgba(51, 51, 51, 0.95); - bottom: 30px; - line-height: 20px; - padding: 15px 10px; - position: absolute; - text-align: start; -} - -.sponsored-explain input, -.suggested-explain input { - background-size: 18px; - height: 18px; - opacity: 1; - pointer-events: none; - position: static; - width: 18px; -} - /* CONTROLS */ .newtab-control { position: absolute; @@ -333,11 +228,6 @@ body.compact .newtab-cell { margin: 40px 0 15px; } -body.compact #newtab-search-container { - margin-top: 0; - margin-bottom: 80px; -} - #newtab-search-container[page-disabled] { opacity: 0; pointer-events: none; diff --git a/application/basilisk/base/content/newtab/newTab.inadjacent.json b/application/basilisk/base/content/newtab/newTab.inadjacent.json deleted file mode 100644 index 53fb542af..000000000 --- a/application/basilisk/base/content/newtab/newTab.inadjacent.json +++ /dev/null @@ -1,3209 +0,0 @@ -{ - "domains": [ - "rp5slFCxq/e7hYhXJCd0vQ==", - "2rEimAJDNX5g8HPZehOrGg==", - "nvLEpj6ZZF3LWH3wUB6lKg==", - "9Cqd4Lm3VvXuJxz79Bbqyg==", - "vNRy4LR+7TOKTixqsr5ybw==", - "N4zSgsZCo6Z4XRwZ4fu8WQ==", - "jsDtRfVbMsFg3KkEl2UiZQ==", - "TckkKpiq0a6J6NTw7uOZqw==", - "9Or7IAYuuIgZA370w9rNIg==", - "ul8WvOjCkxTz9LjT4RqTHg==", - "ZGJrbwb5878Nsqm0z+A7nQ==", - "5iT64HTeeG5SIFXG7A9o3w==", - "YSeSEghPe1kV6g8ghFcNAA==", - "0jIUl1NDmJZQkDY12VDeIQ==", - "aos6UyDyIw0R1nTK5wTawA==", - "G1xxubsq65ugK06UT2DO5A==", - "lbhavoDrDPP/8m0onwo63w==", - "ObcLsjW0SkdvY0nkZmiTGQ==", - "FHZ5084LC0nTAzZlnSKN3Q==", - "cdEr+0Fv5iaVZzalZToseg==", - "Co8WbNYbCPTFPcHpeK3hRQ==", - "qXSzhCEhByLQq9N84tqV+Q==", - "h3ufhRk5IEFaNH11rIACtQ==", - "fQ1PJ/JwazIaYoy/zy49QQ==", - "zAJqfbn54Nsm2ddGtkb59A==", - "ixPM9T8ik/gWGZ7BRIcaig==", - "/E9pwA3E3hVAZoYq3FmCyw==", - "U6ygonI8CxpruhpGB2+Q6A==", - "Igi4voB8oVMVw6WUeDSjZg==", - "jtuHIJhwoTGzavFpM7ilNw==", - "eBvTV27n6Gs+ZsBkpVynvw==", - "sFbzw0AUOGG0NEzkaSxVDg==", - "yAkIS+Ezj6woEff9YvdO7Q==", - "IP1+BwG6q60QzDADi8j7oA==", - "Q/teQEBFepHtwZ7UHa2TEA==", - "B1vDep5a1Gok5Gnth39+LA==", - "cyEIyQ2MZaPGf+K1x9Bbkg==", - "aaM+oEJnF4/nwMWyXJU8rA==", - "qpDNIpxah8FUiqXm5IRaUg==", - "ZTeJ35gMPqIv2WWbeNyIEg==", - "nzoAGQAnC/Xgg5PmOgXqkA==", - "J5pJDuNi3cqQiyaRJAJk4g==", - "2vqN53BXhXzPrKYsh6QH1A==", - "QlrzHNYxCwCBMVENvbXjQA==", - "Ou2HGn43nmsL3RWSNvMdXw==", - "3qk9lsvGTMqVMAZW+xihfw==", - "RncMe42RB2bhmUbYtGVnKQ==", - "hzNXR6dqPq1+vf4Qh5ByWA==", - "sRq3S2ZRs3H39cEQHv4Vig==", - "B4ThUBTVJOUPyOsHxikHXA==", - "A2lU9GkAdSibLO1JJfFnIA==", - "ef3HNkSvuWQrAzkuty2iqg==", - "yKDiRM6bf2xc0QXIwHYuaA==", - "AdCk4ccJuhA0bIT/61J+RQ==", - "UXvAZ7ULCVz2f505K0Wkvg==", - "ueKWblrOwVJNgiOvkXKLBQ==", - "s8u/jPuBAxu1d18HfV5Z0g==", - "hUT0Uc5YMUdNZQEGLz4hJw==", - "6jo/phmMTrEXKrNRsionGQ==", - "s/Ea/3fkyJ9honzPJkgEQQ==", - "hgu2/Jf+WrQAHfO+asW2zw==", - "kiVuTNwZ1r2lqYEZxIHyiQ==", - "24T5KVrVE2mYwJ5Goj3xJw==", - "fiWBVlfj97GGjEvf/Q9Spg==", - "5VWdlvJe7eoXMGkTtHzCUg==", - "+cFQxKa5RWVtc1z00Jujew==", - "nVa+rLH5p+yXBksLwQsjRQ==", - "5tyI6bMdb3tMIi4ewvr/SQ==", - "S6Roj31yS5bZbSFcd3f4Hg==", - "uW1Zl8iuEF8ZT/gwCBEqwA==", - "YwL+FJgxlZ8JVig+9iP5Cw==", - "ThIYK/mQsp9cMf8+rws/4Q==", - "w0oSxOhRG6kE9B868aoYVQ==", - "DJUDGQ0J32dF1kfItyxALg==", - "34/ab69lPkuAKt6WBxJPpA==", - "25jH4C9apgqWZGZP15lM6Q==", - "GxvwleSaSwILD1pG9k9buA==", - "YRAMt2ArEINo83ms6AqJ0A==", - "15HyTJNoMYzi3XCkeU5Z7A==", - "/SqjXGD+TKC90uz1vsjqUw==", - "karhKOknkhtg/LSFo9BGRA==", - "+tD1d0t3vfJvc1hUAvTT4Q==", - "rkaKbtlnyVr53D0rexLqdQ==", - "fAugw4rtnXzzRXfC1wRgOQ==", - "RgxoepF/XOwIsGat5r5HpQ==", - "Y49/EnzVz3ugXCYxFjFN7g==", - "tHMyzBm/2wNDw7TeNeujbg==", - "LlqzYV4uZpiJy4ORWPSekA==", - "M3Huar7/ded9OGgDwJhZgw==", - "QkNNATSx/PJ1XjgZyTtkUQ==", - "skVw0v6Wx00sfHAScPK1Bw==", - "v1gsIvg+C68T9wixMzL2sQ==", - "hDL75EXhl7BaYnAxkoGwbw==", - "tReG97snx2ESpXbfllCL7Q==", - "EiZBXR15dT1TMrkgkzmkvw==", - "5hRHirfD90/sdp0ILJQU8A==", - "rabElvtYtG0jW6dxAOHofg==", - "JpxoTRKWN+SEeBQ453R1YQ==", - "Faz4Lm0cpjvF0IjVkHiZMg==", - "jGErFAIoXx+50KFpVIGZiA==", - "5GzBkduKpUX7u1uwtYIFug==", - "cRBe0J9/KWRX19N2vPkCiw==", - "t/7g8t4Kr3/+SCnOn3XFWQ==", - "sd08c6jUXs5/hxND0fBkPA==", - "nTxKpqIdnHNdpDk7Dx3TEg==", - "5l+RALcce+lTDnmXI+Wqqg==", - "pzJ4QmEBGRNiiX6z0xHh8g==", - "Vfl3YbqR6JRR7SIdsUA/vA==", - "cgfhOdB376a4GAcuACADvA==", - "inAefsQM6tiIhQCMtcPcyA==", - "FTSULGL8CMhmcc7Cyf/X8A==", - "9XSWpaZyHEy7V/tuw5uZEw==", - "+VtM1opKlgb/jrCwc4YjFA==", - "oF46xheuI/NUxUOnOttzvA==", - "Qy+lvhDbJCumr6kiPLd1oA==", - "swps7UEKpIbVBJ9SnPK3zQ==", - "b7wyIiJvJs+29QePxsdWtQ==", - "x3iDZxYyuHtG/9rNW5HMYg==", - "r1dx1g5UOksywvOaQTamfA==", - "KvVF3Si/fr4JQtr7jCJiog==", - "spvZ7hhtG5QY7JXs96lBUg==", - "ECL8mA5B6CswyDH6yJ4hVw==", - "7Uu+YsdS69dMSDYUr6vTag==", - "Rnm9pSvQRRbkHpOijraLZw==", - "aQJqpnXdzqNSFhMn3EJA2Q==", - "TctnXpd7Wd5ZXKMnOFHAQA==", - "+lPqG8l6mf2FWVGWflyF/g==", - "mPmnmL2oRRJmKYjQ6TfN3g==", - "fyXFcT5ZCawDBg74n1WSpg==", - "uq5Zrxq10pO1HoPxReT5og==", - "3eoCsOKXY8RDrHSdlXqmrA==", - "9nQv2BFG56xsHViN5UpHYw==", - "RtP/nJgy/ItyuDrpBbAotg==", - "5E/drRptfHmBhJ7qplujGg==", - "cUxyZvoqXbQ0a/0I9s6Zbg==", - "womzqSigwEF30V422YmxKw==", - "FPvZqDfN8dTFHLVOuYEbUA==", - "YZMXx+scKXp/v9GaJjb1bA==", - "bjURu5MRsNIZavG5HV0eZw==", - "iY0C9uSMEOn8ikT+J7+/Eg==", - "aXkD6BzsdkMEv7A+eYqQQQ==", - "dOcOfEDGHYG2kgmrglDkPw==", - "c7GjtY05Mh+cp6SNuWY3Ig==", - "lM1uY1oVncHXNzKs/cCEtQ==", - "7jXnQJkutLsi+r9aYmrMxw==", - "NgrugWWduj2qdWnEQf9dLA==", - "faYjmy/yn5iXdS28QCIdWw==", - "68XbaOvIZpCGb4G1gaKErA==", - "Yi67HkOLtGYXeL7WD4GPrA==", - "Puo8gXuUkwcoQViaXwkdSQ==", - "L202Et5aZh60Vl20LTKNFg==", - "4agAzQ5+dnTmLZEjsZs26g==", - "LegGM1ft8Y7Ka3CUxpObvg==", - "KRdILc1QDOpow5im/qY+Kw==", - "peMW+rpwmXrSwplVuB/gTA==", - "Pic1ncr+Zn6wv75zjAdzQA==", - "ilSPlWYbiPzIC13vQUBlOw==", - "GUlDufLoTalBqrG/h3mZ6w==", - "5twANNlT57T9BG4r2D9+Hw==", - "ENrnM8HlMi+5y8Hsu4Pn4A==", - "K/DzpLEbz1MpRjA6qyYn4Q==", - "yN1cHJRHDXoFxFZacL6wsw==", - "Rc6r+KqIePH+dnj1aNYCsQ==", - "8u/z5htgqXVU5Dqwd9whJQ==", - "jV575O42EYoqDNxCm9643Q==", - "xCxGo0h3lS8N6X+ivKfpjA==", - "us+2nfpj2gjI7s14Hw0gmA==", - "bp90A/rbESwVU7eh9xRTfQ==", - "5QtMXzbTafvKDQOWZP7M8w==", - "1gFCxPLjQlQGKmSGmHwmJQ==", - "m+/dnOIe6SaIFhfvg+ybDg==", - "9Dcg87+RPq9U+swRg4dH3Q==", - "mnjbL7WFmrWp0RUqS8AMGA==", - "/0e0E+NFmq8GeE5+y2Gekw==", - "y11mbpHHtka9Ep8cr2nEvQ==", - "GdmjRyliw+W21Q+dHO4CWA==", - "X65wWQTpkg756V/Nfn92kQ==", - "xj06KvacQOxRSofbhzBNgA==", - "nVDxVhaa2o38gd1XJgE3aw==", - "4IV+JOGXrltpkQamBRXMgA==", - "jIfp8LqaYXT88r/K3a8gNw==", - "vhT4dDtbMFVyevS6yCGy0g==", - "zMs7/x8hDt8xj2FFc5+6vA==", - "1J7u2N62JGb2VrnCRlJIrw==", - "3hJs9P/RRxB0CO4q0Icb+g==", - "ZpuVY1ZyoKD3hqosdsfT6Q==", - "6KIM7C7eWgxZtqZboiJvZQ==", - "vtb6fdqirkuUkqITAmXTlw==", - "C/rEVr22mw2u/1dwUx9VTg==", - "NrY4Q5C67haCWLK8HXHq9g==", - "X9qvEftCEFWX3gBU5hXy+Q==", - "0zgw7xNB3xVGaH48TyxaNQ==", - "g7J9Jy/PJrAGRgVdvA+bEg==", - "9zb+anAyZVBzuU9rW4cJtg==", - "6Zc5FzT/m0YIjxEPYA6zDQ==", - "R2YPNlvCbVK0EodTR7czIw==", - "gsI6EGgXMtDu+1u364A8mw==", - "Bg2wBFb1/xaxeEiHfBHX+A==", - "64aapfVI6dV3LpTK56KZlg==", - "HdgcJU0W3yVnH69VYStmug==", - "qTDCcv+LK3JPFB/++t66IQ==", - "P0HEIXMnAmbvq+QYREwFzw==", - "aaU7CAmtyE35jNKTkyXOkg==", - "r9G97WKDiQ48qJHP9LBRNg==", - "8mPgQhYVDn8KshDDvvf5SA==", - "GCQiiOLDguXLiYwuLcFPsA==", - "R2Use39If2C0FVBP7KDerA==", - "23C4eh3yBb5n/RNZeTyJkA==", - "2QQtKtBAm2AjJ5c0WQ6BQA==", - "Qc+XYy2qyWJ5VVwd2PExbw==", - "zJ7ScHNxr2leCDNNcuDApA==", - "vFtC0B2oe1gck28JOM1dyg==", - "bLEntCrCHFy9pg3T3gbBzg==", - "G3PmmPGHaWHpPW30xQgm3Q==", - "me61ST+JrXM5k3/a11gRAA==", - "+LJYVZl1iPrdMU3L5+nxZw==", - "CLPzjXKGGpJ0VrkSJp7wPQ==", - "Pc+u0MAzp4lndTz4m6oQ5w==", - "cwBNvZc0u4bGABo88YUsVQ==", - "q7m/EtZySBjZNBjQ5m1hKw==", - "8ZBiwr842ZMKphlqmNngHw==", - "LMCZqd3UoF/kHHwzTdj7Tw==", - "0ODJyWKJSfObo+FNdRQkkA==", - "ViweSJuNWbx5Lc49ETEs/A==", - "x+8rwkqKCv0juoT5m1A4eg==", - "pxuSWn1u+bHtRjyh2Z8veA==", - "GKzs8mlnQQc58CyOBTlfIg==", - "Owg8qCpjZa+PmbhZew6/sw==", - "YLz+HA6qIneP+4naavq44Q==", - "9ajIS45NTicqRANzRhDWFA==", - "DjeSrUoWW2QAZOAybeLGJg==", - "qxALQrqHoDq9d91nU0DckA==", - "yPIeWcW8+3HjDagegrN8bw==", - "ocpLRASvTgqfkY20YlVFHQ==", - "RuLeQHP1wHsxhdmYMcgtrQ==", - "3WwITQML938W9+MUM56a3A==", - "ZbLVNTQSVZQWTNgC4ZGfQg==", - "X6Ln4si8G5aKar52ZH/FEQ==", - "+gbitI/gpxebN/rK7qj8Fw==", - "7cnUHeaPO8txZGGWHL9tKg==", - "epY+dsm5EMoXnZCnO4WSHw==", - "nf8x+F03kOpMhsCSUWEhVg==", - "VE4sLM5bKlLdk85sslxiLQ==", - "Hs3vUOOs2TWQdQZHs+FaQQ==", - "hkOBNoHbno2iNR7t3/d4vg==", - "Ar9N1VYgE7riwmcrM3bA2Q==", - "SbMjjI8/P8B9a9H2G0wHEQ==", - "tU31r8zla146sqczdKXufg==", - "tFmWYH82I3zb+ymk5dhepA==", - "XHjrTLXkm/bBY/BewmJcCQ==", - "FV/D5uSco+Iz8L+5t7E8SA==", - "yKLLiqzxfrCsr6+Rm6kx1Q==", - "B6reUwMkQFaCHb9BYZExpw==", - "5jyuDp82Fux+B0+zlx8EXw==", - "WGKFTWJac8uehn3N59yHJw==", - "JQf9UmutPh3tAnu7FDk3nA==", - "hv5GrLEIjPb4bGOi8RSO0w==", - "p3V7NfveB6cNxFW7+XQNeQ==", - "DinJuuBX9OKsK5fUtcaTcQ==", - "UEMwF4kwgIGxGT4jrBhMPQ==", - "Y78dviyBS3Jq9zoRD5sZtQ==", - "zbjXhZaeyMfdTb2zxvmRMg==", - "kydoXVaNcx1peR5g6i588g==", - "M2suCoFHJ5fh9oKEpUG3xA==", - "/VnKh/NDv7y/bfO6CWsLaQ==", - "S+b37XhKRm8cDwRb1gSsKQ==", - "jz7QlwxCIzysP39Cgro8jg==", - "IjmLaf3stWDAwvjzNbJpQA==", - "cHSj5dpQ04h/WyefjABfmQ==", - "+gO0bg8LY+py2dLM1sM7Ag==", - "fSANOaHD0Koaqg7AoieY9A==", - "vqYHQ3MnHrAIAr1QHwfIag==", - "Uh1mvZNGehK1AaI4a1auKQ==", - "HCbHUfsTDl6+bxPjT57lrA==", - "S7Vjy/gOWp0HozPP1RUOZw==", - "KPh6TwYpspne4KZA6NyMbw==", - "cfh5VZFmIqJH/bKboDvtlA==", - "H1zH9I8RwfEy5DGz3z+dHw==", - "2ksediOVrh4asSBxKcudTg==", - "+jVN/3ASc2O44sX6ab8/cg==", - "uvKYnKE01D5r7kR9UQyo5A==", - "BB9PTlwKAWkExt3kKC/Wog==", - "yqQPU4jT9XvRABZgNQXjgg==", - "6v3eTZtPYBfKFSjfOo2UaA==", - "49z/15Nx9Og7dN9ebVqIzg==", - "VjclDY8HN4fSpB263jsEiQ==", - "vSKsa0JhLCe9QFZKkcj58Q==", - "PolhKCedOsplEcaX4hQ0YQ==", - "D0Qt9sRlMaPnOv1xaq+XUg==", - "gBgJF0PiGEfcUnXF0RO7/w==", - "sC11Rf/mau3FG5SnON4+vQ==", - "rKb3TBM4EPx/RErFOFVCnQ==", - "+n0K7OB2ItzhySZ4rhUrMg==", - "Epm0d/DvXkOFeM4hoPCBrg==", - "K8PVQhEJCEH1ghwOdztjRw==", - "xjA21QjNdThLW3VV7SCnrg==", - "nE72uQToQFVLOzcu/nMjww==", - "2Hc5oyl0AYRy2VzcDKy+VA==", - "Y7XpxIwsGK3Lm/7jX/rRmg==", - "MK7AqlJIGqK2+K5mCvMXRQ==", - "mXycPfF5zOvcj1p4hnikWw==", - "V1fvtnJ0L3sluj9nI5KzRw==", - "TahqPgS7kEg+y6Df0HBASw==", - "EKU3OVlT4b/8j3MTBqpMNg==", - "EdvIAKdRAXj7e42mMlFOGQ==", - "uPm+cF4Jq08S5pQhYFjU8A==", - "CnIwpRVC2URVfoiymnsdYQ==", - "wyx5mnUMgP5wjykjAfTO7w==", - "OwIGvTh8FPFqa4ijNkguAw==", - "4ID0PHTzIMZz2rQqDGBVfA==", - "rlXt6zKE7DswUl0oWGOQUQ==", - "4NP8EFFJyPcuQKnBSxzKgQ==", - "bJgsuw29cO2WozqsGZxl7w==", - "b3q8kjHJPj9DWrz3yNgwjQ==", - "QGYFMpkv37CS2wmyp42ppg==", - "Kzs+/IZJO8v4uIv9mlyJ2Q==", - "ZJY+hujfd58mTKTdsmHoQQ==", - "R8FxgXWKBpEVbnl41+tWEw==", - "+CvLiih/gf2ugXAF+LgWqw==", - "BDbfe/xa9Mz1lVD82ZYRGA==", - "Dz90OhYEjpaJ/pxwg1Qxhg==", - "MLHt6Ak288G0RGhCVaOeqA==", - "r0QffVKB9OD9yGsOtqzlhA==", - "hK8KhTFcR06onlIJjTji/Q==", - "wMum67lfk5E1ohUObJgrOg==", - "JKmZqz9cUnj6eTsWnFaB0A==", - "rtJdfki8fG6CB36CADp0QA==", - "cUyqCa7Oue934riyC17F8g==", - "y4Y4mSSTw/WrIdRpktc5Hw==", - "r36kVMpF+9J+sfI3GeGqow==", - "ydVj2odhergi+2zGUwK4/A==", - "J2NFyb8cXEpZyxWDthYQiA==", - "qYuo5vY8V3tZx41Kh9/4Dw==", - "jrfRznO0nAz6tZM1mHOKIA==", - "JSr/lqDej81xqUvd/O2s7w==", - "vHGjRRSlZHJIliCwIkCAmQ==", - "sQAxqWXeiu/Su0pnnXgI9A==", - "xPe76nHyHmald6kmMQsKdg==", - "50jASqzGm4VyHJbFv8qVRA==", - "uuiJ+yB7JLDh2ulthM0mjg==", - "TI90EuS/bHq/CAlX32UFXg==", - "JgxNrUlL8wutG04ogKFPvw==", - "aMa1yVA71/w6Uf1Szc9rMA==", - "k/Aou2Jmyh8Bu3k8/+ndsQ==", - "iANKiuMqWzrHSk9nbPe3bQ==", - "7GgNLBppgAKcgJCDSsRqOQ==", - "bzVeU2qM9zHuzf7cVIsSZw==", - "rkeLYwMZ1/pW2EmIibALfA==", - "91+Yms6Oy/rP0rVjha5z9w==", - "JgXSPXDqaS1G9NqmJXZG0A==", - "ZzduJxTnXLD9EPKMn1LI4Q==", - "6W79FmpUN1ByNtv5IEXY4w==", - "Y1Nm3omeWX2MXaCjDDYnWQ==", - "ejfikwrSPMqEHjZAk3DMkA==", - "WNfDNaWUOqABQ6c6kR+eyw==", - "4BkqgraeXY7yaI1FE07Evw==", - "AjHz9GkRTFPjrqBokCDzFw==", - "T/6gSz2HwWJDFIVrmcm8Ug==", - "VWy9lB5t4fNCp4O/4n8S4w==", - "/FdZzSprPnNDPwbhV1C0Cg==", - "LUWxfy4lfgB5wUrqCOUisw==", - "r1VGXWeqGeGbfKjigaAS+Q==", - "ztULoqHvCOE6qV7ocqa4/w==", - "QCpzCTReHxGm5lcLsgwPCA==", - "Hst3yfyTB7yBUinvVzYROQ==", - "gf1Ypna/Tt+TZ08Y+GcvGg==", - "3rbml1D0gfXnwOs5jRZ3gA==", - "2vm7g3rk1ACJOTCXkLB3zA==", - "11FE2kknwYi2Qu0JUKMn3A==", - "1b2uf+CdVjufqiVpUShvHw==", - "0a4SafpDIe8V4FlFWYkMHw==", - "7btpMFgeGkUsiTtsmNxGQA==", - "dUx1REyXKiDFAABooqrKEA==", - "knYKU74onR6NkGVjQLezZg==", - "Scto+9TWxj1eZgvNKo+a9A==", - "cvZT1pvNbIL8TWg+SoTZdA==", - "1nXByug2eKq0kR3H3VjnWQ==", - "tG+rpfJBXlyGXxTmkceiKA==", - "7W9aF7dxnL+E8lbS/F7brg==", - "8vr+ERVrM99dp+IGnCWDGQ==", - "oFNMOKbQXcydxnp8fUNOHw==", - "uJZGw3IY2nCcdVeWW1geNQ==", - "q6LG0VzO1oxiogAAU63hyg==", - "f0H/AFSx2KLZi9kVx5BAZg==", - "1RQZ2pWSxT+RKyhBigtSFg==", - "scCQPl0em2Zmv/RQYar60g==", - "A2ODff+ImIkreJtDPUVrlg==", - "vRgkZZGVN7YZrlml0vxrKA==", - "68jPYo3znYoU4uWI7FH3/g==", - "iJ2nT8w8LuK11IXYqBK+YA==", - "54XELlPm8gBvx8D5bN3aUg==", - "PTAm/jGkie7OlgVOvPKpaA==", - "v7BrkRmK0FfWSHunTRHQFQ==", - "dVh/XMTUIx1nYN4q1iH1bA==", - "TSGL3iQYUgVg/O9SBKP9EA==", - "wTO49YX/ePHMWtcoxUAHpw==", - "bMb1ia0rElr2ZpZVhva0Jw==", - "sNmW2b2Ud7dZi3qOF8O8EQ==", - "3djRJvkZk9O2bZeUTe+7xQ==", - "I9KNZC1tijiG1T72C4cVqQ==", - "sQzCwNDlRsSH7iB9cTbBcg==", - "mk1CKDah7EzDJEdhL22B7w==", - "lON3WM0uMJ30F8poBMvAjQ==", - "88PNi9+yn3Bp4/upgxtWGA==", - "C+Ssp+v1r+00+qiTy2d7kA==", - "11U5XEwfMI7avx014LfC8g==", - "xsf0m31Am0W9eLhopAkfnA==", - "d13Rj3NJdcat0K/kxlHLFw==", - "UP7NXAE0uxHRXUAWPhto0w==", - "ZKXxq9yr7NGBOHidht34uQ==", - "Fd2fYFs8vtjws2kx1gf6Rw==", - "ojf6uL85EuEYgLvHoGhUrw==", - "KjnL3x+56r3M2pDj1pPihA==", - "WdCWezJU4JK43EOZ9YHVdg==", - "/jH6imhTPZ/tHI4gYz2+HA==", - "+OLntmlsMBBYPREPnS6iVw==", - "5lfLJAk1L3QzGMML3fOuSw==", - "AZs3v4KJYxdi8T1gjVjI2Q==", - "7pkUY2UzSbGnwLvyRrbxfA==", - "BjfOelfc1IBgmUxMJFjlbQ==", - "TcGhAJHRr7eMwGeFgpFBhg==", - "Y7iDCWYrO1coopM3RZWIPg==", - "mnalaO6xJucSiZ0+99r3Cg==", - "plXHHzA8X9QGwWzlJxhLRw==", - "Zqd6+81TwYuiIgLrToFOTQ==", - "1Pmnur6TbZ9cmemvu0+dSA==", - "OaNpzwshdHUZMphQXa6i8w==", - "WKehT4nGF2T7aKuzABDMlA==", - "4LvQSicqsgxQFWauqlcEjw==", - "BMZB1FwvAuEqyrd0rZrEzw==", - "YfbfE3WyYOW7083Y8sGfwQ==", - "46FCwqh+eMkf+czjhjworw==", - "734u4Y1R3u7UNUnD+wWUoA==", - "yf06Slv9l3IZEjVqvxP2aA==", - "bIk7Fa6SW7X18hfDjTKowg==", - "DnF6TYSJxlc+cwdfevLYng==", - "ionqS0piAOY2LeSReAz4zg==", - "hlMumZ7RJFpILuKs09ABtw==", - "NjeDgQ1nzH1XGRnLNqCmSg==", - "o7y4zQXQAryST2cak4gVbw==", - "29EybnMEO95Ng4l/qK4NWQ==", - "udU65VtsvJspYmamiOsgXw==", - "v1AWe5qb5y3vSKFb7ADeEw==", - "wK6Srd83eLigZ11Q20XGrg==", - "GmC+0rNDMIR+YbUudoNUXw==", - "W4utAK3ws0zjiba/3i91YA==", - "MlKWxeEh8404vXenBLq4bw==", - "Gdf4VEDLBrKJNQ8qzDsIyw==", - "Z9bDWIgcq6XwMoU2ECDR5Q==", - "VIkS30v268x+M1GCcq/A8A==", - "iPwX3SbbG9ez9HoHsrHbKw==", - "yKrsKX4/1B1C0TyvciNz5w==", - "BophnnMszW5o+ywgb+3Qbw==", - "eJLrGwPRa6NgWiOrw1pA7w==", - "eV+RwWPiGEB+76bqvw+hbA==", - "oad5SwflzN0vfNcyEyF4EA==", - "Uw6Iw+TP9ZdZGm2b/DAmkg==", - "9qWLbRLXWIBJUXYjYhY2pg==", - "dxWv00FN/2Cgmgq9U3NVDQ==", - "AX1HxQKXD12Yv5HWi39aPQ==", - "J0NauydfKsACUUEpMhQg8A==", - "mxug34EekabLz0JynutfBg==", - "bNq/hj0Cjt4lkLQeVxDVdQ==", - "nW3zZshjZEoM8KVJoVfnuQ==", - "ghp8sWGKWw20S/z1tbTxFg==", - "S4rFuiKLFKZ+cL7ldiTwpg==", - "8ZqmPJDnQSOFXvNMRQYG2Q==", - "6XYqR2WvDzx4fWO7BIOTjA==", - "Uo+FIhw1mfjF6/M8cE1c/Q==", - "bsHIShcLS134C+dTxFQHyA==", - "19yQHaBemtlgo2QkU5M6jQ==", - "sWLcS+m4aWk31BiBF+vfJQ==", - "BlCgDd7EYDIqnoAiKOXX6Q==", - "MrxR3cJaDHp0t3jQNThEyg==", - "cMo6l1EQESx1rIo+R4Vogg==", - "VOvrzqiZ1EHw+ZzzTWtpsw==", - "1/ZheMsbojazxt31j/l3iA==", - "0QxPAqRF8inBuFEEzNmLjA==", - "UXUNYEOffgW3AdBs7zTMFA==", - "lOPJhHqCtMRFZfWMX/vFZQ==", - "rXSbbRABEf4Ymtda45w8Fw==", - "jfegbZSZWkDoPulFomVntA==", - "hfcH5Az2M7rp+EjtVpPwsg==", - "VsXEBIaMkVftkxt1kIh7TA==", - "M20iX2sUfw5SXaZLZYlTaA==", - "VUDsc9RMS1fSM43c+Jo9dQ==", - "itPtn+JaO4i7wz2wOPOmDQ==", - "rCxoo4TP/+fupXMuIM0sDA==", - "cSHSg9xJz/3F6kc+hKXkwg==", - "b4BoZmzVErvuynxirLxn0w==", - "e4B3HmWjW+6hQzcOLru6Xg==", - "lTE6u9G/RzvmbuAzq2J2/Q==", - "897ptlztTjr7yk+pk8MT0Q==", - "jd6IpPJwOJW1otHKtKZ5Gw==", - "b4aFwwcWMXsSdgS1AdFOXA==", - "FltEN+7NKvzt+XAktHpfHA==", - "ZyDh3vCQWzS5DI1zSasXWA==", - "kcJ1acgBv6FtUhV8KuWoow==", - "zgEyxj/sCs63O98sZS94Yw==", - "/kGxvyEokQsVz0xlKzCn2A==", - "cxqHS4UbPolcYUwMMzgoOA==", - "62RHCbpGU8Hb+Ubn+SCTBg==", - "ePlsM/iOMme2jEUYwi15ng==", - "0fN+eHlbRS6mVZBbH/B9FQ==", - "k0XIjxp2vFG7sTrKcfAihA==", - "0rfG4gRugAwVP0i3AGVxxg==", - "M98hjSxCwvZ27aBaJTGozQ==", - "kzGNkWh3fz27cZer4BspUQ==", - "3CJbrUdW68E3Drhe4ahUnQ==", - "NGApiVkDSwzO45GT57GDQw==", - "lMjip5hbCjkD9JQjuhewDg==", - "GrSbnecYAC3j5gtoKntL0A==", - "9dbn0Kzwr9adCEfBJh78uQ==", - "64QzHOYX0A9++FqRzZRHlQ==", - "YZt6HwCvdI5DRQqndA/hBQ==", - "6GXHGF62/+jZ7PfIBlMxZw==", - "PBULPuFXb6V3Di713n3Gug==", - "8Cm19vJW8ivhFPy0oQXVNA==", - "zDSQ3NJuUGkVOlvVCATRwA==", - "6QAtjOK9enNLRhcVa2iaTg==", - "v/PshI6JjkL9nojLlMNfhg==", - "yTgN5xFIdz1MzFS6xMl5uQ==", - "SCO9nQncEcyVXGCtx30Jdg==", - "7b0oo4+qphu6HRvJq6qkHQ==", - "ol9xhVTG9e1wNo50JdZbOA==", - "hIABph+vhtSF5kkZQtOCTA==", - "k+IBS52XdOe5/hLp28ufnA==", - "6HnWgYNKohqhoa1tnjjU3A==", - "HDxGhvdQwGh0aLRYEGFqnw==", - "LDuBcL5r3PUuzKKZ9x6Kfw==", - "HPvYV94ufwiNHEImu4OYvQ==", - "h2cnQQF2/R3Mq2hWdDdrTg==", - "nqpKfidczdgrNaAyPi7BOQ==", - "2ywo4t5PPSVUCWDwUlOVwQ==", - "jZMDIu95ITTjaUX0pk4V5g==", - "bA2kaTpeXflTElTnQRp6GQ==", - "lwYQm2ynA3ik2gE1m11IEg==", - "5ugVOraop5P5z5XLlYPJyQ==", - "l2NppPcweAtmA1V2CNdk2Q==", - "DbWQI3H2tcJsVJThszfHGA==", - "H6HPFAcdHFbQUNrYnB74dA==", - "H1NJEI+fvOQbI51kaNQQjQ==", - "53UccFNzMi9mKmdeD82vAw==", - "lffapwUUgaQOIqLz2QPbAg==", - "rSvhrHyIlnIBlfNJqemEbw==", - "BLJk9wA88z6e0IQNrWJIVw==", - "5m1ijXEW+4RTNGZsDA/rxQ==", - "GG8a3BlwGrYIwZH9j3cnPA==", - "HhBHt5lQauNl7EZXpsDHJA==", - "/XjB6c5fxFGcKVAQ4o+OMw==", - "+tuUmnRDRWVLA+1k0dcUvg==", - "SM7E98MyViSSS9G0Pwzwyw==", - "c5q/8n7Oeffv3B1snHM/lA==", - "kwlAQhR2jPMmfLTAwcmoxw==", - "0b/xj6fd0x+aB8EB0LC4SA==", - "S8jlvuYuankCnvIvMVMzmg==", - "kZkmDatUOdIqs7GzH3nI1A==", - "obW3kzv2KBvuckU7F+tfjA==", - "pa8nkpAAzDKUldWjIvYMYg==", - "m+eh+ZqS74w2q0vejBkjaw==", - "LcoJBEPTlSsQwfuoKQUxEw==", - "KO2XVYyNZadcQv8aCNn5JA==", - "uvzmRcvgepW6mZbMfYgcNw==", - "KhUT2buOXavGCpcDOcbOYg==", - "fo3JL+2kPgDWfP+CCrFlFw==", - "wIfvvLKC61gOpsddUFjVog==", - "SPHU6ES1WVm0Mu2LB+YjrA==", - "LWWfRqgtph1XrpxF4N64TA==", - "LCvz/h9hbouXCmdWDPGWqg==", - "PXC6ZpdMH0ATis/jGW12iA==", - "z920R8eahJPiTsifrPYdxA==", - "GIHKW6plyLra0BmMOurFgA==", - "k6OmSlaSZ5CB0i7SD9LczQ==", - "YZ39RIXpeLAhyMgmW2vfkQ==", - "bs2QG8yYWxPzhtyMqO6u3A==", - "pKaTI+TfcV3p/sxbd2e7YQ==", - "xWYecfzAtXT9WyQ8NYY/hw==", - "Fz8EI+ZpYlbcttSHs5PfpA==", - "wfwuxn+Vja1DNwiDwL2pcQ==", - "wux5Y8AipBnc5tJapTzgEQ==", - "U+oTpcjhc0E+6UjP11OE/Q==", - "yTVJKBn72RjakMBXDoBKHg==", - "0TxcYwG72dT7Tg+eG8pP1w==", - "imZ+mwiT22sW2M9alcUFfg==", - "CkDIoAFLlIRXra78bxT/ZA==", - "4qMSNAxichi3ori/pR+o0w==", - "zNLlWGW/aKBhUwQZ4DZWoQ==", - "D31ZticrjGWAO45l5hFh7A==", - "HdXg64DBy5WcL5fRRiUVOg==", - "yhI5jHlfFJxu4eV5VJO2zQ==", - "e9GqAEnk8XI5ix6kJuieNQ==", - "EC0+iUdSZvmIEzipXgj7Gg==", - "chwv4+xbEAa93PHg8q9zgQ==", - "B1VVUbl8pU0Phyl1RYrmBg==", - "A+DLpIlYyCb9DaarpLN76g==", - "wHA+D5cObfV3kGORCdEknw==", - "+Mp+JIyO0XC5urvMyi3wvQ==", - "vUE8Iw3NyWXURpXyoNJdaw==", - "ParhxI6RtLETBSwB0vwChQ==", - "NxSdT2+MUkQN49pyNO2bJw==", - "JSyhTcHLTfzHsPrxJyiVrA==", - "PAlx9+U+yQCAc5Fi0BOG0w==", - "W/0s1x3Qm+wN8DhROk6FrQ==", - "L3Jt5dHQpWQk74IAuDOL8g==", - "VWb8U4jF/Ic0+wpoXi/y/g==", - "1wBuHqS1ciup31WTfm3NPg==", - "BDNM1u/9mefjuW1YM2DuBg==", - "SDi5+FoP9bMyKYp+vVv1XA==", - "23d9B9Gz5kUOi1I//EYsSQ==", - "/a9O7kWeXa0le45ab3+nVw==", - "PcoVtZrS1x1Q+6nfm4f80w==", - "A6TLWhipfymkjPYq8kaoDQ==", - "lzUQ1o7JAbdJYpmEqi6KnQ==", - "/2jGyMekNu7U136K+2N3Jg==", - "ZItMIn1vhGqAlpDHclg0Ig==", - "Ee4A3lTMLQ7iDQ7b8QP8Qg==", - "bO55S58bqDiRWXSAIUGJKw==", - "zeHF6fdeqcOId3fRUGscRw==", - "BxsDnI8jXr4lBwDbyHaYXw==", - "ylA6sU7Kaf9fMNIx1+sIlw==", - "ZWXfE3uGU91WpPMGyknmqw==", - "f1+fHgR5rDPsCZOzqrHM7Q==", - "8VqeoQELbCs232+Mu+HblA==", - "beSrliUu0BOadCWmx+yZyA==", - "NQVQfN3nIg9ipHiFh4BvfQ==", - "4wnUAbPT3AHRJrPwTTEjyw==", - "/cdR1i5TuQvO+u3Ov3b0KQ==", - "wtyAZIfhomcHe9dLbYoSvA==", - "ulpDxLeQnIRPnq6oaah2AA==", - "pdPwUHauXOowaq9hpL2yFw==", - "1+A9FCGP3bZhk6gU3LQtNg==", - "raYifKqev8pASjjuV+UTKQ==", - "+OERSmo7OQUUjudkccSMOA==", - "FeRovookFQIsXmHXUJhGOw==", - "USCvrMEm/Wqeu9oX6FrgcQ==", - "kly/2kE4/7ffbO34WTgoGg==", - "IindlAnepkazs5DssBCPhA==", - "Bq82MoMcDjIo/exqd/6UoA==", - "ocvA1/NbyxM0hanwwY6EiA==", - "rtd6mqFgGe98mqO0pFGbSw==", - "nvLEpj6ZZF3LWH3wUB6lKg==", - "AGd0rcLnQ0n+meYyJur1Pw==", - "wI7JrSPQwYHpv2lRsQu9nQ==", - "OnmvXbyT2BYsSDJYZhLScA==", - "CmBf5qchS1V3C2mS6Rl4bw==", - "TafM7nTE5d+tBpRCsb8TjQ==", - "wxkb8evGEaGf/rg/1XUWiA==", - "y1J+o6DC2sETFsySgpDZyA==", - "SVLHWPCCH7GPVCF7QApPbw==", - "HMWOlMmzocOIiJ7yG1YaDQ==", - "DJmrmNRKARzsTCKSMLmcNA==", - "/XC/FmMIOdhMTPqmy4DfUA==", - "63OTPaKM0xCfJOy9EDto+Q==", - "PxReytUUn/BbxYTFMu1r2Q==", - "WjDqf1LyFyhdd8qkwWk+MA==", - "/DiUApY7cVp5W9o24rkgRA==", - "alJtvTAD7dH/zss/Ek1DMQ==", - "xLm/bJBonpTs0PwsF0DvRg==", - "eAOEgF5N80A/oDVnlZYRAw==", - "LqgzKxbI6WTMz0AMIDJR5w==", - "MJ1FuK8PXcmnBAG9meU84A==", - "JLq/DrW2f26NaRwfpDXIEA==", - "fsrX00onlGvfsuiCc35pGg==", - "tXVb5f90k9l3e1oK2NGXog==", - "1JRgSHnfAQFQtSkFTttkqQ==", - "B0TaUQ6dKhPfSc5V/MjLEQ==", - "nkbLVLvh3ClKED97+nH+7Q==", - "avFTp3rS6z5zxQUZQuaBHQ==", - "lNF8PvUIN02NattcGi5u4g==", - "bBEndaOStXBpAK79FrgHaw==", - "dM9up4vKQV5LeX82j//1jQ==", - "4WO6eT0Rh6sokb29zSJQnQ==", - "RHKCMAqrPjvUYt13BVcmvw==", - "Ju4YwtPw+MKzpbC0wJsZow==", - "tzV7ixFH37ze4zuLILTlfA==", - "oPlhC4ebXdkIDazeMSn1fQ==", - "5pje7qyz8BRsa8U4a4rmoA==", - "7E6V6/zSjbtqraG7Umj+Jw==", - "8QK7emHS6rAcAF5QQemW/A==", - "LhqRc9oewY4XaaXTcnXIHQ==", - "p/7qM5+Lwzw1/lIPY91YxQ==", - "fy54Milpa7KZH/zgrDmMXQ==", - "LyPXOoOPMieqINtX8C9Zag==", - "aD4QvtMlr8Lk/zZgZ6zIMg==", - "dsueq9eygFXILDC7ZpamuA==", - "+mJLK+6qq8xFv7O/mbILTw==", - "nHUpYmfV59fe3RWaXhPs3Q==", - "VbCoGr8apEcN7xfdaVwVXw==", - "/2Chaw2M9DzsadFFkCu6WQ==", - "rKAQxu80Q8g1EEhW5Wh8tg==", - "RJJqFMeiCZHdsqs72J17MQ==", - "GF2yvI9UWf1WY7V7HXmKPA==", - "JyIDGL1m/w+pQDOyyeYupA==", - "wR2Gxb07nkaPcZHlEjr8iA==", - "PbDVq2Iw1eeM8c2o/XYdTA==", - "BL3buzSCV78rCXNEhUhuKQ==", - "i42XumprV/aDT5R0HcmfIQ==", - "DuEKxykezAvyaFO2/5ZmKQ==", - "6ACvJNfryPSjGOK39ov8Qg==", - "YaUKOTyByjUvp1XaoLiW5Q==", - "jNcMS2zX1iSZN9uYnb2EIg==", - "VRnx+kd6VdxChwsfbo1oeQ==", - "4Qinl7cWmVeLJgah8bcNkw==", - "Fiy3hkcGZQjNKSQP9vRqyA==", - "HaSc7MZphCMysTy2JbTJkw==", - "VhYGC8KYe5Up+UJ2OTLKUw==", - "K2gk9zWGd0lJFRMQ1AjQ/Q==", - "NfxVYc3RNWZwzh2RmfXpiA==", - "JGeqHRQpf4No74aCs+YTfA==", - "7VHlLw20dWck+I8tCEZilA==", - "V5HKdaTHjA8IzvHNd9C51g==", - "9TalxEyFgy6hFCM73hgb7Q==", - "R/y6+JJP8rzz1KITJ4qWBw==", - "7bM/pn4G7g7Zl6Xf1r62Lg==", - "CHsFJfsvZkPWDXkA6ZMsDQ==", - "uXuPA/2KJbb7ZX+NymN3dw==", - "o+nYS4TqJc6XOiuUzEpC3A==", - "8N3mhHt29FZDHn1P2WH1wQ==", - "uZ2gUA74/7Q33tI2TcGQlg==", - "8B12CamjOGzJDnQ+RkUf4w==", - "9FdpxlIFu11qIPdO7WC5nw==", - "G+sGF13VXPH4Ih6XgFEXxg==", - "y+1I05LDAYJ09tKMs3zW6g==", - "gnkadeCgjdmLdlu/AjBZJg==", - "1I+UVx3krrD4NhzO7dgfHQ==", - "8LNNoHe6rEQyJ0ebl151Mw==", - "yOE90OHQdyOfrAgwDvn2gA==", - "ayBGGPEy++biljvGcwIjXA==", - "o/Y4U6rWfsUCXJ72p5CUGw==", - "5kvyy902llnYGQdn2Py04w==", - "6k2cuk0McTThSMW/QRHfjA==", - "2XrR2hjDEvx8MQpHk9dnjw==", - "fv/PW8oexJYWf5De30fdLQ==", - "861mBNvjIkVgkBiocCUj/Q==", - "NKGY0ANVZ0gnUtzVx1pKSw==", - "4DIPP/yWRgRuFqVeqIyxMQ==", - "cgSEbLqqvDsNUyeA3ryJ6Q==", - "xbBxUP9JyY0wDgHDipBHeg==", - "c3WVxyC5ZFtzGeQlH5Gw+w==", - "ZKeTDCboOgCptrjSfgu0xw==", - "DjHszpS8Dgocv3oQkW/VZQ==", - "Iqszlv4R49UevjGxIPMhIA==", - "uChFnF0oCwARhAOz/d47eA==", - "0egBaMnAf0CQEXf1pCIKnA==", - "FnVNxl5AFH1AieYru2ZG+A==", - "2Ct+pLXrK6Ku1f4qehjurQ==", - "x2nSgcTjA3oGgI8mMgiqjw==", - "AUGmvZkpkKBry5bHZn4DJA==", - "x8kRVzohTdhkryvYeMvkMw==", - "rXfWkabSPN+23Ei1bdxfmQ==", - "ElTNyMR4Rg8ApKrPw88WPg==", - "9jxA/t3TQx8dQ+FBsn/YCg==", - "I07W2eDQwe6DVsm1zHKM8A==", - "0p1jMr06OyBoXQuSLYN4aQ==", - "odGhKtO4bDW5R8SYiI5yCg==", - "5Q/Y2V0iSVTK8HE8JerEig==", - "Ily2MKoFI1zr5LxBy93EmQ==", - "8dUcSkd2qnX5lD9B+fUe+Q==", - "80UE+Ivby3nwplO/HA7cPw==", - "sS6QcitMPdvUBLiMXkWQkw==", - "5VY++KiWgo7jXSdFJsPN3A==", - "aY6B28XdPnuYnbOy9uSP8A==", - "ZfRlID+pC1Rr4IY14jolMw==", - "/YuQw7oAF08KDptxJEBS9g==", - "16d+fhFlgayu3ttKVV/pbg==", - "8dBIsHMEAk7aoArLZKDZtg==", - "wRqaDZVHHurp5whOQ1kDbQ==", - "lFUq6PGk9dBRtUuiEW7Cug==", - "FoJZ61VrU8i084pAuoWhDQ==", - "4mig4AMLUw+T/ect9p4CfA==", - "Po0lhBfiMaXhl+vYh1D8gA==", - "z9cd+Qj+ueX34Zf3997MNQ==", - "1dsKN1nG6upj7kKTKuJWsQ==", - "UtLYUlQJ02oKcjNR3l+ktg==", - "O538ibsrI4gkE5tfwjxjmg==", - "G736AX070whraDxChqUrqw==", - "THs1r8ZEPChSGrrhrNTlsA==", - "pVG1hL96/+hQ+58rJJy6/A==", - "1BjsijOzgHt/0i36ZGffoQ==", - "6rIWazDEWU5WPZHLkqznuQ==", - "cdWUm6uLNzR/knuj2x75eA==", - "nsnX3tKkN1elr18E31tXDw==", - "0fnruVOCxEczscBuv4yL9A==", - "SVuEYfQ9FGyVMo1672n0Yg==", - "ZRWyfXyXqAaOEjkzWl949Q==", - "S2MAIYeDQeJ1pl9vhtYtUg==", - "vsRNZx4thFFFPneubKq1Fw==", - "kuWGANwzNRpG4XmY7KjjNg==", - "i6r+mZfyhZyqlYv56o0H+w==", - "wqWqe0KRjZlUIrGgEOG9Mg==", - "t5wh9JGSkQO78QoQoEqvXA==", - "AGoVLd0QPcXnTedT5T95JQ==", - "aRrcmH+Ud3mF1vEXcpEm4w==", - "C65PZm8rZxJ6tTEb6d08Eg==", - "oAHVGBSJ2cf4dVnb/KEYmw==", - "BuDVDLl0OGdomEcr+73XhQ==", - "bLsStF0DDebpO+xulqGNtg==", - "xukOAM0QVsA72qEy0yku9A==", - "LpoayYsTO8WLFLCSh2kf2w==", - "LEVYAE54618FrlXkDN01Kw==", - "Jm862vBTCYbv/V4T1t46+Q==", - "X4kdXUuhcUqMSduqhfLpxA==", - "cLR0Ry4/N5swqga1R6QDMw==", - "0klouNfZRHFFpdHi4ZR2hA==", - "JGx8sTyvr4bLREIhSqpFkw==", - "ZiJ/kJ9GneF3TIEm08lfvQ==", - "hP7dSa8lLn9KTE/Z0s4GVQ==", - "600bwlyhcy754W1E6tuyYg==", - "U49SfOBeqQV9wzsNkboi8Q==", - "5DDb7fFJQEb3XTc3YyOTjg==", - "6uT7LZiWjLnnqnnSEW4e/Q==", - "tq5xUJt8GtjDIh1b48SthQ==", - "eJFIQh/TR7JriMzYiTw4Sg==", - "jdRzkUJrWxrqoyNH9paHfQ==", - "RKVDdE1AkILTFndYWi9wFg==", - "AEpTVUQhIEJGlXJB6rS26A==", - "PD+yHtJxZJ2XEvjIPIJHsQ==", - "dOS+mVCy3rFX9FvpkTxGXA==", - "lz+SeifYXxamOLs1FsFmSQ==", - "QTz21WkhpPjfK8YoBrpo+w==", - "9wUIeSgNN36SFxy8v2unVg==", - "ash1r2J6B0PUxJe8P0otVQ==", - "y7yS9x3yshVhMpDbQtfYOQ==", - "f07bdNVAe9x+cAMdF1bByQ==", - "N2KovXW14hN/6+iWa1Yv3g==", - "2DNbXVgesUa7PgYQ4zX5Lw==", - "WQznrwqvMhUlM3CzmbhAOQ==", - "FpWDTLTDmkUhH/Sgo+g1Gg==", - "OVHqwV8oQMC5KSMzd5VemA==", - "Bv4mNIC72KppYw/nHQxfpQ==", - "MI+HSMRh8KTW+Afiaxd/Fw==", - "10OltdxPXOvfatJuwPVKbQ==", - "y4/HohCJxtt+cT7nLJB08w==", - "RhcqXY4OsZlVVF7ZlkTeRw==", - "/mrqas0eDX+sFUNJvCQY8g==", - "ZIZx4MehWTVXPN9cVQBmyA==", - "z20AAnvj7WsfJeOu3vemlA==", - "dL6n/JsK+Iq6UTbQuo/GOw==", - "rMm9bHK69h0fcMkMdGgeeA==", - "ftsf2qztw3NC78ep/CZXWQ==", - "/n1RLTTVpygre1dl36PDwQ==", - "/FsJYFNe+7UvsSkiotNJEQ==", - "Yy2pPhITTmkEwoudXizHqQ==", - "lizovLQxu6L9sbafNQuShQ==", - "XV5MYe0Q7YMtoBD6/iMdSw==", - "5jHgQF4SfO/zy9xy9t+9dw==", - "16iT/jCcPDrJEfi2bE5F+Q==", - "syeBfQBUmkXNWCZ1GV8xSA==", - "sr3UXbMg5zzkRduFx/as7g==", - "xUXEE7OBBCudsQnuj5ycOA==", - "ojZY7Gi2QJXE/fp6Wy31iA==", - "RlNPyhgYOIn28R4vKCVtYA==", - "KOm8PTa+ICgDrgK9QxCJZw==", - "DJoy1NSZZw87oxWGlNHhfg==", - "jEdanvXKyZdZJG6mj/3FWw==", - "Omr+zPWVucPCSfkgOzLmSQ==", - "71w3aSvuh2mBLtdqJCN3wA==", - "xjTMO2mvtpvwQrounD4e8g==", - "Zz/5VMbw1TqwazReplvsEg==", - "hIjgi20+km+Ks23NJ4VQ6Q==", - "00TVKawojyqrJkC7YqT41Q==", - "YgVpC5d5V6K/BpOD663yQA==", - "wX70jKLKJApHnhyK0r6t3A==", - "lacCCRiWdquNm4YRO7FoKA==", - "cWdlhVZD7NWHUGte24tMjg==", - "t5U+VMsTtlWAAWSW+00SfQ==", - "AMfL0rH+g8c0VqOUSgNzQw==", - "0G93AxGPVwmr66ZOleM90A==", - "9tiibT8V9VwnPOErWGNT3w==", - "+dBv88reDrjEz6a2xX3Hzw==", - "xX6atcCApI08oVLjjLteLg==", - "+YrqTEJlJCv0A2RHQ8tr1A==", - "aqcOby9QyEbizPsgO3g0yw==", - "s/BZAhh1cTV3JCDUQsV8mA==", - "x9VwDdFPp/rJ+SF16ooWYg==", - "k/OVIllJvW6BefaLEPq7DA==", - "rIMXaCaozDvrdpvpWvyZOQ==", - "qQQwJ/aF87BbnLu3okXxaw==", - "TIWSM78m0RprwgPGK/e0JA==", - "r/b5px/UImGNjT/X5sYjuA==", - "7K8l6KoP0BH82/WMLntfrg==", - "gEHGeR2F82OgBeAlnYhRSw==", - "1/SGIab+NnizimUmNDC4wA==", - "WADmxH7R6B4LR+W6HqQQ6A==", - "pcoBh5ic7baSD4TZWb3BSw==", - "es/L9iW8wsyLeC5S4Q8t+g==", - "D175i+2bZ7aWa4quSSkQpA==", - "WQMffxULFKJ+bun6NrCURA==", - "82hTTe1Nr4N2g7zwgGjxkw==", - "oyYtf08AkWLR52bXm5+sKw==", - "8uP4HUnSodw88yoiWXOIcw==", - "x2NpqNnqRihktNzpxmepkQ==", - "x5zMDuW66467ofgL3spLUQ==", - "OMO4pqzfcbQ11YO4nkTXfg==", - "N4/mQFyhDpPzmihjFJJn6w==", - "NN/ymVQNa17JOTGr6ki3eQ==", - "htDbVu1xGhCRd8qoMlBoMg==", - "S47hklz3Ow+n5aY6+qsCoA==", - "ji+1YHlRvzevs3q5Uw1gfA==", - "3Y4w0nETru3SiSVUMcWXqw==", - "XfBOCJwi2dezYzLe316ivw==", - "kMUdiwM7WR8KGOucLK4Brw==", - "V/xG5QFyx1pihimKmAo8ZA==", - "sQskMBELEq86o1SJGQqfzg==", - "6+jhreeBLfw64tJ+Nhyipw==", - "8iYdEleTXGM+Wc85/7vU9w==", - "D7piVoB2NJlBxK5owyo4+g==", - "hDGa2yLwNvgBd/v6mxmQaQ==", - "WLsh3UF4WXdHwgnbKEwRlQ==", - "D5jaV+HtXkSpSxJPmaBDXg==", - "jCgdKXsBCgf7giUKnr6paQ==", - "XqW7UBTobbV4lt1yfh0LZw==", - "EbGG4X18upaiVQmPfwKytg==", - "dXDPnL1ggEoBqR13aaW9HA==", - "Vik8tGNxO0xfdV0pFmmFDw==", - "Swjn3YkWgj0uxbZ1Idtk+A==", - "JPxEncA4IkfBDvpjHsQzig==", - "F5FcNti7lUa9DyF2iEpBug==", - "HJYgUxFZ66fRT8Ka73RaUg==", - "Jbxl8Nw1vlHO9rtu0q/Fpg==", - "fmC+85h5WBuk8fDEUWPjtQ==", - "dZgMquvZmfLqP4EcFaWCiA==", - "XF/yncdoT4ruPeXCxEhl9Q==", - "QJEbr3+42P9yiAfrekKdRQ==", - "Sr9c0ReRpkDYGAiqSy683g==", - "Nr4zGo5VUrjXbI8Lr4YVWQ==", - "NDZWIhhixq7NT8baJUR4VQ==", - "GFRJoPcXlkKSvJRuBOAYHQ==", - "WHutPin+uUEqtrA7L8878A==", - "2rhjiY0O0Lo36wTHjmlNyw==", - "XsF7R12agx/KkRWl0TyXRA==", - "R6cO8GzYfOGTIi773jtkXw==", - "zrZWcqQsUE3ocWE0fG+SOA==", - "uNzpptKjihEfKRo5A1nWmw==", - "gICaI06E9scnisonpvqCsA==", - "TA9WjiLAFgJubLN4StPwLw==", - "sBpytpE38xz0zYeT+0qc2A==", - "Ej7W3+67kCIng3yulXGpRQ==", - "nR3ACzeVF5YcLX6Gj6AGyQ==", - "b0vZfEyuTja2JYMa20Rtbg==", - "f1h+Vp+xmdZsZIziHrB2+g==", - "WzjvUJ4jZAEK7sBqw+m07A==", - "OzMR5D2LriC5yrVd5hchnA==", - "cw1gBLtxH/m4H7dSM7yvFg==", - "CZbd+UoTz0Qu1kkCS3k8Xg==", - "WtT0QAERZSiIt2SFDiAizg==", - "QsquNcCZL9wv7oZFqm64vQ==", - "FXzaxi3nAXBc8WZfFElQeA==", - "Ml3mi1lGS1IspHp3dYYClg==", - "XGAXhUFjORwKmAq9gGEcRg==", - "wOhbpTzmFla8R0kI9OiHaA==", - "qoK2keBg3hdbn7Q24kkVXg==", - "ZAQHWU6RMg4IadOxuaukyw==", - "RiahBXX2JbPzt8baPiP/8g==", - "Qx6rVv9Xj8CBjqikWI9KFA==", - "ZRnR6i+5WKMRfs3BDRBCJg==", - "91LQuW6bMSxl10J/UDX23A==", - "0dIeIM5Zvm5nSVWLy94LWg==", - "Ja3ECL7ClwDrWMTdcSQ6Ug==", - "f6iLrMpxKhFxIlfRsFAuew==", - "iSeH0JFSGK73F470Rhtesw==", - "DwOTyyCoUfaSShHZx9u6xg==", - "rdeftHE7gwAT67wwhCmkYQ==", - "kUhyc3G8Zvx8+q5q5nVEhw==", - "W8bATujVUT80v2XGJTKXDg==", - "dMRx4Mf6LrN64tiJuyWmDw==", - "9cvHJmim9e0pOaoUEtiM6A==", - "RHToSGASrwEmvzjX6VPvNQ==", - "V7eji28JSg3vTi30BCS7gw==", - "4+htiqjEz9oq0YcI/ErBVg==", - "jKJn4czwUl/6wtZklcMsSg==", - "bvyB6OEwhwCIfJ6KRhjnRw==", - "59ipbMH7cKBsF9bNf4PLeQ==", - "M/cQja3uIk1im9++brbBOA==", - "AChOz8avRYsvxlbWcorQ3w==", - "FcKjlHKfQAGoovtpf+DxWQ==", - "y+cl1/Knb9MZPz8nBB0M+w==", - "b8BZV1NfBdLi70ir4vYvZg==", - "aFJuE/s+Kbge4ppn+wulkA==", - "CWBGcRFYwZ0va6115vV/oQ==", - "glnqaRfwm6NxivtB2nySzw==", - "mPk1IsU5DmDFA/Ym5+1ojw==", - "LGwcvetzQ3QqKjNh5vA8vw==", - "yctId8ltkl3+xqi9bj+RqA==", - "spJI3xFUlpCDqzg0XCxopA==", - "V8m51xgUgywRoV6BGKUrgg==", - "rgcXxjx3pDLotH7TTfAoZw==", - "/TSsi/AwKHtP6kQaeReI3w==", - "8dbyfox/isKLsnVjQNsEXg==", - "MOrAbuJTyGKPC6MgYJlx5Q==", - "uNWFZlP7DA96sf+LWiAhtQ==", - "hNHqznsrIVRSQdII6crkww==", - "GT6WUDXiheKAM7tPg3he9A==", - "JC8Q+8yOJ52NvtVeyHo68w==", - "HMQarkPWOUDIg5+5ja2dBQ==", - "nknBKPgb7US42v8A0fTl/w==", - "fDOUzPTU2ndpbH0vgkgrJQ==", - "GTNttXfMniNhrbhn92Aykg==", - "D2JcY4zWwqaCKebLM8lPiQ==", - "/c34NtdUZAHWIwGl3JM8Tw==", - "/G26n5Xoviqldr5sg/Jl3w==", - "GF0lY77rx1NQzAsZpFtXIQ==", - "BMOi5JmFUg5sCkbTTffXHw==", - "R+beucURp/H5jLs4kW6wmg==", - "xfYZ6qhWNBqqJ0PdWRjOwA==", - "Ahpi9+nl13kPTdzL+jgqMw==", - "oIU19xAvLJwQSZzIH577aA==", - "50xwiYvGQytEDyVgeeOnMg==", - "M0ESOGwJ4WZ4Ons1ljP0bQ==", - "fS471/rN4K2m10mUwGFuLg==", - "RrE3B3X/SJi3CqCUlTYwaw==", - "oDca3JEdRb4vONT9GUUsaQ==", - "pHo1O5zrCHCiLvopP2xaWw==", - "7sCJ4RxbxRqVnF4MBoKfuQ==", - "7R5rFaXCxM3moIUtoCfM2g==", - "4rrSL6N0wyucuxeRELfAmw==", - "9Gkw+hvsR/tFY1cO89topg==", - "aw4CzX8pYbPVMuNrGCEcWg==", - "KyLQxi5UP+qOiyZl0PoHNQ==", - "T1pMWdoNDpIsHF8nKuOn2A==", - "Qv6wWP4PpycDGxe7EZNSCw==", - "ZJc7GV0Yb6MrXkpDVIuc8g==", - "aXrbsro7KLV8s4I4NMi4Eg==", - "7k5rBuh8FbTTI4TP87wBPQ==", - "NRyFx6jqO/oo9ojvbYzsAg==", - "P7eMlOz9YUcJO+pJy0Kpkw==", - "jpjpNjL1IKzJdGqWujhxCw==", - "9k1u/5TgPmXrsx3/NsYUhg==", - "c1wbFbN7AdUERO/xVPJlgw==", - "Yw4ztKv6yqxK9U1L0noFXg==", - "GnJKlRzmgKN9vWyGfMq3aA==", - "91VcAVv7YDzkC1XtluPigw==", - "h1NNwMy0RjQmLloSw1hvdg==", - "pzC8Y0Vj9MPBy3YXR32z6w==", - "UTmTgvl+vGiCDQpLXyVgOg==", - "CzWhuxwYbNB/Ffj/uSCtbw==", - "VOB+9Bcfu8aHKGdNO0iMRw==", - "X2Tawm2Cra6H7WtXi1Z4Qw==", - "6cTETZ9iebhWl+4W5CB+YQ==", - "X4hrgqMIcApsjA9qOWBoCw==", - "1buQEv2YlH/ljTgH0uJEtw==", - "FH5Z60RXXUiDk+dSZBxD3g==", - "FI2WhaSMb3guFLe3e9il8Q==", - "O/EizzJSuFY8MpusBRn7Tg==", - "b6rrRA0W247O+FfvDHbVCQ==", - "ng1Q0A7ljho3TUWWYl46sw==", - "1Ym0lyBJ9aFjhJb/GdUPvQ==", - "+OXdvbTxHtSoLg7bZMho4w==", - "cuQslgfqD2VOMhAdnApHrA==", - "pCQmlnn3BxhsV2GwqjRhXg==", - "6PzjncEw2wHZg7SP7SQk9w==", - "nqtQI1bSM7DCO9P1jGV97Q==", - "O1ckWUwuhD44MswpaD6/rw==", - "RUmhye56tQu9xXs4SRJpOQ==", - "llujnWE17U8MIHmx4SbrSA==", - "UwqBVd4Wfias4ElOjk2BzQ==", - "kBAB2PSjXwqoQOXNrv80AA==", - "w1zN28mSrI/gqHsgs4ME3A==", - "301utVPZ93AnPLYbsiJggw==", - "qIFpKKwUmztsBpJgMaVvSg==", - "QmcURiMzmVeUNaYPSOtTTg==", - "x/MpsQvziUpW40nNUHDS5Q==", - "t1O9jSNjg4DTIv/Za4NbtA==", - "1B5gxGQSGzVKoNd5Ol4N7g==", - "81iQLU+YwxNwq4of6e9z7A==", - "x0eIHCvQLd2jdDaXwSWTYQ==", - "96ORaz1JRHY1Gk8H74+C2g==", - "bNDKcFu8T5Y6OoLSV+o/Sw==", - "WrJMOuXSLKKzgmIDALkyNw==", - "+gpHnUj2GWocP74t5XWz4w==", - "z5DveTu377UW8IHnsiUGZg==", - "irnD9K8bsT+up/JUrxPw6A==", - "ginkFyNVMwkZLE49AbfqfA==", - "2hEzujfG3mR5uQJXbvOPTQ==", - "E9yeifEZtpqlD0N3pomnGw==", - "OpC/sL320wl5anx6AVEL+A==", - "D7wN7b5u5PKkMaLJBP9Ksw==", - "83WGpQGWyt6mCV+emaomog==", - "X6ulLp4noBgefQTsbuIbYQ==", - "BH+rkZWQjTp7au6vtll/CQ==", - "Ex3x5HeDPhgO2S9jjCFy4g==", - "YNqIHCmBp/EbCgaPKJ7phw==", - "312g8iTB9oJgk/OqcgR7Cw==", - "LcF0OqPWrcpHby8RwXz1Yg==", - "gaEtlJtD6ZjF5Ftx0IFt0A==", - "bvbMJZMHScwjJALxEyGIyg==", - "StoXC7TBzyRViPzytAlzyQ==", - "XqFSbgvgZn0CpaZoZiRauQ==", - "AqHVaj3JcR44hnMzUPvVYg==", - "jTg9Y6EfpON4CRFOq0QovA==", - "q/siBRjx6wNu+OTvpFKDwA==", - "goSgZ8N5UbT5NMnW3PjIlQ==", - "9onh6QKp70glZk9cX3s34A==", - "o5XVEpdP4OXH0NEO4Yfc/A==", - "a5gZ5uuRrXEAjgaoh7PXAg==", - "PaROi5U16Tk35p0EKX5JpA==", - "dtnE401dC0zRWU0S/QOTAg==", - "7J3FoFGuTIW36q0PZkgBiw==", - "hiYg+aVzdBUDCG0CXz9kCw==", - "vhdFtKVH4bVatb4n8KzeXw==", - "DWKsPfKDAtfuwgmc2dKUNg==", - "M2JMnViESVHTZaru6LDM6w==", - "G/PA+kt0N+jXDVKjR/054A==", - "6rqK8sjLPJUIp7ohkEwfZg==", - "wajwXfWz2J+O+NVaj6j2UQ==", - "C4QEzQKGxyRi2rjwioHttA==", - "N/HgDydvaXuJvTCBhG/KtA==", - "6erpZS36qZRXeZ9RN9L+kw==", - "bbBsi6tXMVWyq3SDVTIXUg==", - "aySnrShOW4/xRSzl/dtSKQ==", - "rxfACPLtKXbYua18l3WlUw==", - "L4+C6I7ausPl6JbIbmozAg==", - "R3ijnutzvK6IKV3AKHQZSA==", - "leDlMcM+B1mDE8k5SWtUeg==", - "KGI/cXVz6v6CfL8H6akcUQ==", - "NtwqUO3SKZE/9MXLbTJo/g==", - "dJHKDkfMFJeoULg7U4wwDQ==", - "IEz72W2/W8xBx5aCobUFOQ==", - "wUYhs4j3W9nIywu1HIv2JA==", - "GzbeM7snhe+M+J7X+gAsQw==", - "3/1puZTGSrD9qNKPGaUZww==", - "eKQCVzLuzoCLcB4im8147A==", - "CCK+6Dr72G3WlNCzV7nmqw==", - "CJoZn5wdTXbhrWO5LkiW0g==", - "bJ1cZW7KsXmoLw0BcoppJg==", - "OlpA9HsF8MBh7b45WZSSlg==", - "JZRjdJLgZ+S0ieWVDj8IJg==", - "uhT12XY79CtbwhcSfAmAXQ==", - "isep9d+Q7DEUf0W7CJJYzw==", - "K9A87aMlJC8XB9LuFM913g==", - "uqe3rFveJ2JIkcZQ3ZMXHQ==", - "0e8hM3E5tnABRyy29A8yFw==", - "4iiCq+HhC+hPMldNQMt0NA==", - "X4o0OkTz0ec70mzgwRfltA==", - "1E3pMgAHOnHx3ALdNoHr8Q==", - "xNilc7UOu1kyP0+nK5MrLw==", - "DQlZWBgdTCoYB1tJrNS5YQ==", - "iruDC5MeywV4yA8o1tw/KQ==", - "z+1oDVy8GJ5u/UDF+bIQdA==", - "uExgqZkkJnZj252l5dKAGg==", - "ZgdpqFrVGiaHkh9o3rDszg==", - "5N2oi2pB69NxeNt08yPLhw==", - "G37U8XTFyshfCs7qzFxATg==", - "0ZEC3hy411LkOhKblvTcqg==", - "ITZ3P47ALS0JguFms6/cDA==", - "WWN44lbUnEdHmxSfMCZc6w==", - "r2f2MyT+ww1g9uEBzdYI1w==", - "ZvvxwDd0I6MsYd7aobjLUA==", - "uQs79rbD/wEakMUxqMI48A==", - "022B0oiRMx8Xb4Af98mTvQ==", - "afMd/Hr3rYz/l7a3CfdDjg==", - "xmsYnsJq78/f9xuKuQ2pBQ==", - "dFetwmFw+D6bPMAZodUMZQ==", - "TBQpcKq2huNC5OmI2wzRQw==", - "skrQRB9xbOsiSA19YgAdIQ==", - "anyANMnNkUqr3JuPJz5Qzw==", - "6QUGE2S8oFYx4T4nW56cCw==", - "rwtF86ZAbWyKI6kLn4+KBw==", - "6txm8z4/LGCH0cpaet/Hsg==", - "wdRyYjaM11VmqkkxV/5bsA==", - "+k5lDb+QdNc9iZ01hL5yBg==", - "k/pBSWE2BvUsvJhA9Zl5uw==", - "jQjyjWCEo9nWFjP4O8lehw==", - "R6Me6sSGP5xpNI8R0xGOWw==", - "9+hjTVMQUsvVKs7Tmp52tg==", - "VQIpquUqmeyt/q6OgxzduQ==", - "KXvdjZ3rRKn60djPTCENGA==", - "5HovoyHtul8lXh+z8ywq9A==", - "1+XWdu4qCqLLVjqkKz3nmA==", - "LCj4hI520tA685Sscq6uLw==", - "b53qqLnrTBthRXmmnuXWvw==", - "WTr3q/gDkmB4Zyj7Ly20+w==", - "FbxScyuRacAQkdQ034ShTA==", - "qaTdVEeZ6S8NMOxfm+wOMA==", - "ZNrjP1fLdQpGykFXoLBNPw==", - "/Bwpt5fllzDHq2Ul6v86fA==", - "/mFp3GFkGNLhx2CiDvJv4A==", - "RppDe/WGt1Ed6Vqg1+cCkQ==", - "6M6QapJ5xtMXfiD3bMaiLA==", - "Ghuj9hAyfehmYgebBktfgA==", - "GncGQgmWpI/fZyb/6zaFCg==", - "R1TCCfgltnXBvt5AiUnCtQ==", - "5NEP7Xt7ynj6xCzWzt21hQ==", - "4yEkKp2FYZ09mAhw2IcrrA==", - "y2Tn2gmhKs5WKc01ce74rg==", - "wnfYUctNK+UPwefX5y4/Rw==", - "BV1moliPL15M14xkL+H1zw==", - "80C9TB9/XT1gGFfQDJxRoA==", - "yL1DwlIIREPuyuCFULi0uw==", - "D09afzGpwCEH0EgZUSmIZA==", - "eCy/T+a8kXggn1L8SQwgvA==", - "+dIEf5FBrHpkjmwUmGS6eg==", - "kzXsrxWRnWhkA82LsLRYog==", - "Nf9fbRHm844KZ2sqUjNgkA==", - "XAq/C+XyR6m3uzzLlMWO5Q==", - "jiV+b/1EFMnHG6J0hHpzBg==", - "HK0yf7F97bkf1VYCrEFoWA==", - "Cz1G77hsDtAjpe0WzEgQog==", - "xdCCdP8SNBOK3IsX6PiPQA==", - "8snljTGo/uICl9q0Hxy7/A==", - "sLdxIKap0ZfC3GpUk3gjog==", - "IA1jmtfpYkz/E2wD0+27WA==", - "PPa7BDMpRdxJdBxkuWCxKA==", - "CuGIxWhRLN7AalafBZLCKQ==", - "MWcV03ULc0vSt/pFPYPvFA==", - "QVwuN66yPajcjiRnVk/V8g==", - "aLY2pCT0WfFO5EJyinLpPg==", - "dGrf9SWJ13+eWS6BtmKCNw==", - "YtZ8CYfnIpMd2FFA5fJ+1Q==", - "Umd+5fTcxa3mzRFDL9Z8Ww==", - "Al8+d/dlOA5BXsUc5GL8Tg==", - "/KYZdUWrkfxSsIrp46xxow==", - "kr8tw1+3NxoPExnAtTmfxg==", - "PwvPBc+4L73xK22S9kTrdA==", - "VWNDBOtjiiI4uVNntOlu/A==", - "lJFPmPWcDzDp5B2S8Ad8AA==", - "Mofqu40zMRrlcGRLS42eBw==", - "BuENxPg7JNrWXcCxBltOPg==", - "nmD7fEU4u7/4+W/pkC4/0Q==", - "axEl7xXt/bwlvxKhI7hx4g==", - "W04GeDh+Tk/I1S85KlozRA==", - "tVw8U1AsslIFmQs4H1xshg==", - "TSPFvkgw6uLsJh66Ou0H9w==", - "IYIbEaErHoFBn8sTT9ICIQ==", - "WBu0gJmmjVdVbjDmQOkU6w==", - "ZgjifTVKmxOieco81gnccQ==", - "ZrCnZB/U/vcqEtI1cSvnww==", - "2D6yhuABiaFFoXz0Lh0C+w==", - "SfwnYZCKP1iUJyU1yq4eKg==", - "tsiqwelcBAMU/HpLGBtMGw==", - "S9L29U2P5K8wNW+sWbiH7w==", - "sGLPmr568+SalaQr8SE/PA==", - "Hm6MG6BXbAGURVJKWRM6ZA==", - "euxzbIq4vfGYoY3s1QmLcw==", - "/FchS2nPezycB8Bcqc2dbg==", - "ZKvox7BaQg4/p5jIX69Umw==", - "HkbdaMuDTPBDnt3wAn5RpQ==", - "eddhS+FkXxiUnbPoCd5JJw==", - "Muf2Eafcf9G3U2ZvQ9OgtQ==", - "a7Pv1SOWYnkhIUC22dhdDA==", - "O839JUrR+JS30/nOp428QA==", - "2qK2ZEY9LgdKSTaLf6VnLA==", - "BTiGLT6XdZIpFBc91IJY6g==", - "EqYq2aVOrdX5r7hBqUJP7g==", - "SIuKH/Qediq0TyvqUF93HQ==", - "c5ymZKqx/td1MiS2ERiz9A==", - "rqucO37p86LpzehR/asCSQ==", - "1tpM0qgdo7JDFwvT0TD78g==", - "Ar1Eb/f/LtuIjXnnVPYQlA==", - "V8q+xz4ljszLZMrOMOngug==", - "P5WPQc5NOaK7WQiRtFabkw==", - "Xo8ZjXOIoXlBjFCGdlPuZw==", - "jTmPbq+wh30+yJ/dRXk1cA==", - "KSumhnbKxMXQDkZIpDSWmQ==", - "Kh/J1NpDBGoyDU+Mrnnxkg==", - "3BjLFon1Il0SsjxHE2A1LQ==", - "dml2gqLPsKpbIZ93zTXwCQ==", - "ZyoaR1cMiKAsElmYZqKjLA==", - "vnOJ3e9Zd4wPx8PX7QgZzQ==", - "2melaInV0wnhBpiI3da6/A==", - "mUek9NkXm8HiVhQ6YXiyzA==", - "RZTpYKxOAH9JgF1QFGN+hw==", - "a/Y6IAVFv0ykRs9WD+ming==", - "yhRi5M9Etuu9HSu4d24i3w==", - "+1gcqAqaRZwCj5BGiZp3CA==", - "o1zeXHJEKevURAAbUE/Vog==", - "cvOg7N4DmTM+ok1NBLyBiQ==", - "uPdjKJIGzN7pbGZDZdCGaA==", - "REnDNe9mGfqVGZt+GdsmjQ==", - "XqTK/2QuGWj50tGmiDxysA==", - "bL2FuwsPT7a7oserJQnPcw==", - "uO+uK1DntCxVRr1KttfUIw==", - "Xconi1dtldH90Wou9swggw==", - "HRF3WL/ue3/QlYyu7NUTrA==", - "5LuFDNKzMd2BzpWEIYO2Ww==", - "dNTU+/2DdZyGGTdc+3KMhQ==", - "H+NHjk/GJDh/GaNzMQSzjg==", - "/Ph/6l/lFNVqxAje1+PgFA==", - "4WRdAjiUmOQg2MahsunjAg==", - "j+lDhAnWAyso+1N8cm85hQ==", - "nFBXCPeiwxK9mLXPScXzTA==", - "vGKknndb4j6VTV8DxeT4fQ==", - "fdqt93OrpG13KAJ5cASvkg==", - "1MIn73MLroxXirrb+vyg2Q==", - "Q7teXmTHAC5qBy+t7ugf0w==", - "bWwtTFlhO3xEh/pdw0uWaQ==", - "Omi2ZB9kdR1HrVP2nueQkA==", - "+ZozWaPWw8ws1cE5DJACeg==", - "3FH4D31nKV13sC9RpRZFIg==", - "4kXlJNuT79XXf1HuuFOlHw==", - "36XDmX6j542q+Oei1/x0gw==", - "MqqDg9Iyt4k3vYVW5F+LDw==", - "cvrGmub2LoJ+FaM5HTPt9A==", - "uC2lzm7HaMAoczJO6Z/IhQ==", - "MnStiFQAr3QlaRZ02SYGaQ==", - "ZuayB6IpbeITokKGVi9R5w==", - "FtxpWdhEmC6MT61qQv4DGA==", - "KujFdhhgB9q4oJfjYMSsLg==", - "ZV8mEgJweIYk0/l0BFKetA==", - "gDLjxT7vm07arF4SRX5/Vg==", - "/MEOgAhwb7F0nBnV4tIRZA==", - "k2KP9oPMnHmFlZO6u6tgyw==", - "fbTm027Ms0/tEzbGnKZMDA==", - "HOi+vsGAae4vhr+lJ5ATnQ==", - "9Bet5waJF5/ZvsYaHUVEjQ==", - "Wd0dOs7eIMqW5wnILTQBtg==", - "z/e5M2lE9qh3bzB97jZCKA==", - "b16O4LF7sVqB7aLU2f3F1A==", - "lsBTMnse2BgPS6wvPbe7JA==", - "0nOg18ZJ/NicqVUz5Jr0Hg==", - "MFeXfNZy6Q9wBfZmPQy3xg==", - "ksOFI9C7IrDNk4OP6SpPgw==", - "NquRbPn8fFQhBrUCQeRRoQ==", - "ccmy4GVuX967KaQyycmO0w==", - "DY0IolKTYlW+jbKLPAlYjQ==", - "aJFbBhYtMbTyMFBFIz/dTA==", - "9pdeedz1UZUlv8jPfPeZ1g==", - "qZ2q5j2gH3O56xqxkNhlIA==", - "N7fHwb397tuQHtBz1P80ZQ==", - "uOkMpYy/7DYYoethJdixfQ==", - "E9ajQQMe02gyUiW3YLjO/A==", - "dFSavcNwGd8OaLUdWq3sng==", - "TAD0Lk95CD86vbwrcRogaQ==", - "jLI3XpVfjJ6IzrwOc4g9Pw==", - "CzP13PM/mNpJcJg8JD3s6w==", - "GSWncBq4nwomZCBoxCULww==", - "9k17UqdR1HzlF7OBAjpREA==", - "TrWS+reCJ0vbrDNT5HDR9w==", - "CXMKIdGvm60bgfsNc+Imvg==", - "6NP81geiL14BeQW6TpLnUA==", - "hW9DJA1YCxHmVUAF7rhSmQ==", - "8M0kSvjn5KN8bjsMdUqKZQ==", - "eS/vTdSlMUnpmnl1PbHjyw==", - "h2B0ty0GobQhDnFqmKOpKQ==", - "n7KL1Kv027TSxBVwzt9qeA==", - "yYmnM/WOgi+48Rw7foGyXA==", - "FhthAO5IkMyW4dFwpFS7RA==", - "81ZH3SO0NrOO+xoR/Ngw1g==", - "t7HaNlXL16fVwjgSXmeOAQ==", - "N+K1ibXAOyMWdfYctNDSZQ==", - "yQCLV9IoPyXEOaj3IdFMWw==", - "3+zsjCi7TnJhti//YXK35w==", - "600mjiWke4u0CDaSQKLOOg==", - "K4VS+DDkTdBblG93l2eNkA==", - "5KOgetfZR+O2wHQSKt41BQ==", - "kj5WqpRCjWAfjM7ULMcuPQ==", - "AxEjImKz4tMFieSo7m60Sg==", - "jp5Em/0Ml4Txr1ptTUQjpg==", - "jQVlDU+HjZ2OHSDBidxX5A==", - "4NHQwbb3zWq2klqbT/pG6g==", - "PeJS+mXnAA6jQ0WxybRQ8w==", - "l6Ssc04/CnsqUua9ELu2iQ==", - "nFPDZGZowr3XXLmDVpo7hg==", - "yYBIS9PZbKo7Gram7IXWPA==", - "/HU2+fBqfWTEuqINc0UZSA==", - "adT+OjEB2kqpeYi4kQ6FPg==", - "GW1Uaq622QamiiF24QUA0g==", - "rTwJggSxTbwIYdp07ly0LA==", - "4yrFNgqWq17zVCyffULocA==", - "vvh9vAIrXjIwLVkuJb5oDQ==", - "C7UaoIEXsVRxjeA0u99Qmw==", - "x1A74vg/hwwjAx6GrkU8zw==", - "7XRiYvytcwscemlxd9iXIQ==", - "64AA4jLHXc1Dp15aMaGVcA==", - "u/QxrP1NOM/bOJlJlsi/jQ==", - "5M3dFrAOemzQ0MAbA8bI5w==", - "wyqmQGB6vgRVrYtmB2vB7w==", - "8vLA9MOdmLTo3Qg+/2GzLA==", - "/u5W2Gab4GgCMIc4KTp2mg==", - "lhAOM81Ej6YZYBu45pQYgg==", - "MArbGuIAGnw4+fw6mZIxaw==", - "ZZImGypBWwYOAW43xDRWCQ==", - "L2IeUnATZHqOPcrnW2APbA==", - "bQKkL+/KUCsAXlwwIH0N3w==", - "f09F7+1LRolRL5nZTcfKGA==", - "hPnPQOhz4QKhZi02KD6C+A==", - "78b8sDBp28zUlYPV5UTnYw==", - "iVDd2Zk7vwmEh97LkOONpQ==", - "LHQETSI5zsejvDaPpsO29g==", - "Yjm5tSq1ejZn3aWqqysNvA==", - "gkrg0NR0iCaL7edq0vtewA==", - "Lo1xTCEWSxVuIGEbBEkVxA==", - "8GyPup4QAiolFJ9v80/Nkw==", - "3L3KEBHhgDwH615w4OvgZA==", - "hJSP7CostefBkJrwVEjKHA==", - "9oQ/SVNJ4Ye9lq8AaguGAQ==", - "n7Bns42aTungqxKkRfQ5OQ==", - "K5lhaAIZkGeP5rH2ebSJFw==", - "ZaPsR9X77SNt7dLjMJUh8A==", - "18ndtDM9UaNfBR1cr3SHdA==", - "0QbH4oI8IjZ9BRcqRyvvDQ==", - "J/eAtAPswMELIj8K2ai+Xg==", - "qenHZKKlTUiEFv6goKM/Mw==", - "vjrSYGUpeKOtJ2cNgLFg2g==", - "DA+3fjr7mgpwf6BZcExj0w==", - "rh7bzsTQ1UZjG7amysr0Gg==", - "tFMJRXfWE9g78O1uBUxeqQ==", - "e/nWuo5YalCAFKsoJmFyFA==", - "gqehq46BhFX2YLknuMv02w==", - "Uudn69Kcv2CGz2FbfJSSEA==", - "Otz/PgYOEZ1CQDW54FWJIQ==", - "IwfeA6d0cT4nDTCCRhK+pA==", - "jgNijyoj2JrQNSlUv4gk4A==", - "KzWdWPP2gH0DoMYV4ndJRg==", - "pv/m2mA/RJiEQu2Qyfv9RA==", - "ATmMzriwGLl+M3ppkfcZNA==", - "tVvWdA+JqH0HR2OlNVRoag==", - "n6QVaozMGniCO0PCwGQZ6w==", - "gU3gu8Y5CYVPqHrZmLYHbQ==", - "cBBOQn7ZjxDku0CUrxq2ng==", - "w+jzM0I5DRzoUiLS/9QIMQ==", - "MLlVniZ08FHAS5xe+ZKRaA==", - "wMyJLQJdmrC2TSeFkIuSvQ==", - "dG98w8MynOoX7aWmkvt+jg==", - "zm+z+OOyHhljV2TjA3U9zw==", - "Tk5MAqd1gyHpkYi8ErlbWg==", - "g6zSo8BvLuKqdmBFM1ejLA==", - "d0VAZLbLcDUgLgIfT1GmVQ==", - "SNPYH4r/J9vpciGN2ybP5Q==", - "XA2hUgq3GVPpxtRYiqnclg==", - "fVCRaPsTCKEVLkoF4y3zEw==", - "FpgdsQ2OG+bVEy3AeuLXFQ==", - "JquDByOmaQEpFb47ZJ4+JA==", - "e369ZIQjxMZJtopA//G55Q==", - "Nsd+DfRX6L54xs+iWeMjCQ==", - "+/UCpAhZhz368iGioEO8aQ==", - "e5l9ZiNWXglpw6nVCtO8JQ==", - "Cl1u5nGyXaoGyDmNdt38Bw==", - "6sNP0rzCCm3w976I2q2s/w==", - "qcpeZWUlPllQYZU6mHVwUw==", - "kzYddqiMsY3EYrpxve2/CQ==", - "3iC21ByW/YVL+pSyppanWw==", - "3HPOzIZxoaQAmWRy9OkoSg==", - "xsCZVhCk2qJmOqvUjK3Y8Q==", - "i2sSvrTh/RdLJX0uKhbrew==", - "7Y87wVJok20UfuwkGbXxLg==", - "ibsb1ncaLZXAYgGkMO7tjQ==", - "+VfRcTBQ80KSeJRdg0cDfw==", - "kgKWQJJQKLUuD2VYKIKvxA==", - "ARKIvf4+zRF8eCvUITWPng==", - "1fztTtQWNMIMSAc5Hr6jMQ==", - "md6zNd7ZBn3qArYqQz7/fw==", - "kvAaIJb+aRAfKK104dxFAA==", - "UIXytIHyVODxlrg+eQoARA==", - "Dk0L/lQizPEb3Qud6VHb1Q==", - "64YsV2qeDxk2Q6WK/h7OqA==", - "90dtIMq0ozJXezT2r79vMQ==", - "wy/Z8505o4sVovk4UuBp1A==", - "ytDXLDBqWiU1w3sTurYmaw==", - "9pk75mBzhmcdT+koHvgDlw==", - "DQeib845UqBMEl96sqsaSg==", - "UPYR575ASaBSZIR3aX1IgQ==", - "swsVVsPi/5aPFBGP+jmPIw==", - "1cj1Fpd3+UiBAOahEhsluA==", - "ifuJCv9ZA84Vz1FYAPsyEA==", - "uu+ncs63SdQIvG6z4r7Q3Q==", - "UvC1WADanMrhT+gPp/yVqA==", - "llOvGOUDVfX68jKnAlvVRA==", - "SusSOsWNoAerAIMBVWHtfA==", - "VznvTPAAwAev+yhl9oZT0w==", - "luR/kvHLwA6tSdLeTM4TzA==", - "PcdBtV8pfKU0YbDpsjPgwg==", - "5l6kDfjtZjkTZPJvNNOVFw==", - "4FBBtWPvqJ3dv4w25tRHiQ==", - "JJbzQ/trOeqQomsKXKwUpQ==", - "0bj069wXgEJbw7dpiPr8Tg==", - "tejpAZp7y32SO2+o4OGvwQ==", - "kq26VyDyJTH/eM6QvS2cMw==", - "+zBkeHF4P8vLzk1iO1Zn3Q==", - "BzkNYH03gF/mQY71RwO3VA==", - "RnxOYPSQdHS6fw4KkDJtrA==", - "65KhGKUBFQubRRIEdh9SwQ==", - "k1DPiH6NkOFXP/r3N12GyA==", - "DqzWt1gfyu/e7RQl5zWnuQ==", - "gnez1VrH+UHT8C/SB9qGdA==", - "vZtL0yWpSIA+9v8i23bZSg==", - "FNvQqYoe0s/SogpAB7Hr1Q==", - "6nwR+e9Qw0qp8qIwH9S/Mg==", - "BPT4PQxeQcsZsUQl33VGmg==", - "rOYeIcB+Rg5V6JG2k4zS2w==", - "Je1UESovkBa9T6wS0hevLw==", - "HFHMGgfOeO0UPrray1G+Zw==", - "NBmB/cQfS+ipERd7j9+oVg==", - "iIm8c9uDotr87Aij+4vnMw==", - "S3VQa6DH+BdlSrxT/g6B5g==", - "BwRA+tMtwEvth28IwpZx+w==", - "vg3jozLXEmAnmJwdfcEN0g==", - "gW0oKhtQQ7BxozxUWw5XvQ==", - "Q6vGRQiNwoyz7bDETGvi5g==", - "Ak3rlzEOds6ykivfg39xmw==", - "G4qzBI1sFP2faN+tlRL/Bw==", - "ND9l4JWcncRaSLATsq0LVw==", - "yQmNZnp/JZywbBiZs3gecA==", - "ZoNSxARrRiKZF5Wvpg7bew==", - "GhpJfRSWZigLg/azTssyVA==", - "QyyiJ5I/OZC50o89fa5EmQ==", - "4kj0S8XlmhHXoUP7dQItUw==", - "Dt8Q5ORzTmpPR2Wdk0k+Aw==", - "/hFhjFGJx2wRfz6hyrIpvA==", - "eFimq+LuHi42byKnBeqnZQ==", - "JrKGKAKdjfAaYeQH8Y2ZRQ==", - "JFFeXsFsMA59iNtZey7LAA==", - "91SdBFJEZ65M+ixGaprY/A==", - "+S+WXgVDSU1oGmCzGwuT3g==", - "1X14kHeKwGmLeYqpe60XEA==", - "4xojeUxTFmMLGm6jiMYh/Q==", - "+1e7jvUo8f2/2l0TFrQqfA==", - "8WU1vLKV1GhrL7oS9PpABg==", - "DYWCPUq/hpjr6puBE7KBHg==", - "birqO8GOwGEI97zYaHyAuw==", - "6e8boFcyc8iF0/tHVje4eQ==", - "FLvED9nB9FEl9LqPn7OOrA==", - "ji306HRiq965zb8EZD2uig==", - "AklOdt9/2//3ylUhWebHRw==", - "VGRCSrgGTkBNb8sve0fYnQ==", - "oqlkgrYe9aCOwHXddxuyag==", - "KXuFON8tMBizNkCC48ICLA==", - "9aKH1u5+4lgYhhLztQ4KWA==", - "3hVslsq98QCDIiO40JNOuA==", - "OOS6wQCJsXH8CsWEidB35A==", - "YXHQ3JI9+oca8pc/jMH6mA==", - "V9vkAanK+Pkc4FGAokJsTA==", - "OFLn4wun6lq484I7f6yEwg==", - "3WVBP9fyAiBPZAq3DpMwOQ==", - "5gGoDPTc/sOIDLngmlEq4A==", - "E2lvMXqHdTw0x+KCKVnblg==", - "f1Gs++Iilgq9GHukcnBG3w==", - "uIkVijg7RPi/1j7c18G1qA==", - "9T7gB0ZkdWB0VpbKIXiujQ==", - "KCJJfgLe00+tjSfP6EBcUg==", - "WbAdlac/PhYUq7J2+n5f+w==", - "GLnS9wDCje7TOMvBX9jJVA==", - "VAg/aU5nl72O+cdNuPRO4g==", - "kzTl7WH/JXsX1fqgnuTOgw==", - "1HDgfU7xU7LWO/BXsODZAQ==", - "D0W5F7gKMljoG5rlue1jrg==", - "9reBKZ1Rp6xcdH1pFQacjw==", - "SSKhl2L3Mvy93DcZulADtA==", - "hlu7os0KtAkpBTBV6D2jyQ==", - "sfte/o9vVNyida/yLvqADA==", - "gYGQBLo5TdMyXks0LsZhsQ==", - "dNq2InSVDGnYXjkxPNPRxA==", - "fiv0DJivQeqUkrzDNlluRw==", - "msstzxq++XO0AqNTmA7Bmg==", - "DCjgaGV5hgSVtFY5tcwkuA==", - "aMmrAzoRWLOMPHhBuxczKg==", - "qNOSm15bdkIDSc/iUr+UTQ==", - "2nSTEYzLK77h5Rgyti+ULQ==", - "BhKO1s1O693Fjy1LItR/Jw==", - "kRnBEH6ILR5GNSmjHYOclw==", - "R97chlspND/sE9/HMScXjQ==", - "1Oykse0jQVbuR3MvW5ot4A==", - "Dmyb+a7/QFsU4d2cVQsxDw==", - "W5now3RWSzzMDAxsHSl++Q==", - "IrDuBrVu1HWm0BthAHyOLQ==", - "V6zyoX6MERIybGhhULnZiw==", - "ZQSDYgpsimK+lYGdXBWE/w==", - "lV70RNlE++04G1KFB3BMXA==", - "QmSBVvdk0tqH9RAicXq2zA==", - "qNyy6Fc0b8oOMWqqaliZ/w==", - "xvipmmwKdYt4eoKvvRnjEg==", - "Q7Df6zGwvb4rC+EtIKfaSw==", - "n1M2dgFPpmaICP+JwxHUug==", - "1k8tL2xmGFVYMgKUcmDcEw==", - "fFvXa1dbMoOOoWZdHxPGjw==", - "UP9mmAKzeQqGhod7NCqzhg==", - "PMCWKgog/G+GFZcIruSONw==", - "dnvatwSEcl73ROwcZ4bbIQ==", - "hY82j+sUQQRpCi6CCGea5A==", - "QoUC9nyK1BAzoUVnBLV2zw==", - "+aF4ilbjQbLpAuFXQEYMWQ==", - "XTCcsVfEvqxnjc0K5PLcyw==", - "ML7ipnY/g8mA1PUIju1j8Q==", - "tOkYq1BZY152/7IJ6ZYKUg==", - "2bsIpvnGcFhTCSrK9EW1FQ==", - "Af9j1naGtnZf0u1LyYmK1w==", - "ZmblZauRqO5tGysY3/0kDw==", - "PF0lpolQQXlpc3qTLMBk8w==", - "emVLJVzha7ui5OFHPJzeRQ==", - "gR0sgItXIH8hE4FVs9Q07w==", - "PTW+fhZq/ErxHqpM0DZwHQ==", - "g0kHTNRI7x/lAsr92EEppw==", - "24H9q+E8pgCEdFS7JO5kzQ==", - "HtDXgMuF8PJ1haWk88S0Ew==", - "pulldyBt2sw6QDvTrCh6zw==", - "ehwc2vvwNUAI7MxU4MWQZw==", - "enj9VEzLbmeOyYugTmdGfQ==", - "auvG6kWMnhCMi7c7e9eHrw==", - "R36O31Pj8jn0AWSuqI7X2Q==", - "3AVYtcIv7A5mVbVnQMaCeA==", - "T9WoUJNwp8h4Yydixbx6nA==", - "t0WN8TwMLgi8UVEImoFXKg==", - "mS99D+CXhwyfVt8xJ+dJZA==", - "AFdelaqvxRj6T3YdLgCFyg==", - "Lu02ic/E94s42A14m7NGCA==", - "7w3b73nN/fIBvuLuGZDCYQ==", - "O209ftgvu0vSr0UZywRFXA==", - "MQvAr+OOfnYnr/Il/2Ubkg==", - "e5txnNRcGs2a9+mBFcF1Qg==", - "YA0kMTJ82PYuLA4pkn4rfw==", - "QIKjir/ppRyS63BwUcHWmw==", - "P3y5MoXrkRTSLhCdLlnc4A==", - "WY7mCUGvpXrC8gkBB46euw==", - "g0GbRp2hFVIdc7ct7Ky7ag==", - "Cv079ZF55RnbsDT27MOQIA==", - "cvMJ714elj/HUh89a9lzOQ==", - "9inw7xzbqAnZDKOl/MfCqA==", - "F58ktE4O0f7C9HdsXYm+lw==", - "CsPkyTZADMnKcgSuNu1qxg==", - "mAzsVkijuqihhmhNTTz65g==", - "FxnbKnuDct4OWcnFMT/a5w==", - "P5wS+xB8srW4a5KDp/JVkA==", - "ctJYJegZhG42i+vnPFWAWw==", - "OrqJKjRndcZ8OjE3cSQv7g==", - "aXqiibI6BpW3qilV6izHaQ==", - "BA18GEAOOyVXO2yZt2U35w==", - "saEpnDGBSZWqeXSJm34eOA==", - "CUEueo8QXRxkfVdfNIk/gg==", - "H0UMAUfHFQH92A2AXRCBKA==", - "CT9g8mKsIN/VeHLSTFJcNQ==", - "E4NtzxQruLcetC23zKVIng==", - "203EqmJI9Q4tWxTJaBdSzA==", - "Do3aqbRKtmlQI2fXtSZfxQ==", - "JaYQXntiyznQzrTlEeZMIw==", - "VK95g27ws2C6J2h/7rC2qA==", - "CQ0PPwgdG3N6Ohfwx1C8xA==", - "/MeHciFhvFzQsCIw39xIZA==", - "u5cUPxM6/spLIV8VidPrAA==", - "OwArFF1hpdBupCkanpwT+Q==", - "PdBgXFq5mBqNxgCiqaRnkw==", - "lC5EumoIcctvxYqwELqIqw==", - "xoPSM86Se+1hHX0y3hhdkw==", - "F5bs0GGWBx9eBwcJJpXbqg==", - "1mw6LfTiirFyfjejf8QNGA==", - "daBhAvmE9shDgmciDAC5eg==", - "AvdeYb9XNOUFWiiz+XGfng==", - "JJJkp1TpuDx5wrua2Wml7g==", - "3y5Xk65ShGvWFbQxcZaQAQ==", - "l6QHU5JsJExNoOnqxBPVbw==", - "X2YfnPXgF2VHVX95ZcBaxQ==", - "g6udffWh7qUnSIo1Ldn3eA==", - "V2P75JFB4Se9h7TCUMfeNA==", - "IUZ5aGpkJ9rLgSg6oAmMlw==", - "pyrUqiZ98gVXxlXQNXv5fA==", - "83ERX2XJV3ST4XwvN7YWCg==", - "eJDUejE/Ez/7kV+S74PDYg==", - "M9oqlPb63e0kZE0zWOm+JQ==", - "0rTYcuVYdilO7zEfKrxY3A==", - "rfPTskbnoh3hRJH6ZAzQRg==", - "QtD35QhE8sAccPrDnhtQmQ==", - "jpNUgFnanr9Sxvj2xbBXZw==", - "nykEOLL/o7h0cs0yvdeT2g==", - "wX2URK6eDDHeEOF3cgPgHA==", - "jqPQ0aOuvOJte/ghI1RVng==", - "nHTsDl0xeQPC5zNRnoa0Rw==", - "mNv2Q67zePjk/jbQuvkAFA==", - "HjlPM2FQWdILUXHalIhQ5w==", - "cHkOsVd80Rgwepeweq4S1g==", - "kTCHqcb3Cos51o8cL+MXcg==", - "nvmBgp0YlUrdZ05INsEE8Q==", - "kFrRjz7Cf2KvLtz9X6oD+w==", - "Tmx0suRHzlUK4FdBivwOwA==", - "bG+P+p34t/IJ1ubRiWg6IA==", - "uESeJe/nYrHCq4RQbrNpGA==", - "ehfPlu6YctzzpQmFiQDxGA==", - "ZH5Es/4lJ+D5KEkF1BVSGg==", - "HHxn4iIQ7m0tF1rSd+BZBg==", - "DQJRsUwO1fOuGlkgJavcwQ==", - "HITIVoFoWNg04NExe13dNA==", - "MeKXnEfxeuQu9t3r/qWvcw==", - "Y7OofF9eUvp7qlpgdrzvkg==", - "XSb71ae0v+yDxNF5HJXGbQ==", - "p8W1LgFuW6JSOKjHkx3+aA==", - "y2JOIoIiT9cV1VxplZPraQ==", - "MN94B0r5CNAF9sl3Kccdbw==", - "Q1pdQadt12anX1QRmU2Y/A==", - "JIC8R48jGVqro6wmG2KXIw==", - "eWgLAqJOU+fdn8raHb9HCw==", - "5CMadLqS2KWwwMCpzlDmLw==", - "H1y2iXVaQYwP0SakN6sa+Q==", - "CUCjG2UaEBmiYWQc6+AS1Q==", - "yV3IbbTWAbHMhMGVvgb/ZQ==", - "80PCwYh4llIKAplcDvMj4g==", - "fgdUFvQPb5h+Rqz8pzLsmw==", - "2SI4F7Vvde2yjzMLAwxOog==", - "kJdY3XEdJS/hyHdR+IN0GA==", - "IKgNa2oPaFVGYnOsL+GC5Q==", - "eXFOya6x5inTdGwJx/xtUQ==", - "uTA0XbiH3fTeVV7u5z0b3w==", - "onFcHOO1c3pDdfCb5N4WkQ==", - "Slu3z535ijcs5kzDnR7kfA==", - "SElc2+YVi3afE1eG1MI7dQ==", - "ND2hYtAIQGMxBF7o7+u7nQ==", - "Pv9FWQEDLKnG/9K9EIz4Gw==", - "6CjtF1S2Y6RCbhl7hMsD+g==", - "rs2QrN4qzAHCHhkcrAvIfA==", - "eTMPXa60OTGjSPmvR4IgGw==", - "pvXHwJ3dwf9GDzfDD9JI3g==", - "CRmAj3JcasAb4iZ9ZbNIbw==", - "rcY4Ot40678ByCfqvGOGdg==", - "l4ddTxbTCW5UmZW+KRmx6A==", - "NKRzJndo2uXNiNppVnqy1g==", - "0NrvBuyjcJ2q6yaHpz/FOA==", - "3YXp1PmMldUjBz3hC6ItbA==", - "CmVD6nh8b/04/6JV9SovlA==", - "HjyxyL0db2hGDq2ZjwOOhg==", - "4PBaoeEwUj79njftnYYqLg==", - "vFFzkWgGyw6OPADONtEojQ==", - "czBWiYsQtNFrksWwoQxlOw==", - "9iB7+VwXRbi6HLkWyh9/kg==", - "zwY6tCjjya/bgrYaCncaag==", - "mW6TCje9Zg2Ep7nzmDjSYQ==", - "5LJqHFRyIwQKA4HbtqAYQQ==", - "INNBBin5ePwTyhPIyndHHg==", - "dChBe9QR29ObPFu/9PusLg==", - "1dhq3ozNCx0o4dV1syLVDA==", - "nyaekSYTKzfSeSfPrB114Q==", - "TfNHjSTV8w6Pg6+FaGlxvA==", - "m/Lp4U75AQyk9c8cX14HJg==", - "uU1TX5DoDg6EcFKgFcn0GA==", - "B+TsxQZf0IiQrU8X9S4dsQ==", - "6b7ue29cBDsvmj1VSa5njw==", - "RvXWAFwM+mUAPW1MjPBaHA==", - "pdaY6kZ8+QqkMOInvvACNA==", - "7nr3zyWL+HHtJhRrCPhYZA==", - "BXGlq54wIH6R3OdYfSSDRw==", - "b06KGv5zDYsTxyTbQ9/eyA==", - "8ylI1AS3QJpAi3I/NLMYdg==", - "0fpe9E6m3eLp/5j5rLrz2Q==", - "Qrh7OEHjp80IW+YzQwzlJg==", - "lqhgbgEqROAdfzEnJ17eXA==", - "Dulw855DfgIwiK7hr3X8vg==", - "wsp+vmW8sEqXYVURd/gjHA==", - "VoPth5hDHhkQcrQTxHXbuw==", - "TgWe70YalDPyyUz6n88ujg==", - "9lLhHcrPWI4EsA4fHIIXuw==", - "UymZUnEEQWVnLDdRemv+Tw==", - "qnkFUlJ8QT322JuCI3LQgg==", - "/p/aCTIhi1bU0/liuO/a2Q==", - "hWoxz5HhE50oYBNRoPp1JQ==", - "88tB/HgUIUnqWXEX++b5Aw==", - "Z8T1b9RsUWf59D06MUrXCQ==", - "BZTzHJGhzhs3mCXHDqMjnQ==", - "XfY+QUriCAA1+3QAsswdgg==", - "TZ3ATPOFjNqFGSKY3vP2Hw==", - "cl4t9FXabQg7tbh1g7a0OA==", - "9SgfpAY0UhNC6sYGus9GgQ==", - "d/Wd3Ma1xYyoMByPQnA9Cw==", - "DDitrRSvovaiXe2nfAtp4g==", - "s+eHg5K9zZ2Jozu5Oya9ZQ==", - "z3L2BNjQOMOfTVBUxcpnRA==", - "v4xIYrfPGILEbD/LwVDDzA==", - "HoaBBw2aPCyhh0f5GxF+/Q==", - "i9IRqAqKjBTppsxtPB7rdw==", - "cWUg7AfqhiiEmBIu+ryImA==", - "E+02smwQGBIxv42LIF2Y4Q==", - "W4CfeVp9mXgk04flryL7iA==", - "9SUOfKtfKmkGICJnvbIDMg==", - "xweGAZf+Yb3TtwR/sGmGIA==", - "EJgedRYsZPc4cT9rlwaZhg==", - "wv4NC9CIpwuGf/nOQYe/oA==", - "ZXeMG5eqQpZO/SGKC4WQkA==", - "bzXXzQGZs8ustv0K4leklA==", - "RkQK9S1ezo+dFYHQP57qrw==", - "mrinv7KooPQPrLCNTRWCFg==", - "qIUJPanWmGzTD1XxvHp+6w==", - "Js7g8Dr6XsnGURA4UNF0Ug==", - "dpSTNOCPFHN5yGoMpl1EUA==", - "ugY8rTtJkN4CXWMVcRZiZw==", - "rqHKB91H3qVuQAm+Ym5cUA==", - "UjmDFO7uzjl4RZDPeMeNyg==", - "cu4ZluwohhfIYLkWp72pqA==", - "ZydKlOpn2ySBW0G3uAqwuw==", - "LWd0+N3M94n81qd346LfJQ==", - "VbHoWmtiiPdABvkbt+3XKQ==", - "J4MC9He6oqjOWsYQh9nl3Q==", - "ahAbmGJZvUOXrcK6OydNGQ==", - "Byhi4ymFqqH8uIeoMRvPug==", - "LSN9GmT6LUHlCAMFqpuPIA==", - "IAMInfSYb76GxDlAr1dsTg==", - "qYHdgFAXhF/XcW4lxqfvWQ==", - "26+yXbqI+fmIZsYl4UhUzw==", - "AwPTZpC28NJQhf5fNiJuLA==", - "SESKbGF35rjO64gktmLTWA==", - "YVlRQHQglkbj3J2nHiP/Hw==", - "DdaT4JLC7U0EkF50LzIj9w==", - "G0LChrb0OE5YFqsfTpIL1Q==", - "5Yrj6uevT8wHRyqqgnSfeg==", - "NmWmDxwK5FpKlZbo0Rt8RA==", - "iUsUCB0mfRsE9KPEQctIzw==", - "Tm4zk2Lmg8w4ITMI31NfTA==", - "Vu0E+IJXBnc25x4n41kQig==", - "6wkfN8hyKmKU6tG3YetCmw==", - "trjM81KANPZrg9iSThWx6Q==", - "iGuY4VxcotHvMFXuXum7KA==", - "ICPdBCdONUqPwD5BXU5lrw==", - "alqHQBz8V446EdzuVfeY5Q==", - "74FW/QYTzr/P1k6QwVHMcw==", - "avZp5K7zJvRvJvpLSldNAw==", - "TIKadc6FAaRWSQUg5OATgg==", - "PfkWkSbAxIt1Iso0znW0+Q==", - "Z+bsbVP91KrJvxrujBLrrQ==", - "mrxlFD3FBqpSZr1kuuwxGg==", - "nUgYO7/oVNSX8fJqP2dbdg==", - "tVhXk9Ff3wAg56FbdNtcFg==", - "DdiNGiOSoIZxrMrGNvqkXw==", - "CDsanJz7e3r/eQe+ZYFeVQ==", - "wVfSZYjMjbTsD2gaSbwuqQ==", - "6c0iuya20Ys8BsvoI4iQaQ==", - "qCPfJTR8ecTw6u6b1yHibA==", - "fZrj3wGQSt8RXv0ykJROcQ==", - "gR3B8usSEb0NLos51BmJQg==", - "vTAmgfq3GxL4+ubXpzwk5w==", - "jLkmUZ6fV56GfhC0nkh4GA==", - "3v09RHCPTLUztqapThYaHg==", - "nULSbtw2dXbfVjZh33pDiA==", - "IHhyR6+5sZXTH+/NrghIPg==", - "tnUtJ/DQX9WaVJyTgemsUA==", - "7xTKFcog69nTmMfr5qFUTA==", - "IshzWega6zr3979khNVFQQ==", - "Ng5v/B9Z10TTfsDFQ/XrXQ==", - "hnCUnoxofUiqQvrxl73M8w==", - "VPa7DG6v7KnzMvtJPb88LQ==", - "4LtQrahKXVtsbXrEzYU1zQ==", - "Ev/xjTi7akYBI7IeZJ4Igw==", - "41WEjhYUlG6jp2UPGj11eQ==", - "JvXTdChcE3AqMbFYTT3/wg==", - "2rOkEVl90EPqfHOF5q2FYw==", - "mjFBVRJ7TgnJx+Q74xllPg==", - "Uy4QI8D2y1bq/HDNItCtAw==", - "wMOE/pEKVIklE75xjt6b6w==", - "ZcuIvc8fDI+2uF0I0uLiVA==", - "CX/N/lHckmAtHKysYtGdZA==", - "j8to4gtSIRYpCogv2TESuQ==", - "iS9wumBV5ktCTefFzKYfkA==", - "ewPT4dM12nDWEDoRfiZZnA==", - "vWn9OPnrJgfPavg4D6T/HQ==", - "J/PNYu4y6ZMWFFXsAhaoow==", - "catI+QUNk3uJ+mUBY3bY8Q==", - "F8tEIT5EhcvLNRU5f0zlXQ==", - "zyA9f5J7mw5InjhcfeumAQ==", - "MlOOZOwcRGIkifaktEq0aQ==", - "Pt3i49uweYVgWze3OjkjJA==", - "sfIClgTMtZo9CM9MHaoqhQ==", - "HeQbUuBM9sqfXFXRBDISSw==", - "SFn78uklZfMtKoz2N0xDaQ==", - "H6j2nPbBaxHecXruxiWYkA==", - "fU32wmMeD44UsFSqFY0wBA==", - "hDILjSpTLqJpiSSSGu445A==", - "ieEAgvK9LsWh2t6DsQOpWA==", - "xfjBQk3CrNjhufdPIhr91A==", - "j+8/VARfbQSYhHzj0KPurQ==", - "/zFLRvi75UL8qvg+a6zqGg==", - "U0KmEI6e5zJkaI4YJyA5Ew==", - "uXvr6vi5kazZ9BCg2PWPJA==", - "jEqP0dyHKHiUjZ9dNNGTlQ==", - "1xWx5V3G9murZP7srljFmA==", - "OIwtfdq37eQ0qoXuB2j7Hw==", - "fUAy3f9bAglLvZWvkO2Lug==", - "duRFqmvqF93uf/vWn8aOmg==", - "ysRQ+7Aq7eVLOp88KnFVMA==", - "CkZUmKBAGu0FLpgPDrybpw==", - "TrLmfgwaNATh24eSrOT+pw==", - "83wtvSoSP9FVBsdWaiWfpA==", - "pUfWmRXo70yGkUD/x5oIvA==", - "PybPZhJErbRTuAafrrkb3g==", - "8hsfXqi4uiuL+bV1VrHqCw==", - "TVlHoi8J7sOZ2Ti7Dm92cQ==", - "za4rzveYVMFe3Gw531DQJQ==", - "JKphO0UYjFqcbPr6EeBuqg==", - "hqeSvwu8eqA072iidlJBAw==", - "bUF0JIfS4uKd3JZj2xotLQ==", - "hKOsXOBoFTl/K4xE+RNHDA==", - "JHBjKpCgSgrNNACZW1W+1w==", - "Rrq0ak9YexLqqbSD4SSXlw==", - "+NmjwjsPhGJh9bM10SFkLw==", - "xMIHeno2qj3V8q9H1xezeg==", - "TcFinyBrUoAEcLzWdFymow==", - "Rvchz/xjcY9uKiDAkRBMmA==", - "TYlnrwgyeZoRgOpBYneRAg==", - "PbnxuVerGwHyshkumqAARg==", - "iFtadcw8v6betKka9yaJfg==", - "7wgT9WIiMVcrj48PVAMIgw==", - "2HHqeGRMfzf3RXwVybx+ZQ==", - "tdgI9v7cqJsgCAeW1Fii1A==", - "4ZFYKa7ZgvHyZLS6WpM8gA==", - "gB8wkuIzvuDAIhDtNT1gyA==", - "g1ELwsk6hQ+RAY1BH640Pg==", - "UZoibx+y1YJy/uRSa9Oa2w==", - "yS/yMnJDHW0iaOsbj4oPTg==", - "JzW+yhrjXW1ivKu3mUXPXg==", - "/wIZAye9h1TUiZmDW0ZmYA==", - "YK+q7uJObkQZvOwQ9hplMg==", - "Rs8deApkoosIJSfX7NXtAA==", - "MsCloSmTFoBpm7XWYb+ueQ==", - "3ltw31yJuAl4VT6MieEXXw==", - "1+qmrbC8c7MJ6pxmDMcKuA==", - "AYxGETZs477n2sa1Ulu/RQ==", - "Q0TJZxpn3jk67L7N+YDaNA==", - "OGpsXRHlaN8BvZftxh1e7A==", - "UbABE6ECnjB+9YvblE9CYw==", - "kZ0D191c/uv4YMG15yVLDw==", - "QWURrsEgxbJ8MWcaRmOWqw==", - "xiFlcSfa/gnPiO+LwbixcQ==", - "Szko0IPE7RX2+mfsWczrMg==", - "Ugt8HVC/aUzyWpiHd0gCOQ==", - "8j9GVPiFdfIRm/+ho7hpoA==", - "KR401XBdgCrtVDSaXqPEiA==", - "d0NBFiwGlQNclKObRtGVMQ==", - "XEwOJG24eaEtAuBWtMxhwg==", - "0Y6iiZjCwPDwD/CwJzfioQ==", - "MvMbvZNKbXFe2XdN+HtnpQ==", - "fsoXIbq0T0nmSpW8b+bj+g==", - "Uje3Ild84sN41JEg3PEHDg==", - "i6ZYpFwsyWyMJNgqUMSV1A==", - "+P5q4YD1Rr5SX26Xr+tzlw==", - "z4oKy2wKH+sbNSgGjbdHGw==", - "XwKWd03sAz8MmvJEuN08xA==", - "Xv0mNYedaBc57RrcbHr9OA==", - "9oUawSwUGOmb0sDn3XS6og==", - "9RGIQ2qyevNbSSEF36xk/A==", - "q8YF9G2jqydAxSqwyyys5Q==", - "m5JIUETVXcRza4VL4xlJbg==", - "aRpdnrOyu5mWB1P5YMbvOA==", - "rM/BOovNgnvebKMxZQdk7g==", - "fQS0jnQMnHBn7+JZWkiE/g==", - "gAoV4BZYdW1Wm712YXOhWQ==", - "hCzsi1yDv9ja5/o7t94j9Q==", - "CoLvjQDQGldGDqRxfQo+WQ==", - "pfGcaa49SM3S6yJIPk/EJQ==", - "yYp4iuI5f/y/l1AEJxYolQ==", - "Jj4IrSVpqQnhFrzNvylSzA==", - "4jeOFKuKpCmMXUVJSh9y0g==", - "+NMUaQ7XPsAi0rk7tTT9wQ==", - "Jt4Eg6MJn8O4Ph/K2LeSUA==", - "CiiUeJ0LeWfm7+gmEmYXtg==", - "c5Tc7rTFXNJqYyc0ppW+Iw==", - "4KJZPCE9NKTfzFxl76GWjg==", - "aXs9qTEXLTkN956ch3pnOA==", - "f5Xo7F1uaiM760Qbt978iw==", - "wpZqFkKafFpLcykN2IISqg==", - "vIORTYSHFIXk5E2NyIvWcQ==", - "prOsOG0adI4o+oz50moipw==", - "blygTgAHZJ3NzyAT33Bfww==", - "rBt6L/KLT7eybxKt5wtFdg==", - "vMuaLvAntJB5o7lmt/kVXA==", - "iujlt9fXcUXEYc+T2s5UjA==", - "LyYPOZKm8bBegMr5NTSBfg==", - "ZtWvgitOSRDWq7LAKYYd4Q==", - "kh51WUI5TRnKhur6ZEpRTQ==", - "VzQ1NwNv9btxUzxwVqvHQg==", - "8fJLQeIHaTnJ8wGqUiKU6g==", - "vvEH5A39TTe1AOC11rRCLA==", - "dihDsG7+6aocG6M9BWrCzQ==", - "3jqsY8/xTWELmu/az3Daug==", - "mpOtwBvle+nyY6lUBwTemw==", - "E1CvxFbuu9AYW604mnpGTw==", - "1LPC0BzhJbepHTSAiZ3QTw==", - "XpGXh76RDgXC4qnTCsnNHA==", - "3Gg9N7vjAfQEYOtQKuF/Eg==", - "+WpF8+poKmHPUBB4UYh/ig==", - "UNt7CNMtltJWq8giDciGyA==", - "RIZYDgXqsIdTf9o2Tp/S7g==", - "0QCQORCYfLuSbq94Sbt0bQ==", - "hvsZ5JmVevK1zclFYmxHaw==", - "3+9nURtBK3FKn0J9DQDa3g==", - "jdVMQqApseHH3fd91NFhxg==", - "VX+cVXV8p9i5EBTMoiQOQQ==", - "I5qDndyelK4Njv4YrX7S6w==", - "rWliqgfZ3/uCRBOZ9sMmdA==", - "vwno3vugCvt6ooT3CD4qIQ==", - "cffrYrBX3UQhfX1TbAF+GQ==", - "nOiwBFnXxCBfPCHYITgqNg==", - "LQttmX92SI94+hDNVd8Gtw==", - "iCF+GWw9/YGQXsOOPAnPHQ==", - "nwtCsN1xEYaHvEOPzBv+qQ==", - "CQpJFrpOvcQhsTXIlJli+Q==", - "tYeIZjIm0tVEsYxH1iIiUQ==", - "iCnm5fPmSmxsIzuRK6osrA==", - "tX8X8KoxUQ8atFSCxgwE1Q==", - "hZlX6qOfwxW5SPfqtRqaMw==", - "2aIx9UdMxxZWvrfeJ+DcTw==", - "TlJizlASbPtShZhkPww4UA==", - "p+bx+/WQWALXEBCTnIMr4w==", - "4VR5LiXLew6Nyn91zH9L4w==", - "bfUD03N2PRDT+MZ+WFVtow==", - "cTvDd8okNUx0RCMer6O8sw==", - "49jZr/mEW6fvnyzskyN40w==", - "vHmQUl4WHXs1E/Shh+TeyA==", - "fgXfRuqFfAu8qxbTi4bmhA==", - "Wn+Vj4eiWx0WPUHr3nFbyA==", - "2SwIiUwT4vRZPrg7+vZqDA==", - "nkedTagkmf6YE4tEY+0fKw==", - "8nOTDhFyZ8YUA4b6M5p84w==", - "qnzWszsyJhYtx8wkMN6b1g==", - "ka7pMp8eSiv92WgAsz2vdA==", - "pGQEWJ38hb/ZYy2P1+FIuw==", - "cVhdRFuZaW/09CYPmtNv5g==", - "prCOYlboBnzmLEBG/OeVrQ==", - "oIWwTbkVS5DDL47mY9/1KQ==", - "PKtXc4x4DEjM45dnmPWzyg==", - "f9ywiGXsz+PuEsLTV3zIbQ==", - "6G2bD3Y7qbGmfPqH9TqLFA==", - "DMHmyn2U2n+UXxkqdvKpnA==", - "XOG1PYgqoG8gVLIbVLTQgg==", - "1FSrgkUXgZot2CsmbAtkPw==", - "BxFP+4o6PSlGN78eSVT1pA==", - "EZVQGsXTZvht1qedRLF8bQ==", - "eYAQWuWZX2346VMCD6s7/A==", - "jkUpkLoIXuu7aSH8ZghIAQ==", - "mXPtbPaoNAAlGmUMmJEWBQ==", - "HLesnV3DL+FhWF3h6RXe8g==", - "nDAsSla+9XfAlQSPsXtzPA==", - "RAECgYZmcF4WxcFcZ4A0Ww==", - "W+M4BcYNmjj7xAximDGWsA==", - "ueODvMv/f9ZD8O0aIHn4sg==", - "cszpMdGbsbe6BygqMlnC9Q==", - "siHwJx6EgeB1gBT9z/vTyw==", - "FN7oLGBQGHXXn5dLnr/ElA==", - "Tud+AMyuFkWYYZ73yoJGpQ==", - "TuaG3wRdM9BWKAxh2UmAsg==", - "8CjmgWQSAAGcXX9kz3kssw==", - "ays5/F7JANIgPHN0vp2dqQ==", - "PCOGl7GIqbizAKj/sZmlwQ==", - "rZKD8oJnIj5fSNGiccfcvA==", - "gFEnTI8os2BfRGqx9p5x8w==", - "5r1ZsGkrzNQEpgt/gENibw==", - "1YO9G8qAhLIu2rShvekedw==", - "6ZKmm7IW7IdWuVytLr68CQ==", - "mMfn8OaKBxtetweulho+xQ==", - "GQJxu1SoMBH14KPV/G/KrQ==", - "IYIP2UBRyWetVfYLRsi1SQ==", - "Jit0X0srSNFnn8Ymi1EY+g==", - "ARCWkHAnVgBOIkCDQ19ZuA==", - "qA0sTaeNPNIiQbjIe1bOgQ==", - "iGI9uqMoBBAjPszpxjZBWQ==", - "+L1FDsr5VQtuYc2Is5QGjw==", - "4XNUmgwxsqDYsNmPkgNQYQ==", - "Yig+Wh18VIqdsmwtwfoUQw==", - "uqp92lAqjec8UQYfyjaEZw==", - "QiozlNcQCbqXtwItWExqJQ==", - "JFHutgSe1/SlcYKIbNNYwQ==", - "Y26jxXvl79RcffH8O8b9Ew==", - "bQ7J5mebp38rfP/fuqQOsg==", - "HI4ZIE5s8ez8Rb+Mv39FxA==", - "OzH7jTcyeM7RPVFtBdakpQ==", - "HLxROy6fx/mLXFTDSX4eLA==", - "s5RUHVRNAoKMuPR/Jkfc2Q==", - "X9QAaNjgiOeAWSphrGtyVw==", - "ALJWKUImVE40MbEooqsrng==", - "9MDG0WeBPpjGJLEmUJgBWg==", - "9RXymE9kCkDvBzWGyMgIWA==", - "vFox1d3llOeBeCUZGvTy0A==", - "r3lQAYOYhwlLnDWQIunKqg==", - "2os5s7j7Tl46ZmoZJH8FjA==", - "O5N2yd+QQggPBinQ+zIhtQ==", - "ZygAjaN62XhW5smlLkks+Q==", - "AgDJsaW0LkpGE65Kxk5+IA==", - "omAjyj1l6gyQAlBGfdxJTw==", - "fY9VATklOvceDfHZDDk57A==", - "StpQm/cQF8cT0LFzKUhC5w==", - "CYJB3qy5GalPLAv1KGFEZA==", - "coGEgMVs2b314qrXMjNumQ==", - "DQQB/l55iPN9XcySieNX3A==", - "6dshA8knH5qqD+KmR/kdSQ==", - "qyRmvxh8p4j4f+61c10ZFQ==", - "apWEPWUvMC24Y+2vTSLXoA==", - "RzX2OfSFEd//LhZwRwzBVw==", - "NdULoUDGhIolzw1PyYKV0A==", - "5w/c9WkI/FA+4lOtdPxoww==", - "bV9r7j2kNJpDCEM5E2339Q==", - "vbyiKeDCQ4q9dDRI1Q0Ong==", - "9xIgKpZGqq0/OU6wM5ZSHw==", - "RYkDwwng6eeffPHxt8iD9A==", - "w5N/aHbtOIKzcvG3GlMjGA==", - "3P2aJxV8Trll2GH9ptElYA==", - "yteeQr3ub2lDXgLziZV+DQ==", - "yqtj8GfLaUHYv/BsdjxIVw==", - "NyF+4VRog7etp90B9FuEjA==", - "uwA6N5LptSXqIBkTO0Jd7Q==", - "6lVSzYUQ/r0ep4W2eCzFpg==", - "1d7RPHdZ9qzAbG3Vi9BdFA==", - "7br49X11xc2GxQLSpZWjKQ==", - "peMW+rpwmXrSwplVuB/gTA==", - "RqYpA5AY7mKPaSxoQfI1CA==", - "dqVw2q2nhCvTcW82MT7z0g==", - "5S5/asYfWjOwnzYpbK6JDw==", - "NvkR0inSzAdetpI4SOXGhw==", - "tIqwBotg052wGBL65DZ+yA==", - "S4RvORcJ3m6WhnAgV4YfYA==", - "UAqf4owQ+EmrE45hBcUMEw==", - "4aPU6053cfMLHgLwAZJRNg==", - "3Y6/HqS1trYc9Dh778sefg==", - "ck86G8HsbXflyrK7MBntLg==", - "GLmWLXURlUOJ+PMjpWEXVA==", - "jNJQ6otieHBYIXA9LjXprg==", - "AsAHrIkMgc3RRWnklY9lJw==", - "FCLQocqxxhJeleARZ6kSPg==", - "3Leu2Sc+YOntJFlrvhaXeg==", - "hSkY45CeB6Ilvh0Io4W6cg==", - "DwrNdmU5VFFf3TwCCcptPA==", - "u2WQlcMxOACy6VbJXK4FwA==", - "E9IlDyULLdeaVUzN6eky8g==", - "EXveRXjzsjh8zbbQY2pM9g==", - "5VO1inwXMvLDBQSOahT6rg==", - "HaHTsLzx7V3G1SFknXpGxA==", - "MMaegl2Md9s/wOx5o9564w==", - "mpWNaUH9kn4WY26DWNAh3Q==", - "w3G+qXXqqKi8F5s+qvkBUg==", - "wM8tnXO4PDlLVHspZFcjYw==", - "LFcpCtnSnsCPD2gT/RA+Zg==", - "bhVbgJ4Do4v56D9mBuR/EA==", - "yU3N0HMSP5etuHPNrVkZtg==", - "FzqIpOcTsckSNHExrl+9jg==", - "BYz52gYI/Z6AbYbjWefcEA==", - "h3vYYI9yhpSZV2MQMJtwFQ==", - "adJAjAFyR2ne1puEgRiH+g==", - "eDcyiPaB954q5cPXcuxAQw==", - "40gCrW4YWi+2lkqMSPKBPg==", - "ulLuTZqhEDkX0EJ3xwRP9A==", - "y4iBxAMn/KzMmaWShdYiIw==", - "ilBBNK/IV69xKTShvI94fQ==", - "0HN6MIGtkdzNPsrGs611xA==", - "twPn6wTGqI0aR//0wP3xtA==", - "3UNJ37f+gnNyYk9yLFeoYA==", - "4SdHWowXgCpCDL28jEFpAw==", - "Mr5mCtC53+wwmwujOU/fWw==", - "81pAhreEPxcKse+++h1qBg==", - "KmcGEE0pacQ/HDUgjlt7Pg==", - "Gt4/MMrLBErhbFjGbiNqQQ==", - "lf1fwA0YoWUZaEybE+LyMQ==", - "RIVYGO2smx9rmRoDVYMPXw==", - "rJ9qVn8/2nOxexWzqIHlcQ==", - "lfOLLyZNbsWQgHRhicr4ag==", - "wgH1GlUxWi6/yLLFzE76uQ==", - "Qg1ubGl+orphvT990e5ZPA==", - "Z5B+uOmPZbpbFWHpI9WhPw==", - "snGTzo540cCqgBjxrfNpKw==", - "ZqkmoGB0p5uT5J6XBGh7Tw==", - "uPi8TsGY3vQsMVo/nsbgVQ==", - "Y5XR8Igvau/h+c1pRgKayg==", - "ZmVpw1TUVuT13Zw/MNI5hQ==", - "60suecbWRfexSh7C67RENA==", - "kZ/mZZg9YSDmk2rCGChYAg==", - "OpL+vHwPasW30s2E1TYgpA==", - "ZVnErH1Si4u51QoT0OT7pA==", - "3pi3aNVq1QNJmu1j0iyL0g==", - "tb5+2dmYALJibez1W4zXgA==", - "jOPdd330tB6+7C29a9wn0Q==", - "5oD/aGqoakxaezq43x0Tvw==", - "HdB7Se47cWjPgpJN0pZuiA==", - "6WhHPWlqEUqXC52rHGRHjA==", - "WLwpjgr9KzevuogoHZaVUw==", - "E8yMPK7W0SIGTK6gIqhxiQ==", - "1/Hxu8M9N/oNwk8bCj4FNQ==", - "Uo1ebgsOxc3eDRds1ah3ag==", - "5pqqzC/YmRIMA9tMFPi7rg==", - "ri4AOITPdB1YHyXV+5S51g==", - "HfvsiCQN/3mT0FabCU5ygQ==", - "UQTQk5rrs6lEb1a+nkLwfg==", - "VH70dN82yPCRctmAHMfCig==", - "yD3Dd4ToRrl53k/2NSCJiw==", - "fO0+6TsjL+45p9mSsMRiIg==", - "fM5uYpkvJFArnYiQ3MrQnA==", - "V+QzdKh5gxTPp2yPC9ZNEg==", - "XHHEg/8KZioW/4/wgSEkbQ==", - "2abfl3N46tznOpr+94VONQ==", - "gxwbqZDHLbQVqXjaq42BCg==", - "WnHK5ZQDR6Da5cGODXeo0A==", - "SChDh/Np1HyTPWfICfE1uA==", - "yhexr/OFKfZl0o3lS70e4w==", - "N65PqIWiQeS082D6qpfrAg==", - "RM5CpIiB94Sqxi462G7caA==", - "CBAGa5l95f3hVzNi6MPWeQ==", - "OHJBT2SEv5b5NxBpiAf7oQ==", - "p48i7AfSSAyTdJSyHvOONw==", - "/SP6pOdYFzcAl2OL05z4uQ==", - "N8dXCawxSBX40fgRRSDqlQ==", - "bMWFvjM8eVezU1ZXKmdgqw==", - "Um1ftRBycvb+363a90Osog==", - "QAz7FA+jpz9GgLvwdoNTEQ==", - "qO4HlyHMK5ygX+6HbwQe8w==", - "UgvtdE2eBZBUCAJG/6c0og==", - "q5g3c8tnQTW2EjNfb2sukw==", - "gsC/mWD8KFblxB0JxNuqJw==", - "SVFbcjXbV7HRg+7jUrzpwg==", - "bz294kSG4egZnH2dJ8HwEg==", - "ybpTgPr3SjJ12Rj5lC/IMA==", - "yDrAd1ot38soBk7zKdnT8A==", - "BB/R8oQOcoE4j63Hrh8ifg==", - "GNrMvNXQkW7PydlyJa+f1w==", - "w0PKdssv+Zc5J/BbphoxpA==", - "D5ibbo8UJMfFZ48RffuhgQ==", - "MdvhC1cuXqni/0mtQlSOCw==", - "wQKL8Ga6JQkpZ7yymDkC3w==", - "o1uhaQg5/zfne84BFAINUQ==", - "Ft2wXUokFdUf6d2Y/lwriw==", - "sLJrshdEANp0qk2xOUtTnQ==", - "jx7rpxbm1NaUMcE2ktg5sA==", - "ZQ0ZnTsZKWxbRj7Tilh24Q==", - "KhrIIHfqXl9zGE9aGrkRVg==", - "jS0JuioLGAVaHdo/96JFoQ==", - "tr+U/vt+MIGXPRQYYWJfRg==", - "TXab/hqNGWaSK+fXAoB2bg==", - "0K4NBxqEa3RYpnrkrD/XjQ==", - "3oMTbWf7Bv83KRlfjNWQZA==", - "yLAhLNezvqVHmN1SfMRrPw==", - "ZYW30FfgwHmW6nAbUGmwzA==", - "CZNoTy26VUQirvYxSPc/5A==", - "CF1sAlhjDQY/KWOBnSSveA==", - "+CLf5witKkuOvPCulTlkqw==", - "1m1yD4L9A7Q1Ot+wCsrxJQ==", - "2E41e0MgM3WhFx2oasIQeA==", - "mDXHuOmI4ayjy2kLSHku1Q==", - "sCLMrLjEUQ6P1L8tz90Kxg==", - "zDUZCzQesFjO1JI3PwDjfg==", - "x/BIDm6TKMhqu/gtb3kGyw==", - "DEaZD/8aWV6+zkiLSVN/gA==", - "7dz+W494zwU5sg63v5flCg==", - "Y5iDQySR2c3MK7RPMCgSrw==", - "GglPoW5fvr4JSM3Zv99oiA==", - "myzvc+2MfxGD9uuvZYdnqQ==", - "V9G1we3DOIQGKXjjPqIppQ==", - "gYvdNJCDDQmNhtJ6NKSuTA==", - "rXtGpN17Onx8LnccJnXwJQ==", - "/a+bLXOq02sa/s8h7PhUTg==", - "htNVAogFakQkTX6GHoCVXg==", - "eshD40tvOA6bXb0Fs/cH3A==", - "K1CGbMfhlhIuS0YHLG30PQ==", - "aOeJZUIZM9YWjIEokFPnzQ==", - "r0hAwlS0mPZVfCSB+2G6uQ==", - "0q+erphtrB+6HBnnYg7O6w==", - "bkRdUHAksJZGzE1gugizYQ==", - "J8v2f6hWFu8oLuwhOeoQjA==", - "qkvEep4vvXhc2ZJ6R449Mg==", - "6HGeEPyTAu9oiKhNVLjQnA==", - "JoATsk/aJH0UcDchFMksWA==", - "QozQL0DTtr+PXNKifv6l6g==", - "HiAgt86AyznvbI2pnLalVQ==", - "lY+tivtsfvU0LJzBQ6itYQ==", - "EfXDc6h69aBPE6qsB+6+Ig==", - "gnAIpoCyl3mQytLFgBEgGA==", - "p2JPOX8yDQ0agG+tUyyT/g==", - "zeELfk015D5krExLKRUYtg==", - "wDiGoFEfIVEDyyc4VpwhWQ==", - "7Ephy+mklG2Y3MFdqmXqlA==", - "8ZFPMJJYVJHsfRpU4DigSg==", - "ocRh5LR1ZIN9Johnht8fhQ==", - "l5f3I6osM9oxLRAwnUnc5A==", - "yxCyBXqGWA735JEyljDP7Q==", - "qE/h/Z+6buZWf+cmPdhxog==", - "HCu4ZMrcLMZbPXbTlWuvvQ==", - "TDrq23VUdzEU/8L5i8jRJQ==", - "L+N/6geuokiLPPSDXM9Qkg==", - "v6jZicMNM3ysm3U5xu0HoQ==", - "b85nxzs8xiHxaqezuDVWvg==", - "ca+kx+kf7JuZ3pfYKDwFlg==", - "KlY5TGg0pR/57TVX+ik1KQ==", - "3jmCreW5ytSuGfmeLv7NfQ==", - "ucLMWnNDSqE4NOCGWvcGWw==", - "NSrzwNlB0bde3ph8k6ZQcQ==", - "nL4iEd3b5v4Y9fHWDs+Lrw==", - "W2x0SBzSIsTRgyWUCOZ/lg==", - "ifZM0gBm9g9L09YlL+vXBg==", - "4WcFEswYU/HHQPw77DYnyA==", - "TLJbasOoVO435E5NE5JDcA==", - "WyCFB4+6lVtlzu3ExHAGbQ==", - "BW0A06zoQw7S+YMGaegT7g==", - "qP1cCE4zsKGTPhjbcpczMw==", - "UVEZPoH9cysC+17MKHFraw==", - "eQ45Mvf5in9xKrP6/qjYbg==", - "fOARCnIg/foF/6tm7m9+3w==", - "lK2xe+OuPutp4os0ZAZx5w==", - "Tug3eh+28ttyf+U7jfpg5w==", - "ENFfP93LA257G6pXQkmIdg==", - "FuWspiqu5g8Eeli5Az+BkA==", - "kIGxCUxSlNgsKZ45Al1lWw==", - "RzeH+G3gvuK1z+nJGYqARQ==", - "0ofMbUCA3/v5L8lHnX4S5w==", - "VI8pgqBZeGWNaxkuqQVe7g==", - "x6lNRGgJcRxgKTlzhc1WPg==", - "La0gzdbDyXUq6YAXeKPuJA==", - "dAq8/1JSQf1f4QPLUitp0g==", - "WN7lFJfw4lSnTCcbmt5nsg==", - "2aDK0tGNgMLyxT+BQPDE8Q==", - "9W57pTzc572EvSURqwrRhw==", - "37Nkh06O979nt7xzspOFyQ==", - "4TQkMnRsXBobbtnBmfPKnA==", - "f/BjtP5fmFw2dRHgocbFlg==", - "9vEgJVJLEfed6wJ7hBUGgQ==", - "HRWYX2XOdsOqYzCcqkwIyw==", - "StDtLMlCI75g4XC59mESEQ==", - "99+SBN45LwKCPfrjUKRPmw==", - "HbT6W1Ssd3W7ApKzrmsbcg==", - "l8/KMItWaW3n4g1Yot/rcQ==", - "s7iW1M6gkAMp+D/3jHY58w==", - "GWwJ32SZqD5wldrXUdNTLA==", - "YhLEPsi/TNyeUJw69SPYzQ==", - "g0aTR8aJ0uVy3YvGYu5xrw==", - "m6get5wjq5j1i5abnpXuZQ==", - "ymtA8EMPMgmMcimWZZ0A1Q==", - "HEcOaEd9zCoOVbEmroSvJg==", - "F8l+Qd9TZgzV+r8G584lKA==", - "3yDD+xT8iRfUVdxcc7RxKw==", - "1eRUCdIJe3YGD5jOMbkkOg==", - "DO1/jfP/xBI9N0RJNqB2Rw==", - "SiSlasZ+6U2IZYogqr2UPg==", - "tBQDfy48FnIOZI04rxfdcA==", - "HEghmKg3GN60K7otpeNhaA==", - "mTLBkP+yGHsdk5g7zLjVUw==", - "RgtwfY5pTolKrUGT+6Pp6g==", - "EyIsYQxgFa4huyo/Lomv7g==", - "HwLSUie8bzH+pOJT3XQFyg==", - "7Tauesu7bgs5lJmQROVFiQ==", - "ojugpLIfzflgU2lonfdGxA==", - "ZqjnqxZE/BjOUY0CMdVl0g==", - "oQjugfjraFziga1BcwRLRA==", - "JXCYeWjFqcdSf6QwB54G+A==", - "TeBGJCqSqbzvljIh9viAqA==", - "1Gpj4TPXhdPEI4zfQFsOCg==", - "asouSfUjJa8yfMG7BBe+fA==", - "ccy3Ke2k4+evIw0agHlh3w==", - "CzSumIcYrZlxOUwUnLR2Zw==", - "9QFYrCXsGsInUb4SClS3cQ==", - "3RTtSaMp1TZegJo5gFtwwA==", - "aTWiWjyeSDVY/q8y9xc2zg==", - "UK+R+hAoVeZ4xvsoZjdWpw==", - "rHagXw+CkF3uEWPWDKXvog==", - "MfkyURTBfkNZwB+wZKjP4g==", - "Qf7JFJJuuacSzl6djUT2EQ==", - "K1RL+tLjICBvMupe7QppIQ==", - "R2OOV18CV/YpWL1xzr/VQg==", - "o+areESiXgSO0Lby56cBeg==", - "VPqyIomYm7HbK5biVDvlpw==", - "pw1jplCdTC+b0ThX0FXOjw==", - "gTnsH3IzALFscTZ1JkA9pw==", - "JYJvOZ4CHktLrYJyAbdOnA==", - "P8lUiLFoL100c9YSQWYqDA==", - "LATQEY7f47i77M6p11wjWA==", - "U9kE50Wq5/EHO03c5hE4Ug==", - "pFKzcRHSUBqSMtkEJvrR1Q==", - "vHVXsAMQqc0qp7HA5Q+YkA==", - "3XyoREdvhmSbyvAbgw2y/A==", - "qOEIUWtGm5vx/+fg4tuazg==", - "a6IszND1m+6w+W+CvseC7g==", - "KuNY8qAJBce+yUIluW8AYw==", - "5Wcq+6hgnWsQZ/bojERpUw==", - "l2ZB9TvT68rn8AAN4MdxWw==", - "h5HsEsObPuPFqREfynVblw==", - "fvm0IQfnbfZFETg9v3z/Fg==", - "QV0OG5bpjrjku4AzDvp9yw==", - "nMuMtK/Zkb3Xr34oFuX/Lg==", - "jMZKSMP2THqwpWqJNJRWdw==", - "fX4G68hFL7DmEmjbWlCBJQ==", - "ZlBNHAiYsfaEEiPQ1z+rCA==", - "ckugAisBNX18eQz+EnEjjw==", - "Dt6hvhPJu94CJpiyJ5uUkg==", - "eYE9No9sN5kUZ5ePEyS3+Q==", - "Tp52d1NndiC9w3crFqFm9g==", - "MBjMU/17AXBK0tqyARZP5w==", - "1EI9aa955ejNo1dJepcZJw==", - "FqWLkhWl0iiD/u2cp+XK9A==", - "j8nMH8mK/0Aae7ZkqyPgdg==", - "ZtmnX24AwYAXHb2ZDC6MeQ==", - "who8uUamlHWHXnBf7dwy4A==", - "CmkmWcMK4eqPBcRbdnQvhw==", - "61V74uIjaSfZM8au1dxr1A==", - "778O1hdVKHLG2q9dycUS0Q==", - "IdadoCPmSgHDHzn1zyf8Jw==", - "Z2rwGmVEMCY6nCfHO3qOzw==", - "Q3TpCE+wnmH/1h/EPWsBtQ==", - "HnVfyqgJ+1xSsN4deTXcIA==", - "XgPHx2+ULpm14IOZU2lrDg==", - "IbN736G1Px5bsYqE5gW1JQ==", - "nY/H7vThZ+dDxoPRyql+Cg==", - "wlWxtQDJ+siGhN2fJn3qtw==", - "MrbEUlTagbesBNg0OemHpw==", - "LJtRcR70ug6UHiuqbT6NGw==", - "hSNZWNKUtDtMo6otkXA/DA==", - "LawT9ZygiVtBk0XJ+KkQgQ==", - "DLzHkTjjuH6LpWHo2ITD0Q==", - "i8XXN7jcrmhnrOVDV8a2Hw==", - "ogcuGHUZJkmv+vCz567a2g==", - "rUp5Mfc57+A8Q29SPcvH/Q==", - "6706ncrH1OANFnaK6DUMqQ==", - "gK7dhke5ChQzlYc/bcIkcg==", - "t3Txxjq43e/CtQmfQTKwWg==", - "6ZMs9vCzK9lsbS6eyzZlIA==", - "uTHBqApdKOAgdwX3cjrCYQ==", - "zirOtGUXeRL22ezfotZfQg==", - "iK0dWKHjVVexuXvMWJV9pg==", - "uzEgwx1iAXAvWPKSVwYSeQ==", - "FHvI0IVNvih8tC7JgzvCOw==", - "jjNMPXbmpFNsCpWY0cv3eg==", - "/cJ0Nn5YbXeUpOHMfWXNHQ==", - "WkSJpxBa45XJRWWZFee7hw==", - "edlXkskLx287vOBZ9+gVYg==", - "+Pl0bSMBAdXpRIA+zE02JA==", - "3xw8+0/WU51Yz4TWIMK8mw==", - "GdTanUprpE3X/YjJDPpkhQ==", - "qnsBdl050y9cUaWxbCczRw==", - "pnJnBzAJlO4j3IRqcfmhkQ==", - "USq1iF90eUv41QBebs3bhw==", - "QH3lAwOYBAJ0Fd5pULAZqw==", - "gvvyX5ATi4q9NhnwxRxC8w==", - "7xDIG/80SnhgxAYPL9YJtg==", - "WVhfn2yJZ43qCTu0TVWJwA==", - "twjiDKJM7528oIu/el4Zbg==", - "6sBemZt4qY/TBwqk3YcLOQ==", - "m3XYojKO+I6PXlVRUQBC3w==", - "gUNP5w7ANJm257qjFxSJrA==", - "mMLhjdWNnZ8zts9q+a2v3g==", - "kjWYVC7Eok2w2YT4rrI+IA==", - "ZzT5b0dYQXkQHTXySpWEaA==", - "YzTV0esAxBFVls3e0qRsnA==", - "9xmtuClkFlpz/X5E9JBWBA==", - "nhAnHuCGXcYlqzOxrrEe1g==", - "cbBXgB1WQ/i8Xul0bYY2fg==", - "AkAes5oErTaJiGD2I4A1Pw==", - "Wx9jh/teM0LJHrvTScssyQ==", - "fU5ZZ1bIVsV+eXxOpGWo/Q==", - "k8eZxqwxiN/ievXdLSEL/w==", - "E2LR1aZ3DcdCBuVT7BhReA==", - "1eCHcz4swFH+uRhiilOinQ==", - "JipruVZx4ban3Zo5nNM37g==", - "IPLD9nT5EEYG9ioaSIYuuA==", - "pHozgRyMiEmyzThtJnY4MQ==", - "p0eNK7zJd7D/HEGaVOrtrQ==", - "dGjcKAOGBd4gIjJq7fL+qQ==", - "uMq8cDVWFD+tpn8aeP8Pqg==", - "gC7gUwGumN7GNlWwfIOjJQ==", - "It+K/RCYMOfNrDZxo7lbcA==", - "4CfEP8TeMKX33ktwgifGgA==", - "nxDGRpePV3H4NChn4eLwag==", - "300hoYyMR/mk1mfWJxS8/w==", - "DmxgZsQg+Qy1GP0fPkW3VA==", - "1vqRt79ukuvdJNyIlIag8Q==", - "RWI0HfpP7643OSEZR8kxzw==", - "zZtYkKU50PPEj6qSbO5/Sw==", - "UNRlg6+CYVOt68NwgufGNA==", - "kkbX+a00dfiTgbMI+aJpMg==", - "VIC7inSiqzM6v9VqtXDyCw==", - "l+x2QhxG8wb5AQbcRxXlmA==", - "GUiinC3vgBjbQC2ybMrMNQ==", - "6uMF5i0b/xsk55DlPumT7A==", - "aK9nybtiIBUvxgs1iQFgsw==", - "BLbTFLSb4mkxMaq4/B2khg==", - "mTAqtg6oi0iytHQCaSVUsA==", - "eBapvE+hdyFTsZ0y5yrahg==", - "lHN2dn2cUKJ8ocVL3vEhUQ==", - "Mj87ajJ/yR41XwAbFzJbcA==", - "FA+nK6mpFWdD0kLFcEdhxA==", - "FrTgaF5YZCNkyfR1kVzTLQ==", - "5eHStFN7wEmIE+uuRwIlPQ==", - "AyWlT+EGzIXc395zTlEU5Q==", - "I+wVQA+jpPTJ6xEsAlYucg==", - "Y1flEyZZAYxauMo4cmtJ1w==", - "1AeReq55UQotRQVKJ66pmg==", - "xzGzN5Hhbh0m/KezjNvXbQ==", - "meHzY9dIF7llDpFQo1gyMg==", - "RnOXOygwJFqrD+DlM3R5Ew==", - "JKg64m6mU7C/CkTwVn4ASg==", - "gGLz3Ss+amU7y6JF09jq7A==", - "Pu9pEf+Tek3J+3jmQNqrKw==", - "EATnlYm0p3h04cLAL95JgA==", - "o64LDtKq/Fulf1PkVfFcyg==", - "hUWqqG1QwYgGC5uXJpCvJw==", - "RfSwpO/ywQx4lfgeYlBr2w==", - "VaJc9vtYlqJbRPGb5Tf0ow==", - "9JKIJrlQjhNSC46H3Cstcw==", - "6Z9myGCF5ylWljgIYAmhqw==", - "9bAWYElyRN1oJ6eJwPtCtQ==", - "ohK6EftXOqBzIMI+5XnESw==", - "AVjwqrTBQH1VREuBlOyUOg==", - "G2UponGde3/Z+9b2m9abpQ==", - "DoiItHSms0B9gYmunVbRkQ==", - "vUC0HlTTHj6qNHwfviDtAw==", - "hq35Fjgvrcx6I9e6egWS4w==", - "sw+bmpzqsM4gEQtnqocQLQ==", - "ApiuEPWr8UjuRyJjsYZQBw==", - "VXu4ARjq7DS2IR/gT24Pfw==", - "3TbRZtFtsh9ez8hqZuTDeA==", - "CazLJMJjQMeHhYLwXW7YNg==", - "ROSt+NlEoiPFtpRqKtDUrQ==", - "IUwVHH6+8/0c+nOrjclOWA==", - "lkzFdvtBx5bV6xZO0cxK7g==", - "4ekt4m38G9m599xJCmhlug==", - "fzkmVWKhJsxyCwiqB/ULnQ==", - "LZAKplVoNjeQgfaHqkyEJA==", - "91vfsZ7Lx9x5gqWTOdM4sg==", - "MVoxyIA+emaulH8Oks8Weg==", - "oGH7SMLI2/qjd9Vnhi3s0A==", - "vmqfGJE6r4yDahtU/HLrxw==", - "Y5KKN7t/v9JSxG/m1GMPSA==", - "gXlb7bbRqHXusTE5deolGA==", - "/2c4oNniwhL3z5IOngfggg==", - "HgIFX42oUdRPu7sKAXhNWg==", - "A3dX2ShyL9+WOi6MNJBoYQ==", - "hN9bmMHfmnVBVr+7Ibd2Ng==", - "DB706G73NpBSRS8TKQOVZw==", - "JSyq2MIuObPnEgEUDyALjQ==", - "kSUectNPXpXNg+tIveTFRw==", - "XVVy3e6dTnO3HpgD6BtwQw==", - "td7nDgTDmKPSODRusMcupw==", - "Lt/pVD4TFRoiikmgAxEWEw==", - "mmRob7iyTkTLDu8ObmTPow==", - "Fd0c8f2eykUp9GYhqOcKoA==", - "18RKixTv12q3xoBLz6eKiA==", - "RClzwwKh51rbB4ekl99EZA==", - "oONlXCW4aAqGczQ/bUllBw==", - "foPAmiABJ3IXBoed2EgQXA==", - "wEJDulZafLuXCvcqBYioFQ==", - "K1RgR6HR5uDEQgZ32TAFgA==", - "SEIZhyguLoyH7So0p1KY0A==", - "ggIfX1J4dX3xQoHnHUI7VA==", - "HBRzLacCVYfwUVGzrefZYg==", - "aWZRql2IUPVe9hS3dxgVfQ==", - "Err1mbWJud80JNsDEmXcYg==", - "Z2MkqmpQXdlctCTCUDPyzw==", - "JnE6BK0vpWIhNkaeaYNUzw==", - "5dUry23poD+0wxZ3hH6WmA==", - "DwP0MQf71VsqvAbAMtC3QQ==", - "kHcBZXoxnFJ+GMwBZ/xhfQ==", - "SUAwMWLMml8uGqagz5oqhQ==", - "79uTykH43voFC3XhHHUzKg==", - "P5fucOJhtcRIoElFJS4ffg==", - "s8NpalwgPdHPla7Zi9FJ3w==", - "8cXqZub6rjgJXmh1CYJBOg==", - "tY916jrSySzrL+YTcVmYKQ==", - "DRiFNojs7wM8sfkWcmLnhQ==", - "wqUJ1Gq1Yz2cXFkbcCmzHQ==", - "0u+0WHr7WI6IlVBBgiRi6w==", - "GCYI9Dn1h3gOuueKc7pdKA==", - "nVDxVhaa2o38gd1XJgE3aw==", - "5I/heFSQG/UpWGx0uhAqGQ==", - "1PvTn90xwZJPoVfyT5/uIQ==", - "jHOoSl3ldFYr9YErEBnD3w==", - "swJhrPwllq5JORWiP5EkDA==", - "tj2rWvF2Fl+XIccctj8Mhw==", - "QvYZxsLdu+3nV/WhY1DsYg==", - "fKalNdhsyxTt1w08bv9fJA==", - "CHLHizLruvCrVi9chj9sXA==", - "sa2DECaqYH1z1/AFhpHi+g==", - "LbPp1oL0t3K2BAlIN+l8DA==", - "5SbwLDNT6sBOy6nONtUcTg==", - "AfVPdxD3FyfwwNrQnVNQ7A==", - "jt9Ocr9D8EwGRgrXVz//aQ==", - "KkwQL0DeUM3nPFfHb2ej+A==", - "WwraoO97OTalvavjUsqhxQ==", - "fAKFfwlCOyhtdBK6yNnsNg==", - "EqMlrz1to7HG4GIFTPaehQ==", - "YmjZJyNfHN5FaTL/HAm8ww==", - "L2D7G0btrwxl9V4dP3XM5Q==", - "oUqO4HrBvkpSL781qAC9+w==", - "c6Yhwy/q3j7skXq52l36Ww==", - "FWphIPZMumqnXr1glnbK4w==", - "AcKwfS8FRVqb72uSkDNY/Q==", - "uSIiF1r9F18avZczmlEuMQ==", - "XrFDomoH2qFjQ2jJ2yp9lA==", - "N2X7KWekNN+fMmwyXgKD5w==", - "IdmcpJXyVDajzeiGZixhSA==", - "Wf2olJCYZRGTTZxZoBePuQ==", - "oVlG+0rjrg2tdFImxIeVBA==", - "7w4PDRJxptG8HMe/ijL6cQ==", - "rueNryrchijjmWaA3kljYg==", - "ZybIEGf1Rn/26vlHmuMxhw==", - "yYVW07lOZHdgtX42xJONIA==", - "4ifNsmjYf1iOn2YpMfzihg==", - "KTjwL+qswa+Bid8xLdjMTg==", - "THfzE2G2NVKKfO+A2TjeFw==", - "QoqHzpHDHTwQD5UF30NruQ==", - "dTMoNd6DDr1Tu8tuZWLudw==", - "wOc4TbwQGUwOC1B3BEZ4OQ==", - "gfhkPuMvjoC3CGcnOvki3Q==", - "vljJciS+uuIvL7XXm5688g==", - "EGLOaMe6Nvzs/cmb7pNpbg==", - "oLWWIn/2AbKRHnddr2og9g==", - "7l0RMKbONGS/goW/M+gnMQ==", - "eFkXKRd2dwu/KWI5ZFpEzw==", - "jWsC7kdp2YmIZpfXGUimiA==", - "Jcxjli2tcIAjCe+5LyvqdQ==", - "MUkRa/PjeWMhbCTq43g6Aw==", - "g2nh2xENCFOpHZfdEXnoQA==", - "x6M66krXSi0EhppwmDmsxA==", - "26Wmdp6SkKN74W0/XPcnmA==", - "ycjv4XkS5O7zcF3sqq9MwQ==", - "gfnbviaVhKvv1UvlRGznww==", - "aIPde9CtyZrhbHLK740bfw==", - "0p8YbEMxeb73HbAfvPLQRw==", - "Is3uxoSNqoIo5I15z6Z2UQ==", - "NZtcY8fIpSKPso/KA6ZfzA==", - "iQ304I1hmLZktA1d1cuOJA==", - "0QB0OUW5x2JLHfrtmpZQ+w==", - "kgyUtd8MFe0tuuxDEUZA9w==", - "AcbG0e6xN8pZfYAv7QJe1Q==", - "bb/U8UynPHwczew/hxLQxw==", - "NuBYjwlxadAH+vLWYRZ3bg==", - "Ao1Zc0h5AdSHtYt1caWZnQ==", - "FL/j3GJBuXdAo54JYiWklQ==", - "E2v8Kk60qVpQ232YzjS2ow==", - "zVupSPz7cD0v/mD/eUIIjg==", - "sEeblUmISi1HK4omrWuPTA==", - "xQpYjaAmrQudWgsdu24J0A==", - "vCekQ2nOQKiN/q8Be/qwZg==", - "8g08gjG/QtvAYer32xgNAg==", - "miiOqnhtef1ODjFzMHnxjA==", - "sXlFMSTBFnq0STHj6cS/8w==", - "+SclwwY8R2RPrnX54Z+A6w==", - "g8TcogVxHpw7uhgNFt5VCQ==", - "9viAzLFGYYudBYFu7kFamg==", - "BAJ+/jbk2HyobezZyB9LiQ==", - "/DJgKE9ouibewuZ2QEnk6w==", - "fxg/vQq9WPpmQsqQ4RFYaA==", - "lM/EhwTsbivA7MDecaVTPw==", - "pVgjGg4TeTNhKimyOu3AAw==", - "gYnznEt9r97haD/j2Cko7g==", - "/ngbFuKIAVpdSwsA3VxvNw==", - "VCL3xfPVCL5RjihQM59fgg==", - "eDWsx4isnr2xPveBOGc7Hw==", - "FIOCTEbzb2+KMCnEdJ7jZw==", - "40HzgVKYnqIb6NJhpSIF0A==", - "ccK42Lm8Tsv73YMVZRwL6A==", - "MpAwWMt7bcs4eL7hCSLudQ==", - "zxsSqovedB3HT99jVblCnQ==", - "4erEA42TqGA9K4iFKkxMMA==", - "BaRwTrc5ulyKbW4+QqD0dw==", - "CT3ldhWpS1SEEmPtjejR/Q==", - "lkl6XkrTMUpXi46dPxTPxg==", - "3EhLkC9NqD3A6ApV6idmgg==", - "fsW2DaKYTCC7gswCT+ByQQ==", - "pW4gDKtVLj48gNz6V17QdA==", - "KjfL7YyVqmCJGBGDFdJ0gw==", - "bGGUhiG9SqJMHQWitXTcYQ==", - "8RtLlzkGEiisy1v9Xo0sbw==", - "R81DX/5a7DYKkS4CU+TL+w==", - "Tu6w6DtX2RJJ3Ym3o3QAWw==", - "nx/U4Tode5ILux4DSR+QMg==", - "mjQS8CpyGnsZIDOIEdYUxg==", - "wJpepvmtQQ3sz3tVFDnFqw==", - "a4rPqbDWiMivVzaRxvAj7g==", - "6o5g9JfKLKQ2vBPqKs6kjg==", - "UzPPFSXgeV7KW4CN5GIQXA==", - "NdVyHoTbBhX6Umz/9vbi0g==", - "Fzuq+Wg7clo6DTujNrxsSA==", - "XXFr0WUuGsH5nXPas7hR3Q==", - "JVSLiwurnCelNBiG2nflpQ==", - "NiawWuMBDo0Q3P2xK/vnLQ==", - "nNaGqigseHw30DaAhjBU3g==", - "+edqJYGvcy1AH2mEjJtSIg==", - "1WIi4I62GqkjDXOYqHWJfQ==", - "rwplpbNJz0ADUHTmzAj15Q==", - "iWNlSnwrtCmVF89B+DZqOQ==", - "tHDbi43e6k6uBgO0hA+Uiw==", - "fHNpW230mNib08aB7IM3XQ==", - "OChiB4BzcRE8Qxilu6TgJg==", - "d+ctfXU0j07rpRRzb5/HDA==", - "GDMqfhPQN0PxfJPnK1Bb9A==", - "bLd38ZNkVeuhf0joEAxnBQ==", - "nvUKoKfC6j8fz3gEDQrc/w==", - "fhcbn9xE/6zobqQ2niSBgA==", - "HGxe+5/kkh6R9GXzEOOFHA==", - "mPwCyD0yrIDonVi+fhXyEQ==", - "5PfGtbH9fmVuNnq83xIIgQ==", - "XePy/hhnQwHXFeXUQQ55Vg==", - "yfAaL0MMtSXPQ37pBdmHxQ==", - "NiQ/m4DZXUbpca9aZdzWAw==", - "uT6WRh5UpVdeABssoP2VTg==", - "oxoZP897lgMg/KLcZAtkAg==", - "oKt57TPe4PogmsGssc3Cbg==", - "RxmdoO8ak8y/HzMSIm+yBQ==", - "6leyDVmC5jglAa98NQ3+Hg==", - "+QosBAnSM2h4lsKuBlqEZw==", - "hy303iin+Wm7JA6MeelwiQ==", - "m9iuy4UtsjmyPzy6FTTZvw==", - "f6Ye5F0Lkn34uLVDCzogFQ==", - "iGykaF+h4p46HhrWqL8Ffg==", - "LPYFDbTEp5nGtG6uO8epSw==", - "t2vWMIh2BvfDSQaz5T1TZw==", - "OONAvFS/kmH7+vPhAGTNSg==", - "g/z9yk94XaeBRFj4hqPzdw==", - "2wesXiib76wM9sqRZ7JYwQ==", - "n7h9v2N1gOcvMuBEf8uThw==", - "ITYL3tDwddEdWSD6J6ULaA==", - "inrUwXyKikpOW0y2Kl1wGw==", - "iwKBOGDTFzV4aXgDGfyUkw==", - "+fcjH2kZKNj8quOytUk4nQ==", - "Srl4HivgHMxMOUHyM3jvNw==", - "qngzBJbiTB4fivrdnE5gOg==", - "G0MlFNCbRjXk4ekcPO/chQ==", - "t+bYn9UqrzKiuxAYGF7RLA==", - "RVD3Ij6sRwwxTUDAxwELtA==", - "RNdyt6ZRGvwYG5Ws3QTuEA==", - "9DRHdyX8ECKHUoEsGuqR4Q==", - "oMJLQTH1wW7LvOV0KRx/dw==", - "bjLZ7ot/X/vWSVx4EYwMCg==", - "+p8pofUlwn8vV6Rp6+sz9g==", - "cchuqe+CWCJpoakjHLvUfA==", - "NvurnIHin4O+wNP7MnrZ1w==", - "RBMv0IxXEO3o7MnV47Bzow==", - "xTizUioizbMQxD0T6fy/EQ==", - "ZCdad3AwhVArttapWFwT/Q==", - "Hy1nqC40l5ItxumkIC2LAA==", - "W/5ThNLu43uT1O+fg0Fzwg==", - "b3BQG9/9qDNC/bNSTBY/sQ==", - "neQoa8pvETr07blVMN3pgA==", - "oR8rvIZoeoaZ/ufpo0htfQ==", - "zEzWZ6l7EKoVUxvk/l78Mw==", - "IHyIeMad23fSDisblwyfpA==", - "m6srF+pMehggHB1tdoxlPg==", - "kggaIvN2tlbZdZRI8S5Apw==", - "2RFaMPlSbVuoEqKXgkIa5A==", - "//eHwmDOQRSrv+k9C/k3ZQ==", - "X/Gha4Ajjm/GStp/tv+Jvw==", - "+H0Rglt/HnhZwdty2hsDHg==", - "a1aL8zQ+ie3YPogE3hyFFg==", - "HxEU37uBMeiR5y8q/pM42g==", - "68nqDtXOuxF7DSw6muEZvg==", - "s5+78jS4hQYrFtxqTW3g1Q==", - "drfODfDI6GyMW7hzkmzQvA==", - "pT1raq2fChffFSIBX3fRiA==", - "sfowXUMdN2mCoBVrUzulZg==", - "AV/YJfdoDUdRcrXVwinhQg==", - "3AKEYQqpkfW7CZMFQZoxOw==", - "PHwJ5ZAqqftZ4ypr8H1qiQ==", - "AoN/pnK4KEUaGw4V9SFjpg==", - "soBA65OmZdfBGJkBmY/4Iw==", - "mSstwJq7IkJ0JBJ5T8xDKg==", - "h13Xuonj+0dD1xH86IhSyQ==", - "HK9xG03FjgCy8vSR+hx8+Q==", - "oFanDWdePmmZN0xqwpUukA==", - "zCRZgVsHbQZcVMHd9pGD3A==", - "EvSB+rCggob2RBeXyDQRvQ==", - "tXuu7YpZOuMLTv87NjKerA==", - "DJ+a37tCaGF5OgUhG+T0NA==", - "KkXlgPJPen6HLxbNn5llBw==", - "2W6lz1Z7PhkvObEAg2XKJw==", - "n+xYzfKmMoB3lWkdZ+D3rg==", - "CPDs+We/1wvsGdaiqxzeCQ==", - "2Wvk/kouEEOY0evUkQLhOQ==", - "ezsm4aFd6+DO9FUxz0A8Pg==", - "9sYLg75/hudZaBA3FrzKHw==", - "Pp1ZMxJ8yajdbfKM4HAQxA==", - "xiyRfVG0EfBA+rCk+tgWRQ==", - "/IarsLzJB8bf0AupJJ+/Eg==", - "LJeLdqmriyAQp+QjZGFkdQ==", - "IhHyHbHGyQS+VawxteLP0w==", - "nGzPc0kI/EduVjiK7bzM6Q==", - "m06wctjNc3o7iyBHDMZs2w==", - "mSJF9dJnxZ15lTC6ilbJ2A==", - "xdmY+qyoxxuRZa9kuNpDEg==", - "oNOI17POQCAkDwj6lJsYOA==", - "p73gSu4d+4T/ZNNkIv9Nlw==", - "vOJ55zFdgPPauPyFYBf01w==", - "4A+RHIw+aDzw0rSRYfbc7g==", - "/gi3UZmunVOIXhZSktZ8zQ==", - "a6vem8n6WmRZAalDrHNP0g==", - "kGeXrHEN6o7h5qJYcThCPw==", - "wrewZ0hoHODf7qmoGcOd7g==", - "Z0sjccxzKylgEiPCFBqPSA==", - "LKyOFgUKKGUU/PxpFYMILw==", - "L2RofFWDO0fVgSz4D2mtdw==", - "KI7tQFYW38zYHOzkKp9/lQ==", - "ewe/P3pJLYu/kMb5tpvVog==", - "IADk81pIu8NIL/+9Fi94pA==", - "0L0FVcH5Dlj3oL8+e9Na7g==", - "tdiTXKrkqxstDasT0D5BPA==", - "R906Kxp2VFVR3VD+o6Vxcw==", - "wc+8ohFWgOF4VlSYiZIGwQ==", - "wJKFMqh6MGctWfasjHrPEg==", - "UHpge5Bldt9oPGo2oxnYvQ==", - "vX7RIhatQeXAMr1+OjzhZw==", - "s2AKVTwrY65/SWqQxDGJQg==", - "Q4bfQslDSqU64MOQbBQEUw==", - "mVT74Eht+gAowINoMKV7IQ==", - "EuGWtIbyKToOe6DN3NkVpQ==", - "ALlGgVDO8So71ccX0D6u2g==", - "Rww3qkF3kWSd+AaMT0kfdw==", - "hlvtFGW8r0PkbUAYXEM+Hw==", - "Oc3BqTF3ZBW3xE0QsnFn/A==", - "3j0kFUZ6g+yeeEljx+WXGg==", - "8BLkvEkfnOizJq0OTCYGzw==", - "Lqel4GdU0ZkfoJVXI5WC/Q==", - "rvE64KQGkVkbl07y7JwBqw==", - "HbXv8InyZqFT7i3VrllBgg==", - "zwQ/3MzTJ9rfBmrANIh14w==", - "gglLMohmJDPRGMY1XKndjQ==", - "lyfqic/AbEJbCiw+wA01FA==", - "XqUO7ULEYhDOuT/I2J8BOA==", - "wPhJcp7U7IVX83szbIOOxQ==", - "1gA65t5FiBTEgMELTQFUPQ==", - "ll2M0QQzBsj5OFi02fv3Yg==", - "wt+qDLU38kzNU75ZYi3Hbw==", - "a4EYNljinYTx9vb1VvUA6A==", - "T6LA+daQqRI38iDKZTdg1A==", - "gwyVIrTk5o0YMKQq4lpJ+Q==", - "bPRX2zl+K1S0iWAWUn1DZw==", - "KQw25X4LnQ9is+qdqfxo0w==", - "6tfM6dx3R5TiVKaqYQjnCg==", - "OlwHO6Sg2zIwsCOCRu0HiQ==", - "mr1qjhliRfl87wPOrJbFQg==", - "8c+lvG5sZNimvx9NKNH3ug==", - "5Nk2Z94DhlIdfG5HNgvBbQ==", - "F50iXjRo1aSTr37GQQXuJA==", - "tfgO55QqUyayjDfQh+Zo1Q==", - "h7Fc+eT/GuC8iWI+YTD0UQ==", - "3TjntNWtpG7VqBt3729L6Q==", - "+DWs0vvFGt6d3mzdcsdsyA==", - "VJt2kPVBLEBpGpgvuv1oUw==", - "XLq/nWX8lQqjxsK9jlCqUg==", - "9s3ar9q32Y5A3tla5GW/2Q==", - "51yLpfEdvqXmtB6+q27/AQ==", - "AiMtfedwGcddA+XYNc+21g==", - "p/48hurJ1kh2FFPpyChzJg==", - "CRiL6zpjfznhGXhCIbz8pQ==", - "/jDVt9dRIn+o4IQ1DPwbsg==", - "UNdKik7Vy23LjjPzEdzNsg==", - "Koiog/hpN7ew5kgJbty34A==", - "4itEKfbRCJvqlgKnyEdIOQ==", - "zi04Yc01ZheuFAQc59E45A==", - "etRjRvfL/IwceY/IJ1tgzQ==", - "3sNJJIx1NnjYcgJhjOLJOg==", - "4yVqq66iHYQjiTSxGgX2oA==", - "Q8RVI/kRbKuXa8HAQD7zUA==", - "OERGn45uzfDfglzFFn6JAg==", - "JGEy6VP3sz3LHiyT2UwNHQ==", - "1zDfWw5LdG20ClNP1HYxgw==", - "TGB+FIzzKnouLh5bAiVOQg==", - "n5GA+pA9mO/f4RN9NL9lNg==", - "bUxQBaqKyvlSHcuRL9whjg==", - "tOdlnsE3L3XCBDJRmb/OqA==", - "XdkxmYYooeDKzy7PXVigBQ==", - "PMvG4NqJP76kMRAup6TSZA==", - "qpFJZqzkklby+u1UT3c1iA==", - "fW3QZyq5UixIA1mP6eWgqQ==", - "9nMltdrrBmM5ESBY2FRjGA==", - "1Vtrv6QUAfiYQjlLTpNovg==", - "ur9JDCVNwzSH4q4ngDlHNQ==", - "4u3eyKc+y3uRnkASrgBVUw==", - "XddlSluOH6VkR7spFIFmdQ==", - "NOmu8oZc6CcKLu+Wfz2YOQ==", - "3Ejtsqw3Iep/UQd0tXnSlg==", - "y/e3HSdg7T19FanRpJ7+7Q==", - "YodhkayN5wsgPZEYN7/KNA==", - "pZfn6IiG+V28fN8E2hawDQ==", - "jGHMJqbj6X1NdTDyWmXYAQ==", - "olTSlmirL9MFhKORiOKYkQ==", - "CrJDgdfzOea2M2hVedTrIg==", - "fpXijBOM3Ai1RkmHven5Ww==", - "eLYKLr4labZeLiRrDJ9mnA==", - "9vmJUS7WIVOlhMqwipAknQ==", - "G7J/za99BFbAZH+Q+/B8WA==", - "Hb+pdSavvJ9lUXkSVZW8Og==", - "gTB2zM3RPm27mUQRXc/YRg==", - "e5KCqQ/1GAyVMRNgQpYf6g==", - "1ApqwW7pE+XUB2Cs2M6y7g==", - "/wiA2ltAuWyBhIvQAYBTQw==", - "HFCQEiZf7/SNc+oNSkkwlA==", - "JFi6N1PlrpKaYECOnI7GFg==", - "E4ojRDwGsIiyuxBuXHsKBA==", - "+25t/2lo0FUEtWYK8LdQZQ==", - "up2MVDi9ve+s83/nwNtZ7Q==", - "cXpfd6Io6Glj2/QzrDMCvA==", - "DCvI9byhw0wOFwF1uP6xIQ==", - "PibGJQNw7VHPTgqeCzGUGA==", - "0ZRGz+oj2infCAkuKKuHiQ==", - "2QS/6OBA1T01NlIbfkTYJg==", - "P14k+fyz0TG9yIPdojp52w==", - "g5EzTJ0KA4sO3+Opss3LMg==", - "R5oOM58zdbVxFSDQnNWqeA==", - "Vg2E5qEDfC+QxZTZDCu9yQ==", - "YPgMthbpcBN2CMkugV60hQ==", - "gZWTFt5CuLqMz6OhWL+hqQ==", - "YrEP9z2WPQ8l7TY1qWncDA==", - "7p4NpnoNSQR7ISg+w+4yFg==", - "9L6yLO93sRN70+3qq3ObfA==", - "QH36wzyIhh6I56Vnx79hRA==", - "9DtM1vls4rFTdrSnQ7uWXw==", - "ZlOAnCLV1PkR0kb3E+Nfuw==", - "9UhKmKtr4vMzXTEn74BEhg==", - "Ndx5LDiVyyTz/Fh3oBTgvA==", - "mXZ4JeBwT2WJQL4a/Tm4jQ==", - "N9nD7BGEM7LDwWIMDB+rEQ==", - "dmAfbd9F0OJHRAhNMEkRsA==", - "jV/D2B11NLXZRH77sG9lBw==", - "1C50kisi9nvyVJNfq2hOEQ==", - "NMbAjbnuK7EkVeY3CQI5VA==", - "J1nYqJ7tIQK1+a/3sMXI/Q==", - "m416yrrAlv+YPClGvGh+qQ==", - "rLZII1R6EGus+tYCiUtm6g==", - "xktOghh1S9nIX6fXWnT+Ug==", - "FcFcn4qmPse5mJCX5yNlsA==", - "xAAipGfHTGTjp9Qk1MR8RQ==", - "RQOlmzHwQKFpafKPJj0D8w==", - "WRjYdKdtnd1G9e/vFXCt0g==", - "z0BU//aSjYHAkGGk3ZSGNg==", - "M55eersiJuN9v61r8DoAjQ==", - "l2mAbuFF3QBIUILDODiUHQ==", - "IhpXs1TK7itQ3uTzZPRP5Q==", - "t2EkpUsLOEOsrnep0nZSmA==", - "lMaO8Yf+6YNowGyhDkPhQA==", - "UbSFw5jtyLk5MealqJw++A==", - "5u2PdDcIY3RQgtchSGDCGg==", - "MQYM3BT77i35LG9HcqxY2Q==", - "8AfCSZC0uasVON9Y/0P2Pw==", - "evaWFoxZNQcRszIRnxqB+A==", - "+8PiQt6O7pJI/nIvQpDaAg==", - "eRwaYiog2DdlGQyaltCMJg==", - "JyUJEnU6hJu8x2NCnGrYFw==", - "l0E0U/CJsyCVSTsXW4Fp+w==", - "XV13yK0QypJXmgI+dj4KYw==", - "jrRH0aTUYCOpPLZwzwPRfQ==", - "N3YDSkBUqSmrmNvZZx4a1Q==", - "0yJ7TQYzcp3DXVSvwavr+w==", - "rhgtLQh0F9bRA6IllM7AGw==", - "IWZnTJ3Hb9qw9HAK/M9gTw==", - "izeyFvXOumNgVyLrbKW45g==", - "xYD8jrCDmuQna+p1ebnKDQ==", - "SOdpdrk2ayeyv0xWdNuy9g==", - "HYylUirJRqLm+dkp39fSOQ==", - "q4z6A4l3nhX3smTmXr+Sig==", - "Zyo0fzewcqXiKe2mAwKx5g==", - "LMEtzh0+J27+4zORfcjITw==", - "LoUv/f2lcWpjftzpdivMww==", - "mXBfDUt/sBW5OUZs2sihvw==", - "PggVPQL5YKqSU/1asihcrg==", - "mI0eT4Rlr7QerMIngcu/ng==", - "NmQrsmb8PVP05qnSulPe5Q==", - "TcyyXrSsQsnz0gJ36w4Dxw==", - "y4mfEDerrhaqApDdhP5vjA==", - "ynaj4XjU27b7XbqPyxI8Ig==", - "Ua6aO6HwM+rY4sPR19CNFA==", - "3go7bJ9WqH/PPUTjNP3q/Q==", - "n1ixvP7SfwYT3L2iWpJg6A==", - "W8y32OLHihfeV0XFw7LmOg==", - "uzkNhmo2d08tv5AmnyqkoQ==", - "hJ8leLNuJ6DK5V8scnDaZQ==", - "KodYHHN62zESrXUye7M01g==", - "H+yPRiooEh5J7lAJB4RZ7Q==", - "dZg5w8rFETMp9SgW7m0gfg==", - "LsmsPokAwWNCuC74MaqFCQ==", - "1QGhj9NONF2rC44UdO+Izw==", - "uwGivY3/C9WK+dirRPJZ4A==", - "rXGWY/Gq+ZEsmvBHUfFMmQ==", - "j4FBMnNfdBwx0VsDeTvhFg==", - "81nkjWtpBhqhvOp6K8dcWg==", - "dCDaYYrgASXPMGFRV0RCGg==", - "Kj1QI+s9261S3lTtPKd9eg==", - "LblwOqNiciHmt2NXjd89tg==", - "46piyANQVvvLqcoMq5G8tQ==", - "XJihma9zSRrXLC+T+VcFDA==", - "K3NBEG8jJTJbSrYSOC3FKw==", - "cT3PwwS6ALZA/na9NjtdzA==", - "wJ4uCrl4DPg70ltw1dZO3w==", - "JATLdpQm//SQnkyCfI5x7Q==", - "X1PaCfEDScclLtOTiF5JUw==", - "444F9T6Y7J67Y9sULG81qg==", - "8JVHFRwAd/SCLU0CRJYofg==", - "aLh1XEUrfR9W82gzusKcOg==", - "U+bB5NjFIuQr/Y5UpXHwxA==", - "Egs14xVbRWjfBBX7X5Z60g==", - "KSorNz/PLR/YYkxaj1fuqw==", - "RDgGGxTtcPvRg/5KRRlz4w==", - "5T39s5CtSrK5awMPUcEWJg==", - "+PUVXkoTqHxJHO18z4KMfw==", - "Bvk8NX4l6WktLcRDRKsK/A==", - "kNGIV3+jQmJlZDTXy1pnyA==", - "E3jMjAgXwvwR8PA53g4+PQ==", - "MbI04HlTGCoc/6WDejwtaQ==", - "aEnHUfn7UE/Euh6jsMuZ7g==", - "z4Bft++f72QeDh4PWGr/sw==", - "1lCcQWGDePPYco4vYrA5vw==", - "iu5csar0IQQBOTgw5OvJwQ==", - "raKMXnnX6PFFsbloDqyVzQ==", - "uPnL9tboMZo0Kl2fe24CmA==", - "8OFxXwnPmrogpNoueZlC4Q==", - "V6CRKrKezPwsRdbm0DJ2Yg==", - "xmGgK3W5y+oCd0K2u8XjZQ==", - "Ry3zgZ6KHrpNyb7+Tt2Pkw==", - "IwLbkL33z+LdTjaFYh93kg==", - "caepyBOAFu0MxbcXrGf6TA==", - "iIWxFdolLcnXqIjPMg+5kQ==", - "P430CeF2MDkuq11YdjvV8A==", - "yCu+DVU/ceMTOZ5h/7wQTg==", - "4mQVNv7FHj+/O6XFqWFt/Q==", - "OEJ40VmMDYzc2ESEMontRA==", - "D66Suu3tWBD+eurBpPXfjA==", - "RNK9G1hfuz3ETY/RmA9+aA==", - "BYpHADmEnzBsegdYTv8B5Q==", - "DBKrdpCE0awppxST4o/zzg==", - "KOmdvm+wJuZ/nT/o1+xOuw==", - "gDxqUdxxeXDYhJk9zcrNyA==", - "UPzS4LR3p/h0u69+7YemrQ==", - "hf9HFxWRNX2ucH8FLS7ytA==", - "ozVqYsmUueKifb4lDyVyrg==", - "TfHvdbl2M4deg65QKBTPng==", - "SzCGM8ypE58FLaR1+1ccxQ==", - "3nthUmLZ30HxQrzr2d7xFA==", - "1jBaRO8Bg5l6TH7qJ8EPiw==", - "eJlcN+gJnqAnctbWSIO9uA==", - "G8LFBop8u6IIng+gQuVg3w==", - "3JhnM6G4L06NHt31lR0zXA==", - "342VOUOxoLHUqtHANt83Hw==", - "hRxbdeniAVFgKUgB9Q3Y+g==", - "cFFE2R4GztNoftYkqalqUQ==", - "YmaksRzoU+OwlpiEaBDYaQ==", - "jon1y9yMEGfiIBjsDeeJdA==", - "oSnrpW4UmmVXtUGWqLq+tQ==", - "zaqyy3GaJ7cp8qDoLJWcTw==", - "luO1R8dUM9gy1E2lojRQoA==", - "YHM6NNHjmodv+G0mRLK7kw==", - "ZSmN8mmI9lDEHkJqBBg0Nw==", - "520wTzrysiRi2Td92Zq0HQ==", - "RAAw14BA1ws5Wu/rU7oegw==", - "vb6Agwzk4JG0Nn7qRPPFMQ==", - "joDXdLpXvRjOqkRiYaD/Sw==", - "dK2DU3t1ns+DWDwfBvH3SQ==", - "gZNJ1Qq6OcnwXqc+jXzMLQ==", - "R8ULpSNu9FcCwXZM0QedSg==", - "mc45FSMtzdw2PTcEBwHWPw==", - "d0qvm3bl38rRCpYdWqolCQ==", - "o9tdzmIu+3J/EYU4YWyTkA==", - "5eXpiczlRdmqMYSaodOUiQ==", - "KYuUNrkTvjUWQovw9dNakA==", - "02im2RooJQ/9UfUrh5LO+A==", - "kWPUUi7x9kKKa6nJ+FDR5Q==", - "6z8CRivao3IMyV4p4gMh7g==", - "SmRWEzqddY9ucGAP5jXjAg==", - "DJscTYNFPyPmTb57g/1w+Q==", - "uOHrw37yF9oLLVd16nUpeg==", - "HaIRV9SNPRTPDOSX9sK/bg==", - "K4yZNVoqHjXNhrZzz2gTew==", - "bTNRjJm+FfSQVfd56nNNqQ==", - "x5lyMArsv1MuJmEFlWCnNw==", - "cxpZ4bloGv734LBf4NpVhA==", - "kUudvRfA33uJDzHIShQd3Q==", - "3Wfj05vCLFAB9vII5AU9tw==", - "FUQySDFodnRhr+NUsWt0KA==", - "eC/RcoCVQBlXdE9WtcgXIw==", - "NoX8lkY+kd2GPuGjp+s0tQ==", - "EzjbinBHx3Wr08eXpH3HXA==", - "0VsaJHR0Ms8zegsCpAKoyg==", - "e2xLFVavnZIUUtxJx+qa1g==", - "Kt6BTG1zdeBZ3nlVk+BZKQ==", - "EUXQZwLgnDG+C8qxVoBNdw==", - "0SkC/4PtnX1bMYgD6r6CLA==", - "rzj6mjHCcMEouL66083BAg==", - "V5HEaY3v9agOhsbYOAZgJA==", - "tJt6VDdAPEemBUvnoc4viA==", - "g0lWrzEYMntVIahC7i0O2g==", - "zCpibjrZOA3FQ4lYt0WoVA==", - "4Xh/B3C16rrjbES+FM1W8g==", - "GHEdXgGWOeOa6RuPMF0xXg==", - "3kREs/qaMX0AwFXN0LO5ow==", - "GLDNTSwygNBmuFwCIm7HtA==", - "JBkbaBiorCtFq9M9lSUdMg==", - "rJCuanCy51ydVD4nInf9IQ==", - "OzFRv+PzPqTNmOnvZGoo5g==", - "7mxU5fJl/c6dXss9H3vGcQ==", - "9J53kk+InE3CKa7cPyCXMw==", - "x9TIZ9Ua++3BX+MpjgTuWA==", - "h0MH5NGFfChgmRJ3E/R3HQ==", - "25w3ZRUzCvJwAVHYCIO5uw==", - "1Wc8jQlDSB4Dp32wkL2odw==", - "ipPPjxpXHS1tcykXmrHPMQ==", - "r95wJtP5rsTExKMS7QhHcw==", - "TZT86wXfzFffjt0f95UF5w==", - "VpmBstwR7qPVqPgKYQTA3g==", - "3++dZXzZ6AFEz7hK+i5hww==", - "mAiD16zf+rCc7Qzxjd5buA==", - "1JI9bT92UzxI8txjhst9LQ==", - "TNyvLixb03aP2f8cDozzfA==", - "spHVvA/pc7nF9Q4ON020+w==", - "GA8k6GQ20DGduVoC+gieRA==", - "T7waQc3PvTFr0yWGKmFQdQ==", - "P0Pc8owrqt6spdf7FgBFSw==", - "DKApp/alXiaPSRNm3MfSuA==", - "UreSZCIdDgloih8KLeX7gg==", - "xJi0T+psHOXMivSOVpMWeQ==", - "cNsC9bH30eM1EZS6IdEdtQ==", - "XjjrIpsmATV/lyln4tPb+g==", - "qt5CsMts2aD4lw/4Q6bHYQ==", - "h+KRDKIvyVUBmRjv1LcCyg==", - "2j83jrPwPfYlpJJ2clEBYQ==", - "ZrCezGLz38xKmzAom6yCTQ==", - "SEGu+cSbeeeZg4xWwsSErQ==", - "Duz/8Ebbd0w6oHwOs0Wnwg==", - "Ci7sS7Yi1+IwAM3VMAB4ew==", - "DG2Qe2DqPs5MkZPOqX363Q==", - "v0Bvws1WYVoEgDt8xmVKew==", - "CtDj/h2Q/lRey20G8dzSgA==", - "WRoJMO0BCJyn5V6qnpUi4Q==", - "RQywrOLZEKw9+kG6qTzr3g==", - "mU4CqbAwpwqegxJaOz9ofQ==", - "aN5x46Gw1VihRalwCt1CGg==", - "U6VQghxOXsydh3Naa5Nz4A==", - "YA+zdEC+yEgFWRIgS1Eiqw==", - "oPcxgoismve6+jXyIKK6AQ==", - "PqLCd/pwc+q5GkL6MB0jTg==", - "fHL+fHtDxhALZFb9W/uHuw==", - "dhTevyxTYAuKbdLWhG47Kw==", - "VllbOAjeW3Dpbj5lp2OSmA==", - "3itfXtlLPRmPCSYaSvc39Q==", - "GNak/LFeoHWlTdLW1iU4eg==", - "HuDuxs2KiGqmeyY1s1PjpQ==", - "xs8J3cesq7lDhP/dNltqOw==", - "foXSDEUwMhfHWJSmSejsQg==", - "6fWom3YoKvW6NIg6y9o9CQ==", - "NhZbSq0CjDNOAIvBHBM9zA==", - "5w4FbRhWACP7k2WnNitiHg==", - "0UeRwDID2RBIikInqFI7uw==", - "/y/jHHEpUu5TR+R2o96kXA==", - "voO3krg4sdy4Iu+MZEr8+g==", - "hdzol5dk//Q6tCm4+OndIA==", - "Nc5kiwXCAyjpzt43G5RF1A==", - "3UBYBMejKInSbCHRoJJ7dg==", - "dRFCIbVu0Y8XbjG5i+UFCQ==", - "t8pjhdyNJirkvYgWIO/eKg==", - "FAXzjjIr8l1nsQFPpgxM/g==", - "SPGpjEJrpflv1hF0qsFlPw==", - "9Y1ZmfiHJd9vCiZ6KfO1xQ==", - "7Eqzyb+Kep+dIahYJWNNxQ==", - "9rL8nC/VbSqrvnUtH9WsxQ==", - "H4FZ5Wcnb40hQM1DMGGe8A==", - "AjoXWGb/l9xH/hscgEc6kQ==", - "6nzFl41uutgDdC30oOeCqg==", - "3jo1jRy3MybXtoLR+JIbJw==", - "mXdE08dv+OlIhlcqMBH2Gg==", - "Ifd7DI6o8N5gnyAKqZTlRw==", - "JNUvg/kxL3rdcZnD4IqUxw==", - "ry8B+sAHNeFIZHCCDynFyw==", - "TXaEd5lIKhzjcncfNcBgSg==", - "Mr3ehuDMUimOSn+FlkchdA==", - "cwiGhjmX9v8I7E/ekQ0h+g==", - "I/r5+1jnqumCPprKC/2BqA==", - "S4V3MfGYk8I4fd3WH09yYw==", - "A+crVyUeynAkEMYKbnFjZw==", - "vtyHcNQPcUTRuZcQvRUX4Q==", - "UNKx1ZVv3HNp21zrUSm6ew==", - "rsAlvGLv2D0swd6ol3WlvA==", - "2qwqb8ENAR2fpQnw55sPDw==", - "xBJJuYYnsTJOeFggZSKC4Q==", - "omvtZZKruPiEt6fV0YXTdg==", - "JZEgKUhUN+USJsvtF4HZOg==", - "euG/kpJ5elSDOGNbWWDfNQ==", - "DiiVmM6/WNcp0MUjSaFq6w==", - "QCNS8gAml1M2pJ+MxZsueg==", - "M6+pggFsHfM3alFxcMOFNQ==", - "YLoWpDTwXnszEQm8FA164Q==", - "N08oUZtlXbQvO9t3vXnGog==", - "jkjuJowWuOa4CLY+RZiErQ==", - "mPf+S+6oAoVIYEVveaiNFA==", - "R0iVyo5qreP/68uZlZphDA==", - "GYlqhQgp03B0mXpUhQ+ZCA==", - "lQNbmWD7PhwNGye+zbc3GQ==", - "cNeaOJEOzUSDdRmenPQyuw==", - "Gp66/Txv6ebv5bn85TuQtA==", - "xAda6DVkcvvqhI8vWZeGyA==", - "Ggk1Qa0lEdAgCXG6SmCkBA==", - "MYuO7ZURXtyaf56q7hH4Zw==", - "RUIdZRTgJBudWUZQFgiFaQ==", - "bgFJxLirUom2zT0h7LdOpw==", - "A2gaOpIlrS7TKVQgy9XMSw==", - "zevXp0lqqnXv9X6Bgmjtqg==", - "a5iuFqWAdFFsRgp7SFYwNg==", - "TxTy0TaDsWTcRH3wdBEQLQ==", - "jephVdKDeJIhXPrdMOJ4qA==", - "C4KdamfqUPuJ3RGFdpIEdw==", - "zl6l2Ioz1qovRUIWrSyxVA==", - "+gGaDxUe0UnNrf3PPg1qQQ==", - "1HgbrlaLMHS6Qj/0kkaJxg==", - "eGxTly6Pnu7eV/MKYMmuYw==", - "RAMKfnlrzNjpyh2BWt6JHg==", - "4pZQm9ogCZ/EAR9pjJm1eA==", - "l1zv3erwXIegQFd02NlCag==", - "uHGyRZchuA4ulmuD5LqquQ==", - "/vFu89tsV+lbcoiqM/XWog==", - "63SUgqfQimrmjvy/bEDQ0w==", - "JLHuf+FlChFDa9LYfTQ4Eg==", - "I+ZnPePTFX8ZODe14bxgyA==", - "CtoK1k3U82BkvzuPfQ4pjQ==", - "6nqQm4C7y+wZ+qX0kVjwmA==", - "+C3kBxRXIjqBk0EJxe3Xfg==", - "qVu748pIxEZtiywg4/4qhw==", - "07o+sKjjRCYkwy/ACyoYhg==", - "CiLF4dkbLURekBcQbwPUVA==", - "W/N5/nkp4iQIPYfAagVV7A==", - "3PJOphhEjw0E4arTfVVwdg==", - "YdMbARHwB+bSOd0PlTlXiA==", - "41hbx5Yr7UWxsV6+bWUYUA==", - "SqJHXD0MorNwHtHL9TbWLg==", - "pWKGUzm/muwOiBtzkRMnRg==", - "az9zZ7HTa4FJGRQMcamvEw==", - "zavAAN8C9Wo8oBLyztp63Q==", - "yBAnPmwrMJ8kpPP292S/Lw==", - "E6szQhjuUAz2e0h9ffQfEQ==", - "Fs3cQxQyS9kM4T8j5R7rWw==", - "GB5fRLZxnjRUfEe0SwcePQ==", - "+9OY8xkT9dM/rb2T6ACtOQ==", - "If2xFBD1p91iDD7ZrsfgjA==", - "QCFfoMhy8EleZAOpfRY88w==", - "NobWPk1Z6bHt5s9NHXt/pg==", - "nK6T4vV4384OIcqO5tQMhA==", - "Zov1EzK+VomiuwT1+ulQ8g==", - "pF98OKDvLUlnTzo7wmlpOw==", - "Wrq9YDsieAMC3Y2DSY5Rcg==" - ] -} diff --git a/application/basilisk/base/content/newtab/newTab.js b/application/basilisk/base/content/newtab/newTab.js index bbd2ef39d..1731edadc 100644 --- a/application/basilisk/base/content/newtab/newTab.js +++ b/application/basilisk/base/content/newtab/newTab.js @@ -11,7 +11,6 @@ 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:///modules/DirectoryLinksProvider.jsm"); Cu.import("resource://gre/modules/NewTabUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Rect", diff --git a/application/basilisk/base/content/newtab/newTab.xhtml b/application/basilisk/base/content/newtab/newTab.xhtml index eef51b4b2..7de1ff3d4 100644 --- a/application/basilisk/base/content/newtab/newTab.xhtml +++ b/application/basilisk/base/content/newtab/newTab.xhtml @@ -73,7 +73,6 @@ <div id="newtab-horizontal-margin"> <div class="newtab-side-margin"/> <div id="newtab-grid"> - <h1 id="topsites-heading"/> </div> <div class="newtab-side-margin"/> </div> diff --git a/application/basilisk/base/content/newtab/page.js b/application/basilisk/base/content/newtab/page.js index f7626ced2..7c19a9827 100644 --- a/application/basilisk/base/content/newtab/page.js +++ b/application/basilisk/base/content/newtab/page.js @@ -48,11 +48,6 @@ var gPage = { let enabled = gAllPages.enabled; this._updateAttributes(enabled); - // 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(); @@ -79,10 +74,7 @@ var gPage = { 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) { + if (gGrid.ready) { gGrid.refresh(); } @@ -119,10 +111,6 @@ var gPage = { document.getElementById("newtab-search-submit").value = document.body.getAttribute("dir") == "ltr" ? "\u25B6" : "\u25C0"; - if (Services.prefs.getBoolPref("browser.newtabpage.compact")) { - document.body.classList.add("compact"); - } - // Initialize search. gSearch.init(); @@ -174,16 +162,6 @@ var gPage = { */ _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); - } }, /** @@ -258,40 +236,5 @@ var gPage = { }, 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; - } - } - } - } - - DirectoryLinksProvider.reportSitesAction(sites, "view", lastIndex); - }, - - maybeShowAutoMigrationUndoNotification() { - sendAsyncMessage("NewTab:MaybeShowAutoMigrationUndoNotification"); - }, + } }; diff --git a/application/basilisk/base/content/newtab/sites.js b/application/basilisk/base/content/newtab/sites.js index 9d103ce9b..00f81869a 100644 --- a/application/basilisk/base/content/newtab/sites.js +++ b/application/basilisk/base/content/newtab/sites.js @@ -62,7 +62,7 @@ Site.prototype = { this._updateAttributes(true); let changed = gPinnedLinks.pin(this._link, aIndex); if (changed) { - // render site again to remove suggested/sponsored tags + // render site again this._render(); } return changed; @@ -136,15 +136,6 @@ Site.prototype = { 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 */ @@ -155,11 +146,8 @@ Site.prototype = { 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); } }, @@ -171,11 +159,8 @@ Site.prototype = { // first check for end time, as it may modify the link this._checkLinkEndTime(); // setup display variables - let enhanced = gAllPages.enhanced && DirectoryLinksProvider.getEnhancedLink(this.link); let url = this.url; - let title = enhanced && enhanced.title ? enhanced.title : - this.link.type == "history" ? this.link.baseDomain : - this.title; + 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"); @@ -189,22 +174,6 @@ Site.prototype = { titleNode.style.backgroundColor = this.link.titleBgColor; } - // remove "suggested" attribute to avoid showing "suggested" tag - // after site was pinned or dropped - this.node.removeAttribute("suggested"); - - if (this.link.targetedSite) { - if (this.node.getAttribute("type") != "sponsored") { - this._querySelector(".newtab-sponsored").textContent = - newTabString("suggested.tag"); - } - - this.node.setAttribute("suggested", true); - let explanation = this._getSuggestedTileExplanation(); - this._querySelector(".newtab-suggested").innerHTML = - `<div class='newtab-suggested-bounds'> ${explanation} </div>`; - } - if (this.isPinned()) this._updateAttributes(true); // Capture the page if the thumbnail is missing, which will cause page.js @@ -244,8 +213,7 @@ Site.prototype = { */ refreshThumbnail: function Site_refreshThumbnail() { // Only enhance tiles if that feature is turned on - let link = gAllPages.enhanced && DirectoryLinksProvider.getEnhancedLink(this.link) || - this.link; + let link = this.link; let thumbnail = this._querySelector(".newtab-thumbnail.thumbnail"); if (link.bgColor) { @@ -267,16 +235,6 @@ Site.prototype = { placeholder.style.backgroundColor = "hsl(" + hue + ",80%,40%)"; placeholder.textContent = link.baseDomain.substr(0,1).toUpperCase(); } - - if (link.enhancedImageURI) { - let enhanced = this._querySelector(".enhanced-content"); - enhanced.style.backgroundImage = 'url("' + link.enhancedImageURI + '")'; - - if (this.link.type != link.type) { - this.node.setAttribute("type", "enhanced"); - this.enhancedId = link.directoryId; - } - } }, _ignoreHoverEvents: function(element) { @@ -296,13 +254,6 @@ Site.prototype = { this._node.addEventListener("dragstart", this, false); this._node.addEventListener("dragend", this, false); this._node.addEventListener("mouseover", this, false); - - // Specially treat the sponsored icon & suggested explanation - // text to prevent regular hover effects - let sponsored = this._querySelector(".newtab-sponsored"); - let suggested = this._querySelector(".newtab-suggested"); - this._ignoreHoverEvents(sponsored); - this._ignoreHoverEvents(suggested); }, /** @@ -333,31 +284,6 @@ Site.prototype = { .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"); - } - else { - let explain = document.createElementNS(HTML_NAMESPACE, "div"); - explain.className = explanationTextClass.slice(1); // Slice off the first character, '.' - this.node.appendChild(explain); - - let link = '<a href="' + TILES_EXPLAIN_LINK + '">' + - newTabString("learn.link") + "</a>"; - let type = (this.node.getAttribute("suggested") && this.node.getAttribute("type") == "affiliate") ? - "suggested" : this.node.getAttribute("type"); - let icon = '<input type="button" class="newtab-control newtab-' + - (type == "enhanced" ? "customize" : "control-block") + '"/>'; - explain.innerHTML = newTabString(type + (type == "sponsored" ? ".explain2" : ".explain"), [icon, link]); - - button.setAttribute("active", "true"); - } - }, - /** * Handles site click events. */ @@ -376,48 +302,25 @@ Site.prototype = { action = "click"; } } - // Handle sponsored explanation link click - else if (target.parentElement.classList.contains("sponsored-explain")) { - action = "sponsored_link"; - } - else if (target.parentElement.classList.contains("suggested-explain")) { - action = "suggested_link"; - } // Only handle primary clicks for the remaining targets else if (button == 0) { aEvent.preventDefault(); if (target.classList.contains("newtab-control-block")) { - // Notify DirectoryLinksProvider of suggested tile block, this may - // affect if and how suggested tiles are recommended and needs to - // be reported before pages are updated inside block() call - if (this.link.targetedSite) { - DirectoryLinksProvider.handleSuggestedTileBlock(); - } this.block(); action = "block"; } - else if (target.classList.contains("sponsored-explain") || - target.classList.contains("newtab-sponsored")) { - this._toggleLegalText(".newtab-sponsored", ".sponsored-explain"); - action = "sponsored"; - } 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 + // link has changed - update rest of the pages gAllPages.update(gPage); } action = "pin"; } } - - // Report all link click actions - if (action) { - DirectoryLinksProvider.reportSitesAction(gGrid.sites, action, tileIndex); - } }, /** diff --git a/application/basilisk/base/content/nsContextMenu.js b/application/basilisk/base/content/nsContextMenu.js index 3f77dcb90..370e5ba60 100644 --- a/application/basilisk/base/content/nsContextMenu.js +++ b/application/basilisk/base/content/nsContextMenu.js @@ -4,7 +4,6 @@ # 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/. -Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm"); Components.utils.import("resource://gre/modules/LoginManagerContextMenu.jsm"); @@ -113,7 +112,6 @@ nsContextMenu.prototype = { this.initLeaveDOMFullScreenItems(); this.initClickToPlayItems(); this.initPasswordManagerItems(); - this.initSyncItems(); }, initPageMenuSeparator: function CM_initPageMenuSeparator() { @@ -142,28 +140,11 @@ nsContextMenu.prototype = { this.onPlainTextLink = true; } - var inContainer = false; - if (gContextMenuContentData.userContextId) { - inContainer = true; - var item = document.getElementById("context-openlinkincontainertab"); - - item.setAttribute("data-usercontextid", gContextMenuContentData.userContextId); - - var label = - ContextualIdentityService.getUserContextLabel(gContextMenuContentData.userContextId); - item.setAttribute("label", - gBrowserBundle.formatStringFromName("userContextOpenLink.label", - [label], 1)); - } - var shouldShow = this.onSaveableLink || isMailtoInternal || this.onPlainTextLink; var isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window); - var showContainers = Services.prefs.getBoolPref("privacy.userContext.enabled"); this.showItem("context-openlink", shouldShow && !isWindowPrivate); this.showItem("context-openlinkprivate", shouldShow); - this.showItem("context-openlinkintab", shouldShow && !inContainer); - this.showItem("context-openlinkincontainertab", shouldShow && inContainer); - this.showItem("context-openlinkinusercontext-menu", shouldShow && !isWindowPrivate && showContainers); + this.showItem("context-openlinkintab", shouldShow); this.showItem("context-openlinkincurrent", this.onPlainTextLink); this.showItem("context-sep-open", shouldShow); }, @@ -540,10 +521,6 @@ nsContextMenu.prototype = { popup.insertBefore(fragment, insertBeforeElement); }, - initSyncItems: function() { - gFxAccounts.initPageContextMenu(this); - }, - openPasswordManager: function() { LoginHelper.openPasswordManager(window, gContextMenuContentData.documentURIObject.host); }, @@ -958,13 +935,6 @@ nsContextMenu.prototype = { params[p] = extra[p]; } - // If we want to change userContextId, we must be sure that we don't - // propagate the referrer. - if ("userContextId" in params && - params.userContextId != gContextMenuContentData.userContextId) { - params.noReferrer = true; - } - return params; }, @@ -982,7 +952,7 @@ nsContextMenu.prototype = { }, // Open linked-to URL in a new tab. - openLinkInTab: function(event) { + openLinkInTab: function() { urlSecurityCheck(this.linkURL, this.principal); let referrerURI = gContextMenuContentData.documentURIObject; @@ -1003,7 +973,6 @@ nsContextMenu.prototype = { let params = { allowMixedContent: persistAllowMixedContentInChildTab, - userContextId: parseInt(event.target.getAttribute('data-usercontextid')), }; openLinkIn(this.linkURL, "tab", this._openLinkInParameters(params)); @@ -1779,8 +1748,4 @@ nsContextMenu.prototype = { menuItem.label = menuLabel; menuItem.accessKey = gNavigatorBundle.getString("contextMenuSearch.accesskey"); }, - createContainerMenu: function(aEvent) { - return createUserContextMenu(aEvent, true, - gContextMenuContentData.userContextId); - }, }; diff --git a/application/basilisk/base/content/sanitize.js b/application/basilisk/base/content/sanitize.js index 841376580..0a00defa4 100644 --- a/application/basilisk/base/content/sanitize.js +++ b/application/basilisk/base/content/sanitize.js @@ -19,8 +19,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", "resource:///modules/DownloadsCommon.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch", - "resource://gre/modules/TelemetryStopwatch.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "console", "resource://gre/modules/Console.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Preferences", @@ -154,8 +152,6 @@ Sanitizer.prototype = { // we catch and store them, but continue to sanitize as much as possible. // Callers should check returned errors and give user feedback // about items that could not be sanitized - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_TOTAL", refObj); let annotateError = (name, ex) => { progress[name] = "failed"; @@ -188,7 +184,7 @@ Sanitizer.prototype = { } // Sanitization is complete. - TelemetryStopwatch.finish("FX_SANITIZE_TOTAL", refObj); + // Reset the inProgress preference since we were not killed during // sanitization. Preferences.reset(Sanitizer.PREF_SANITIZE_IN_PROGRESS); @@ -210,8 +206,6 @@ Sanitizer.prototype = { cache: { clear: Task.async(function* (range) { let seenException; - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_CACHE", refObj); try { // Cache doesn't consult timespan, nor does it have the @@ -232,7 +226,6 @@ Sanitizer.prototype = { seenException = ex; } - TelemetryStopwatch.finish("FX_SANITIZE_CACHE", refObj); if (seenException) { throw seenException; } @@ -243,10 +236,8 @@ Sanitizer.prototype = { clear: Task.async(function* (range) { let seenException; let yieldCounter = 0; - let refObj = {}; // Clear cookies. - TelemetryStopwatch.start("FX_SANITIZE_COOKIES_2", refObj); try { let cookieMgr = Components.classes["@mozilla.org/cookiemanager;1"] .getService(Ci.nsICookieManager); @@ -274,8 +265,6 @@ Sanitizer.prototype = { } } catch (ex) { seenException = ex; - } finally { - TelemetryStopwatch.finish("FX_SANITIZE_COOKIES_2", refObj); } // Clear deviceIds. Done asynchronously (returns before complete). @@ -332,13 +321,6 @@ Sanitizer.prototype = { if (!range || age >= 0) { let tags = ph.getPluginTags(); for (let tag of tags) { - let refObj = {}; - let probe = ""; - if (/\bFlash\b/.test(tag.name)) { - probe = tag.loaded ? "FX_SANITIZE_LOADED_FLASH" - : "FX_SANITIZE_UNLOADED_FLASH"; - TelemetryStopwatch.start(probe, refObj); - } try { let rv = yield new Promise(resolve => ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, age, resolve) @@ -349,14 +331,8 @@ Sanitizer.prototype = { ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, -1, resolve) ); } - if (probe) { - TelemetryStopwatch.finish(probe, refObj); - } } catch (ex) { // Ignore errors from plug-ins - if (probe) { - TelemetryStopwatch.cancel(probe, refObj); - } } } } @@ -413,8 +389,6 @@ Sanitizer.prototype = { history: { clear: Task.async(function* (range) { let seenException; - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_HISTORY", refObj); try { if (range) { yield PlacesUtils.history.removeVisitsByFilter({ @@ -427,8 +401,6 @@ Sanitizer.prototype = { } } catch (ex) { seenException = ex; - } finally { - TelemetryStopwatch.finish("FX_SANITIZE_HISTORY", refObj); } try { @@ -455,8 +427,6 @@ Sanitizer.prototype = { formdata: { clear: Task.async(function* (range) { let seenException; - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_FORMDATA", refObj); try { // Clear undo history of all searchBars let windows = Services.wm.getEnumerator("navigator:browser"); @@ -504,7 +474,6 @@ Sanitizer.prototype = { seenException = ex; } - TelemetryStopwatch.finish("FX_SANITIZE_FORMDATA", refObj); if (seenException) { throw seenException; } @@ -513,8 +482,6 @@ Sanitizer.prototype = { downloads: { clear: Task.async(function* (range) { - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_DOWNLOADS", refObj); try { let filterByTime = null; if (range) { @@ -528,16 +495,13 @@ Sanitizer.prototype = { // Clear all completed/cancelled downloads let list = yield Downloads.getList(Downloads.ALL); list.removeFinished(filterByTime); - } finally { - TelemetryStopwatch.finish("FX_SANITIZE_DOWNLOADS", refObj); - } + } catch (ex) { + } }) }, sessions: { clear: Task.async(function* (range) { - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_SESSIONS", refObj); try { // clear all auth tokens @@ -547,17 +511,14 @@ Sanitizer.prototype = { // clear FTP and plain HTTP auth sessions Services.obs.notifyObservers(null, "net:clear-active-logins", null); - } finally { - TelemetryStopwatch.finish("FX_SANITIZE_SESSIONS", refObj); - } + } catch (ex) { + } }) }, siteSettings: { clear: Task.async(function* (range) { let seenException; - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_SITESETTINGS", refObj); let startDateMS = range ? range[0] / 1000 : null; @@ -615,7 +576,6 @@ Sanitizer.prototype = { seenException = ex; } - TelemetryStopwatch.finish("FX_SANITIZE_SITESETTINGS", refObj); if (seenException) { throw seenException; } @@ -672,9 +632,6 @@ Sanitizer.prototype = { // If/once we get here, we should actually be able to close all windows. - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_OPENWINDOWS", refObj); - // First create a new window. We do this first so that on non-mac, we don't // accidentally close the app by closing all the windows. let handler = Cc["@mozilla.org/browser/clh;1"].getService(Ci.nsIBrowserHandler); @@ -719,7 +676,6 @@ Sanitizer.prototype = { newWindowOpened = true; // If we're the last thing to happen, invoke callback. if (numWindowsClosing == 0) { - TelemetryStopwatch.finish("FX_SANITIZE_OPENWINDOWS", refObj); resolve(); } } @@ -731,7 +687,6 @@ Sanitizer.prototype = { Services.obs.removeObserver(onWindowClosed, "xul-window-destroyed"); // If we're the last thing to happen, invoke callback. if (newWindowOpened) { - TelemetryStopwatch.finish("FX_SANITIZE_OPENWINDOWS", refObj); resolve(); } } diff --git a/application/basilisk/base/content/sync/customize.css b/application/basilisk/base/content/sync/customize.css deleted file mode 100644 index 2bb62595d..000000000 --- a/application/basilisk/base/content/sync/customize.css +++ /dev/null @@ -1,28 +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/. */ - -:root { - font-size: 80%; -} - -#sync-customize-pane { - padding-inline-start: 74px; - background: top left url(chrome://browser/skin/sync-128.png) no-repeat; - background-size: 64px; -} - -#sync-customize-title { - margin-inline-start: 0; - padding-bottom: 0.5em; - font-weight: bold; -} - -#sync-customize-subtitle { - font-size: 90%; -} - -checkbox { - margin: 0; - padding: 0.5em 0 0; -} diff --git a/application/basilisk/base/content/sync/customize.js b/application/basilisk/base/content/sync/customize.js deleted file mode 100644 index f431ac58c..000000000 --- a/application/basilisk/base/content/sync/customize.js +++ /dev/null @@ -1,25 +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"; - -Components.utils.import("resource://gre/modules/Services.jsm"); - -addEventListener("dialogaccept", function () { - let pane = document.getElementById("sync-customize-pane"); - // First determine what the preference for the "global" sync enabled pref - // should be based on the engines selected. - let prefElts = pane.querySelectorAll("preferences > preference"); - let syncEnabled = false; - for (let elt of prefElts) { - if (elt.name.startsWith("services.sync.") && elt.value) { - syncEnabled = true; - break; - } - } - Services.prefs.setBoolPref("services.sync.enabled", syncEnabled); - // and write the individual prefs. - pane.writePreferences(true); - window.arguments[0].accepted = true; -}); diff --git a/application/basilisk/base/content/sync/customize.xul b/application/basilisk/base/content/sync/customize.xul deleted file mode 100644 index 827edf565..000000000 --- a/application/basilisk/base/content/sync/customize.xul +++ /dev/null @@ -1,62 +0,0 @@ -<?xml version="1.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/. --> - -<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> -<?xml-stylesheet href="chrome://browser/content/sync/customize.css" type="text/css"?> - -<!DOCTYPE dialog [ -<!ENTITY % syncCustomizeDTD SYSTEM "chrome://browser/locale/syncCustomize.dtd"> -%syncCustomizeDTD; -]> -<dialog id="sync-customize" - windowtype="Sync:Customize" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - xmlns:html="http://www.w3.org/1999/xhtml" - title="&syncCustomize.dialog.title;" - buttonlabelaccept="&syncCustomize.acceptButton.label;" - buttons="accept"> - - <prefpane id="sync-customize-pane"> - <preferences> - <preference id="engine.bookmarks" name="services.sync.engine.bookmarks" type="bool"/> - <preference id="engine.history" name="services.sync.engine.history" type="bool"/> - <preference id="engine.tabs" name="services.sync.engine.tabs" type="bool"/> - <preference id="engine.passwords" name="services.sync.engine.passwords" type="bool"/> - <preference id="engine.addons" name="services.sync.engine.addons" type="bool"/> - <preference id="engine.prefs" name="services.sync.engine.prefs" type="bool"/> - </preferences> - - <label id="sync-customize-title" value="&syncCustomize.title;"/> - <description id="sync-customize-subtitle" - value="&syncCustomize.description;"/> - - <vbox align="start"> - <checkbox label="&engine.tabs.label;" - accesskey="&engine.tabs.accesskey;" - preference="engine.tabs"/> - <checkbox label="&engine.bookmarks.label;" - accesskey="&engine.bookmarks.accesskey;" - preference="engine.bookmarks"/> - <checkbox label="&engine.passwords.label;" - accesskey="&engine.passwords.accesskey;" - preference="engine.passwords"/> - <checkbox label="&engine.history.label;" - accesskey="&engine.history.accesskey;" - preference="engine.history"/> - <checkbox label="&engine.addons.label;" - accesskey="&engine.addons.accesskey;" - preference="engine.addons"/> - <checkbox label="&engine.prefs.label;" - accesskey="&engine.prefs.accesskey;" - preference="engine.prefs"/> - </vbox> - - </prefpane> - - <script type="application/javascript" - src="chrome://browser/content/sync/customize.js" /> - -</dialog> diff --git a/application/basilisk/base/content/tab-content.js b/application/basilisk/base/content/tab-content.js index 11a9fabce..fec13eba7 100644 --- a/application/basilisk/base/content/tab-content.js +++ b/application/basilisk/base/content/tab-content.js @@ -9,9 +9,6 @@ var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -#ifdef MOZ_WEBEXTENSIONS -Cu.import("resource://gre/modules/ExtensionContent.jsm"); -#endif XPCOMUtils.defineLazyModuleGetter(this, "E10SUtils", "resource:///modules/E10SUtils.jsm"); @@ -23,6 +20,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "AboutReader", "resource://gre/modules/AboutReader.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Readerable", + "resource://gre/modules/Readerable.jsm"); XPCOMUtils.defineLazyGetter(this, "SimpleServiceDiscovery", function() { let ssdp = Cu.import("resource://gre/modules/SimpleServiceDiscovery.jsm", {}).SimpleServiceDiscovery; // Register targets @@ -339,7 +338,7 @@ var AboutReaderListener = { * painted is not going to work. */ updateReaderButton: function(forceNonArticle) { - if (!ReaderMode.isEnabledForParseOnLoad || this.isAboutReader || + if (!Readerable.isEnabledForParseOnLoad || this.isAboutReader || !content || !(content.document instanceof content.HTMLDocument) || content.document.mozSyntheticDocument) { return; @@ -378,7 +377,7 @@ var AboutReaderListener = { this.cancelPotentialPendingReadabilityCheck(); // Only send updates when there are articles; there's no point updating with // |false| all the time. - if (ReaderMode.isProbablyReaderable(content.document)) { + if (Readerable.isProbablyReaderable(content.document)) { sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: true }); } else if (forceNonArticle) { sendAsyncMessage("Reader:UpdateReaderButton", { isArticle: false }); @@ -558,13 +557,6 @@ var PageStyleHandler = { }; PageStyleHandler.init(); -// Keep a reference to the translation content handler to avoid it it being GC'ed. -var trHandler = null; -if (Services.prefs.getBoolPref("browser.translation.detectLanguage")) { - Cu.import("resource:///modules/translation/TranslationContentHandler.jsm"); - trHandler = new TranslationContentHandler(global, docShell); -} - function gKeywordURIFixup(fixupInfo) { fixupInfo.QueryInterface(Ci.nsIURIFixupInfo); if (!fixupInfo.consumer) { @@ -896,41 +888,6 @@ var RefreshBlocker = { RefreshBlocker.init(); -var UserContextIdNotifier = { - init() { - addEventListener("DOMWindowCreated", this); - }, - - uninit() { - removeEventListener("DOMWindowCreated", this); - }, - - handleEvent(aEvent) { - // When the window is created, we want to inform the tabbrowser about - // the userContextId in use in order to update the UI correctly. - // Just because we cannot change the userContextId from an active docShell, - // we don't need to check DOMContentLoaded again. - this.uninit(); - - // We use the docShell because content.document can have been loaded before - // setting the originAttributes. - let loadContext = docShell.QueryInterface(Ci.nsILoadContext); - let userContextId = loadContext.originAttributes.userContextId; - - sendAsyncMessage("Browser:WindowCreated", { userContextId }); - } -}; - -UserContextIdNotifier.init(); - -#ifdef MOZ_WEBEXTENSIONS -ExtensionContent.init(this); -addEventListener("unload", () => { - ExtensionContent.uninit(this); - RefreshBlocker.uninit(); -}); -#endif - addMessageListener("AllowScriptsToClose", () => { content.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowUtils) diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml index f8dbcf364..df83f677f 100644 --- a/application/basilisk/base/content/tabbrowser.xml +++ b/application/basilisk/base/content/tabbrowser.xml @@ -25,7 +25,7 @@ <xul:vbox flex="1" class="browserContainer"> <xul:stack flex="1" class="browserStack" anonid="browserStack"> <xul:browser anonid="initialBrowser" type="content-primary" message="true" messagemanagergroup="browsers" - xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,selectmenulist,datetimepicker"/> + xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,selectmenulist,datetimepicker,authdosprotected"/> </xul:stack> </xul:vbox> </xul:hbox> @@ -371,17 +371,6 @@ <parameter name="aWindow"/> <body> <![CDATA[ - // When not using remote browsers, we can take a fast path by getting - // directly from the content window to the browser without looping - // over all browsers. - if (!gMultiProcessBrowser) { - let browser = aWindow.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebNavigation) - .QueryInterface(Ci.nsIDocShell) - .chromeEventHandler; - return this.getTabForBrowser(browser); - } - for (let i = 0; i < this.browsers.length; i++) { // NB: We use contentWindowAsCPOW so that this code works both // for remote browsers as well. aWindow may be a CPOW. @@ -814,10 +803,8 @@ } let unifiedComplete = this.mTabBrowser._unifiedComplete; - let userContextId = this.mBrowser.getAttribute("usercontextid") || 0; if (this.mBrowser.registeredOpenURI) { - unifiedComplete.unregisterOpenPage(this.mBrowser.registeredOpenURI, - userContextId); + unifiedComplete.unregisterOpenPage(this.mBrowser.registeredOpenURI); delete this.mBrowser.registeredOpenURI; } // Tabs in private windows aren't registered as "Open" so @@ -825,7 +812,7 @@ if (!isBlankPageURL(aLocation.spec) && (!PrivateBrowsingUtils.isWindowPrivate(window) || PrivateBrowsingUtils.permanentPrivateBrowsing)) { - unifiedComplete.registerOpenPage(aLocation, userContextId); + unifiedComplete.registerOpenPage(aLocation); this.mBrowser.registeredOpenURI = aLocation; } } @@ -1042,11 +1029,6 @@ </body> </method> - <!-- Holds a unique ID for the tab change that's currently being timed. - Used to make sure that multiple, rapid tab switches do not try to - create overlapping timers. --> - <field name="_tabSwitchID">null</field> - <method name="updateCurrentBrowser"> <parameter name="aForceUpdate"/> <body> @@ -1055,33 +1037,6 @@ if (this.mCurrentBrowser == newBrowser && !aForceUpdate) return; - if (!aForceUpdate) { - TelemetryStopwatch.start("FX_TAB_SWITCH_UPDATE_MS"); - if (!gMultiProcessBrowser) { - // old way of measuring tab paint which is not valid with e10s. - // Waiting until the next MozAfterPaint ensures that we capture - // the time it takes to paint, upload the textures to the compositor, - // and then composite. - if (this._tabSwitchID) { - TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_MS"); - } - - let tabSwitchID = Symbol(); - - TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_MS"); - this._tabSwitchID = tabSwitchID; - - let onMozAfterPaint = () => { - if (this._tabSwitchID === tabSwitchID) { - TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_MS"); - this._tabSwitchID = null; - } - window.removeEventListener("MozAfterPaint", onMozAfterPaint); - } - window.addEventListener("MozAfterPaint", onMozAfterPaint); - } - } - var oldTab = this.mCurrentTab; // Preview mode should not reset the owner @@ -1262,7 +1217,6 @@ this._adjustFocusAfterTabSwitch(this.mCurrentTab); } - updateUserContextUIIndicator(); gIdentityHandler.updateSharingIndicator(); this.tabContainer._setPositionalAttributes(); @@ -1274,9 +1228,6 @@ }); this.dispatchEvent(event); } - - if (!aForceUpdate) - TelemetryStopwatch.finish("FX_TAB_SWITCH_UPDATE_MS"); ]]> </body> </method> @@ -1521,7 +1472,6 @@ var aSkipAnimation; var aForceNotRemote; var aNoReferrer; - var aUserContextId; var aRelatedBrowser; var aOriginPrincipal; var aOpener; @@ -1542,7 +1492,6 @@ aSkipAnimation = params.skipAnimation; aForceNotRemote = params.forceNotRemote; aNoReferrer = params.noReferrer; - aUserContextId = params.userContextId; aRelatedBrowser = params.relatedBrowser; aOriginPrincipal = params.originPrincipal; aOpener = params.opener; @@ -1565,7 +1514,6 @@ allowMixedContent: aAllowMixedContent, forceNotRemote: aForceNotRemote, noReferrer: aNoReferrer, - userContextId: aUserContextId, originPrincipal: aOriginPrincipal, relatedBrowser: aRelatedBrowser, opener: aOpener }); @@ -1586,7 +1534,6 @@ let aTargetTab; let aNewIndex = -1; let aPostDatas = []; - let aUserContextId; if (arguments.length == 2 && typeof arguments[1] == "object") { let params = arguments[1]; @@ -1597,7 +1544,6 @@ aNewIndex = typeof params.newIndex === "number" ? params.newIndex : aNewIndex; aPostDatas = params.postDatas || aPostDatas; - aUserContextId = params.userContextId; } if (!aURIs.length) @@ -1646,8 +1592,7 @@ ownerTab: owner, skipAnimation: multiple, allowThirdPartyFixup: aAllowThirdPartyFixup, - postData: aPostDatas[0], - userContextId: aUserContextId + postData: aPostDatas[0] }); if (aNewIndex !== -1) { this.moveTabTo(firstTabAdded, aNewIndex); @@ -1660,8 +1605,7 @@ let tab = this.addTab(aURIs[i], { skipAnimation: true, allowThirdPartyFixup: aAllowThirdPartyFixup, - postData: aPostDatas[i], - userContextId: aUserContextId + postData: aPostDatas[i] }); if (targetTabIndex !== -1) this.moveTabTo(tab, ++tabNum); @@ -1934,7 +1878,7 @@ <body> <![CDATA[ // Supported parameters: - // userContextId, remote, isPreloadBrowser, uriIsAboutBlank, permanentKey + // remote, isPreloadBrowser, uriIsAboutBlank, permanentKey const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; @@ -1946,10 +1890,6 @@ b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu")); b.setAttribute("tooltip", this.getAttribute("contenttooltip")); - if (aParams.userContextId) { - b.setAttribute("usercontextid", aParams.userContextId); - } - if (aParams.remote) { b.setAttribute("remote", "true"); } @@ -1971,6 +1911,10 @@ if (this.hasAttribute("datetimepicker")) { b.setAttribute("datetimepicker", this.getAttribute("datetimepicker")); } + + if (this.hasAttribute("authdosprotected")) { + b.setAttribute("authdosprotected", this.getAttribute("authdosprotected")); + } b.setAttribute("autoscrollpopup", this._autoScrollPopup.id); @@ -2024,7 +1968,7 @@ "use strict"; // Supported parameters: - // forceNotRemote, userContextId + // forceNotRemote let uriIsAboutBlank = !aURI || aURI == "about:blank"; @@ -2042,7 +1986,6 @@ // Private windows are not included because both the label and the // icon for the tab would be set incorrectly (see bug 1195981). if (aURI == BROWSER_NEW_TAB_URL && - !aParams.userContextId && !PrivateBrowsingUtils.isWindowPrivate(window)) { browser = this._getPreloadedBrowser(); if (browser) { @@ -2056,7 +1999,6 @@ browser = this._createBrowser({permanentKey: aTab.permanentKey, remote: remote, uriIsAboutBlank: uriIsAboutBlank, - userContextId: aParams.userContextId, relatedBrowser: aParams.relatedBrowser, opener: aParams.opener}); } @@ -2131,11 +2073,11 @@ var aAllowMixedContent; var aForceNotRemote; var aNoReferrer; - var aUserContextId; var aEventDetail; var aRelatedBrowser; var aOriginPrincipal; var aOpener; + var aSkipBackgroundNotify; if (arguments.length == 2 && typeof arguments[1] == "object" && !(arguments[1] instanceof Ci.nsIURI)) { @@ -2153,11 +2095,11 @@ aAllowMixedContent = params.allowMixedContent; aForceNotRemote = params.forceNotRemote; aNoReferrer = params.noReferrer; - aUserContextId = params.userContextId; aEventDetail = params.eventDetail; aRelatedBrowser = params.relatedBrowser; aOriginPrincipal = params.originPrincipal; aOpener = params.opener; + aSkipBackgroundNotify = params.skipBackgroundNotify; } // if we're adding tabs, we're past interrupt mode, ditch the owner @@ -2179,13 +2121,13 @@ t.setAttribute("label", aURI); } - if (aUserContextId) { - t.setAttribute("usercontextid", aUserContextId); - ContextualIdentityService.setTabStyle(t); - } - t.setAttribute("crop", "end"); t.setAttribute("onerror", "this.removeAttribute('image');"); + + if (aSkipBackgroundNotify) { + t.setAttribute("skipbackgroundnotify", true); + } + t.className = "tabbrowser-tab"; this.tabContainer._unlockTabSizing(); @@ -2228,7 +2170,6 @@ // of tab.linkedBrowser. let browserParams = { forceNotRemote: aForceNotRemote, - userContextId: aUserContextId, relatedBrowser: aRelatedBrowser, opener: aOpener, }; @@ -2607,8 +2548,7 @@ listener.destroy(); if (browser.registeredOpenURI && !aAdoptedByTab) { - this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI, - browser.getAttribute("usercontextid") || 0); + this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI); delete browser.registeredOpenURI; } @@ -2807,11 +2747,6 @@ if (ourBrowser.isRemoteBrowser != otherBrowser.isRemoteBrowser) return; - // Keep the userContextId if set on other browser - if (otherBrowser.hasAttribute("usercontextid")) { - ourBrowser.setAttribute("usercontextid", otherBrowser.getAttribute("usercontextid")); - } - // That's gBrowser for the other window, not the tab's browser! var remoteBrowser = aOtherTab.ownerDocument.defaultView.gBrowser; var isPending = aOtherTab.hasAttribute("pending"); @@ -2844,10 +2779,6 @@ aOurTab.setAttribute("soundplaying", "true"); modifiedAttrs.push("soundplaying"); } - if (aOtherTab.hasAttribute("usercontextid")) { - aOurTab.setUserContextId(aOtherTab.getAttribute("usercontextid")); - modifiedAttrs.push("usercontextid"); - } if (aOtherTab.hasAttribute("sharing")) { aOurTab.setAttribute("sharing", aOtherTab.getAttribute("sharing")); modifiedAttrs.push("sharing"); @@ -2985,8 +2916,7 @@ <![CDATA[ // If the current URI is registered as open remove it from the list. if (aOurBrowser.registeredOpenURI) { - this._unifiedComplete.unregisterOpenPage(aOurBrowser.registeredOpenURI, - aOurBrowser.getAttribute("usercontextid") || 0); + this._unifiedComplete.unregisterOpenPage(aOurBrowser.registeredOpenURI); delete aOurBrowser.registeredOpenURI; } @@ -3019,7 +2949,10 @@ <parameter name="aTab"/> <body> <![CDATA[ - this.getBrowserForTab(aTab).reload(); + let browser = this.getBrowserForTab(aTab); + // Reset DOS mitigation for basic auth prompt + delete browser.authPromptCounter; + browser.reload(); ]]> </body> </method> @@ -3323,10 +3256,6 @@ // it in the other window (making it seem to have moved between // windows). let params = { eventDetail: { adoptedTab: aTab } }; - if (aTab.hasAttribute("usercontextid")) { - // new tab must have the same usercontextid as the old one - params.userContextId = aTab.getAttribute("usercontextid"); - } let newTab = this.addTab("about:blank", params); let newBrowser = this.getBrowserForTab(newTab); let newURL = aTab.linkedBrowser.currentURI.spec; @@ -4145,8 +4074,6 @@ */ startTabSwitch: function () { - TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_E10S_MS", window); - TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_E10S_MS", window); this.addMarker("AsyncTabSwitch:Start"); this.switchInProgress = true; }, @@ -4162,31 +4089,18 @@ this.getTabState(this.requestedTab) == this.STATE_LOADED) { // After this point the tab has switched from the content thread's point of view. // The changes will be visible after the next refresh driver tick + composite. - let time = TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_TOTAL_E10S_MS", window); - if (time != -1) { - TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_E10S_MS", window); - this.log("DEBUG: tab switch time = " + time); this.addMarker("AsyncTabSwitch:Finish"); - } this.switchInProgress = false; } }, spinnerDisplayed: function () { this.assert(!this.spinnerTab); - TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window); - // We have a second, similar probe for capturing recordings of - // when the spinner is displayed for very long periods. - TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_LONG_MS", window); this.addMarker("AsyncTabSwitch:SpinnerShown"); }, spinnerHidden: function () { this.assert(this.spinnerTab); - this.log("DEBUG: spinner time = " + - TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window)); - TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window); - TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_LONG_MS", window); this.addMarker("AsyncTabSwitch:SpinnerHidden"); // we do not get a onPaint after displaying the spinner this.maybeFinishTabSwitch(); @@ -4210,11 +4124,7 @@ return true; if (this._logInit) return this._shouldLog; - let result = false; - try { - result = Services.prefs.getBoolPref("browser.tabs.remote.logSwitchTiming"); - } catch (ex) { - } + let result = Services.prefs.getBoolPref("browser.tabs.remote.logSwitchTiming", false); this._shouldLog = result; this._logInit = true; return this._shouldLog; @@ -4661,7 +4571,6 @@ disableSetDesktopBackground: data.disableSetDesktopBg, loginFillInfo: data.loginFillInfo, parentAllowsMixedContent: data.parentAllowsMixedContent, - userContextId: data.userContextId, }; let popup = browser.ownerDocument.getElementById("contentAreaContextMenu"); let event = gContextMenuContentData.event; @@ -4688,17 +4597,6 @@ } case "Browser:WindowCreated": { let tab = this.getTabForBrowser(browser); - if (tab && data.userContextId) { - ContextualIdentityService.telemetry(data.userContextId); - tab.setUserContextId(data.userContextId); - } - - // We don't want to update the container icon and identifier if - // this is not the selected browser. - if (browser == gBrowser.selectedBrowser) { - updateUserContextUIIndicator(); - } - break; } case "Findbar:Keypress": { @@ -4881,8 +4779,7 @@ for (let tab of this.tabs) { let browser = tab.linkedBrowser; if (browser.registeredOpenURI) { - this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI, - browser.getAttribute("usercontextid") || 0); + this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI); delete browser.registeredOpenURI; } let filter = this._tabFilters.get(tab); @@ -5283,7 +5180,7 @@ </xul:arrowscrollbox> </content> - <implementation implements="nsIDOMEventListener, nsIObserver"> + <implementation implements="nsIDOMEventListener"> <constructor> <![CDATA[ this.mTabClipWidth = Services.prefs.getIntPref("browser.tabs.tabClipWidth"); @@ -5296,23 +5193,11 @@ window.addEventListener("resize", this, false); window.addEventListener("load", this, false); - try { - this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled"); - } catch (ex) { - this._tabAnimationLoggingEnabled = false; - } + this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled", false); this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled"); - this.observe(null, "nsPref:changed", "privacy.userContext.enabled"); - Services.prefs.addObserver("privacy.userContext.enabled", this, false); ]]> </constructor> - <destructor> - <![CDATA[ - Services.prefs.removeObserver("privacy.userContext.enabled", this); - ]]> - </destructor> - <field name="tabbrowser" readonly="true"> document.getElementById(this.getAttribute("tabbrowser")); </field> @@ -5338,55 +5223,6 @@ <field name="_afterHoveredTab">null</field> <field name="_hoveredTab">null</field> - <method name="observe"> - <parameter name="aSubject"/> - <parameter name="aTopic"/> - <parameter name="aData"/> - <body><![CDATA[ - switch (aTopic) { - case "nsPref:changed": - // This is the only pref observed. - let containersEnabled = Services.prefs.getBoolPref("privacy.userContext.enabled"); - - const newTab = document.getElementById("new-tab-button"); - const newTab2 = document.getAnonymousElementByAttribute(this, "anonid", "tabs-newtab-button") - - if (containersEnabled) { - for (let parent of [newTab, newTab2]) { - if (!parent) - continue; - let popup = document.createElementNS( - "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", - "menupopup"); - if (parent.id) { - popup.id = "newtab-popup"; - } else { - popup.setAttribute("anonid", "newtab-popup"); - } - popup.className = "new-tab-popup"; - popup.setAttribute("position", "after_end"); - parent.appendChild(popup); - - gClickAndHoldListenersOnElement.add(parent); - parent.setAttribute("type", "menu"); - } - } else { - for (let parent of [newTab, newTab2]) { - if (!parent) - continue; - gClickAndHoldListenersOnElement.remove(parent); - parent.removeAttribute("type"); - if (!parent.firstChild) - continue; - parent.firstChild.remove(); - } - } - - break; - } - ]]></body> - </method> - <property name="_isCustomizing" readonly="true"> <getter> let root = document.documentElement; @@ -5982,7 +5818,11 @@ this._fillTrailingGap(); this._handleTabSelect(); } else { - this._notifyBackgroundTab(tab); + if (tab.hasAttribute("skipbackgroundnotify")) { + tab.removeAttribute("skipbackgroundnotify"); + } else { + this._notifyBackgroundTab(tab); + } } // XXXmano: this is a temporary workaround for bug 345399 @@ -6483,7 +6323,6 @@ inBackground = !inBackground; let targetTab = this._getDragTargetTab(event, true); - let userContextId = this.selectedItem.getAttribute("usercontextid"); let replace = !!targetTab; let newIndex = this._getDropIndex(event, true); let urls = links.map(link => link.url); @@ -6493,7 +6332,6 @@ allowThirdPartyFixup: true, targetTab, newIndex, - userContextId, }); } @@ -6754,14 +6592,6 @@ --> <field name="muteReason">undefined</field> - <property name="userContextId" readonly="true"> - <getter> - return this.hasAttribute("usercontextid") - ? parseInt(this.getAttribute("usercontextid")) - : 0; - </getter> - </property> - <property name="soundPlaying" readonly="true"> <getter> return this.getAttribute("soundplaying") == "true"; @@ -6889,27 +6719,6 @@ ]]> </body> </method> - - <method name="setUserContextId"> - <parameter name="aUserContextId"/> - <body> - <![CDATA[ - if (aUserContextId) { - if (this.linkedBrowser) { - this.linkedBrowser.setAttribute("usercontextid", aUserContextId); - } - this.setAttribute("usercontextid", aUserContextId); - } else { - if (this.linkedBrowser) { - this.linkedBrowser.removeAttribute("usercontextid"); - } - this.removeAttribute("usercontextid"); - } - - ContextualIdentityService.setTabStyle(this); - ]]> - </body> - </method> </implementation> <handlers> @@ -7086,49 +6895,26 @@ <handlers> <handler event="popupshowing"> <![CDATA[ - if (event.target.getAttribute("id") == "alltabs_containersMenuTab") { - createUserContextMenu(event); - return; - } + document.getElementById("alltabs_undoCloseTab").disabled = + SessionStore.getClosedTabCount(window) == 0; - let containersEnabled = Services.prefs.getBoolPref("privacy.userContext.enabled"); - - if (event.target.getAttribute("anonid") == "newtab-popup" || - event.target.id == "newtab-popup") { - createUserContextMenu(event); - } else { - document.getElementById("alltabs-popup-separator-1").hidden = !containersEnabled; - let containersTab = document.getElementById("alltabs_containersTab"); - - containersTab.hidden = !containersEnabled; - if (PrivateBrowsingUtils.isWindowPrivate(window)) { - containersTab.setAttribute("disabled", "true"); - } - - document.getElementById("alltabs_undoCloseTab").disabled = - SessionStore.getClosedTabCount(window) == 0; - - var tabcontainer = gBrowser.tabContainer; + var tabcontainer = gBrowser.tabContainer; - // Listen for changes in the tab bar. - tabcontainer.addEventListener("TabAttrModified", this, false); - tabcontainer.addEventListener("TabClose", this, false); - tabcontainer.mTabstrip.addEventListener("scroll", this, false); + // Listen for changes in the tab bar. + tabcontainer.addEventListener("TabAttrModified", this, false); + tabcontainer.addEventListener("TabClose", this, false); + tabcontainer.mTabstrip.addEventListener("scroll", this, false); - let tabs = gBrowser.visibleTabs; - for (var i = 0; i < tabs.length; i++) { - if (!tabs[i].pinned) - this._createTabMenuItem(tabs[i]); - } - this._updateTabsVisibilityStatus(); + let tabs = gBrowser.visibleTabs; + for (var i = 0; i < tabs.length; i++) { + if (!tabs[i].pinned) + this._createTabMenuItem(tabs[i]); } + this._updateTabsVisibilityStatus(); ]]></handler> <handler event="popuphidden"> <![CDATA[ - if (event.target.getAttribute("id") == "alltabs_containersMenuTab") { - return; - } // clear out the menu popup and remove the listeners for (let i = this.childNodes.length - 1; i > 0; i--) { @@ -7137,9 +6923,6 @@ menuItem.tab.mCorrespondingMenuitem = null; this.removeChild(menuItem); } - if (menuItem.hasAttribute("usercontextid")) { - this.removeChild(menuItem); - } } var tabcontainer = gBrowser.tabContainer; tabcontainer.mTabstrip.removeEventListener("scroll", this, false); diff --git a/application/basilisk/base/content/urlbarBindings.xml b/application/basilisk/base/content/urlbarBindings.xml index eb3150581..b9c17818a 100644 --- a/application/basilisk/base/content/urlbarBindings.xml +++ b/application/basilisk/base/content/urlbarBindings.xml @@ -56,11 +56,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. <field name="AppConstants" readonly="true"> (Components.utils.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants; </field> -#ifdef MOZ_WEBEXTENSIONS - <field name="ExtensionSearchHandler" readonly="true"> - (Components.utils.import("resource://gre/modules/ExtensionSearchHandler.jsm", {})).ExtensionSearchHandler; - </field> -#endif <constructor><![CDATA[ this._prefs = Components.classes["@mozilla.org/preferences-service;1"] @@ -488,15 +483,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. actionDetails ); break; -#ifdef MOZ_WEBEXTENSIONS - case "extension": - this.handleRevert(); - // Give the extension control of handling the command. - let searchString = action.params.content; - let keyword = action.params.keyword; - this.ExtensionSearchHandler.handleInputEntered(keyword, searchString, where); - return; -#endif } } else { // This is a fallback for add-ons and old testing code that directly @@ -554,6 +540,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Cu.reportError(ex); } + // Reset DOS mitigations for the basic auth prompt. + delete browser.authPromptCounter; + let params = { postData, allowThirdPartyFixup: true, @@ -1214,11 +1203,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. this._clearNoActions(); this.formatValue(); } -#ifdef MOZ_WEBEXTENSIONS - if (ExtensionSearchHandler.hasActiveInputSession()) { - ExtensionSearchHandler.handleInputCancelled(); - } -#endif ]]></handler> <handler event="dragstart" phase="capturing"><![CDATA[ diff --git a/application/basilisk/base/content/utilityOverlay.js b/application/basilisk/base/content/utilityOverlay.js index 38ca82f55..3d27f7d27 100644 --- a/application/basilisk/base/content/utilityOverlay.js +++ b/application/basilisk/base/content/utilityOverlay.js @@ -5,7 +5,6 @@ // Services = object with smart getters for common XPCOM services Components.utils.import("resource://gre/modules/AppConstants.jsm"); -Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); @@ -18,6 +17,9 @@ XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService", "@mozilla.org/browser/aboutnewtab-service;1", "nsIAboutNewTabService"); +XPCOMUtils.defineLazyModuleGetter(this, "Deprecated", + "resource://gre/modules/Deprecated.jsm"); + this.__defineGetter__("BROWSER_NEW_TAB_URL", () => { if (PrivateBrowsingUtils.isWindowPrivate(window) && !PrivateBrowsingUtils.permanentPrivateBrowsing && @@ -35,7 +37,7 @@ var gBidiUI = false; * Determines whether the given url is considered a special URL for new tabs. */ function isBlankPageURL(aURL) { - return aURL == "about:blank" || aURL == "about:newtab" || aURL == "about:logopage"; + return aURL == "about:blank" || aURL == BROWSER_NEW_TAB_URL || aURL == "about:logopage"; } function getBrowserURL() @@ -43,6 +45,13 @@ function getBrowserURL() return "chrome://browser/content/browser.xul"; } +function getBoolPref(pref, defaultValue) { + Deprecated.warning("getBoolPref is deprecated and will be removed in a future release. " + + "You should use Services.pref.getBoolPref (Services.jsm).", + "https://github.com/MoonchildProductions/UXP/issues/989"); + return Services.prefs.getBoolPref(pref, defaultValue); +} + function getTopWin(skipPopups) { // If this is called in a browser window, use that window regardless of // whether it's the frontmost window, since commands can be executed in @@ -61,16 +70,6 @@ function openTopWin(url) { openUILinkIn(url, "current"); } -function getBoolPref(prefname, def) -{ - try { - return Services.prefs.getBoolPref(prefname); - } - catch (er) { - return def; - } -} - /* openUILink handles clicks on UI elements that cause URLs to load. * * As the third argument, you may pass an object with the same properties as @@ -137,7 +136,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt ) // ignoreButton allows "middle-click paste" to use function without always opening in a new window. var middle = !ignoreButton && e.button == 1; - var middleUsesTabs = getBoolPref("browser.tabs.opentabfor.middleclick", true); + var middleUsesTabs = Services.prefs.getBoolPref("browser.tabs.opentabfor.middleclick", true); // Don't do anything special with right-mouse clicks. They're probably clicks on context menu items. @@ -145,7 +144,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt ) if (metaKey || (middle && middleUsesTabs)) return shift ? "tabshifted" : "tab"; - if (alt && getBoolPref("browser.altClickSave", false)) + if (alt && Services.prefs.getBoolPref("browser.altClickSave", false)) return "save"; if (shift || (middle && !middleUsesTabs)) @@ -176,7 +175,6 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt ) * skipTabAnimation (boolean) * allowPinnedTabHostChange (boolean) * allowPopups (boolean) - * userContextId (unsigned int) */ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI) { var params; @@ -222,7 +220,6 @@ function openLinkIn(url, where, params) { var aAllowPinnedTabHostChange = !!params.allowPinnedTabHostChange; var aNoReferrer = params.noReferrer; var aAllowPopups = !!params.allowPopups; - var aUserContextId = params.userContextId; var aIndicateErrorPageLoad = params.indicateErrorPageLoad; var aPrincipal = params.originPrincipal; var aTriggeringPrincipal = params.triggeringPrincipal; @@ -268,7 +265,6 @@ function openLinkIn(url, where, params) { function useOAForPrincipal(principal) { if (principal && principal.isCodebasePrincipal) { let attrs = { - userContextId: aUserContextId, privateBrowsingId: aIsPrivate || (w && PrivateBrowsingUtils.isWindowPrivate(w)), }; return Services.scriptSecurityManager.createCodebasePrincipal(principal.URI, attrs); @@ -315,17 +311,12 @@ function openLinkIn(url, where, params) { createInstance(Ci.nsISupportsPRUint32); referrerPolicySupports.data = aReferrerPolicy; - var userContextIdSupports = Cc["@mozilla.org/supports-PRUint32;1"]. - createInstance(Ci.nsISupportsPRUint32); - userContextIdSupports.data = aUserContextId; - sa.appendElement(wuri, /* weak =*/ false); sa.appendElement(charset, /* weak =*/ false); sa.appendElement(referrerURISupports, /* weak =*/ false); sa.appendElement(aPostData, /* weak =*/ false); sa.appendElement(allowThirdPartyFixupSupports, /* weak =*/ false); sa.appendElement(referrerPolicySupports, /* weak =*/ false); - sa.appendElement(userContextIdSupports, /* weak =*/ false); sa.appendElement(aPrincipal, /* weak =*/ false); sa.appendElement(aTriggeringPrincipal, /* weak =*/ false); @@ -342,7 +333,7 @@ function openLinkIn(url, where, params) { if (loadInBackground == null) { loadInBackground = aFromChrome ? false : - getBoolPref("browser.tabs.loadInBackground"); + Services.prefs.getBoolPref("browser.tabs.loadInBackground"); } let uriObj; @@ -418,8 +409,7 @@ function openLinkIn(url, where, params) { flags: flags, referrerURI: aNoReferrer ? null : aReferrerURI, referrerPolicy: aReferrerPolicy, - postData: aPostData, - userContextId: aUserContextId + postData: aPostData }); browserUsedForLoad = aCurrentBrowser; break; @@ -438,7 +428,6 @@ function openLinkIn(url, where, params) { skipAnimation: aSkipTabAnimation, allowMixedContent: aAllowMixedContent, noReferrer: aNoReferrer, - userContextId: aUserContextId, originPrincipal: aPrincipal, triggeringPrincipal: aTriggeringPrincipal, }); @@ -482,74 +471,6 @@ function checkForMiddleClick(node, event) { } } -// Populate a menu with user-context menu items. This method should be called -// by onpopupshowing passing the event as first argument. -function createUserContextMenu(event, isContextMenu = false, excludeUserContextId = 0) { - while (event.target.hasChildNodes()) { - event.target.removeChild(event.target.firstChild); - } - - let bundle = document.getElementById("bundle_browser"); - let docfrag = document.createDocumentFragment(); - - // If we are excluding a userContextId, we want to add a 'no-container' item. - if (excludeUserContextId) { - let menuitem = document.createElement("menuitem"); - menuitem.setAttribute("data-usercontextid", "0"); - menuitem.setAttribute("label", bundle.getString("userContextNone.label")); - menuitem.setAttribute("accesskey", bundle.getString("userContextNone.accesskey")); - - // We don't set an oncommand/command attribute because if we have - // to exclude a userContextId we are generating the contextMenu and - // isContextMenu will be true. - - docfrag.appendChild(menuitem); - - let menuseparator = document.createElement("menuseparator"); - docfrag.appendChild(menuseparator); - } - - ContextualIdentityService.getIdentities().forEach(identity => { - if (identity.userContextId == excludeUserContextId) { - return; - } - - let menuitem = document.createElement("menuitem"); - menuitem.setAttribute("data-usercontextid", identity.userContextId); - menuitem.setAttribute("label", ContextualIdentityService.getUserContextLabel(identity.userContextId)); - - if (identity.accessKey) { - menuitem.setAttribute("accesskey", bundle.getString(identity.accessKey)); - } - - menuitem.classList.add("menuitem-iconic"); - menuitem.setAttribute("data-identity-color", identity.color); - - if (!isContextMenu) { - menuitem.setAttribute("command", "Browser:NewUserContextTab"); - } - - menuitem.setAttribute("data-identity-icon", identity.icon); - - docfrag.appendChild(menuitem); - }); - - if (!isContextMenu) { - docfrag.appendChild(document.createElement("menuseparator")); - - let menuitem = document.createElement("menuitem"); - menuitem.setAttribute("label", - bundle.getString("userContext.aboutPage.label")); - menuitem.setAttribute("accesskey", - bundle.getString("userContext.aboutPage.accesskey")); - menuitem.setAttribute("command", "Browser:OpenAboutContainers"); - docfrag.appendChild(menuitem); - } - - event.target.appendChild(docfrag); - return true; -} - // Closes all popups that are ancestors of the node. function closeMenus(node) { @@ -652,7 +573,7 @@ function getShellService() function isBidiEnabled() { // first check the pref. - if (getBoolPref("bidi.browser.ui", false)) + if (Services.prefs.getBoolPref("bidi.browser.ui", false)) return true; // then check intl.uidirection.<locale> @@ -914,7 +835,7 @@ function openHelpLink(aHelpTopic, aCalledFromModal, aWhere) { function openPrefsHelp() { // non-instant apply prefwindows are usually modal, so we can't open in the topmost window, // since its probably behind the window. - var instantApply = getBoolPref("browser.preferences.instantApply"); + var instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply"); var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic; openHelpLink(helpTopic, !instantApply); diff --git a/application/basilisk/base/content/web-panels.xul b/application/basilisk/base/content/web-panels.xul index 223b20ed7..78f8954c1 100644 --- a/application/basilisk/base/content/web-panels.xul +++ b/application/basilisk/base/content/web-panels.xul @@ -23,7 +23,6 @@ <script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/> <script type="application/javascript" src="chrome://browser/content/browser.js"/> <script type="application/javascript" src="chrome://browser/content/browser-places.js"/> - <script type="application/javascript" src="chrome://browser/content/browser-fxaccounts.js"/> <script type="application/javascript" src="chrome://browser/content/nsContextMenu.js"/> <script type="application/javascript" src="chrome://browser/content/web-panels.js"/> @@ -44,6 +43,21 @@ disabled="true"/> <command id="Browser:Stop" oncommand="PanelBrowserStop();"/> <command id="Browser:Reload" oncommand="PanelBrowserReload();"/> + <command id="Browser:BackOrBackDuplicate" + oncommand="getPanelBrowser().webNavigation.goBack(event);" + disabled="true"> + <observes element="Browser:Back" attribute="disabled"/> + </command> + <command id="Browser:ForwardOrForwardDuplicate" + oncommand="getPanelBrowser().webNavigation.goForward(event);" + disabled="true"> + <observes element="Browser:Forward" attribute="disabled"/> + </command> + <command id="Browser:ReloadOrDuplicate" + oncommand="PanelBrowserReload(event)" + disabled="true"> + <observes element="Browser:Reload" attribute="disabled"/> + </command> </commandset> <popupset id="mainPopupSet"> diff --git a/application/basilisk/base/jar.mn b/application/basilisk/base/jar.mn index 5ec92d79a..f546ec4bd 100644 --- a/application/basilisk/base/jar.mn +++ b/application/basilisk/base/jar.mn @@ -15,7 +15,6 @@ browser.jar: * content/browser/aboutDialog.xul (content/aboutDialog.xul) content/browser/aboutDialog.js (content/aboutDialog.js) content/browser/aboutDialog.css (content/aboutDialog.css) - content/browser/aboutRobots.xhtml (content/aboutRobots.xhtml) * content/browser/abouthome/aboutHome.xhtml (content/abouthome/aboutHome.xhtml) content/browser/abouthome/aboutHome.js (content/abouthome/aboutHome.js) * content/browser/abouthome/aboutHome.css (content/abouthome/aboutHome.css) @@ -25,7 +24,9 @@ browser.jar: content/browser/abouthome/bookmarks.png (content/abouthome/bookmarks.png) content/browser/abouthome/history.png (content/abouthome/history.png) content/browser/abouthome/addons.png (content/abouthome/addons.png) +#ifdef MOZ_SERVICES_SYNC content/browser/abouthome/sync.png (content/abouthome/sync.png) +#endif content/browser/abouthome/settings.png (content/abouthome/settings.png) content/browser/abouthome/restore.png (content/abouthome/restore.png) content/browser/abouthome/restore-large.png (content/abouthome/restore-large.png) @@ -36,7 +37,9 @@ browser.jar: content/browser/abouthome/bookmarks@2x.png (content/abouthome/bookmarks@2x.png) content/browser/abouthome/history@2x.png (content/abouthome/history@2x.png) content/browser/abouthome/addons@2x.png (content/abouthome/addons@2x.png) +#ifdef MOZ_SERVICES_SYNC content/browser/abouthome/sync@2x.png (content/abouthome/sync@2x.png) +#endif content/browser/abouthome/settings@2x.png (content/abouthome/settings@2x.png) content/browser/abouthome/restore@2x.png (content/abouthome/restore@2x.png) content/browser/abouthome/restore-large@2x.png (content/abouthome/restore-large@2x.png) @@ -49,18 +52,6 @@ browser.jar: content/browser/abouthealthreport/abouthealth.js (content/abouthealthreport/abouthealth.js) content/browser/abouthealthreport/abouthealth.css (content/abouthealthreport/abouthealth.css) #endif - content/browser/aboutaccounts/aboutaccounts.xhtml (content/aboutaccounts/aboutaccounts.xhtml) - content/browser/aboutaccounts/aboutaccounts.js (content/aboutaccounts/aboutaccounts.js) - content/browser/aboutaccounts/aboutaccounts.css (content/aboutaccounts/aboutaccounts.css) - content/browser/aboutaccounts/main.css (content/aboutaccounts/main.css) - content/browser/aboutaccounts/normalize.css (content/aboutaccounts/normalize.css) - content/browser/aboutaccounts/images/fox.png (content/aboutaccounts/images/fox.png) - content/browser/aboutaccounts/images/graphic_sync_intro.png (content/aboutaccounts/images/graphic_sync_intro.png) - content/browser/aboutaccounts/images/graphic_sync_intro@2x.png (content/aboutaccounts/images/graphic_sync_intro@2x.png) - - - content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png) - content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png) content/browser/aboutTabCrashed.css (content/aboutTabCrashed.css) content/browser/aboutTabCrashed.js (content/aboutTabCrashed.js) content/browser/aboutTabCrashed.xhtml (content/aboutTabCrashed.xhtml) @@ -72,21 +63,18 @@ browser.jar: content/browser/browser-ctrlTab.js (content/browser-ctrlTab.js) content/browser/browser-customization.js (content/browser-customization.js) content/browser/browser-data-submission-info-bar.js (content/browser-data-submission-info-bar.js) - content/browser/browser-devedition.js (content/browser-devedition.js) content/browser/browser-feeds.js (content/browser-feeds.js) content/browser/browser-fullScreenAndPointerLock.js (content/browser-fullScreenAndPointerLock.js) content/browser/browser-fullZoom.js (content/browser-fullZoom.js) - content/browser/browser-fxaccounts.js (content/browser-fxaccounts.js) content/browser/browser-gestureSupport.js (content/browser-gestureSupport.js) * content/browser/browser-media.js (content/browser-media.js) - content/browser/browser-places.js (content/browser-places.js) +* content/browser/browser-places.js (content/browser-places.js) content/browser/browser-plugins.js (content/browser-plugins.js) content/browser/browser-refreshblocker.js (content/browser-refreshblocker.js) #ifdef MOZ_SAFE_BROWSING content/browser/browser-safebrowsing.js (content/browser-safebrowsing.js) #endif content/browser/browser-sidebar.js (content/browser-sidebar.js) -* content/browser/browser-syncui.js (content/browser-syncui.js) * content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) #ifdef CAN_DRAW_IN_TITLEBAR content/browser/browser-tabsintitlebar.js (content/browser-tabsintitlebar.js) @@ -95,7 +83,7 @@ browser.jar: #endif content/browser/browser-thumbnails.js (content/browser-thumbnails.js) content/browser/browser-trackingprotection.js (content/browser-trackingprotection.js) -* content/browser/tab-content.js (content/tab-content.js) + content/browser/tab-content.js (content/tab-content.js) content/browser/content.js (content/content.js) content/browser/defaultthemes/1.footer.jpg (content/defaultthemes/1.footer.jpg) content/browser/defaultthemes/1.header.jpg (content/defaultthemes/1.header.jpg) @@ -125,8 +113,6 @@ browser.jar: 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/newtab/newTab.inadjacent.json (content/newtab/newTab.inadjacent.json) - content/browser/newtab/alternativeDefaultSites.json (content/newtab/alternativeDefaultSites.json) * content/browser/pageinfo/pageInfo.xul (content/pageinfo/pageInfo.xul) content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js) content/browser/pageinfo/pageInfo.css (content/pageinfo/pageInfo.css) @@ -135,21 +121,6 @@ browser.jar: content/browser/pageinfo/feeds.xml (content/pageinfo/feeds.xml) content/browser/pageinfo/permissions.js (content/pageinfo/permissions.js) content/browser/pageinfo/security.js (content/pageinfo/security.js) - content/browser/sync/aboutSyncTabs.xul (content/sync/aboutSyncTabs.xul) -* content/browser/sync/aboutSyncTabs.js (content/sync/aboutSyncTabs.js) - content/browser/sync/aboutSyncTabs.css (content/sync/aboutSyncTabs.css) - content/browser/sync/aboutSyncTabs-bindings.xml (content/sync/aboutSyncTabs-bindings.xml) - content/browser/sync/setup.xul (content/sync/setup.xul) - content/browser/sync/addDevice.js (content/sync/addDevice.js) - content/browser/sync/addDevice.xul (content/sync/addDevice.xul) - content/browser/sync/setup.js (content/sync/setup.js) - content/browser/sync/genericChange.xul (content/sync/genericChange.xul) - content/browser/sync/genericChange.js (content/sync/genericChange.js) - content/browser/sync/key.xhtml (content/sync/key.xhtml) - content/browser/sync/utils.js (content/sync/utils.js) - content/browser/sync/customize.xul (content/sync/customize.xul) - content/browser/sync/customize.js (content/sync/customize.js) - content/browser/sync/customize.css (content/sync/customize.css) content/browser/safeMode.css (content/safeMode.css) content/browser/safeMode.js (content/safeMode.js) content/browser/safeMode.xul (content/safeMode.xul) @@ -161,7 +132,7 @@ browser.jar: content/browser/contentSearchUI.css (content/contentSearchUI.css) content/browser/tabbrowser.css (content/tabbrowser.css) content/browser/tabbrowser.xml (content/tabbrowser.xml) -* content/browser/urlbarBindings.xml (content/urlbarBindings.xml) + content/browser/urlbarBindings.xml (content/urlbarBindings.xml) content/browser/utilityOverlay.js (content/utilityOverlay.js) content/browser/usercontext.svg (content/usercontext.svg) content/browser/web-panels.js (content/web-panels.js) diff --git a/application/basilisk/branding/official/branding.nsi b/application/basilisk/branding/official/branding.nsi index 58d7554df..250abd84d 100644 --- a/application/basilisk/branding/official/branding.nsi +++ b/application/basilisk/branding/official/branding.nsi @@ -12,39 +12,5 @@ !define CompanyName "Moonchild Productions" !define URLInfoAbout "https://www.basilisk-browser.org" !define URLUpdateInfo "https://www.basilisk-browser.org/releasenotes.shtml" -!define HelpLink "https://www.basilisk-browser.org" - -; The OFFICIAL define is a workaround to support different urls for Release and -; Beta since they share the same branding when building with other branches that -; set the update channel to beta. -!define OFFICIAL -!define URLStubDownload "" -!define URLManualDownload "" -!define URLSystemRequirements "http://www.basilisk-browser.org/requirements.shtml" -!define Channel "release" - -# The installer's certificate name and issuer expected by the stub installer -!define CertNameDownload "" -!define CertIssuerDownload "" - -# Dialog units are used so the UI displays correctly with the system's DPI -# settings. -# The dialog units for the bitmap's dimensions should match exactly with the -# bitmap's width and height in pixels. -!define APPNAME_BMP_WIDTH_DU "134u" -!define APPNAME_BMP_HEIGHT_DU "36u" -!define INTRO_BLURB_WIDTH_DU "258u" -!define INTRO_BLURB_EDGE_DU "170u" -!define INTRO_BLURB_LTR_TOP_DU "20u" -!define INTRO_BLURB_RTL_TOP_DU "12u" - -# UI Colors that can be customized for each channel -!define FOOTER_CONTROL_TEXT_COLOR_NORMAL 0x000000 -!define FOOTER_CONTROL_TEXT_COLOR_FADED 0x666666 -!define FOOTER_BKGRD_COLOR 0xFFFFFF -!define INTRO_BLURB_TEXT_COLOR 0x666666 -!define INSTALL_BLURB_TEXT_COLOR 0x666666 -!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0x666666 -!define COMMON_TEXT_COLOR_NORMAL 0x000000 -!define COMMON_TEXT_COLOR_FADED 0x666666 -!define COMMON_BKGRD_COLOR 0xF0F0F0 +!define HelpLink "https://www.basilisk-browser.org/contact.shtml" +!define URLSystemRequirements "https://www.basilisk-browser.org/requirements.shtml" diff --git a/application/basilisk/branding/official/disk.icns b/application/basilisk/branding/official/disk.icns Binary files differindex 82fdccff8..bb3fdd5e4 100644 --- a/application/basilisk/branding/official/disk.icns +++ b/application/basilisk/branding/official/disk.icns diff --git a/application/basilisk/branding/official/document.icns b/application/basilisk/branding/official/document.icns Binary files differindex 5f03305d7..388296713 100644 --- a/application/basilisk/branding/official/document.icns +++ b/application/basilisk/branding/official/document.icns diff --git a/application/basilisk/branding/official/firefox.icns b/application/basilisk/branding/official/firefox.icns Binary files differindex 4d2ad5a04..8b9232cba 100644 --- a/application/basilisk/branding/official/firefox.icns +++ b/application/basilisk/branding/official/firefox.icns diff --git a/application/basilisk/branding/official/pref/basilisk-branding.js b/application/basilisk/branding/official/pref/basilisk-branding.js index 190b84e78..946902f88 100644 --- a/application/basilisk/branding/official/pref/basilisk-branding.js +++ b/application/basilisk/branding/official/pref/basilisk-branding.js @@ -11,7 +11,7 @@ #define BRANDING_RELNOTESPATH releasenotes.shtml #define BRANDING_FIRSTRUNPATH firstrun/ #define BRANDING_APPUPDATEURL aus.@BRANDING_BASEURL@ -#define BRANDING_APPUPDATEPATH ?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&buildid=%BUILD_ID%&channel=%CHANNEL% +#define BRANDING_APPUPDATEPATH ?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&toolkit=%WIDGET_TOOLKIT%&buildid=%BUILD_ID%&channel=%CHANNEL% // Shared Branding Preferences // XXX: These should REALLY go back to application preferences diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc index fb0e6b79b..307d889d9 100644 --- a/application/basilisk/branding/shared/uaoverrides.inc +++ b/application/basilisk/branding/shared/uaoverrides.inc @@ -26,6 +26,7 @@ pref("@GUAO_PREF@.addons.mozilla.org", "Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) // Required for domains that have proven unresponsive to requests from users
pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (@OS_SLICE@ rv:42.0) @GK_SLICE@ Firefox/42.0 @APP_SLICE@");
pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (@OS_SLICE@ rv:42.0) @GK_SLICE@ Firefox/42.0");
+pref("@GUAO_PREF@.netflix.com","Mozilla/5.0 (@OS_SLICE@ rv:42.0) @GK_SLICE@ Firefox/42.0 @APP_SLICE@");
// The never-ending Facebook debacle...
@@ -36,6 +37,7 @@ 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.
// UA-Sniffing domains below have indicated no interest in supporting Pale Moon (BOO!)
+pref("@GUAO_PREF@.whatsapp.com","Mozilla/5.0 (@OS_SLICE@ rv:61.0) @GK_SLICE@ Firefox/61.0");
// UA-sniffing domains that are "app/vendor-specific" and do not like Pale Moon
diff --git a/application/basilisk/branding/unofficial/branding.nsi b/application/basilisk/branding/unofficial/branding.nsi index 77f08a4cb..586dd0074 100644 --- a/application/basilisk/branding/unofficial/branding.nsi +++ b/application/basilisk/branding/unofficial/branding.nsi @@ -10,36 +10,7 @@ # instead of BrandFullName and typically should not be modified. !define BrandFullNameInternal "Serpent" !define CompanyName "Moonchild Productions" -!define URLInfoAbout "http://www.basilisk-browser.org" +!define URLInfoAbout "https://www.basilisk-browser.org" +!define URLUpdateInfo "https://www.basilisk-browser.org" !define HelpLink "https://forum.palemoon.org" - -!define URLStubDownload "" -!define URLManualDownload "" -!define URLSystemRequirements "" -!define Channel "unofficial" - -# The installer's certificate name and issuer expected by the stub installer -!define CertNameDownload "" -!define CertIssuerDownload "" - -# Dialog units are used so the UI displays correctly with the system's DPI -# settings. -# The dialog units for the bitmap's dimensions should match exactly with the -# bitmap's width and height in pixels. -!define APPNAME_BMP_WIDTH_DU 159u -!define APPNAME_BMP_HEIGHT_DU 50u -!define INTRO_BLURB_WIDTH_DU "230u" -!define INTRO_BLURB_EDGE_DU "198u" -!define INTRO_BLURB_LTR_TOP_DU "16u" -!define INTRO_BLURB_RTL_TOP_DU "11u" - -# UI Colors that can be customized for each channel -!define FOOTER_CONTROL_TEXT_COLOR_NORMAL 0x000000 -!define FOOTER_CONTROL_TEXT_COLOR_FADED 0x999999 -!define FOOTER_BKGRD_COLOR 0xFFFFFF -!define INTRO_BLURB_TEXT_COLOR 0xFFFFFF -!define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF -!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF -!define COMMON_TEXT_COLOR_NORMAL 0xFFFFFF -!define COMMON_TEXT_COLOR_FADED 0xA1AAB3 -!define COMMON_BKGRD_COLOR 0x0F1B26 +!define URLSystemRequirements "https://www.basilisk-browser.org" diff --git a/application/basilisk/components/about/AboutRedirector.cpp b/application/basilisk/components/about/AboutRedirector.cpp index b77949ea7..d52b063e2 100644 --- a/application/basilisk/components/about/AboutRedirector.cpp +++ b/application/basilisk/components/about/AboutRedirector.cpp @@ -80,11 +80,6 @@ static RedirEntry kRedirMap[] = { nsIAboutModule::ALLOW_SCRIPT }, { - "robots", "chrome://browser/content/aboutRobots.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT - }, - { "searchreset", "chrome://browser/content/search/searchReset.xhtml", nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT @@ -97,10 +92,16 @@ static RedirEntry kRedirMap[] = { "welcomeback", "chrome://browser/content/aboutWelcomeBack.xhtml", nsIAboutModule::ALLOW_SCRIPT }, +#ifdef MOZ_SERVICES_SYNC + { + "sync-progress", "chrome://browser/content/sync/progress.xhtml", + nsIAboutModule::ALLOW_SCRIPT + }, { "sync-tabs", "chrome://browser/content/sync/aboutSyncTabs.xul", nsIAboutModule::ALLOW_SCRIPT }, +#endif { "home", "chrome://browser/content/abouthome/aboutHome.xhtml", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::URI_MUST_LOAD_IN_CHILD | @@ -128,10 +129,6 @@ static RedirEntry kRedirMap[] = { }, #endif { - "accounts", "chrome://browser/content/aboutaccounts/aboutaccounts.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { "reader", "chrome://global/content/reader/aboutReader.html", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT | diff --git a/application/basilisk/components/build/nsModule.cpp b/application/basilisk/components/build/nsModule.cpp index 1baccd710..3fdde8823 100644 --- a/application/basilisk/components/build/nsModule.cpp +++ b/application/basilisk/components/build/nsModule.cpp @@ -94,16 +94,17 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = { { NS_ABOUT_MODULE_CONTRACTID_PREFIX "feeds", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "privatebrowsing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "rights", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "robots", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "searchreset", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "welcomeback", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, +#ifdef MOZ_SERVICES_SYNC { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-tabs", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, + { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-progress", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, +#endif { NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "newtab", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "preferences", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, { NS_ABOUT_MODULE_CONTRACTID_PREFIX "downloads", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "accounts", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, #ifdef MOZ_SERVICES_HEALTHREPORT { NS_ABOUT_MODULE_CONTRACTID_PREFIX "healthreport", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, #endif diff --git a/application/basilisk/components/contextualidentity/content/usercontext.css b/application/basilisk/components/contextualidentity/content/usercontext.css deleted file mode 100644 index 728275d9f..000000000 --- a/application/basilisk/components/contextualidentity/content/usercontext.css +++ /dev/null @@ -1,91 +0,0 @@ -[data-identity-color="blue"] { - --identity-tab-color: #0996f8; - --identity-icon-color: #00a7e0; -} - -[data-identity-color="turquoise"] { - --identity-tab-color: #01bdad; - --identity-icon-color: #01bdad; -} - -[data-identity-color="green"] { - --identity-tab-color: #57bd35; - --identity-icon-color: #7dc14c; -} - -[data-identity-color="yellow"] { - --identity-tab-color: #ffcb00; - --identity-icon-color: #ffcb00; -} - -[data-identity-color="orange"] { - --identity-tab-color: #ff9216; - --identity-icon-color: #ff9216; -} - -[data-identity-color="red"] { - --identity-tab-color: #d92215; - --identity-icon-color: #d92215; -} - -[data-identity-color="pink"] { - --identity-tab-color: #ea385e; - --identity-icon-color: #ee5195; -} - -[data-identity-color="purple"] { - --identity-tab-color: #7a2f7a; - --identity-icon-color: #7a2f7a; -} - -[data-identity-icon="fingerprint"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#fingerprint"); -} - -[data-identity-icon="briefcase"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#briefcase"); -} - -[data-identity-icon="dollar"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#dollar"); -} - -[data-identity-icon="cart"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#cart"); -} - -[data-identity-icon="circle"] { - --identity-icon: url("chrome://browser/content/usercontext.svg#circle"); -} - -#userContext-indicator { - height: 16px; - width: 16px; -} - -#userContext-label { - margin-inline-end: 3px; - color: var(--identity-tab-color); -} - -#userContext-icons { - -moz-box-align: center; -} - -.tabbrowser-tab[usercontextid] { - background-image: linear-gradient(to right, transparent 20%, var(--identity-tab-color) 30%, var(--identity-tab-color) 70%, transparent 80%); - background-size: auto 2px; - background-repeat: no-repeat; -} - -.userContext-icon, -.menuitem-iconic[data-usercontextid] > .menu-iconic-left > .menu-iconic-icon, -.subviewbutton[usercontextid] > .toolbarbutton-icon, -#userContext-indicator { - background-image: var(--identity-icon); - filter: url(chrome://browser/skin/filters.svg#fill); - fill: var(--identity-icon-color); - background-size: contain; - background-repeat: no-repeat; - background-position: center center; -} diff --git a/application/basilisk/components/contextualidentity/jar.mn b/application/basilisk/components/contextualidentity/jar.mn deleted file mode 100644 index 848245949..000000000 --- a/application/basilisk/components/contextualidentity/jar.mn +++ /dev/null @@ -1,6 +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/. - -browser.jar: - content/browser/usercontext/usercontext.css (content/usercontext.css) diff --git a/application/basilisk/components/customizableui/CustomizableUI.jsm b/application/basilisk/components/customizableui/CustomizableUI.jsm index cb0f519b2..ce395121c 100644 --- a/application/basilisk/components/customizableui/CustomizableUI.jsm +++ b/application/basilisk/components/customizableui/CustomizableUI.jsm @@ -38,7 +38,6 @@ const kPrefCustomizationState = "browser.uiCustomization.state"; const kPrefCustomizationAutoAdd = "browser.uiCustomization.autoAdd"; const kPrefCustomizationDebug = "browser.uiCustomization.debug"; const kPrefDrawInTitlebar = "browser.tabs.drawInTitlebar"; -const kPrefWebIDEInNavbar = "devtools.webide.widget.inNavbarByDefault"; const kExpectedWindowURL = "chrome://browser/content/browser.xul"; @@ -158,10 +157,7 @@ var gUIStateBeforeReset = { XPCOMUtils.defineLazyGetter(this, "log", () => { let scope = {}; Cu.import("resource://gre/modules/Console.jsm", scope); - let debug; - try { - debug = Services.prefs.getBoolPref(kPrefCustomizationDebug); - } catch (ex) {} + let debug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false); let consoleOptions = { maxLogLevel: debug ? "all" : "log", prefix: "CustomizableUI", @@ -200,12 +196,9 @@ var CustomizableUIInternal = { "find-button", "preferences-button", "add-ons-button", - "sync-button", ]; - if (!AppConstants.MOZ_DEV_EDITION) { - panelPlacements.splice(-1, 0, "developer-button"); - } + panelPlacements.splice(-1, 0, "developer-button"); let showCharacterEncoding = Services.prefs.getComplexValue( "browser.menu.showCharacterEncoding", @@ -230,14 +223,6 @@ var CustomizableUIInternal = { "home-button", ]; - if (AppConstants.MOZ_DEV_EDITION) { - navbarPlacements.splice(2, 0, "developer-button"); - } - - if (Services.prefs.getBoolPref(kPrefWebIDEInNavbar)) { - navbarPlacements.push("webide-button"); - } - // Place this last, when createWidget is called for pocket, it will // append to the toolbar. if (Services.prefs.getPrefType("extensions.pocket.enabled") != Services.prefs.PREF_INVALID && @@ -1915,16 +1900,10 @@ var CustomizableUIInternal = { // state immediately when a browser window opens, which is important for // other consumers of this API. loadSavedState: function() { - let state = null; - try { - state = Services.prefs.getCharPref(kPrefCustomizationState); - } catch (e) { - log.debug("No saved state found"); - // This will fail if nothing has been customized, so silently fall back to - // the defaults. - } - + let state = Services.prefs.getCharPref(kPrefCustomizationState, ""); if (!state) { + log.debug("No saved state found"); + // Nothing has been customized, so silently fall back to the defaults. return; } try { @@ -2209,10 +2188,7 @@ var CustomizableUIInternal = { this.notifyListeners("onWidgetAdded", widget.id, widget.currentArea, widget.currentPosition); } else if (widgetMightNeedAutoAdding) { - let autoAdd = true; - try { - autoAdd = Services.prefs.getBoolPref(kPrefCustomizationAutoAdd); - } catch (e) {} + let autoAdd = Services.prefs.getBoolPref(kPrefCustomizationAutoAdd, true); // If the widget doesn't have an existing placement, and it hasn't been // seen before, then add it to its default area so it can be used. diff --git a/application/basilisk/components/customizableui/CustomizableWidgets.jsm b/application/basilisk/components/customizableui/CustomizableWidgets.jsm index 642e06f0f..d4a191a97 100644 --- a/application/basilisk/components/customizableui/CustomizableWidgets.jsm +++ b/application/basilisk/components/customizableui/CustomizableWidgets.jsm @@ -23,10 +23,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu", "resource://gre/modules/CharsetMenu.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "SyncedTabs", - "resource://services-sync/SyncedTabs.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", - "resource://gre/modules/ContextualIdentityService.jsm"); XPCOMUtils.defineLazyGetter(this, "CharsetBundle", function() { const kCharsetBundle = "chrome://global/locale/charsetMenu.properties"; @@ -44,10 +40,7 @@ const kWidePanelItemClass = "panel-wide-item"; XPCOMUtils.defineLazyGetter(this, "log", () => { let scope = {}; Cu.import("resource://gre/modules/Console.jsm", scope); - let debug; - try { - debug = Services.prefs.getBoolPref(kPrefCustomizationDebug); - } catch (ex) {} + let debug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false); let consoleOptions = { maxLogLevel: debug ? "all" : "log", prefix: "CustomizableWidgets", @@ -290,215 +283,6 @@ const CustomizableWidgets = [ log.debug("History view is being hidden!"); } }, { - id: "sync-button", - label: "remotetabs-panelmenu.label", - tooltiptext: "remotetabs-panelmenu.tooltiptext2", - type: "view", - viewId: "PanelUI-remotetabs", - defaultArea: CustomizableUI.AREA_PANEL, - deckIndices: { - DECKINDEX_TABS: 0, - DECKINDEX_TABSDISABLED: 1, - DECKINDEX_FETCHING: 2, - DECKINDEX_NOCLIENTS: 3, - }, - onCreated(aNode) { - // Add an observer to the button so we get the animation during sync. - // (Note the observer sets many attributes, including label and - // tooltiptext, but we only want the 'syncstatus' attribute for the - // animation) - let doc = aNode.ownerDocument; - let obnode = doc.createElementNS(kNSXUL, "observes"); - obnode.setAttribute("element", "sync-status"); - obnode.setAttribute("attribute", "syncstatus"); - aNode.appendChild(obnode); - - // A somewhat complicated dance to format the mobilepromo label. - let bundle = doc.getElementById("bundle_browser"); - let formatArgs = ["android", "ios"].map(os => { - let link = doc.createElement("label"); - link.textContent = bundle.getString(`appMenuRemoteTabs.mobilePromo.${os}`); - link.setAttribute("mobile-promo-os", os); - link.className = "text-link remotetabs-promo-link"; - return link.outerHTML; - }); - let promoParentElt = doc.getElementById("PanelUI-remotetabs-mobile-promo"); - // Put it all together... - let contents = bundle.getFormattedString("appMenuRemoteTabs.mobilePromo.text2", formatArgs); - promoParentElt.innerHTML = contents; - // We manually manage the "click" event to open the promo links because - // allowing the "text-link" widget handle it has 2 problems: (1) it only - // supports button 0 and (2) it's tricky to intercept when it does the - // open and auto-close the panel. (1) can probably be fixed, but (2) is - // trickier without hard-coding here the knowledge of exactly what buttons - // it does support. - // So we allow left and middle clicks to open the link in a new tab and - // close the panel; not setting a "href" attribute prevents the text-link - // widget handling it, and we build the final URL in the click handler to - // make testing easier (ie, so tests can change the pref after the links - // were created and have the new pref value used.) - promoParentElt.addEventListener("click", e => { - let os = e.target.getAttribute("mobile-promo-os"); - if (!os || e.button > 1) { - return; - } - let link = Services.prefs.getCharPref(`identity.mobilepromo.${os}`) + "synced-tabs"; - doc.defaultView.openUILinkIn(link, "tab"); - CustomizableUI.hidePanelForNode(e.target); - }); - }, - onViewShowing(aEvent) { - let doc = aEvent.target.ownerDocument; - this._tabsList = doc.getElementById("PanelUI-remotetabs-tabslist"); - Services.obs.addObserver(this, SyncedTabs.TOPIC_TABS_CHANGED, false); - - if (SyncedTabs.isConfiguredToSyncTabs) { - if (SyncedTabs.hasSyncedThisSession) { - this.setDeckIndex(this.deckIndices.DECKINDEX_TABS); - } else { - // Sync hasn't synced tabs yet, so show the "fetching" panel. - this.setDeckIndex(this.deckIndices.DECKINDEX_FETCHING); - } - // force a background sync. - SyncedTabs.syncTabs().catch(ex => { - Cu.reportError(ex); - }); - // show the current list - it will be updated by our observer. - this._showTabs(); - } else { - // not configured to sync tabs, so no point updating the list. - this.setDeckIndex(this.deckIndices.DECKINDEX_TABSDISABLED); - } - }, - onViewHiding() { - Services.obs.removeObserver(this, SyncedTabs.TOPIC_TABS_CHANGED); - this._tabsList = null; - }, - _tabsList: null, - observe(subject, topic, data) { - switch (topic) { - case SyncedTabs.TOPIC_TABS_CHANGED: - this._showTabs(); - break; - default: - break; - } - }, - setDeckIndex(index) { - let deck = this._tabsList.ownerDocument.getElementById("PanelUI-remotetabs-deck"); - // We call setAttribute instead of relying on the XBL property setter due - // to things going wrong when we try and set the index before the XBL - // binding has been created - see bug 1241851 for the gory details. - deck.setAttribute("selectedIndex", index); - }, - - _showTabsPromise: Promise.resolve(), - // Update the tab list after any existing in-flight updates are complete. - _showTabs() { - this._showTabsPromise = this._showTabsPromise.then(() => { - return this.__showTabs(); - }); - }, - // Return a new promise to update the tab list. - __showTabs() { - let doc = this._tabsList.ownerDocument; - return SyncedTabs.getTabClients().then(clients => { - // The view may have been hidden while the promise was resolving. - if (!this._tabsList) { - return; - } - if (clients.length === 0 && !SyncedTabs.hasSyncedThisSession) { - // the "fetching tabs" deck is being shown - let's leave it there. - // When that first sync completes we'll be notified and update. - return; - } - - if (clients.length === 0) { - this.setDeckIndex(this.deckIndices.DECKINDEX_NOCLIENTS); - return; - } - - this.setDeckIndex(this.deckIndices.DECKINDEX_TABS); - this._clearTabList(); - SyncedTabs.sortTabClientsByLastUsed(clients, 50 /* maxTabs */); - let fragment = doc.createDocumentFragment(); - - for (let client of clients) { - // add a menu separator for all clients other than the first. - if (fragment.lastChild) { - let separator = doc.createElementNS(kNSXUL, "menuseparator"); - fragment.appendChild(separator); - } - this._appendClient(client, fragment); - } - this._tabsList.appendChild(fragment); - }).catch(err => { - Cu.reportError(err); - }).then(() => { - // an observer for tests. - Services.obs.notifyObservers(null, "synced-tabs-menu:test:tabs-updated", null); - }); - }, - _clearTabList () { - let list = this._tabsList; - while (list.lastChild) { - list.lastChild.remove(); - } - }, - _showNoClientMessage() { - this._appendMessageLabel("notabslabel"); - }, - _appendMessageLabel(messageAttr, appendTo = null) { - if (!appendTo) { - appendTo = this._tabsList; - } - let message = this._tabsList.getAttribute(messageAttr); - let doc = this._tabsList.ownerDocument; - let messageLabel = doc.createElementNS(kNSXUL, "label"); - messageLabel.textContent = message; - appendTo.appendChild(messageLabel); - return messageLabel; - }, - _appendClient: function (client, attachFragment) { - let doc = attachFragment.ownerDocument; - // Create the element for the remote client. - let clientItem = doc.createElementNS(kNSXUL, "label"); - clientItem.setAttribute("itemtype", "client"); - let window = doc.defaultView; - clientItem.setAttribute("tooltiptext", - window.gSyncUI.formatLastSyncDate(new Date(client.lastModified))); - clientItem.textContent = client.name; - - attachFragment.appendChild(clientItem); - - if (client.tabs.length == 0) { - let label = this._appendMessageLabel("notabsforclientlabel", attachFragment); - label.setAttribute("class", "PanelUI-remotetabs-notabsforclient-label"); - } else { - for (let tab of client.tabs) { - let tabEnt = this._createTabElement(doc, tab); - attachFragment.appendChild(tabEnt); - } - } - }, - _createTabElement(doc, tabInfo) { - let item = doc.createElementNS(kNSXUL, "toolbarbutton"); - let tooltipText = (tabInfo.title ? tabInfo.title + "\n" : "") + tabInfo.url; - item.setAttribute("itemtype", "tab"); - item.setAttribute("class", "subviewbutton"); - item.setAttribute("targetURI", tabInfo.url); - item.setAttribute("label", tabInfo.title != "" ? tabInfo.title : tabInfo.url); - item.setAttribute("image", tabInfo.icon); - item.setAttribute("tooltiptext", tooltipText); - // We need to use "click" instead of "command" here so openUILink - // respects different buttons (eg, to open in a new tab). - item.addEventListener("click", e => { - doc.defaultView.openUILink(tabInfo.url, e); - CustomizableUI.hidePanelForNode(item); - }); - return item; - }, - }, { id: "privatebrowsing-button", shortcutId: "key_privatebrowsing", defaultArea: CustomizableUI.AREA_PANEL, @@ -1050,89 +834,6 @@ const CustomizableWidgets = [ let win = aEvent.view; win.MailIntegration.sendLinkForBrowser(win.gBrowser.selectedBrowser) } - }, { - id: "containers-panelmenu", - type: "view", - viewId: "PanelUI-containers", - hasObserver: false, - onCreated: function(aNode) { - let doc = aNode.ownerDocument; - let win = doc.defaultView; - let items = doc.getElementById("PanelUI-containersItems"); - - let onItemCommand = function (aEvent) { - let item = aEvent.target; - if (item.hasAttribute("usercontextid")) { - let userContextId = parseInt(item.getAttribute("usercontextid")); - win.openUILinkIn(win.BROWSER_NEW_TAB_URL, "tab", {userContextId}); - } - }; - items.addEventListener("command", onItemCommand); - - if (PrivateBrowsingUtils.isWindowPrivate(win)) { - aNode.setAttribute("disabled", "true"); - } - - this.updateVisibility(aNode); - - if (!this.hasObserver) { - Services.prefs.addObserver("privacy.userContext.enabled", this, true); - this.hasObserver = true; - } - }, - onViewShowing: function(aEvent) { - let doc = aEvent.target.ownerDocument; - - let items = doc.getElementById("PanelUI-containersItems"); - - while (items.firstChild) { - items.firstChild.remove(); - } - - let fragment = doc.createDocumentFragment(); - let bundle = doc.getElementById("bundle_browser"); - - ContextualIdentityService.getIdentities().forEach(identity => { - let label = ContextualIdentityService.getUserContextLabel(identity.userContextId); - - let item = doc.createElementNS(kNSXUL, "toolbarbutton"); - item.setAttribute("label", label); - item.setAttribute("usercontextid", identity.userContextId); - item.setAttribute("class", "subviewbutton"); - item.setAttribute("data-identity-color", identity.color); - item.setAttribute("data-identity-icon", identity.icon); - - fragment.appendChild(item); - }); - - fragment.appendChild(doc.createElementNS(kNSXUL, "menuseparator")); - - let item = doc.createElementNS(kNSXUL, "toolbarbutton"); - item.setAttribute("label", bundle.getString("userContext.aboutPage.label")); - item.setAttribute("command", "Browser:OpenAboutContainers"); - item.setAttribute("class", "subviewbutton"); - fragment.appendChild(item); - - items.appendChild(fragment); - }, - - updateVisibility(aNode) { - aNode.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled"); - }, - - observe(aSubject, aTopic, aData) { - let {instances} = CustomizableUI.getWidget("containers-panelmenu"); - for (let {node} of instances) { - if (node) { - this.updateVisibility(node); - } - } - }, - - QueryInterface: XPCOMUtils.generateQI([ - Ci.nsISupportsWeakReference, - Ci.nsIObserver - ]), }]; let preferencesButton = { diff --git a/application/basilisk/components/customizableui/CustomizeMode.jsm b/application/basilisk/components/customizableui/CustomizeMode.jsm index 4365ddfbc..2958655d2 100644 --- a/application/basilisk/components/customizableui/CustomizeMode.jsm +++ b/application/basilisk/components/customizableui/CustomizeMode.jsm @@ -40,9 +40,7 @@ let gDebug; XPCOMUtils.defineLazyGetter(this, "log", () => { let scope = {}; Cu.import("resource://gre/modules/Console.jsm", scope); - try { - gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug); - } catch (ex) {} + gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false); let consoleOptions = { maxLogLevel: gDebug ? "all" : "log", prefix: "CustomizeMode", @@ -1503,10 +1501,7 @@ CustomizeMode.prototype = { if (!AppConstants.CAN_DRAW_IN_TITLEBAR) { return; } - let drawInTitlebar = true; - try { - drawInTitlebar = Services.prefs.getBoolPref(kDrawInTitlebarPref); - } catch (ex) { } + let drawInTitlebar = Services.prefs.getBoolPref(kDrawInTitlebarPref, true); let button = this.document.getElementById("customization-titlebar-visibility-button"); // Drawing in the titlebar means 'hiding' the titlebar: if (drawInTitlebar) { diff --git a/application/basilisk/components/customizableui/content/panelUI.inc.xul b/application/basilisk/components/customizableui/content/panelUI.inc.xul index e389b14bf..da8077554 100644 --- a/application/basilisk/components/customizableui/content/panelUI.inc.xul +++ b/application/basilisk/components/customizableui/content/panelUI.inc.xul @@ -20,26 +20,6 @@ oncommand="gMenuButtonUpdateBadge.onMenuPanelCommand(event);" wrap="true" hidden="true"/> - <hbox id="PanelUI-footer-fxa"> - <hbox id="PanelUI-fxa-status" - defaultlabel="&fxaSignIn.label;" - signedinTooltiptext="&fxaSignedIn.tooltip;" - tooltiptext="&fxaSignedIn.tooltip;" - errorlabel="&fxaSignInError.label;" - unverifiedlabel="&fxaUnverified.label;" - onclick="if (event.which == 1) gFxAccounts.onMenuPanelCommand();"> - <image id="PanelUI-fxa-avatar"/> - <toolbarbutton id="PanelUI-fxa-label" - fxabrandname="&syncBrand.fxAccount.label;"/> - </hbox> - <toolbarseparator/> - <toolbarbutton id="PanelUI-fxa-icon" - oncommand="gSyncUI.doSync();" - closemenu="none"> - <observes element="sync-status" attribute="syncstatus"/> - <observes element="sync-status" attribute="tooltiptext"/> - </toolbarbutton> - </hbox> <hbox id="PanelUI-footer-inner"> <toolbarbutton id="PanelUI-customize" label="&appMenuCustomize.label;" @@ -102,95 +82,6 @@ oncommand="PlacesCommandHook.showPlacesOrganizer('History'); CustomizableUI.hidePanelForNode(this);"/> </panelview> - <panelview id="PanelUI-remotetabs" flex="1" class="PanelUI-subView"> - <label value="&appMenuRemoteTabs.label;" class="panel-subview-header"/> - <vbox class="panel-subview-body"> - <!-- this widget has 3 boxes in the body, but only 1 is ever visible --> - <!-- When Sync is ready to sync --> - <vbox id="PanelUI-remotetabs-main" observes="sync-syncnow-state"> - <vbox id="PanelUI-remotetabs-buttons"> - <toolbarbutton id="PanelUI-remotetabs-view-sidebar" - class="subviewbutton" - observes="viewTabsSidebar" - label="&appMenuRemoteTabs.sidebar.label;"/> - <toolbarbutton id="PanelUI-remotetabs-syncnow" - observes="sync-status" - class="subviewbutton" - oncommand="gSyncUI.doSync();" - closemenu="none"/> - <menuseparator id="PanelUI-remotetabs-separator"/> - </vbox> - <deck id="PanelUI-remotetabs-deck"> - <!-- Sync is ready to Sync and the "tabs" engine is enabled --> - <vbox id="PanelUI-remotetabs-tabspane"> - <vbox id="PanelUI-remotetabs-tabslist" - notabsforclientlabel="&appMenuRemoteTabs.notabs.label;" - /> - </vbox> - <!-- Sync is ready to Sync but the "tabs" engine isn't enabled--> - <hbox id="PanelUI-remotetabs-tabsdisabledpane" pack="center" flex="1"> - <vbox class="PanelUI-remotetabs-instruction-box"> - <hbox pack="center"> - <image class="fxaSyncIllustration" alt=""/> - </hbox> - <label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.tabsnotsyncing.label;</label> - <hbox pack="center"> - <toolbarbutton class="PanelUI-remotetabs-prefs-button" - label="&appMenuRemoteTabs.openprefs.label;" - oncommand="gSyncUI.openSetup(null, 'synced-tabs');"/> - </hbox> - </vbox> - </hbox> - <!-- Sync is ready to Sync but we are still fetching the tabs to show --> - <vbox id="PanelUI-remotetabs-fetching"> - <!-- Show intentionally blank panel, see bug 1239845 --> - </vbox> - <!-- Sync has only 1 (ie, this) device connected --> - <hbox id="PanelUI-remotetabs-nodevicespane" pack="center" flex="1"> - <vbox class="PanelUI-remotetabs-instruction-box"> - <hbox pack="center"> - <image class="fxaSyncIllustration" alt=""/> - </hbox> - <label class="PanelUI-remotetabs-instruction-title">&appMenuRemoteTabs.noclients.title;</label> - <label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.noclients.subtitle;</label> - <!-- The inner HTML for PanelUI-remotetabs-mobile-promo is built at runtime --> - <label id="PanelUI-remotetabs-mobile-promo" fxAccountsBrand="&syncBrand.fxAccount.label;"/> - </vbox> - </hbox> - </deck> - </vbox> - <!-- a box to ensure contained boxes are centered horizonally --> - <hbox pack="center" flex="1"> - <!-- When Sync is not configured --> - <vbox id="PanelUI-remotetabs-setupsync" - flex="1" - align="center" - class="PanelUI-remotetabs-instruction-box" - observes="sync-setup-state"> - <image class="fxaSyncIllustration" alt=""/> - <label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.notsignedin.label;</label> - <toolbarbutton class="PanelUI-remotetabs-prefs-button" - label="&appMenuRemoteTabs.signin.label;" - oncommand="gSyncUI.openSetup(null, 'synced-tabs');"/> - </vbox> - <!-- When Sync needs re-authentication. This uses the exact same messaging - as "Sync is not configured" but remains a separate box so we get - the goodness of observing broadcasters to manage the hidden states --> - <vbox id="PanelUI-remotetabs-reauthsync" - flex="1" - align="center" - class="PanelUI-remotetabs-instruction-box" - observes="sync-reauth-state"> - <image class="fxaSyncIllustration" alt=""/> - <label class="PanelUI-remotetabs-instruction-label">&appMenuRemoteTabs.notsignedin.label;</label> - <toolbarbutton class="PanelUI-remotetabs-prefs-button" - label="&appMenuRemoteTabs.signin.label;" - oncommand="gSyncUI.openSetup(null, 'synced-tabs');"/> - </vbox> - </hbox> - </vbox> - </panelview> - <panelview id="PanelUI-bookmarks" flex="1" class="PanelUI-subView"> <label value="&bookmarksMenu.label;" class="panel-subview-header"/> <vbox class="panel-subview-body"> diff --git a/application/basilisk/components/customizableui/moz.build b/application/basilisk/components/customizableui/moz.build index 034630dc9..5797a03b0 100644 --- a/application/basilisk/components/customizableui/moz.build +++ b/application/basilisk/components/customizableui/moz.build @@ -9,7 +9,6 @@ DIRS += [ ] EXTRA_JS_MODULES += [ - 'CustomizableUI.jsm', 'CustomizableWidgets.jsm', 'CustomizeMode.jsm', 'DragPositionManager.jsm', @@ -17,5 +16,9 @@ EXTRA_JS_MODULES += [ 'ScrollbarSampler.jsm', ] +EXTRA_PP_JS_MODULES += [ + 'CustomizableUI.jsm', +] + if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'): DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1 diff --git a/application/basilisk/components/distribution.js b/application/basilisk/components/distribution.js index 589129a5a..c30e4dcfe 100644 --- a/application/basilisk/components/distribution.js +++ b/application/basilisk/components/distribution.js @@ -22,10 +22,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", this.DistributionCustomizer = function DistributionCustomizer() { // For parallel xpcshell testing purposes allow loading the distribution.ini // file from the profile folder through an hidden pref. - let loadFromProfile = false; - try { - loadFromProfile = Services.prefs.getBoolPref("distribution.testing.loadFromProfile"); - } catch (ex) {} + loadFromProfile = Services.prefs.getBoolPref("distribution.testing.loadFromProfile", false); let dirSvc = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties); try { @@ -60,13 +57,7 @@ DistributionCustomizer.prototype = { }, get _locale() { - let locale; - try { - locale = this._prefs.getCharPref("general.useragent.locale"); - } - catch (e) { - locale = "en-US"; - } + let locale = this._prefs.getCharPref("general.useragent.locale", "en-US"); this.__defineGetter__("_locale", () => locale); return this._locale; }, @@ -291,11 +282,7 @@ DistributionCustomizer.prototype = { this._ini.getString("Global", "id") + ".bookmarksProcessed"; } - let bmProcessed = false; - try { - bmProcessed = this._prefs.getBoolPref(bmProcessedPref); - } - catch (e) {} + let bmProcessed = this._prefs.getBoolPref(bmProcessedPref, false); if (!bmProcessed) { if (sections["BookmarksMenu"]) diff --git a/application/basilisk/components/feeds/FeedWriter.js b/application/basilisk/components/feeds/FeedWriter.js index 20f1399b0..ceb2a7e2f 100644 --- a/application/basilisk/components/feeds/FeedWriter.js +++ b/application/basilisk/components/feeds/FeedWriter.js @@ -19,12 +19,7 @@ function LOG(str) { let prefB = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefBranch); - let shouldLog = false; - try { - shouldLog = prefB.getBoolPref("feeds.log"); - } - catch (ex) { - } + let shouldLog = prefB.getBoolPref("feeds.log", false); if (shouldLog) dump("*** Feeds: " + str + "\n"); diff --git a/application/basilisk/components/feeds/WebContentConverter.js b/application/basilisk/components/feeds/WebContentConverter.js index 2cb5cd145..159eca7c2 100644 --- a/application/basilisk/components/feeds/WebContentConverter.js +++ b/application/basilisk/components/feeds/WebContentConverter.js @@ -187,13 +187,8 @@ const Utils = { // check if it is in the black list let pb = Services.prefs; - let allowed; - try { - allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol); - } - catch (e) { - allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default"); - } + let allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol, + pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default")); if (!allowed) { throw this.getSecurityError( `Not allowed to register a protocol handler for ${aProtocol}`, diff --git a/application/basilisk/components/migration/AutoMigrate.jsm b/application/basilisk/components/migration/AutoMigrate.jsm index b38747825..003f70d70 100644 --- a/application/basilisk/components/migration/AutoMigrate.jsm +++ b/application/basilisk/components/migration/AutoMigrate.jsm @@ -37,8 +37,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch", - "resource://gre/modules/TelemetryStopwatch.jsm"); XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() { const kBrandBundle = "chrome://branding/locale/brand.properties"; @@ -211,7 +209,6 @@ const AutoMigrate = { undo: Task.async(function* () { let browserId = Preferences.get(kAutoMigrateBrowserPref, "unknown"); - TelemetryStopwatch.startKeyed("FX_STARTUP_MIGRATION_UNDO_TOTAL_MS", browserId); let histogram = Services.telemetry.getHistogramById("FX_STARTUP_MIGRATION_AUTOMATED_IMPORT_UNDO"); histogram.add(0); if (!(yield this.canUndo())) { @@ -236,38 +233,24 @@ const AutoMigrate = { Services.telemetry.getKeyedHistogramById(histogramId).add(browserId, this._errorMap[type]); }; - let startTelemetryStopwatch = resourceType => { - let histogramId = `FX_STARTUP_MIGRATION_UNDO_${resourceType.toUpperCase()}_MS`; - TelemetryStopwatch.startKeyed(histogramId, browserId); - }; - let stopTelemetryStopwatch = resourceType => { - let histogramId = `FX_STARTUP_MIGRATION_UNDO_${resourceType.toUpperCase()}_MS`; - TelemetryStopwatch.finishKeyed(histogramId, browserId); - }; - startTelemetryStopwatch("bookmarks"); yield this._removeUnchangedBookmarks(stateData.get("bookmarks")).catch(ex => { Cu.reportError("Uncaught exception when removing unchanged bookmarks!"); Cu.reportError(ex); }); - stopTelemetryStopwatch("bookmarks"); reportErrorTelemetry("bookmarks"); histogram.add(15); - startTelemetryStopwatch("visits"); yield this._removeSomeVisits(stateData.get("visits")).catch(ex => { Cu.reportError("Uncaught exception when removing history visits!"); Cu.reportError(ex); }); - stopTelemetryStopwatch("visits"); reportErrorTelemetry("visits"); histogram.add(20); - startTelemetryStopwatch("logins"); yield this._removeUnchangedLogins(stateData.get("logins")).catch(ex => { Cu.reportError("Uncaught exception when removing unchanged logins!"); Cu.reportError(ex); }); - stopTelemetryStopwatch("logins"); reportErrorTelemetry("logins"); histogram.add(25); @@ -278,7 +261,6 @@ const AutoMigrate = { this._purgeUndoState(this.UNDO_REMOVED_REASON_UNDO_USED); histogram.add(30); - TelemetryStopwatch.finishKeyed("FX_STARTUP_MIGRATION_UNDO_TOTAL_MS", browserId); }), _removeNotificationBars() { diff --git a/application/basilisk/components/migration/MigrationUtils.jsm b/application/basilisk/components/migration/MigrationUtils.jsm index e133ec520..ccae006fe 100644 --- a/application/basilisk/components/migration/MigrationUtils.jsm +++ b/application/basilisk/components/migration/MigrationUtils.jsm @@ -32,8 +32,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "ResponsivenessMonitor", "resource://gre/modules/ResponsivenessMonitor.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Sqlite", "resource://gre/modules/Sqlite.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch", - "resource://gre/modules/TelemetryStopwatch.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry", "resource://gre/modules/WindowsRegistry.jsm"); @@ -254,14 +252,6 @@ this.MigratorPrototype = { let browserKey = this.getBrowserKey(); - let maybeStartTelemetryStopwatch = resourceType => { - let histogramId = getHistogramIdForResourceType(resourceType, "FX_MIGRATION_*_IMPORT_MS"); - if (histogramId) { - TelemetryStopwatch.startKeyed(histogramId, browserKey); - } - return histogramId; - }; - let maybeStartResponsivenessMonitor = resourceType => { let responsivenessMonitor; let responsivenessHistogramId = @@ -323,8 +313,6 @@ this.MigratorPrototype = { for (let [migrationType, itemResources] of resourcesGroupedByItems) { notify("Migration:ItemBeforeMigrate", migrationType); - let stopwatchHistogramId = maybeStartTelemetryStopwatch(migrationType); - let {responsivenessMonitor, responsivenessHistogramId} = maybeStartResponsivenessMonitor(migrationType); @@ -340,10 +328,6 @@ this.MigratorPrototype = { migrationType); resourcesGroupedByItems.delete(migrationType); - if (stopwatchHistogramId) { - TelemetryStopwatch.finishKeyed(stopwatchHistogramId, browserKey); - } - maybeFinishResponsivenessMonitor(responsivenessMonitor, responsivenessHistogramId); if (resourcesGroupedByItems.size == 0) { diff --git a/application/basilisk/components/migration/content/migration.xul b/application/basilisk/components/migration/content/migration.xul index e85091002..62c97c107 100644 --- a/application/basilisk/components/migration/content/migration.xul +++ b/application/basilisk/components/migration/content/migration.xul @@ -24,11 +24,9 @@ <wizardpage id="importSource" pageid="importSource" next="selectProfile" label="&importSource.title;" onpageadvanced="return MigrationWizard.onImportSourcePageAdvanced();"> -#ifdef XP_WIN + <description id="importAll" control="importSourceGroup">&importFrom.label;</description> -#else - <description id="importAll" control="importSourceGroup">&importFromUnix.label;</description> -#endif + <description id="importBookmarks" control="importSourceGroup" hidden="true">&importFromBookmarks.label;</description> <radiogroup id="importSourceGroup" align="start"> diff --git a/application/basilisk/components/moz.build b/application/basilisk/components/moz.build index 07e79bc36..a9c29936b 100644 --- a/application/basilisk/components/moz.build +++ b/application/basilisk/components/moz.build @@ -6,7 +6,6 @@ DIRS += [ 'about', - 'contextualidentity', 'customizableui', 'dirprovider', 'downloads', @@ -20,12 +19,11 @@ DIRS += [ 'sessionstore', 'shell', 'selfsupport', - 'syncedtabs', 'translation', ] -if CONFIG['MOZ_WEBEXTENSIONS']: - DIRS += ['webextensions'] +if CONFIG['MOZ_SERVICES_SYNC']: + DIRS += ['sync'] DIRS += ['build'] @@ -39,6 +37,9 @@ XPIDL_MODULE = 'browsercompsbase' EXTRA_COMPONENTS += [ 'BrowserComponents.manifest', 'nsBrowserContentHandler.js', +] + +EXTRA_PP_COMPONENTS += [ 'nsBrowserGlue.js', ] diff --git a/application/basilisk/components/newtab/NewTabPrefsProvider.jsm b/application/basilisk/components/newtab/NewTabPrefsProvider.jsm index c1d8b4149..ad0d1e581 100644 --- a/application/basilisk/components/newtab/NewTabPrefsProvider.jsm +++ b/application/basilisk/components/newtab/NewTabPrefsProvider.jsm @@ -21,7 +21,6 @@ const gPrefsMap = new Map([ ["browser.newtabpage.remote.mode", "str"], ["browser.newtabpage.remote.version", "str"], ["browser.newtabpage.enabled", "bool"], - ["browser.newtabpage.enhanced", "bool"], ["browser.newtabpage.introShown", "bool"], ["browser.newtabpage.updateIntroShown", "bool"], ["browser.newtabpage.pinned", "str"], @@ -34,7 +33,6 @@ const gPrefsMap = new Map([ // prefs that are important for the newtab page const gNewtabPagePrefs = new Set([ "browser.newtabpage.enabled", - "browser.newtabpage.enhanced", "browser.newtabpage.pinned", "browser.newtabpage.blocked", "browser.newtabpage.introShown", diff --git a/application/basilisk/components/nsBrowserContentHandler.js b/application/basilisk/components/nsBrowserContentHandler.js index 74144fc1b..d65e52594 100644 --- a/application/basilisk/components/nsBrowserContentHandler.js +++ b/application/basilisk/components/nsBrowserContentHandler.js @@ -100,20 +100,14 @@ const OVERRIDE_NEW_BUILD_ID = 3; * OVERRIDE_NONE otherwise. */ function needHomepageOverride(prefb) { - var savedmstone = null; - try { - savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone"); - } catch (e) {} + var savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone", ""); if (savedmstone == "ignore") return OVERRIDE_NONE; var mstone = Services.appinfo.platformVersion; - var savedBuildID = null; - try { - savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID"); - } catch (e) {} + var savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID", ""); var buildID = Services.appinfo.platformBuildID; @@ -489,10 +483,7 @@ nsBrowserContentHandler.prototype = { // URL if we do end up showing an overridePage. This makes it possible // to have the overridePage's content vary depending on the version we're // upgrading from. - let old_mstone = "unknown"; - try { - old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone"); - } catch (ex) {} + let old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone", "unknown"); override = needHomepageOverride(prefb); if (override != OVERRIDE_NONE) { switch (override) { diff --git a/application/basilisk/components/nsBrowserGlue.js b/application/basilisk/components/nsBrowserGlue.js index 3258159b6..5d3e4689b 100644 --- a/application/basilisk/components/nsBrowserGlue.js +++ b/application/basilisk/components/nsBrowserGlue.js @@ -32,7 +32,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", "@mozilla.org/alerts-s ["ContentPrefServiceParent", "resource://gre/modules/ContentPrefServiceParent.jsm"], ["ContentSearch", "resource:///modules/ContentSearch.jsm"], ["DateTimePickerHelper", "resource://gre/modules/DateTimePickerHelper.jsm"], - ["DirectoryLinksProvider", "resource:///modules/DirectoryLinksProvider.jsm"], ["Feeds", "resource:///modules/Feeds.jsm"], ["FileUtils", "resource://gre/modules/FileUtils.jsm"], ["FormValidationHandler", "resource:///modules/FormValidationHandler.jsm"], @@ -143,6 +142,7 @@ BrowserGlue.prototype = { Services.prefs.savePrefFile(null); }, +#ifdef MOZ_SERVICES_SYNC _setSyncAutoconnectDelay: function BG__setSyncAutoconnectDelay() { // Assume that a non-zero value for services.sync.autoconnectDelay should override if (Services.prefs.prefHasUserValue("services.sync.autoconnectDelay")) { @@ -164,6 +164,7 @@ BrowserGlue.prototype = { Cu.import("resource://services-sync/main.js"); Weave.Service.scheduler.delayedAutoConnect(delay); }, +#endif // nsIObserver implementation observe: function BG_observe(subject, topic, data) { @@ -210,18 +211,14 @@ BrowserGlue.prototype = { this._setPrefToSaveSession(); } break; +#ifdef MOZ_SERVICES_SYNC case "weave:service:ready": this._setSyncAutoconnectDelay(); break; - case "fxaccounts:onverified": - this._showSyncStartedDoorhanger(); - break; - case "fxaccounts:device_disconnected": - this._onDeviceDisconnected(); - break; - case "weave:engine:clients:display-uris": - this._onDisplaySyncURIs(subject); - break; + case "weave:engine:clients:display-uri": + this._onDisplaySyncURI(subject); + break; +#endif case "session-save": this._setPrefToSaveSession(true); subject.QueryInterface(Ci.nsISupportsPRBool); @@ -428,10 +425,10 @@ BrowserGlue.prototype = { os.addObserver(this, "browser-lastwindow-close-requested", false); os.addObserver(this, "browser-lastwindow-close-granted", false); } +#ifdef MOZ_SERVICES_SYNC os.addObserver(this, "weave:service:ready", false); - os.addObserver(this, "fxaccounts:onverified", false); - os.addObserver(this, "fxaccounts:device_disconnected", false); - os.addObserver(this, "weave:engine:clients:display-uris", false); + os.addObserver(this, "weave:engine:clients:display-uri", false); +#endif os.addObserver(this, "session-save", false); os.addObserver(this, "places-init-complete", false); this._isPlacesInitObserver = true; @@ -479,10 +476,10 @@ BrowserGlue.prototype = { os.removeObserver(this, "browser-lastwindow-close-requested"); os.removeObserver(this, "browser-lastwindow-close-granted"); } +#ifdef MOZ_SERVICES_SYNC os.removeObserver(this, "weave:service:ready"); - os.removeObserver(this, "fxaccounts:onverified"); - os.removeObserver(this, "fxaccounts:device_disconnected"); - os.removeObserver(this, "weave:engine:clients:display-uris"); + os.removeObserver(this, "weave:engine:clients:display-uri"); +#endif os.removeObserver(this, "session-save"); if (this._bookmarksBackupIdleTime) { this._idleService.removeIdleObserver(this, this._bookmarksBackupIdleTime); @@ -657,9 +654,7 @@ BrowserGlue.prototype = { webrtcUI.init(); AboutHome.init(); - DirectoryLinksProvider.init(); NewTabUtils.init(); - NewTabUtils.links.addProvider(DirectoryLinksProvider); AboutNewTab.init(); NewTabMessages.init(); @@ -681,19 +676,6 @@ BrowserGlue.prototype = { // Ensure we keep track of places/pw-mananager undo by init'ing this early. Cu.import("resource:///modules/AutoMigrate.jsm"); - if (!AppConstants.RELEASE_OR_BETA) { - let themeName = gBrowserBundle.GetStringFromName("deveditionTheme.name"); - let vendorShortName = gBrandBundle.GetStringFromName("vendorShortName"); - - LightweightThemeManager.addBuiltInTheme({ - id: "firefox-devedition@mozilla.org", - name: themeName, - headerURL: "resource:///chrome/browser/content/browser/defaultthemes/devedition.header.png", - iconURL: "resource:///chrome/browser/content/browser/defaultthemes/devedition.icon.png", - author: vendorShortName, - }); - } - TabCrashHandler.init(); Services.obs.notifyObservers(null, "browser-ui-startup-complete", ""); @@ -963,10 +945,7 @@ BrowserGlue.prototype = { // Offer to reset a user's profile if it hasn't been used for 60 days. const OFFER_PROFILE_RESET_INTERVAL_MS = 60 * 24 * 60 * 60 * 1000; let lastUse = Services.appinfo.replacedLockTime; - let disableResetPrompt = false; - try { - disableResetPrompt = Services.prefs.getBoolPref("browser.disableResetPrompt"); - } catch (e) {} + let disableResetPrompt = Services.prefs.getBoolPref("browser.disableResetPrompt", false); if (!disableResetPrompt && lastUse && Date.now() - lastUse >= OFFER_PROFILE_RESET_INTERVAL_MS) { @@ -1062,10 +1041,6 @@ BrowserGlue.prototype = { // All initial windows have opened. _onWindowsRestored: function BG__onWindowsRestored() { - if (AppConstants.MOZ_DEV_EDITION) { - this._createExtraDefaultProfile(); - } - this._initServiceDiscovery(); // Show update notification, if needed. @@ -1080,24 +1055,19 @@ BrowserGlue.prototype = { // For any add-ons that were installed disabled and can be enabled offer // them to the user. - let win = RecentWindow.getMostRecentBrowserWindow(); - AddonManager.getAllAddons(addons => { - for (let addon of addons) { - // If this add-on has already seen (or seen is undefined for non-XPI - // add-ons) then skip it. - if (addon.seen !== false) { - continue; - } - - // If this add-on cannot be enabled (either already enabled or - // appDisabled) then skip it. - if (!(addon.permissions & AddonManager.PERM_CAN_ENABLE)) { - continue; - } - - win.openUILinkIn("about:newaddon?id=" + addon.id, "tab"); - } - }); + let changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED); + if (changedIDs.length > 0) { + let win = RecentWindow.getMostRecentBrowserWindow(); + AddonManager.getAddonsByIDs(changedIDs, function(aAddons) { + aAddons.forEach(function(aAddon) { + // If the add-on isn't user disabled or can't be enabled then skip it. + if (!aAddon.userDisabled || !(aAddon.permissions & AddonManager.PERM_CAN_ENABLE)) + return; + + win.openUILinkIn("about:newaddon?id=" + aAddon.id, "tab"); + }) + }); + } let signingRequired; if (AppConstants.MOZ_REQUIRE_SIGNING) { @@ -1110,6 +1080,11 @@ BrowserGlue.prototype = { let disabledAddons = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_DISABLED); AddonManager.getAddonsByIDs(disabledAddons, (addons) => { for (let addon of addons) { + // WEs return null, skip. + if (!addon) { + continue; + } + if (addon.type == "experiment") continue; @@ -1201,40 +1176,6 @@ BrowserGlue.prototype = { E10SAccessibilityCheck.onWindowsRestored(); }, - _createExtraDefaultProfile: function () { - if (!AppConstants.MOZ_DEV_EDITION) { - return; - } - // If Developer Edition is the only installed Firefox version and no other - // profiles are present, create a second one for use by other versions. - // This helps Firefox versions earlier than 35 avoid accidentally using the - // unsuitable Developer Edition profile. - let profileService = Cc["@mozilla.org/toolkit/profile-service;1"] - .getService(Ci.nsIToolkitProfileService); - let profileCount = profileService.profileCount; - if (profileCount == 1 && profileService.selectedProfile.name != "default") { - let newProfile; - try { - newProfile = profileService.createProfile(null, "default"); - profileService.defaultProfile = newProfile; - profileService.flush(); - } catch (e) { - Cu.reportError("Could not create profile 'default': " + e); - } - if (newProfile) { - // We don't want a default profile with Developer Edition settings, an - // empty profile directory will do. The profile service of the other - // Firefox will populate it with its own stuff. - let newProfilePath = newProfile.rootDir.path; - OS.File.removeDir(newProfilePath).then(() => { - return OS.File.makeDir(newProfilePath); - }).then(null, e => { - Cu.reportError("Could not empty profile 'default': " + e); - }); - } - } - }, - _onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) { // If user has already dismissed quit request, then do nothing if ((aCancelQuit instanceof Ci.nsISupportsPRBool) && aCancelQuit.data) @@ -1507,10 +1448,7 @@ BrowserGlue.prototype = { } catch (ex) {} // Support legacy bookmarks.html format for apps that depend on that format. - let autoExportHTML = false; - try { - autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML"); - } catch (ex) {} // Do not export. + let autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML", false); // Do not export. if (autoExportHTML) { // Sqlite.jsm and Places shutdown happen at profile-before-change, thus, // to be on the safe side, this should run earlier. @@ -1580,10 +1518,7 @@ BrowserGlue.prototype = { // An import operation is about to run. // Don't try to recreate smart bookmarks if autoExportHTML is true or // smart bookmarks are disabled. - let smartBookmarksVersion = 0; - try { - smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion"); - } catch (ex) {} + let smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion", 0); if (!autoExportHTML && smartBookmarksVersion != -1) Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0); @@ -1934,10 +1869,7 @@ BrowserGlue.prototype = { // Refactor urlbar suggestion preferences to make it extendable and // allow new suggestion types (e.g: search suggestions). let types = ["history", "bookmark", "openpage"]; - let defaultBehavior = 0; - try { - defaultBehavior = Services.prefs.getIntPref("browser.urlbar.default.behavior"); - } catch (ex) {} + let defaultBehavior = Services.prefs.getIntPref("browser.urlbar.default.behavior", 0); try { let autocompleteEnabled = Services.prefs.getBoolPref("browser.urlbar.autocomplete.enabled"); if (!autocompleteEnabled) { @@ -1990,26 +1922,16 @@ BrowserGlue.prototype = { if (currentUIVersion < 30) { // Convert old devedition theme pref to lightweight theme storage - let lightweightThemeSelected = false; - let selectedThemeID = null; - try { - lightweightThemeSelected = Services.prefs.prefHasUserValue("lightweightThemes.selectedThemeID"); - selectedThemeID = Services.prefs.getCharPref("lightweightThemes.selectedThemeID"); - } catch (e) {} + let lightweightThemeSelected = Services.prefs.prefHasUserValue("lightweightThemes.selectedThemeID", false); + let selectedThemeID = Services.prefs.getCharPref("lightweightThemes.selectedThemeID", ""); let defaultThemeSelected = false; try { defaultThemeSelected = Services.prefs.getCharPref("general.skins.selectedSkin") == "classic/1.0"; } catch (e) {} - // If we are on the devedition channel, the devedition theme is on by - // default. But we need to handle the case where they didn't want it - // applied, and unapply the theme. - let userChoseToNotUseDeveditionTheme = - !defaultThemeSelected || - (lightweightThemeSelected && selectedThemeID != "firefox-devedition@mozilla.org"); - - if (userChoseToNotUseDeveditionTheme && selectedThemeID == "firefox-devedition@mozilla.org") { + // If we have the dev edition theme selected, reset it. + if (selectedThemeID == "firefox-devedition@mozilla.org") { Services.prefs.setCharPref("lightweightThemes.selectedThemeID", ""); } @@ -2145,10 +2067,7 @@ BrowserGlue.prototype = { const MAX_RESULTS = 10; // Get current smart bookmarks version. If not set, create them. - let smartBookmarksCurrentVersion = 0; - try { - smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF); - } catch (ex) {} + let smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF, 0); // If version is current, or smart bookmarks are disabled, bail out. if (smartBookmarksCurrentVersion == -1 || @@ -2274,90 +2193,29 @@ BrowserGlue.prototype = { chromeWindow.openPreferences(...args); }, +#ifdef MOZ_SERVICES_SYNC /** - * Called as an observer when Sync's "display URIs" notification is fired. + * Called as an observer when Sync's "display URI" notification is fired. * - * We open the received URIs in background tabs. + * We open the received URI in a background tab. + * + * Eventually, this will likely be replaced by a more robust tab syncing + * feature. This functionality is considered somewhat evil by UX because it + * opens a new tab automatically without any prompting. However, it is a + * lesser evil than sending a tab to a specific device (from e.g. Fennec) + * and having nothing happen on the receiving end. */ - _onDisplaySyncURIs: function _onDisplaySyncURIs(data) { + _onDisplaySyncURI: function _onDisplaySyncURI(data) { try { - // The payload is wrapped weirdly because of how Sync does notifications. - const URIs = data.wrappedJSObject.object; + let tabbrowser = RecentWindow.getMostRecentBrowserWindow({private: false}).gBrowser; - const findWindow = () => RecentWindow.getMostRecentBrowserWindow({private: false}); - - // win can be null, but it's ok, we'll assign it later in openTab() - let win = findWindow(); - - const openTab = URI => { - let tab; - if (!win) { - Services.appShell.hiddenDOMWindow.open(URI.uri); - win = findWindow(); - tab = win.gBrowser.tabs[0]; - } else { - tab = win.gBrowser.addTab(URI.uri); - } - tab.setAttribute("attention", true); - return tab; - }; - - const firstTab = openTab(URIs[0]); - URIs.slice(1).forEach(URI => openTab(URI)); - - let title, body; - const deviceName = Weave.Service.clientsEngine.getClientName(URIs[0].clientId); - const bundle = Services.strings.createBundle("chrome://browser/locale/accounts.properties"); - if (URIs.length == 1) { - // Due to bug 1305895, tabs from iOS may not have device information, so - // we have separate strings to handle those cases. (See Also - // unnamedTabsArrivingNotificationNoDevice.body below) - if (deviceName) { - title = bundle.formatStringFromName("tabArrivingNotificationWithDevice.title", [deviceName], 1); - } else { - title = bundle.GetStringFromName("tabArrivingNotification.title"); - } - // Use the page URL as the body. We strip the fragment and query to - // reduce size, and also format it the same way that the url bar would. - body = URIs[0].uri.replace(/[?#].*$/, ""); - if (win.gURLBar) { - body = win.gURLBar.trimValue(body); - } - } else { - title = bundle.GetStringFromName("tabsArrivingNotification.title"); - const allSameDevice = URIs.every(URI => URI.clientId == URIs[0].clientId); - const unknownDevice = allSameDevice && !deviceName; - let tabArrivingBody; - if (unknownDevice) { - tabArrivingBody = "unnamedTabsArrivingNotificationNoDevice.body"; - } else if (allSameDevice) { - tabArrivingBody = "unnamedTabsArrivingNotification2.body"; - } else { - tabArrivingBody = "unnamedTabsArrivingNotificationMultiple2.body" - } - - body = bundle.GetStringFromName(tabArrivingBody); - body = PluralForm.get(URIs.length, body); - body = body.replace("#1", URIs.length); - body = body.replace("#2", deviceName); - } - - const clickCallback = (subject, topic, data) => { - if (topic == "alertclickcallback") { - win.gBrowser.selectedTab = firstTab; - } - } - - // Specify an icon because on Windows no icon is shown at the moment - let imageURL; - if (AppConstants.platform == "win") { - imageURL = "chrome://branding/content/icon64.png"; - } - AlertsService.showAlertNotification(imageURL, title, body, true, null, clickCallback); + // The payload is wrapped weirdly because of how Sync does notifications. + tabbrowser.addTab(data.wrappedJSObject.object.uri); } catch (ex) { - Cu.reportError("Error displaying tab(s) received by Sync: " + ex); + Cu.reportError("Error displaying tab received by Sync: " + ex); } }, +#endif _onDeviceDisconnected() { let bundle = Services.strings.createBundle("chrome://browser/locale/accounts.properties"); diff --git a/application/basilisk/components/places/PlacesUIUtils.jsm b/application/basilisk/components/places/PlacesUIUtils.jsm index 17fa276aa..035fc12c2 100644 --- a/application/basilisk/components/places/PlacesUIUtils.jsm +++ b/application/basilisk/components/places/PlacesUIUtils.jsm @@ -1418,9 +1418,9 @@ this.PlacesUIUtils = { }, shouldShowTabsFromOtherComputersMenuitem: function() { - let weaveOK = Weave.Status.checkSetup() != Weave.CLIENT_NOT_CONFIGURED && - Weave.Svc.Prefs.get("firstSync", "") != "notReady"; - return weaveOK; +#ifdef MOZ_SERVICES_SYNC + // Weave code to enable menu item +#endif }, /** diff --git a/application/basilisk/components/places/content/controller.js b/application/basilisk/components/places/content/controller.js index ebdab60f4..931c8fac1 100644 --- a/application/basilisk/components/places/content/controller.js +++ b/application/basilisk/components/places/content/controller.js @@ -461,7 +461,11 @@ PlacesController.prototype = { if (parentNode) { if (PlacesUtils.nodeIsTagQuery(parentNode)) nodeData["tagChild"] = true; - else if (this.hasCachedLivemarkInfo(parentNode)) + } + } else { + var parentNode = node.parent; + if (parentNode) { + if (this.hasCachedLivemarkInfo(parentNode)) nodeData["livemarkChild"] = true; } } diff --git a/application/basilisk/components/places/content/history-panel.js b/application/basilisk/components/places/content/history-panel.js index 20dbbb5bd..65f00e93b 100644 --- a/application/basilisk/components/places/content/history-panel.js +++ b/application/basilisk/components/places/content/history-panel.js @@ -3,8 +3,6 @@ * 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/. */ -Components.utils.import("resource://gre/modules/TelemetryStopwatch.jsm"); - var gHistoryTree; var gSearchBox; var gHistoryGrouping = ""; @@ -81,16 +79,11 @@ function searchHistory(aInput) options.resultType = resultType; options.includeHidden = !!aInput; - if (gHistoryGrouping == "lastvisited") - this.TelemetryStopwatch.start("HISTORY_LASTVISITED_TREE_QUERY_TIME_MS"); - // call load() on the tree manually // instead of setting the place attribute in history-panel.xul // otherwise, we will end up calling load() twice gHistoryTree.load([query], options); - if (gHistoryGrouping == "lastvisited") - this.TelemetryStopwatch.finish("HISTORY_LASTVISITED_TREE_QUERY_TIME_MS"); } window.addEventListener("SidebarFocused", diff --git a/application/basilisk/components/places/content/places.js b/application/basilisk/components/places/content/places.js index aa43b20e6..375c3de17 100644 --- a/application/basilisk/components/places/content/places.js +++ b/application/basilisk/components/places/content/places.js @@ -5,7 +5,6 @@ Components.utils.import("resource://gre/modules/AppConstants.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -Components.utils.import("resource://gre/modules/TelemetryStopwatch.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "MigrationUtils", "resource:///modules/MigrationUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", @@ -810,9 +809,7 @@ var PlacesSearchBox = { currentView.load([query], options); } else { - TelemetryStopwatch.start(HISTORY_LIBRARY_SEARCH_TELEMETRY); currentView.applyFilter(filterString, null, true); - TelemetryStopwatch.finish(HISTORY_LIBRARY_SEARCH_TELEMETRY); } break; case "downloads": diff --git a/application/basilisk/components/places/content/placesOverlay.xul b/application/basilisk/components/places/content/placesOverlay.xul index 512eb923e..2dbef0f04 100644 --- a/application/basilisk/components/places/content/placesOverlay.xul +++ b/application/basilisk/components/places/content/placesOverlay.xul @@ -198,7 +198,7 @@ accesskey="&cmd.delete.accesskey;" closemenu="single" selection="link" - forcehideselection="bookmark"/> + forcehideselection="bookmark|livemarkChild"/> <menuitem id="placesContext_deleteHost" command="placesCmd_deleteDataHost" label="&cmd.deleteDomainData.label;" @@ -207,7 +207,7 @@ selection="link|host" selectiontype="single" hideifprivatebrowsing="true" - forcehideselection="bookmark"/> + forcehideselection="bookmark|livemarkChild"/> <menuseparator id="placesContext_deleteSeparator"/> <menuitem id="placesContext_sortBy:name" command="placesCmd_sortBy:name" diff --git a/application/basilisk/components/places/moz.build b/application/basilisk/components/places/moz.build index 9e5a2c074..ea6d43538 100644 --- a/application/basilisk/components/places/moz.build +++ b/application/basilisk/components/places/moz.build @@ -6,6 +6,6 @@ JAR_MANIFESTS += ['jar.mn'] -EXTRA_JS_MODULES += [ +EXTRA_PP_JS_MODULES += [ 'PlacesUIUtils.jsm', ] diff --git a/application/basilisk/components/preferences/connection.js b/application/basilisk/components/preferences/connection.js index f6b395a2d..349139bed 100644 --- a/application/basilisk/components/preferences/connection.js +++ b/application/basilisk/components/preferences/connection.js @@ -76,7 +76,7 @@ var gConnectionsDialog = { var autologinProxyPref = document.getElementById("signon.autologin.proxy"); autologinProxyPref.disabled = proxyTypePref.value == 0; var noProxiesPref = document.getElementById("network.proxy.no_proxies_on"); - noProxiesPref.disabled = proxyTypePref.value != 1; + noProxiesPref.disabled = proxyTypePref.value == 0; var autoconfigURLPref = document.getElementById("network.proxy.autoconfig_url"); autoconfigURLPref.disabled = proxyTypePref.value != 2; diff --git a/application/basilisk/components/preferences/connection.xul b/application/basilisk/components/preferences/connection.xul index a3f0d082a..1eb0c1544 100644 --- a/application/basilisk/components/preferences/connection.xul +++ b/application/basilisk/components/preferences/connection.xul @@ -145,9 +145,6 @@ </radiogroup> </box> </row> - <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/> - <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/> - <label value="&noproxyExplain.label;" control="networkProxyNone"/> </rows> </grid> <radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/> @@ -162,6 +159,9 @@ </radiogroup> </groupbox> <separator class="thin"/> + <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/> + <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/> + <label value="&noproxyExplain.label;" control="networkProxyNone"/> <checkbox id="autologinProxy" label="&autologinproxy.label;" accesskey="&autologinproxy.accesskey;" diff --git a/application/basilisk/components/preferences/containers.js b/application/basilisk/components/preferences/containers.js deleted file mode 100644 index 6ca5853f7..000000000 --- a/application/basilisk/components/preferences/containers.js +++ /dev/null @@ -1,176 +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/. */ - -Components.utils.import("resource://gre/modules/Services.jsm"); -Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm"); - -const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties"); - -const HTMLNS = "http://www.w3.org/1999/xhtml"; - -let gContainersManager = { - icons: [ - "fingerprint", - "briefcase", - "dollar", - "cart", - "circle" - ], - - colors: [ - "blue", - "turquoise", - "green", - "yellow", - "orange", - "red", - "pink", - "purple" - ], - - onLoad() { - let params = window.arguments[0] || {}; - this.init(params); - }, - - init(aParams) { - this.userContextId = aParams.userContextId || null; - this.identity = aParams.identity; - - if (aParams.windowTitle) { - document.title = aParams.windowTitle; - } - - const iconWrapper = document.getElementById("iconWrapper"); - iconWrapper.appendChild(this.createIconButtons()); - - const colorWrapper = document.getElementById("colorWrapper"); - colorWrapper.appendChild(this.createColorSwatches()); - - if (this.identity.name) { - const name = document.getElementById("name"); - name.value = this.identity.name; - this.checkForm(); - } - - this.setLabelsMinWidth(); - - // This is to prevent layout jank caused by the svgs and outlines rendering at different times - document.getElementById("containers-content").removeAttribute("hidden"); - }, - - setLabelsMinWidth() { - const labelMinWidth = containersBundle.GetStringFromName("containers.labelMinWidth"); - const labels = [ - document.getElementById("nameLabel"), - document.getElementById("iconLabel"), - document.getElementById("colorLabel") - ]; - for (let label of labels) { - label.style.minWidth = labelMinWidth; - } - }, - - uninit() { - }, - - // Check if name string as to if the form can be submitted - checkForm() { - const name = document.getElementById("name"); - let btnApplyChanges = document.getElementById("btnApplyChanges"); - if (!name.value) { - btnApplyChanges.setAttribute("disabled", true); - } else { - btnApplyChanges.removeAttribute("disabled"); - } - }, - - createIconButtons(defaultIcon) { - let radiogroup = document.createElement("radiogroup"); - radiogroup.setAttribute("id", "icon"); - radiogroup.className = "icon-buttons"; - - for (let icon of this.icons) { - let iconSwatch = document.createElement("radio"); - iconSwatch.id = "iconbutton-" + icon; - iconSwatch.name = "icon"; - iconSwatch.type = "radio"; - iconSwatch.value = icon; - - if (this.identity.icon && this.identity.icon == icon) { - iconSwatch.setAttribute("selected", true); - } - - iconSwatch.setAttribute("label", - containersBundle.GetStringFromName(`containers.${icon}.label`)); - let iconElement = document.createElement("hbox"); - iconElement.className = 'userContext-icon'; - iconElement.setAttribute("data-identity-icon", icon); - - iconSwatch.appendChild(iconElement); - radiogroup.appendChild(iconSwatch); - } - - return radiogroup; - }, - - createColorSwatches(defaultColor) { - let radiogroup = document.createElement("radiogroup"); - radiogroup.setAttribute("id", "color"); - - for (let color of this.colors) { - let colorSwatch = document.createElement("radio"); - colorSwatch.id = "colorswatch-" + color; - colorSwatch.name = "color"; - colorSwatch.type = "radio"; - colorSwatch.value = color; - - if (this.identity.color && this.identity.color == color) { - colorSwatch.setAttribute("selected", true); - } - - colorSwatch.setAttribute("label", - containersBundle.GetStringFromName(`containers.${color}.label`)); - let iconElement = document.createElement("hbox"); - iconElement.className = 'userContext-icon'; - iconElement.setAttribute("data-identity-icon", "circle"); - iconElement.setAttribute("data-identity-color", color); - - colorSwatch.appendChild(iconElement); - radiogroup.appendChild(colorSwatch); - } - return radiogroup; - }, - - onApplyChanges() { - let icon = document.getElementById("icon").value; - let color = document.getElementById("color").value; - let name = document.getElementById("name").value; - - if (this.icons.indexOf(icon) == -1) { - throw "Internal error. The icon value doesn't match."; - } - - if (this.colors.indexOf(color) == -1) { - throw "Internal error. The color value doesn't match."; - } - - if (this.userContextId) { - ContextualIdentityService.update(this.userContextId, - name, - icon, - color); - } else { - ContextualIdentityService.create(name, - icon, - color); - } - window.parent.location.reload() - }, - - onWindowKeyPress(aEvent) { - if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE) - window.close(); - } -} diff --git a/application/basilisk/components/preferences/containers.xul b/application/basilisk/components/preferences/containers.xul deleted file mode 100644 index 62a775fe4..000000000 --- a/application/basilisk/components/preferences/containers.xul +++ /dev/null @@ -1,52 +0,0 @@ -<?xml version="1.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/. --> - -<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> -<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css" type="text/css"?> - -<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/containers.dtd" > - -<window id="ContainersDialog" class="windowDialog" - windowtype="Browser:Permissions" - title="&window.title;" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - style="width: &window.width;;" - onload="gContainersManager.onLoad();" - onunload="gContainersManager.uninit();" - persist="screenX screenY width height" - onkeypress="gContainersManager.onWindowKeyPress(event);"> - - <script src="chrome://global/content/treeUtils.js"/> - <script src="chrome://browser/content/preferences/containers.js"/> - - <stringbundle id="bundlePreferences" - src="chrome://browser/locale/preferences/preferences.properties"/> - - <keyset> - <key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/> - </keyset> - - <vbox class="contentPane largeDialogContainer" flex="1" hidden="true" id="containers-content"> - <description id="permissionsText" control="url"/> - <separator class="thin"/> - <hbox align="start"> - <label id="nameLabel" control="url" value="&name.label;" accesskey="&name.accesskey;"/> - <textbox id="name" flex="1" onkeyup="gContainersManager.checkForm();" /> - </hbox> - <hbox align="center" id="iconWrapper"> - <label id="iconLabel" control="url" value="&icon.label;" accesskey="&icon.accesskey;"/> - </hbox> - <hbox align="center" id="colorWrapper"> - <label id="colorLabel" control="url" value="&color.label;" accesskey="&color.accesskey;"/> - </hbox> - </vbox> - <vbox> - <hbox class="actionButtons" align="right" flex="1"> - <button id="btnApplyChanges" disabled="true" oncommand="gContainersManager.onApplyChanges();" icon="save" - label="&button.ok.label;" accesskey="&button.ok.accesskey;"/> - </hbox> - </vbox> -</window> diff --git a/application/basilisk/components/preferences/cookies.js b/application/basilisk/components/preferences/cookies.js index c420855f8..4ede5b6e6 100644 --- a/application/basilisk/components/preferences/cookies.js +++ b/application/basilisk/components/preferences/cookies.js @@ -7,12 +7,8 @@ const nsICookie = Components.interfaces.nsICookie; Components.utils.import("resource://gre/modules/AppConstants.jsm"); Components.utils.import("resource://gre/modules/PluralForm.jsm"); -Components.utils.import("resource://gre/modules/Services.jsm") Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", - "resource://gre/modules/ContextualIdentityService.jsm"); - var gCookiesWindow = { _cm : Components.classes["@mozilla.org/cookiemanager;1"] .getService(Components.interfaces.nsICookieManager), @@ -38,10 +34,6 @@ var gCookiesWindow = { this._populateList(true); document.getElementById("filter").focus(); - - if (!Services.prefs.getBoolPref("privacy.userContext.enabled")) { - document.getElementById("userContextRow").hidden = true; - } }, uninit: function () { @@ -82,24 +74,11 @@ var gCookiesWindow = { aCookieB.originAttributes); }, - _isPrivateCookie: function (aCookie) { - let { userContextId } = aCookie.originAttributes; - if (!userContextId) { - // Default identity is public. - return false; - } - return !ContextualIdentityService.getIdentityFromId(userContextId).public; - }, - observe: function (aCookie, aTopic, aData) { if (aTopic != "cookie-changed") return; if (aCookie instanceof Components.interfaces.nsICookie) { - if (this._isPrivateCookie(aCookie)) { - return; - } - var strippedHost = this._makeStrippedHost(aCookie.host); if (aData == "changed") this._handleCookieChanged(aCookie, strippedHost); @@ -498,9 +477,6 @@ var gCookiesWindow = { while (e.hasMoreElements()) { var cookie = e.getNext(); if (cookie && cookie instanceof Components.interfaces.nsICookie) { - if (this._isPrivateCookie(cookie)) { - continue; - } var strippedHost = this._makeStrippedHost(cookie.host); this._addCookie(strippedHost, cookie, hostCount); @@ -524,17 +500,9 @@ var gCookiesWindow = { return this._bundle.getString("expireAtEndOfSession"); }, - _getUserContextString: function(aUserContextId) { - if (parseInt(aUserContextId) == 0) { - return this._bundle.getString("defaultUserContextLabel"); - } - - return ContextualIdentityService.getUserContextLabel(aUserContextId); - }, - _updateCookieData: function (aItem) { var seln = this._view.selection; - var ids = ["name", "value", "host", "path", "isSecure", "expires", "userContext"]; + var ids = ["name", "value", "host", "path", "isSecure", "expires"]; var properties; if (aItem && !aItem.container && seln.count > 0) { @@ -543,8 +511,7 @@ var gCookiesWindow = { isDomain: aItem.isDomain ? this._bundle.getString("domainColon") : this._bundle.getString("hostColon"), isSecure: aItem.isSecure ? this._bundle.getString("forSecureOnly") - : this._bundle.getString("forAnyConnection"), - userContext: this._getUserContextString(aItem.originAttributes.userContextId) }; + : this._bundle.getString("forAnyConnection") }; for (let id of ids) { document.getElementById(id).disabled = false; } @@ -553,7 +520,7 @@ var gCookiesWindow = { var noneSelected = this._bundle.getString("noCookieSelected"); properties = { name: noneSelected, value: noneSelected, host: noneSelected, path: noneSelected, expires: noneSelected, - isSecure: noneSelected, userContext: noneSelected }; + isSecure: noneSelected }; for (let id of ids) { document.getElementById(id).disabled = true; } diff --git a/application/basilisk/components/preferences/cookies.xul b/application/basilisk/components/preferences/cookies.xul index bd60d9346..d5fefdef7 100644 --- a/application/basilisk/components/preferences/cookies.xul +++ b/application/basilisk/components/preferences/cookies.xul @@ -85,10 +85,6 @@ <hbox pack="end"><label id="expiresLabel" control="expires" value="&props.expires.label;"/></hbox> <textbox id="expires" readonly="true" class="plain"/> </row> - <row align="center" id="userContextRow"> - <hbox pack="end"><label id="userContextLabel" control="userContext" value="&props.container.label;"/></hbox> - <textbox id="userContext" readonly="true" class="plain"/> - </row> </rows> </grid> </hbox> diff --git a/application/basilisk/components/preferences/handlers.css b/application/basilisk/components/preferences/handlers.css index 6af75a08b..d5f100831 100644 --- a/application/basilisk/components/preferences/handlers.css +++ b/application/basilisk/components/preferences/handlers.css @@ -10,10 +10,6 @@ -moz-binding: url("chrome://browser/content/preferences/handlers.xml#handler-selected"); } -#containersView > richlistitem { - -moz-binding: url("chrome://browser/content/preferences/handlers.xml#container"); -} - /** * Make the icons appear. * Note: we display the icon box for every item whether or not it has an icon diff --git a/application/basilisk/components/preferences/handlers.xml b/application/basilisk/components/preferences/handlers.xml index 0c629d759..ad07a493c 100644 --- a/application/basilisk/components/preferences/handlers.xml +++ b/application/basilisk/components/preferences/handlers.xml @@ -69,29 +69,6 @@ </binding> - <binding id="container"> - <content> - <xul:hbox flex="1" equalsize="always"> - <xul:hbox flex="1" align="center"> - <xul:hbox xbl:inherits="data-identity-icon=containerIcon,data-identity-color=containerColor" height="24" width="24" class="userContext-icon"/> - <xul:label flex="1" crop="end" xbl:inherits="value=containerName"/> - </xul:hbox> - <xul:hbox flex="1" align="right"> - <xul:button anonid="preferencesButton" - xbl:inherits="value=userContextId" - onclick="gContainersPane.onPeferenceClick(event.originalTarget)"> - Preferences - </xul:button> - <xul:button anonid="removeButton" - xbl:inherits="value=userContextId" - onclick="gContainersPane.onRemoveClick(event.originalTarget)"> - Remove - </xul:button> - </xul:hbox> - </xul:hbox> - </content> - </binding> - <binding id="offlineapp" extends="chrome://global/content/bindings/listbox.xml#listitem"> <content> diff --git a/application/basilisk/components/preferences/in-content/advanced.js b/application/basilisk/components/preferences/in-content/advanced.js index 5f9458eee..850f0e09f 100644 --- a/application/basilisk/components/preferences/in-content/advanced.js +++ b/application/basilisk/components/preferences/in-content/advanced.js @@ -670,25 +670,6 @@ var gAdvancedPane = { // or the binary platform or OS version is not known. // A locked pref is sufficient to disable the radiogroup. radiogroup.disabled = !canCheck || enabledPref.locked || autoPref.locked; - - if (AppConstants.MOZ_MAINTENANCE_SERVICE) { - // Check to see if the maintenance service is installed. - // If it is don't show the preference at all. - var installed; - try { - var wrk = Components.classes["@mozilla.org/windows-registry-key;1"] - .createInstance(Components.interfaces.nsIWindowsRegKey); - wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE, - "SOFTWARE\\Mozilla\\MaintenanceService", - wrk.ACCESS_READ | wrk.WOW64_64); - installed = wrk.readIntValue("Installed"); - wrk.close(); - } catch (e) { - } - if (installed != 1) { - document.getElementById("useService").hidden = true; - } - } } }, diff --git a/application/basilisk/components/preferences/in-content/advanced.xul b/application/basilisk/components/preferences/in-content/advanced.xul index 4973f8e09..50e276501 100644 --- a/application/basilisk/components/preferences/in-content/advanced.xul +++ b/application/basilisk/components/preferences/in-content/advanced.xul @@ -79,12 +79,6 @@ <preference id="app.update.disable_button.showUpdateHistory" name="app.update.disable_button.showUpdateHistory" type="bool"/> - -#ifdef MOZ_MAINTENANCE_SERVICE - <preference id="app.update.service.enabled" - name="app.update.service.enabled" - type="bool"/> -#endif #endif <preference id="browser.search.update" @@ -331,13 +325,6 @@ accesskey="&updateHistory.accesskey;" preference="app.update.disable_button.showUpdateHistory"/> </hbox> - -#ifdef MOZ_MAINTENANCE_SERVICE - <checkbox id="useService" - label="&useService.label;" - accesskey="&useService.accesskey;" - preference="app.update.service.enabled"/> -#endif </groupbox> #endif <groupbox id="updateOthers" align="start"> diff --git a/application/basilisk/components/preferences/in-content/containers.js b/application/basilisk/components/preferences/in-content/containers.js deleted file mode 100644 index 758e45fff..000000000 --- a/application/basilisk/components/preferences/in-content/containers.js +++ /dev/null @@ -1,73 +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/. */ - -Components.utils.import("resource://gre/modules/AppConstants.jsm"); -Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm"); - -const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties"); - -const defaultContainerIcon = "fingerprint"; -const defaultContainerColor = "blue"; - -let gContainersPane = { - - init() { - this._list = document.getElementById("containersView"); - - document.getElementById("backContainersLink").addEventListener("click", function () { - gotoPref("privacy"); - }); - - this._rebuildView(); - }, - - _rebuildView() { - const containers = ContextualIdentityService.getIdentities(); - while (this._list.firstChild) { - this._list.firstChild.remove(); - } - for (let container of containers) { - let item = document.createElement("richlistitem"); - item.setAttribute("containerName", ContextualIdentityService.getUserContextLabel(container.userContextId)); - item.setAttribute("containerIcon", container.icon); - item.setAttribute("containerColor", container.color); - item.setAttribute("userContextId", container.userContextId); - - this._list.appendChild(item); - } - }, - - onRemoveClick(button) { - let userContextId = button.getAttribute("value"); - ContextualIdentityService.remove(userContextId); - this._rebuildView(); - }, - onPeferenceClick(button) { - this.openPreferenceDialog(button.getAttribute("value")); - }, - - onAddButtonClick(button) { - this.openPreferenceDialog(null); - }, - - openPreferenceDialog(userContextId) { - let identity = { - name: "", - icon: defaultContainerIcon, - color: defaultContainerColor - }; - let title; - if (userContextId) { - identity = ContextualIdentityService.getIdentityFromId(userContextId); - // This is required to get the translation string from defaults - identity.name = ContextualIdentityService.getUserContextLabel(identity.userContextId); - title = containersBundle.formatStringFromName("containers.updateContainerTitle", [identity.name], 1); - } - - const params = { userContextId, identity, windowTitle: title }; - gSubDialog.open("chrome://browser/content/preferences/containers.xul", - null, params); - } - -}; diff --git a/application/basilisk/components/preferences/in-content/containers.xul b/application/basilisk/components/preferences/in-content/containers.xul deleted file mode 100644 index e83bac1c3..000000000 --- a/application/basilisk/components/preferences/in-content/containers.xul +++ /dev/null @@ -1,54 +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/. - -<!-- Containers panel --> - -<script type="application/javascript" - src="chrome://browser/content/preferences/in-content/containers.js"/> - -<preferences id="containerPreferences" hidden="true" data-category="paneContainer"> - <!-- Containers --> - <preference id="privacy.userContext.enabled" - name="privacy.userContext.enabled" - type="bool"/> - -</preferences> - -<hbox hidden="true" - class="container-header-links" - data-category="paneContainers"> - <label class="text-link" id="backContainersLink" value="&backLink.label;" /> -</hbox> - -<hbox id="header-containers" - class="header" - hidden="true" - data-category="paneContainers"> - <label class="header-name" flex="1">&paneContainers.title;</label> - <button class="help-button" - aria-label="&helpButton.label;"/> -</hbox> - -<!-- Containers --> -<groupbox id="browserContainersGroup" data-category="paneContainers" hidden="true"> - <vbox id="browserContainersbox"> - - <richlistbox id="containersView" orient="vertical" persist="lastSelectedType" - flex="1"> - <listheader equalsize="always"> - <treecol id="typeColumn" label="&label.label;" value="type" - persist="sortDirection" - flex="1" sortDirection="ascending"/> - <treecol id="actionColumn" value="action" - persist="sortDirection" - flex="1"/> - </listheader> - </richlistbox> - </vbox> - <vbox> - <hbox flex="1"> - <button onclick="gContainersPane.onAddButtonClick();" accesskey="&addButton.accesskey;" label="&addButton.label;"/> - </hbox> - </vbox> -</groupbox> diff --git a/application/basilisk/components/preferences/in-content/content.js b/application/basilisk/components/preferences/in-content/content.js index a957b1dd5..2eac10ca4 100644 --- a/application/basilisk/components/preferences/in-content/content.js +++ b/application/basilisk/components/preferences/in-content/content.js @@ -31,18 +31,6 @@ var gContentPane = { menulist.value = FontBuilder.readFontSelection(menulist); } - // Show translation preferences if we may: - const prefName = "browser.translation.ui.show"; - if (Services.prefs.getBoolPref(prefName)) { - let row = document.getElementById("translationBox"); - row.removeAttribute("hidden"); - // Showing attribution only for Bing Translator. - Components.utils.import("resource:///modules/translation/Translation.jsm"); - if (Translation.translationEngine == "bing") { - document.getElementById("bingAttribution").removeAttribute("hidden"); - } - } - if (AlertsServiceDND) { let notificationsDoNotDisturbRow = document.getElementById("notificationsDoNotDisturbRow"); @@ -66,10 +54,6 @@ var gContentPane = { gContentPane.configureColors); setEventListener("chooseLanguage", "command", gContentPane.showLanguages); - setEventListener("translationAttributionImage", "click", - gContentPane.openTranslationProviderAttribution); - setEventListener("translateButton", "command", - gContentPane.showTranslationExceptions); setEventListener("notificationsDoNotDisturb", "command", gContentPane.toggleDoNotDisturbNotifications); @@ -274,21 +258,6 @@ var gContentPane = { gSubDialog.open("chrome://browser/content/preferences/languages.xul"); }, - /** - * Displays the translation exceptions dialog where specific site and language - * translation preferences can be set. - */ - showTranslationExceptions: function () - { - gSubDialog.open("chrome://browser/content/preferences/translation.xul"); - }, - - openTranslationProviderAttribution: function () - { - Components.utils.import("resource:///modules/translation/Translation.jsm"); - Translation.openProviderAttribution(); - }, - toggleDoNotDisturbNotifications: function (event) { AlertsServiceDND.manualDoNotDisturb = event.target.checked; diff --git a/application/basilisk/components/preferences/in-content/content.xul b/application/basilisk/components/preferences/in-content/content.xul index 9434cba62..fac864411 100644 --- a/application/basilisk/components/preferences/in-content/content.xul +++ b/application/basilisk/components/preferences/in-content/content.xul @@ -22,11 +22,6 @@ <preference id="font.language.group" name="font.language.group" type="wstring"/> - - <!-- Languages --> - <preference id="browser.translation.detectLanguage" - name="browser.translation.detectLanguage" - type="bool"/> </preferences> <script type="application/javascript" @@ -191,23 +186,4 @@ label="&chooseButton.label;" accesskey="&chooseButton.accesskey;"/> </hbox> - - <hbox id="translationBox" hidden="true"> - <hbox align="center" flex="1"> - <checkbox id="translate" preference="browser.translation.detectLanguage" - label="&translateWebPages.label;." accesskey="&translateWebPages.accesskey;" - onsyncfrompreference="return gContentPane.updateButtons('translateButton', - 'browser.translation.detectLanguage');"/> - <hbox id="bingAttribution" hidden="true"> - <label>&translation.options.attribution.beforeLogo;</label> - <separator orient="vertical" class="thin"/> - <image id="translationAttributionImage" aria-label="Microsoft Translator" - src="chrome://browser/content/microsoft-translator-attribution.png"/> - <separator orient="vertical" class="thin"/> - <label>&translation.options.attribution.afterLogo;</label> - </hbox> - </hbox> - <button id="translateButton" label="&translateExceptions.label;" - accesskey="&translateExceptions.accesskey;"/> - </hbox> </groupbox> diff --git a/application/basilisk/components/preferences/in-content/jar.mn b/application/basilisk/components/preferences/in-content/jar.mn index e61a88856..21f5ccf38 100644 --- a/application/basilisk/components/preferences/in-content/jar.mn +++ b/application/basilisk/components/preferences/in-content/jar.mn @@ -3,16 +3,17 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/preferences/in-content/preferences.js +* content/browser/preferences/in-content/preferences.js * content/browser/preferences/in-content/preferences.xul content/browser/preferences/in-content/subdialogs.js content/browser/preferences/in-content/main.js * content/browser/preferences/in-content/privacy.js - content/browser/preferences/in-content/containers.js content/browser/preferences/in-content/advanced.js content/browser/preferences/in-content/applications.js * content/browser/preferences/in-content/content.js +#ifdef MOZ_SERVICES_SYNC content/browser/preferences/in-content/sync.js +#endif * content/browser/preferences/in-content/security.js content/browser/preferences/in-content/search.js diff --git a/application/basilisk/components/preferences/in-content/main.js b/application/basilisk/components/preferences/in-content/main.js index bac771bec..8f3dffa57 100644 --- a/application/basilisk/components/preferences/in-content/main.js +++ b/application/basilisk/components/preferences/in-content/main.js @@ -78,18 +78,6 @@ var gMainPane = { setEventListener("chooseFolder", "command", gMainPane.chooseFolder); - if (AppConstants.MOZ_DEV_EDITION) { - let uAppData = OS.Constants.Path.userApplicationDataDir; - let ignoreSeparateProfile = OS.Path.join(uAppData, "ignore-dev-edition-profile"); - - setEventListener("separateProfileMode", "command", gMainPane.separateProfileModeChange); - let separateProfileModeCheckbox = document.getElementById("separateProfileMode"); - setEventListener("getStarted", "click", gMainPane.onGetStarted); - - OS.File.stat(ignoreSeparateProfile).then(() => separateProfileModeCheckbox.checked = false, - () => separateProfileModeCheckbox.checked = true); - } - // Notify observers that the UI is now ready Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService) @@ -101,71 +89,6 @@ var gMainPane = { // **STUB** }, - separateProfileModeChange: function () - { - if (AppConstants.MOZ_DEV_EDITION) { - function quitApp() { - Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestartNotSameProfile); - } - function revertCheckbox(error) { - separateProfileModeCheckbox.checked = !separateProfileModeCheckbox.checked; - if (error) { - Cu.reportError("Failed to toggle separate profile mode: " + error); - } - } - function createOrRemoveSpecialDevEditionFile(onSuccess) { - let uAppData = OS.Constants.Path.userApplicationDataDir; - let ignoreSeparateProfile = OS.Path.join(uAppData, "ignore-dev-edition-profile"); - - if (separateProfileModeCheckbox.checked) { - OS.File.remove(ignoreSeparateProfile).then(onSuccess, revertCheckbox); - } else { - OS.File.writeAtomic(ignoreSeparateProfile, new Uint8Array()).then(onSuccess, revertCheckbox); - } - } - - let separateProfileModeCheckbox = document.getElementById("separateProfileMode"); - let button_index = confirmRestartPrompt(separateProfileModeCheckbox.checked, - 0, false, true); - switch (button_index) { - case CONFIRM_RESTART_PROMPT_CANCEL: - revertCheckbox(); - return; - case CONFIRM_RESTART_PROMPT_RESTART_NOW: - const Cc = Components.classes, Ci = Components.interfaces; - let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"] - .createInstance(Ci.nsISupportsPRBool); - Services.obs.notifyObservers(cancelQuit, "quit-application-requested", - "restart"); - if (!cancelQuit.data) { - createOrRemoveSpecialDevEditionFile(quitApp); - return; - } - - // Revert the checkbox in case we didn't quit - revertCheckbox(); - return; - case CONFIRM_RESTART_PROMPT_RESTART_LATER: - createOrRemoveSpecialDevEditionFile(); - return; - } - } - }, - - onGetStarted: function (aEvent) { - if (AppConstants.MOZ_DEV_EDITION) { - const Cc = Components.classes, Ci = Components.interfaces; - let wm = Cc["@mozilla.org/appshell/window-mediator;1"] - .getService(Ci.nsIWindowMediator); - let win = wm.getMostRecentWindow("navigator:browser"); - - if (win) { - let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup"); - win.gBrowser.selectedTab = accountsTab; - } - } - }, - // HOME PAGE /* diff --git a/application/basilisk/components/preferences/in-content/main.xul b/application/basilisk/components/preferences/in-content/main.xul index 8eca11877..f695b308b 100644 --- a/application/basilisk/components/preferences/in-content/main.xul +++ b/application/basilisk/components/preferences/in-content/main.xul @@ -112,17 +112,6 @@ hidden="true"> <caption><label>&startup.label;</label></caption> -#ifdef MOZ_DEV_EDITION - <vbox id="separateProfileBox"> - <checkbox id="separateProfileMode" - label="&separateProfileMode.label;"/> - <hbox align="center" class="indent"> - <label id="useFirefoxSync">&useFirefoxSync.label;</label> - <label id="getStarted" class="text-link">&getStarted.label;</label> - </hbox> - </vbox> -#endif - #ifdef HAVE_SHELL_SERVICE <vbox id="defaultBrowserBox"> <hbox align="center"> diff --git a/application/basilisk/components/preferences/in-content/preferences.js b/application/basilisk/components/preferences/in-content/preferences.js index e18ab4b04..69cb180d5 100644 --- a/application/basilisk/components/preferences/in-content/preferences.js +++ b/application/basilisk/components/preferences/in-content/preferences.js @@ -61,11 +61,12 @@ function init_all() { register_module("paneGeneral", gMainPane); register_module("paneSearch", gSearchPane); register_module("panePrivacy", gPrivacyPane); - register_module("paneContainers", gContainersPane); register_module("paneAdvanced", gAdvancedPane); register_module("paneApplications", gApplicationsPane); register_module("paneContent", gContentPane); +#ifdef MOZ_SERVICES_SYNC register_module("paneSync", gSyncPane); +#endif register_module("paneSecurity", gSecurityPane); let categories = document.getElementById("categories"); diff --git a/application/basilisk/components/preferences/in-content/preferences.xul b/application/basilisk/components/preferences/in-content/preferences.xul index 7ec7ef119..61639aa19 100644 --- a/application/basilisk/components/preferences/in-content/preferences.xul +++ b/application/basilisk/components/preferences/in-content/preferences.xul @@ -13,7 +13,6 @@ href="chrome://browser/content/preferences/handlers.css"?> <?xml-stylesheet href="chrome://browser/skin/preferences/applications.css"?> <?xml-stylesheet href="chrome://browser/skin/preferences/in-content/search.css"?> -<?xml-stylesheet href="chrome://browser/skin/preferences/in-content/containers.css"?> <!DOCTYPE page [ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> @@ -23,12 +22,12 @@ <!ENTITY % privacyDTD SYSTEM "chrome://browser/locale/preferences/privacy.dtd"> <!ENTITY % tabsDTD SYSTEM "chrome://browser/locale/preferences/tabs.dtd"> <!ENTITY % searchDTD SYSTEM "chrome://browser/locale/preferences/search.dtd"> +#ifdef MOZ_SERVICES_SYNC <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd"> <!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd"> +#endif <!ENTITY % securityDTD SYSTEM "chrome://browser/locale/preferences/security.dtd"> -<!ENTITY % containersDTD SYSTEM - "chrome://browser/locale/preferences/containers.dtd"> <!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd"> <!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences/main.dtd"> <!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd"> @@ -43,10 +42,11 @@ %privacyDTD; %tabsDTD; %searchDTD; +#ifdef MOZ_SERVICES_SYNC %syncBrandDTD; %syncDTD; +#endif %securityDTD; -%containersDTD; %sanitizeDTD; %mainDTD; %aboutHomeDTD; @@ -134,12 +134,6 @@ <label class="category-name" flex="1">&panePrivacy.title;</label> </richlistitem> - <richlistitem id="category-containers" - class="category" - value="paneContainers" - helpTopic="prefs-containers" - hidden="true"/> - <richlistitem id="category-security" class="category" value="paneSecurity" @@ -150,6 +144,7 @@ <label class="category-name" flex="1">&paneSecurity.title;</label> </richlistitem> +#ifdef MOZ_SERVICES_SYNC <richlistitem id="category-sync" class="category" value="paneSync" @@ -159,6 +154,7 @@ <image class="category-icon"/> <label class="category-name" flex="1">&paneSync.title;</label> </richlistitem> +#endif <richlistitem id="category-advanced" class="category" @@ -183,12 +179,13 @@ #include main.xul #include search.xul #include privacy.xul -#include containers.xul #include advanced.xul #include applications.xul #include content.xul #include security.xul +#ifdef MOZ_SERVICES_SYNC #include sync.xul +#endif </prefpane> </vbox> diff --git a/application/basilisk/components/preferences/in-content/privacy.js b/application/basilisk/components/preferences/in-content/privacy.js index eab606e36..a976fb4fa 100644 --- a/application/basilisk/components/preferences/in-content/privacy.js +++ b/application/basilisk/components/preferences/in-content/privacy.js @@ -5,8 +5,6 @@ Components.utils.import("resource://gre/modules/AppConstants.jsm"); Components.utils.import("resource://gre/modules/PluralForm.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", - "resource://gre/modules/ContextualIdentityService.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm"); @@ -62,59 +60,6 @@ var gPrivacyPane = { }, /** - * Show the Containers UI depending on the privacy.userContext.ui.enabled pref. - */ - _initBrowserContainers: function () { - if (!Services.prefs.getBoolPref("privacy.userContext.ui.enabled")) { - return; - } - - let link = document.getElementById("browserContainersLearnMore"); - link.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "containers"; - - document.getElementById("browserContainersbox").hidden = false; - - document.getElementById("browserContainersCheckbox").checked = - Services.prefs.getBoolPref("privacy.userContext.enabled"); - }, - - _checkBrowserContainers: function(event) { - let checkbox = document.getElementById("browserContainersCheckbox"); - if (checkbox.checked) { - Services.prefs.setBoolPref("privacy.userContext.enabled", true); - return; - } - - let count = ContextualIdentityService.countContainerTabs(); - if (count == 0) { - Services.prefs.setBoolPref("privacy.userContext.enabled", false); - return; - } - - let bundlePreferences = document.getElementById("bundlePreferences"); - - let title = bundlePreferences.getString("disableContainersAlertTitle"); - let message = PluralForm.get(count, bundlePreferences.getString("disableContainersMsg")) - .replace("#S", count) - let okButton = PluralForm.get(count, bundlePreferences.getString("disableContainersOkButton")) - .replace("#S", count) - let cancelButton = bundlePreferences.getString("disableContainersButton2"); - - let buttonFlags = (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_0) + - (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_1); - - let rv = Services.prompt.confirmEx(window, title, message, buttonFlags, - okButton, cancelButton, null, null, {}); - if (rv == 0) { - ContextualIdentityService.closeAllContainerTabs(); - Services.prefs.setBoolPref("privacy.userContext.enabled", false); - return; - } - - checkbox.checked = true; - }, - - /** * Sets up the UI for the number of days of history to keep, and updates the * label of the "Clear Now..." button. */ @@ -136,7 +81,6 @@ var gPrivacyPane = { this._initTrackingProtectionPBM(); #endif this._initAutocomplete(); - this._initBrowserContainers(); setEventListener("privacy.sanitize.sanitizeOnShutdown", "change", gPrivacyPane._updateSanitizeSettingsButton); @@ -184,10 +128,6 @@ var gPrivacyPane = { setEventListener("changeBlockListPBM", "command", gPrivacyPane.showBlockLists); #endif - setEventListener("browserContainersCheckbox", "command", - gPrivacyPane._checkBrowserContainers); - setEventListener("browserContainersSettings", "command", - gPrivacyPane.showContainerSettings); }, #ifdef MOZ_SAFE_BROWSING @@ -489,13 +429,6 @@ var gPrivacyPane = { }, #endif - /** - * Displays container panel for customising and adding containers. - */ - showContainerSettings() { - gotoPref("containers"); - }, - #ifdef MOZ_SAFE_BROWSING /** * Displays the available block lists for tracking protection. @@ -702,25 +635,4 @@ var gPrivacyPane = { settingsButton.disabled = !sanitizeOnShutdownPref.value; }, - - // CONTAINERS - - /* - * preferences: - * - * privacy.userContext.enabled - * - true if containers is enabled - */ - - /** - * Enables/disables the Settings button used to configure containers - */ - readBrowserContainersCheckbox: function () - { - var pref = document.getElementById("privacy.userContext.enabled"); - var settings = document.getElementById("browserContainersSettings"); - - settings.disabled = !pref.value; - } - }; diff --git a/application/basilisk/components/preferences/in-content/privacy.xul b/application/basilisk/components/preferences/in-content/privacy.xul index e6cdc5dd2..691cd6bf9 100644 --- a/application/basilisk/components/preferences/in-content/privacy.xul +++ b/application/basilisk/components/preferences/in-content/privacy.xul @@ -302,28 +302,3 @@ &suggestionSettings.label; </label> </groupbox> - -<!-- Containers --> -<groupbox id="browserContainersGroup" data-category="panePrivacy" hidden="true"> - <vbox id="browserContainersbox" hidden="true"> - <caption><label>&browserContainersHeader.label; - <label id="browserContainersLearnMore" class="text-link" - value="&browserContainersLearnMore.label;"/> - </label></caption> - <hbox align="start"> - <vbox> - <checkbox id="browserContainersCheckbox" - label="&browserContainersEnabled.label;" - accesskey="&browserContainersEnabled.accesskey;" - preference="privacy.userContext.enabled" - onsyncfrompreference="return gPrivacyPane.readBrowserContainersCheckbox();"/> - </vbox> - <spacer flex="1"/> - <vbox> - <button id="browserContainersSettings" - label="&browserContainersSettings.label;" - accesskey="&browserContainersSettings.accesskey;"/> - </vbox> - </hbox> - </vbox> -</groupbox> diff --git a/application/basilisk/components/preferences/in-content/sync.js b/application/basilisk/components/preferences/in-content/sync.js index 27f7cd48c..917b5f123 100644 --- a/application/basilisk/components/preferences/in-content/sync.js +++ b/application/basilisk/components/preferences/in-content/sync.js @@ -1,32 +1,16 @@ /* 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/. */ + * 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/. */ Components.utils.import("resource://services-sync/main.js"); Components.utils.import("resource://gre/modules/Services.jsm"); -XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function () { - return Components.utils.import("resource://gre/modules/FxAccountsCommon.js", {}); -}); - -XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts", - "resource://gre/modules/FxAccounts.jsm"); - const PAGE_NO_ACCOUNT = 0; const PAGE_HAS_ACCOUNT = 1; const PAGE_NEEDS_UPDATE = 2; -const FXA_PAGE_LOGGED_OUT = 3; -const FXA_PAGE_LOGGED_IN = 4; - -// Indexes into the "login status" deck. -// We are in a successful verified state - everything should work! -const FXA_LOGIN_VERIFIED = 0; -// We have logged in to an unverified account. -const FXA_LOGIN_UNVERIFIED = 1; -// We are logged in locally, but the server rejected our credentials. -const FXA_LOGIN_FAILED = 2; var gSyncPane = { + _stringBundle: null, prefArray: ["engine.bookmarks", "engine.passwords", "engine.prefs", "engine.tabs", "engine.history"], @@ -45,13 +29,11 @@ var gSyncPane = { needsUpdate: function () { this.page = PAGE_NEEDS_UPDATE; let label = document.getElementById("loginError"); - label.textContent = Weave.Utils.getErrorString(Weave.Status.login); + label.value = Weave.Utils.getErrorString(Weave.Status.login); label.className = "error"; }, init: function () { - this._setupEventListeners(); - // If the Service hasn't finished initializing, wait for it. let xps = Components.classes["@mozilla.org/weave/service;1"] .getService(Components.interfaces.nsISupports) @@ -62,10 +44,6 @@ var gSyncPane = { return; } - // it may take some time before we can determine what provider to use - // and the state of that provider, so show the "please wait" page. - this._showLoadPage(xps); - let onUnload = function () { window.removeEventListener("unload", onUnload, false); try { @@ -85,352 +63,50 @@ var gSyncPane = { xps.ensureLoaded(); }, - _showLoadPage: function (xps) { - let username; - try { - username = Services.prefs.getCharPref("services.sync.username"); - } catch (e) {} - if (!username) { - this.page = FXA_PAGE_LOGGED_OUT; - } else if (xps.fxAccountsEnabled) { - // Use cached values while we wait for the up-to-date values - let cachedComputerName; - try { - cachedComputerName = Services.prefs.getCharPref("services.sync.client.name"); - } - catch (e) { - cachedComputerName = ""; - } - document.getElementById("fxaEmailAddress1").textContent = username; - this._populateComputerName(cachedComputerName); - this.page = FXA_PAGE_LOGGED_IN; - } else { // Old Sync - this.page = PAGE_HAS_ACCOUNT; - } - }, - _init: function () { let topics = ["weave:service:login:error", "weave:service:login:finish", - "weave:service:start-over:finish", + "weave:service:start-over", "weave:service:setup-complete", - "weave:service:logout:finish", - FxAccountsCommon.ONVERIFIED_NOTIFICATION, - FxAccountsCommon.ONLOGIN_NOTIFICATION, - FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION, - ]; + "weave:service:logout:finish"]; + // Add the observers now and remove them on unload - // XXXzpao This should use Services.obs.* but Weave's Obs does nice handling + //XXXzpao This should use Services.obs.* but Weave's Obs does nice handling // of `this`. Fix in a followup. (bug 583347) topics.forEach(function (topic) { Weave.Svc.Obs.add(topic, this.updateWeavePrefs, this); }, this); - window.addEventListener("unload", function() { topics.forEach(function (topic) { Weave.Svc.Obs.remove(topic, this.updateWeavePrefs, this); }, gSyncPane); }, false); - XPCOMUtils.defineLazyGetter(this, '_stringBundle', () => { - return Services.strings.createBundle("chrome://browser/locale/preferences/preferences.properties"); - }); - - XPCOMUtils.defineLazyGetter(this, '_accountsStringBundle', () => { - return Services.strings.createBundle("chrome://browser/locale/accounts.properties"); - }); - - let url = Services.prefs.getCharPref("identity.mobilepromo.android") + "sync-preferences"; - document.getElementById("fxaMobilePromo-android").setAttribute("href", url); - document.getElementById("fxaMobilePromo-android-hasFxaAccount").setAttribute("href", url); - url = Services.prefs.getCharPref("identity.mobilepromo.ios") + "sync-preferences"; - document.getElementById("fxaMobilePromo-ios").setAttribute("href", url); - document.getElementById("fxaMobilePromo-ios-hasFxaAccount").setAttribute("href", url); - - document.getElementById("tosPP-small-ToS").setAttribute("href", gSyncUtils.tosURL); - document.getElementById("tosPP-normal-ToS").setAttribute("href", gSyncUtils.tosURL); - document.getElementById("tosPP-small-PP").setAttribute("href", gSyncUtils.privacyPolicyURL); - document.getElementById("tosPP-normal-PP").setAttribute("href", gSyncUtils.privacyPolicyURL); - - fxAccounts.promiseAccountsManageURI(this._getEntryPoint()).then(url => { - document.getElementById("verifiedManage").setAttribute("href", url); - }); - + this._stringBundle = + Services.strings.createBundle("chrome://browser/locale/preferences/preferences.properties"); this.updateWeavePrefs(); - - this._initProfileImageUI(); - }, - - _toggleComputerNameControls: function(editMode) { - let textbox = document.getElementById("fxaSyncComputerName"); - textbox.disabled = !editMode; - document.getElementById("fxaChangeDeviceName").hidden = editMode; - document.getElementById("fxaCancelChangeDeviceName").hidden = !editMode; - document.getElementById("fxaSaveChangeDeviceName").hidden = !editMode; - }, - - _focusComputerNameTextbox: function() { - let textbox = document.getElementById("fxaSyncComputerName"); - let valLength = textbox.value.length; - textbox.focus(); - textbox.setSelectionRange(valLength, valLength); - }, - - _blurComputerNameTextbox: function() { - document.getElementById("fxaSyncComputerName").blur(); - }, - - _focusAfterComputerNameTextbox: function() { - // Focus the most appropriate element that's *not* the "computer name" box. - Services.focus.moveFocus(window, - document.getElementById("fxaSyncComputerName"), - Services.focus.MOVEFOCUS_FORWARD, 0); - }, - - _updateComputerNameValue: function(save) { - if (save) { - let textbox = document.getElementById("fxaSyncComputerName"); - Weave.Service.clientsEngine.localName = textbox.value; - } - this._populateComputerName(Weave.Service.clientsEngine.localName); - }, - - _setupEventListeners: function() { - function setEventListener(aId, aEventType, aCallback) - { - document.getElementById(aId) - .addEventListener(aEventType, aCallback.bind(gSyncPane)); - } - - setEventListener("noAccountSetup", "click", function (aEvent) { - aEvent.stopPropagation(); - gSyncPane.openSetup(null); - }); - setEventListener("noAccountPair", "click", function (aEvent) { - aEvent.stopPropagation(); - gSyncPane.openSetup('pair'); - }); - setEventListener("syncChangePassword", "command", - () => gSyncUtils.changePassword()); - setEventListener("syncResetPassphrase", "command", - () => gSyncUtils.resetPassphrase()); - setEventListener("syncReset", "command", gSyncPane.resetSync); - setEventListener("syncAddDeviceLabel", "click", function () { - gSyncPane.openAddDevice(); - return false; - }); - setEventListener("syncEnginesList", "select", function () { - if (this.selectedCount) - this.clearSelection(); - }); - setEventListener("syncComputerName", "change", function (e) { - gSyncUtils.changeName(e.target); - }); - setEventListener("fxaChangeDeviceName", "command", function () { - this._toggleComputerNameControls(true); - this._focusComputerNameTextbox(); - }); - setEventListener("fxaCancelChangeDeviceName", "command", function () { - // We explicitly blur the textbox because of bug 75324, then after - // changing the state of the buttons, force focus to whatever the focus - // manager thinks should be next (which on the mac, depends on an OSX - // keyboard access preference) - this._blurComputerNameTextbox(); - this._toggleComputerNameControls(false); - this._updateComputerNameValue(false); - this._focusAfterComputerNameTextbox(); - }); - setEventListener("fxaSaveChangeDeviceName", "command", function () { - // Work around bug 75324 - see above. - this._blurComputerNameTextbox(); - this._toggleComputerNameControls(false); - this._updateComputerNameValue(true); - this._focusAfterComputerNameTextbox(); - }); - setEventListener("unlinkDevice", "click", function () { - gSyncPane.startOver(true); - return false; - }); - setEventListener("loginErrorUpdatePass", "click", function () { - gSyncPane.updatePass(); - return false; - }); - setEventListener("loginErrorResetPass", "click", function () { - gSyncPane.resetPass(); - return false; - }); - setEventListener("loginErrorStartOver", "click", function () { - gSyncPane.startOver(true); - return false; - }); - setEventListener("noFxaSignUp", "command", function () { - gSyncPane.signUp(); - return false; - }); - setEventListener("noFxaSignIn", "command", function () { - gSyncPane.signIn(); - return false; - }); - setEventListener("fxaUnlinkButton", "command", function () { - gSyncPane.unlinkFirefoxAccount(true); - }); - setEventListener("verifyFxaAccount", "command", - gSyncPane.verifyFirefoxAccount); - setEventListener("unverifiedUnlinkFxaAccount", "command", function () { - /* no warning as account can't have previously synced */ - gSyncPane.unlinkFirefoxAccount(false); - }); - setEventListener("rejectReSignIn", "command", - gSyncPane.reSignIn); - setEventListener("rejectUnlinkFxaAccount", "command", function () { - gSyncPane.unlinkFirefoxAccount(true); - }); - setEventListener("fxaSyncComputerName", "keypress", function (e) { - if (e.keyCode == KeyEvent.DOM_VK_RETURN) { - document.getElementById("fxaSaveChangeDeviceName").click(); - } else if (e.keyCode == KeyEvent.DOM_VK_ESCAPE) { - document.getElementById("fxaCancelChangeDeviceName").click(); - } - }); - }, - - _initProfileImageUI: function () { - try { - if (Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled")) { - document.getElementById("fxaProfileImage").hidden = false; - } - } catch (e) { } + document.getElementById("weavePrefsDeck").setAttribute("hidden", ""); }, updateWeavePrefs: function () { - let service = Components.classes["@mozilla.org/weave/service;1"] - .getService(Components.interfaces.nsISupports) - .wrappedJSObject; - // service.fxAccountsEnabled is false iff sync is already configured for - // the legacy provider. - if (service.fxAccountsEnabled) { - let displayNameLabel = document.getElementById("fxaDisplayName"); - let fxaEmailAddress1Label = document.getElementById("fxaEmailAddress1"); - fxaEmailAddress1Label.hidden = false; - displayNameLabel.hidden = true; - - let profileInfoEnabled; - try { - profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled"); - } catch (ex) {} - - // determine the fxa status... - this._showLoadPage(service); - - fxAccounts.getSignedInUser().then(data => { - if (!data) { - this.page = FXA_PAGE_LOGGED_OUT; - return false; - } - this.page = FXA_PAGE_LOGGED_IN; - // We are logged in locally, but maybe we are in a state where the - // server rejected our credentials (eg, password changed on the server) - let fxaLoginStatus = document.getElementById("fxaLoginStatus"); - let syncReady; - // Not Verfied implies login error state, so check that first. - if (!data.verified) { - fxaLoginStatus.selectedIndex = FXA_LOGIN_UNVERIFIED; - syncReady = false; - // So we think we are logged in, so login problems are next. - // (Although if the Sync identity manager is still initializing, we - // ignore login errors and assume all will eventually be good.) - // LOGIN_FAILED_LOGIN_REJECTED explicitly means "you must log back in". - // All other login failures are assumed to be transient and should go - // away by themselves, so aren't reflected here. - } else if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) { - fxaLoginStatus.selectedIndex = FXA_LOGIN_FAILED; - syncReady = false; - // Else we must be golden (or in an error state we expect to magically - // resolve itself) - } else { - fxaLoginStatus.selectedIndex = FXA_LOGIN_VERIFIED; - syncReady = true; - } - fxaEmailAddress1Label.textContent = data.email; - document.getElementById("fxaEmailAddress2").textContent = data.email; - document.getElementById("fxaEmailAddress3").textContent = data.email; - this._populateComputerName(Weave.Service.clientsEngine.localName); - let engines = document.getElementById("fxaSyncEngines") - for (let checkbox of engines.querySelectorAll("checkbox")) { - checkbox.disabled = !syncReady; - } - document.getElementById("fxaChangeDeviceName").disabled = !syncReady; - - // Clear the profile image (if any) of the previously logged in account. - document.getElementById("fxaProfileImage").style.removeProperty("list-style-image"); - - // If the account is verified the next promise in the chain will - // fetch profile data. - return data.verified; - }).then(isVerified => { - if (isVerified) { - return fxAccounts.getSignedInUserProfile(); - } - return null; - }).then(data => { - let fxaLoginStatus = document.getElementById("fxaLoginStatus"); - if (data && profileInfoEnabled) { - if (data.displayName) { - fxaLoginStatus.setAttribute("hasName", true); - displayNameLabel.hidden = false; - displayNameLabel.textContent = data.displayName; - } else { - fxaLoginStatus.removeAttribute("hasName"); - } - if (data.avatar) { - let bgImage = "url(\"" + data.avatar + "\")"; - let profileImageElement = document.getElementById("fxaProfileImage"); - profileImageElement.style.listStyleImage = bgImage; - - let img = new Image(); - img.onerror = () => { - // Clear the image if it has trouble loading. Since this callback is asynchronous - // we check to make sure the image is still the same before we clear it. - if (profileImageElement.style.listStyleImage === bgImage) { - profileImageElement.style.removeProperty("list-style-image"); - } - }; - img.src = data.avatar; - } - } else { - fxaLoginStatus.removeAttribute("hasName"); - } - }, err => { - FxAccountsCommon.log.error(err); - }).catch(err => { - // If we get here something's really busted - Cu.reportError(String(err)); - }); - - // If fxAccountEnabled is false and we are in a "not configured" state, - // then fxAccounts is probably fully disabled rather than just unconfigured, - // so handle this case. This block can be removed once we remove support - // for fxAccounts being disabled. - } else if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED || - Weave.Svc.Prefs.get("firstSync", "") == "notReady") { + if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED || + Weave.Svc.Prefs.get("firstSync", "") == "notReady") { this.page = PAGE_NO_ACCOUNT; - // else: sync was previously configured for the legacy provider, so we - // make the "old" panels available. } else if (Weave.Status.login == Weave.LOGIN_FAILED_INVALID_PASSPHRASE || Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) { this.needsUpdate(); } else { this.page = PAGE_HAS_ACCOUNT; - document.getElementById("accountName").textContent = Weave.Service.identity.account; + document.getElementById("accountName").value = Weave.Service.identity.account; document.getElementById("syncComputerName").value = Weave.Service.clientsEngine.localName; - document.getElementById("tosPP-normal").hidden = this._usingCustomServer; + document.getElementById("tosPP").hidden = this._usingCustomServer; } }, startOver: function (showDialog) { if (showDialog) { let flags = Services.prompt.BUTTON_POS_0 * Services.prompt.BUTTON_TITLE_IS_STRING + - Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_CANCEL + + Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_CANCEL + Services.prompt.BUTTON_POS_1_DEFAULT; let buttonChoice = Services.prompt.confirmEx(window, @@ -441,8 +117,9 @@ var gSyncPane = { null, null, null, {}); // If the user selects cancel, just bail - if (buttonChoice == 1) + if (buttonChoice == 1) { return; + } } Weave.Service.startOver(); @@ -450,33 +127,19 @@ var gSyncPane = { }, updatePass: function () { - if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) + if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) { gSyncUtils.changePassword(); - else + } else { gSyncUtils.updatePassphrase(); + } }, resetPass: function () { - if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) + if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) { gSyncUtils.resetPassword(); - else + } else { gSyncUtils.resetPassphrase(); - }, - - _getEntryPoint: function () { - let params = new URLSearchParams(document.URL.split("#")[0].split("?")[1] || ""); - return params.get("entrypoint") || "preferences"; - }, - - _openAboutAccounts: function(action) { - let entryPoint = this._getEntryPoint(); - let params = new URLSearchParams(); - if (action) { - params.set("action", action); } - params.set("entrypoint", entryPoint); - - this.replaceTabWithUrl("about:accounts?" + params); }, /** @@ -489,185 +152,42 @@ var gSyncPane = { * "reset" -- reset sync */ openSetup: function (wizardType) { - let service = Components.classes["@mozilla.org/weave/service;1"] - .getService(Components.interfaces.nsISupports) - .wrappedJSObject; - - if (service.fxAccountsEnabled) { - this._openAboutAccounts(); + let win = Services.wm.getMostRecentWindow("Weave:AccountSetup"); + if (win) { + win.focus(); } else { - let win = Services.wm.getMostRecentWindow("Weave:AccountSetup"); - if (win) - win.focus(); - else { - window.openDialog("chrome://browser/content/sync/setup.xul", - "weaveSetup", "centerscreen,chrome,resizable=no", - wizardType); - } - } - }, - - openContentInBrowser: function(url, options) { - let win = Services.wm.getMostRecentWindow("navigator:browser"); - if (!win) { - // no window to use, so use _openLink to create a new one. We don't - // always use that as it prefers to open a new window rather than use - // an existing one. - gSyncUtils._openLink(url); - return; + window.openDialog("chrome://browser/content/sync/setup.xul", + "weaveSetup", "centerscreen,chrome,resizable=no", + wizardType); } - win.switchToTabHavingURI(url, true, options); - }, - - // Replace the current tab with the specified URL. - replaceTabWithUrl(url) { - // Get the <browser> element hosting us. - let browser = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebNavigation) - .QueryInterface(Ci.nsIDocShell) - .chromeEventHandler; - // And tell it to load our URL. - browser.loadURI(url); }, - signUp: function() { - this._openAboutAccounts("signup"); - }, - - signIn: function() { - this._openAboutAccounts("signin"); - }, - - reSignIn: function() { - this._openAboutAccounts("reauth"); - }, - - - clickOrSpaceOrEnterPressed: function(event) { - // Note: charCode is deprecated, but 'char' not yet implemented. - // Replace charCode with char when implemented, see Bug 680830 - return ((event.type == "click" && event.button == 0) || - (event.type == "keypress" && - (event.charCode == KeyEvent.DOM_VK_SPACE || event.keyCode == KeyEvent.DOM_VK_RETURN))); - }, - - openChangeProfileImage: function(event) { - if (this.clickOrSpaceOrEnterPressed(event)) { - fxAccounts.promiseAccountsChangeProfileURI(this._getEntryPoint(), "avatar") - .then(url => { - this.openContentInBrowser(url, { - replaceQueryString: true - }); - }); - // Prevent page from scrolling on the space key. - event.preventDefault(); - } - }, - - openManageFirefoxAccount: function(event) { - if (this.clickOrSpaceOrEnterPressed(event)) { - this.manageFirefoxAccount(); - // Prevent page from scrolling on the space key. - event.preventDefault(); - } - }, - - manageFirefoxAccount: function() { - fxAccounts.promiseAccountsManageURI(this._getEntryPoint()) - .then(url => { - this.openContentInBrowser(url, { - replaceQueryString: true - }); - }); - }, - - verifyFirefoxAccount: function() { - let showVerifyNotification = (data) => { - let isError = !data; - let maybeNot = isError ? "Not" : ""; - let sb = this._accountsStringBundle; - let title = sb.GetStringFromName("verification" + maybeNot + "SentTitle"); - let email = !isError && data ? data.email : ""; - let body = sb.formatStringFromName("verification" + maybeNot + "SentBody", [email], 1); - new Notification(title, { body }) - } - - let onError = () => { - showVerifyNotification(); - }; - - let onSuccess = data => { - if (data) { - showVerifyNotification(data); - } else { - onError(); - } - }; - - fxAccounts.resendVerificationEmail() - .then(fxAccounts.getSignedInUser, onError) - .then(onSuccess, onError); - }, - - openOldSyncSupportPage: function() { - let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "old-sync"; - this.openContentInBrowser(url); - }, - - unlinkFirefoxAccount: function(confirm) { - if (confirm) { - // We use a string bundle shared with aboutAccounts. - let sb = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties"); - let disconnectLabel = sb.GetStringFromName("disconnect.label"); - let title = sb.GetStringFromName("disconnect.verify.title"); - let body = sb.GetStringFromName("disconnect.verify.bodyHeading") + - "\n\n" + - sb.GetStringFromName("disconnect.verify.bodyText"); - let ps = Services.prompt; - let buttonFlags = (ps.BUTTON_POS_0 * ps.BUTTON_TITLE_IS_STRING) + - (ps.BUTTON_POS_1 * ps.BUTTON_TITLE_CANCEL) + - ps.BUTTON_POS_1_DEFAULT; - - let factory = Cc["@mozilla.org/prompter;1"] - .getService(Ci.nsIPromptFactory); - let prompt = factory.getPrompt(window, Ci.nsIPrompt); - let bag = prompt.QueryInterface(Ci.nsIWritablePropertyBag2); - bag.setPropertyAsBool("allowTabModal", true); - - let pressed = prompt.confirmEx(title, body, buttonFlags, - disconnectLabel, null, null, null, {}); - - if (pressed != 0) { // 0 is the "continue" button - return; - } + openQuotaDialog: function () { + let win = Services.wm.getMostRecentWindow("Sync:ViewQuota"); + if (win) { + win.focus(); + } else { + window.openDialog("chrome://browser/content/sync/quota.xul", "", + "centerscreen,chrome,dialog,modal"); } - fxAccounts.signOut().then(() => { - this.updateWeavePrefs(); - }); }, openAddDevice: function () { - if (!Weave.Utils.ensureMPUnlocked()) + if (!Weave.Utils.ensureMPUnlocked()) { return; + } let win = Services.wm.getMostRecentWindow("Sync:AddDevice"); - if (win) + if (win) { win.focus(); - else + } else { window.openDialog("chrome://browser/content/sync/addDevice.xul", "syncAddDevice", "centerscreen,chrome,resizable=no"); + } }, resetSync: function () { this.openSetup("reset"); }, - - _populateComputerName(value) { - let textbox = document.getElementById("fxaSyncComputerName"); - if (!textbox.hasAttribute("placeholder")) { - textbox.setAttribute("placeholder", - Weave.Utils.getDefaultDeviceName()); - } - textbox.value = value; - }, }; + diff --git a/application/basilisk/components/preferences/in-content/sync.xul b/application/basilisk/components/preferences/in-content/sync.xul index f1aebf2aa..7ca075483 100644 --- a/application/basilisk/components/preferences/in-content/sync.xul +++ b/application/basilisk/components/preferences/in-content/sync.xul @@ -1,35 +1,22 @@ -# 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/. - -<!-- Sync panel --> - -<preferences id="syncEnginePrefs" hidden="true" data-category="paneSync"> - <preference id="engine.addons" - name="services.sync.engine.addons" - type="bool"/> - <preference id="engine.bookmarks" - name="services.sync.engine.bookmarks" - type="bool"/> - <preference id="engine.history" - name="services.sync.engine.history" - type="bool"/> - <preference id="engine.tabs" - name="services.sync.engine.tabs" - type="bool"/> - <preference id="engine.prefs" - name="services.sync.engine.prefs" - type="bool"/> - <preference id="engine.passwords" - name="services.sync.engine.passwords" - type="bool"/> -</preferences> +<!-- 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/. --> <script type="application/javascript" src="chrome://browser/content/preferences/in-content/sync.js"/> <script type="application/javascript" src="chrome://browser/content/sync/utils.js"/> +<preferences> +<!-- <preference id="engine.addons" name="services.sync.engine.addons" type="bool"/> --> + <preference id="engine.bookmarks" name="services.sync.engine.bookmarks" type="bool"/> + <preference id="engine.history" name="services.sync.engine.history" type="bool"/> + <preference id="engine.tabs" name="services.sync.engine.tabs" type="bool"/> + <preference id="engine.prefs" name="services.sync.engine.prefs" type="bool"/> + <preference id="engine.passwords" name="services.sync.engine.passwords" type="bool"/> +</preferences> + + <hbox id="header-sync" class="header" hidden="true" @@ -39,22 +26,19 @@ </hbox> <deck id="weavePrefsDeck" data-category="paneSync" hidden="true"> - <!-- These panels are for the "legacy" sync provider --> <vbox id="noAccount" align="center"> <spacer flex="1"/> <description id="syncDesc"> &weaveDesc.label; </description> <separator/> - <label id="noAccountSetup" class="text-link"> - &setupButton.label; - </label> - <vbox id="pairDevice"> - <separator/> - <label id="noAccountPair" class="text-link"> - &pairDevice.label; - </label> - </vbox> + <label class="text-link" + onclick="event.stopPropagation(); gSyncPane.openSetup(null);" + value="&setupButton.label;"/> + <separator/> + <label class="text-link" + onclick="event.stopPropagation(); gSyncPane.openSetup('pair');" + value="&pairDevice.label;"/> <spacer flex="3"/> </vbox> @@ -63,7 +47,7 @@ <!-- label is set to account name --> <caption id="accountCaption" align="center"> <image id="accountCaptionImage"/> - <label id="accountName"/> + <label id="accountName" value=""/> </caption> <hbox> @@ -71,30 +55,39 @@ label="&manageAccount.label;" accesskey="&manageAccount.accesskey;"> <menupopup> - <menuitem id="syncChangePassword" label="&changePassword2.label;"/> - <menuitem id="syncResetPassphrase" label="&myRecoveryKey.label;"/> + <menuitem label="&viewQuota.label;" + oncommand="gSyncPane.openQuotaDialog();"/> + <menuseparator/> + <menuitem label="&changePassword2.label;" + oncommand="gSyncUtils.changePassword();"/> + <menuitem label="&myRecoveryKey.label;" + oncommand="gSyncUtils.resetPassphrase();"/> <menuseparator/> - <menuitem id="syncReset" label="&resetSync2.label;"/> + <menuitem label="&resetSync2.label;" + oncommand="gSyncPane.resetSync();"/> </menupopup> </button> </hbox> <hbox> <label id="syncAddDeviceLabel" - class="text-link"> - &pairDevice.label; - </label> + class="text-link" + onclick="gSyncPane.openAddDevice(); return false;" + value="&pairDevice.label;"/> </hbox> <vbox> - <label>&syncMy.label;</label> + <label value="&syncMy.label;" /> <richlistbox id="syncEnginesList" - orient="vertical"> + orient="vertical" + onselect="if (this.selectedCount) this.clearSelection();"> + <!-- <richlistitem> <checkbox label="&engine.addons.label;" accesskey="&engine.addons.accesskey;" preference="engine.addons"/> </richlistitem> + --> <richlistitem> <checkbox label="&engine.bookmarks.label;" accesskey="&engine.bookmarks.accesskey;" @@ -132,228 +125,42 @@ </columns> <rows> <row align="center"> - <label control="syncComputerName"> - &syncDeviceName.label; - </label> - <textbox id="syncComputerName"/> + <label value="&syncDeviceName.label;" + accesskey="&syncDeviceName.accesskey;" + control="syncComputerName"/> + <textbox id="syncComputerName" + onchange="gSyncUtils.changeName(this)"/> </row> </rows> </grid> <hbox> - <label id="unlinkDevice" class="text-link"> - &unlinkDevice.label; - </label> + <label class="text-link" + onclick="gSyncPane.startOver(true); return false;" + value="&unlinkDevice.label;"/> </hbox> </groupbox> - <vbox id="tosPP-normal"> - <label id="tosPP-normal-ToS" class="text-link"> - &prefs.tosLink.label; - </label> - <label id="tosPP-normal-PP" class="text-link"> - &prefs.ppLink.label; - </label> - </vbox> - </vbox> - - <vbox id="needsUpdate" align="center" pack="center"> - <hbox> - <label id="loginError"/> - <label id="loginErrorUpdatePass" class="text-link"> - &updatePass.label; - </label> - <label id="loginErrorResetPass" class="text-link"> - &resetPass.label; - </label> + <hbox id="tosPP" pack="center"> + <label class="text-link" + onclick="event.stopPropagation();gSyncUtils.openToS();" + value="&prefs.tosLink.label;"/> + <label class="text-link" + onclick="event.stopPropagation();gSyncUtils.openPrivacyPolicy();" + value="&prefs.ppLink.label;"/> </hbox> - <label id="loginErrorStartOver" class="text-link"> - &unlinkDevice.label; - </label> </vbox> - <!-- These panels are for the Firefox Accounts identity provider --> - <vbox id="noFxaAccount"> - <hbox> - <vbox id="fxaContentWrapper"> - <groupbox id="noFxaGroup"> - <vbox> - <label id="noFxaCaption">&signedOut.caption;</label> - <description id="noFxaDescription" flex="1">&signedOut.description;</description> - <hbox class="fxaAccountBox"> - <vbox> - <image class="fxaFirefoxLogo"/> - </vbox> - <vbox flex="1"> - <label id="signedOutAccountBoxTitle">&signedOut.accountBox.title;</label> - <hbox class="fxaAccountBoxButtons"> - <button id="noFxaSignUp" label="&signedOut.accountBox.create;" accesskey="&signedOut.accountBox.create.accesskey;"></button> - <button id="noFxaSignIn" label="&signedOut.accountBox.signin;" accesskey="&signedOut.accountBox.signin.accesskey;"></button> - </hbox> - </vbox> - </hbox> - </vbox> - </groupbox> - </vbox> - <vbox> - <image class="fxaSyncIllustration"/> - </vbox> - </hbox> - <label class="fxaMobilePromo"> - &mobilePromo3.start;<!-- We put these comments to avoid inserting white spaces - --><label id="fxaMobilePromo-android" - class="androidLink text-link"><!-- - -->&mobilePromo3.androidLink;</label><!-- - -->&mobilePromo3.iOSBefore;<!-- - --><label id="fxaMobilePromo-ios" - class="iOSLink text-link"><!-- - -->&mobilePromo3.iOSLink;</label><!-- - -->&mobilePromo3.end; - </label> - </vbox> - - <vbox id="hasFxaAccount"> + <vbox id="needsUpdate" align="center" pack="center"> <hbox> - <vbox id="fxaContentWrapper"> - <groupbox id="fxaGroup"> - <caption><label>&syncBrand.fxAccount.label;</label></caption> - <deck id="fxaLoginStatus"> - - <!-- logged in and verified and all is good --> - <hbox id="fxaLoginVerified" class="fxaAccountBox"> - <vbox align="center" pack="center"> - <image id="fxaProfileImage" class="actionable" - role="button" - onclick="gSyncPane.openChangeProfileImage(event);" hidden="true" - onkeypress="gSyncPane.openChangeProfileImage(event);" - tooltiptext="&profilePicture.tooltip;"/> - </vbox> - <vbox flex="1" pack="center"> - <label id="fxaDisplayName" hidden="true"/> - <label id="fxaEmailAddress1"/> - <hbox class="fxaAccountBoxButtons"> - <button id="fxaUnlinkButton" label="&disconnect.label;" accesskey="&disconnect.accesskey;"/> - <html:a id="verifiedManage" target="_blank" - accesskey="&verifiedManage.accesskey;" - onkeypress="gSyncPane.openManageFirefoxAccount(event);"><!-- - -->&verifiedManage.label;</html:a> - </hbox> - </vbox> - </hbox> - - <!-- logged in to an unverified account --> - <hbox id="fxaLoginUnverified" class="fxaAccountBox"> - <vbox> - <image id="fxaProfileImage"/> - </vbox> - <vbox flex="1"> - <hbox> - <vbox><image id="fxaLoginRejectedWarning"/></vbox> - <description flex="1"> - &signedInUnverified.beforename.label; - <label id="fxaEmailAddress2"/> - &signedInUnverified.aftername.label; - </description> - </hbox> - <hbox class="fxaAccountBoxButtons"> - <button id="verifyFxaAccount" accesskey="&verify.accesskey;">&verify.label;</button> - <button id="unverifiedUnlinkFxaAccount" accesskey="&forget.accesskey;">&forget.label;</button> - </hbox> - </vbox> - </hbox> - - <!-- logged in locally but server rejected credentials --> - <hbox id="fxaLoginRejected" class="fxaAccountBox"> - <vbox> - <image id="fxaProfileImage"/> - </vbox> - <vbox flex="1"> - <hbox> - <vbox><image id="fxaLoginRejectedWarning"/></vbox> - <description flex="1"> - &signedInLoginFailure.beforename.label; - <label id="fxaEmailAddress3"/> - &signedInLoginFailure.aftername.label; - </description> - </hbox> - <hbox class="fxaAccountBoxButtons"> - <button id="rejectReSignIn" accessky="&signIn.accesskey;">&signIn.label;</button> - <button id="rejectUnlinkFxaAccount" accesskey="&forget.accesskey;">&forget.label;</button> - </hbox> - </vbox> - </hbox> - </deck> - </groupbox> - <groupbox id="syncOptions"> - <caption><label>&signedIn.engines.label;</label></caption> - <hbox id="fxaSyncEngines"> - <vbox align="start" flex="1"> - <checkbox label="&engine.tabs.label;" - accesskey="&engine.tabs.accesskey;" - preference="engine.tabs"/> - <checkbox label="&engine.bookmarks.label;" - accesskey="&engine.bookmarks.accesskey;" - preference="engine.bookmarks"/> - <checkbox label="&engine.passwords.label;" - accesskey="&engine.passwords.accesskey;" - preference="engine.passwords"/> - </vbox> - <vbox align="start" flex="1"> - <checkbox label="&engine.history.label;" - accesskey="&engine.history.accesskey;" - preference="engine.history"/> - <checkbox label="&engine.addons.label;" - accesskey="&engine.addons.accesskey;" - preference="engine.addons"/> - <checkbox label="&engine.prefs.label;" - accesskey="&engine.prefs.accesskey;" - preference="engine.prefs"/> - </vbox> - <spacer/> - </hbox> - </groupbox> - </vbox> - <vbox> - <image class="fxaSyncIllustration"/> - </vbox> + <label id="loginError" value=""/> + <label class="text-link" + onclick="gSyncPane.updatePass(); return false;" + value="&updatePass.label;"/> + <label class="text-link" + onclick="gSyncPane.resetPass(); return false;" + value="&resetPass.label;"/> </hbox> - <groupbox> - <caption> - <label control="fxaSyncComputerName"> - &fxaSyncDeviceName.label; - </label> - </caption> - <hbox id="fxaDeviceName"> - <textbox id="fxaSyncComputerName" disabled="true"/> - <hbox> - <button id="fxaChangeDeviceName" - label="&changeSyncDeviceName.label;" - accesskey="&changeSyncDeviceName.accesskey;"/> - <button id="fxaCancelChangeDeviceName" - label="&cancelChangeSyncDeviceName.label;" - accesskey="&cancelChangeSyncDeviceName.accesskey;" - hidden="true"/> - <button id="fxaSaveChangeDeviceName" - label="&saveChangeSyncDeviceName.label;" - accesskey="&saveChangeSyncDeviceName.accesskey;" - hidden="true"/> - </hbox> - </hbox> - </groupbox> - <label class="fxaMobilePromo"> - &mobilePromo3.start;<!-- We put these comments to avoid inserting white spaces - --><label class="androidLink text-link" id="fxaMobilePromo-android-hasFxaAccount"><!-- - -->&mobilePromo3.androidLink;</label><!-- - -->&mobilePromo3.iOSBefore;<!-- - --><label class="iOSLink text-link" id="fxaMobilePromo-ios-hasFxaAccount"><!-- - -->&mobilePromo3.iOSLink;</label><!-- - -->&mobilePromo3.end; - </label> - <vbox id="tosPP-small" align="start"> - <label id="tosPP-small-ToS" class="text-link"> - &prefs.tosLink.label; - </label> - <label id="tosPP-small-PP" class="text-link"> - &fxaPrivacyNotice.link.label; - </label> - </vbox> + <label class="text-link" + onclick="gSyncPane.startOver(true); return false;" + value="&unlinkDevice.label;"/> </vbox> </deck> diff --git a/application/basilisk/components/preferences/jar.mn b/application/basilisk/components/preferences/jar.mn index d233c7865..f74be0820 100644 --- a/application/basilisk/components/preferences/jar.mn +++ b/application/basilisk/components/preferences/jar.mn @@ -24,12 +24,8 @@ browser.jar: * content/browser/preferences/languages.xul content/browser/preferences/languages.js content/browser/preferences/permissions.xul - content/browser/preferences/containers.xul - content/browser/preferences/containers.js content/browser/preferences/permissions.js content/browser/preferences/sanitize.xul content/browser/preferences/sanitize.js content/browser/preferences/selectBookmark.xul content/browser/preferences/selectBookmark.js - content/browser/preferences/translation.xul - content/browser/preferences/translation.js diff --git a/application/basilisk/components/preferences/translation.js b/application/basilisk/components/preferences/translation.js deleted file mode 100644 index cd570db0e..000000000 --- a/application/basilisk/components/preferences/translation.js +++ /dev/null @@ -1,255 +0,0 @@ -/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */ -/* 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"; - -var {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); - -XPCOMUtils.defineLazyGetter(this, "gLangBundle", () => - Services.strings.createBundle("chrome://global/locale/languageNames.properties")); - -const kPermissionType = "translate"; -const kLanguagesPref = "browser.translation.neverForLanguages"; - -function Tree(aId, aData) -{ - this._data = aData; - this._tree = document.getElementById(aId); - this._tree.view = this; -} - -Tree.prototype = { - get boxObject() { - return this._tree.treeBoxObject; - }, - get isEmpty() { - return !this._data.length; - }, - get hasSelection() { - return this.selection.count > 0; - }, - getSelectedItems: function() { - let result = []; - - let rc = this.selection.getRangeCount(); - for (let i = 0; i < rc; ++i) { - let min = {}, max = {}; - this.selection.getRangeAt(i, min, max); - for (let j = min.value; j <= max.value; ++j) - result.push(this._data[j]); - } - - return result; - }, - - // nsITreeView implementation - get rowCount() { - return this._data.length; - }, - getCellText: function (aRow, aColumn) { - return this._data[aRow]; - }, - isSeparator: function(aIndex) { - return false; - }, - isSorted: function() { - return false; - }, - isContainer: function(aIndex) { - return false; - }, - setTree: function(aTree) {}, - getImageSrc: function(aRow, aColumn) {}, - getProgressMode: function(aRow, aColumn) {}, - getCellValue: function(aRow, aColumn) {}, - cycleHeader: function(column) {}, - getRowProperties: function(row) { - return ""; - }, - getColumnProperties: function(column) { - return ""; - }, - getCellProperties: function(row, column) { - return ""; - }, - QueryInterface: XPCOMUtils.generateQI([Ci.nsITreeView]) -}; - -function Lang(aCode) -{ - this.langCode = aCode; - this._label = gLangBundle.GetStringFromName(aCode); -} - -Lang.prototype = { - toString: function() { - return this._label; - } -} - -var gTranslationExceptions = { - onLoad: function() { - if (this._siteTree) { - // Re-using an open dialog, clear the old observers. - this.uninit(); - } - - // Load site permissions into an array. - this._sites = []; - let enumerator = Services.perms.enumerator; - while (enumerator.hasMoreElements()) { - let perm = enumerator.getNext().QueryInterface(Ci.nsIPermission); - - if (perm.type == kPermissionType && - perm.capability == Services.perms.DENY_ACTION) { - this._sites.push(perm.principal.origin); - } - } - Services.obs.addObserver(this, "perm-changed", false); - this._sites.sort(); - - this._siteTree = new Tree("sitesTree", this._sites); - this.onSiteSelected(); - - this._langs = this.getLanguageExceptions(); - Services.prefs.addObserver(kLanguagesPref, this, false); - this._langTree = new Tree("languagesTree", this._langs); - this.onLanguageSelected(); - }, - - // Get the list of languages we don't translate as an array. - getLanguageExceptions: function() { - let langs = Services.prefs.getCharPref(kLanguagesPref); - if (!langs) - return []; - - let result = langs.split(",").map(code => new Lang(code)); - result.sort(); - - return result; - }, - - observe: function(aSubject, aTopic, aData) { - if (aTopic == "perm-changed") { - if (aData == "cleared") { - if (!this._sites.length) - return; - let removed = this._sites.splice(0, this._sites.length); - this._siteTree.boxObject.rowCountChanged(0, - removed.length); - } - else { - let perm = aSubject.QueryInterface(Ci.nsIPermission); - if (perm.type != kPermissionType) - return; - - if (aData == "added") { - if (perm.capability != Services.perms.DENY_ACTION) - return; - this._sites.push(perm.principal.origin); - this._sites.sort(); - let boxObject = this._siteTree.boxObject; - boxObject.rowCountChanged(0, 1); - boxObject.invalidate(); - } - else if (aData == "deleted") { - let index = this._sites.indexOf(perm.principal.origin); - if (index == -1) - return; - this._sites.splice(index, 1); - this._siteTree.boxObject.rowCountChanged(index, -1); - this.onSiteSelected(); - return; - } - } - this.onSiteSelected(); - } - else if (aTopic == "nsPref:changed") { - this._langs = this.getLanguageExceptions(); - let change = this._langs.length - this._langTree.rowCount; - this._langTree._data = this._langs; - let boxObject = this._langTree.boxObject; - if (change) - boxObject.rowCountChanged(0, change); - boxObject.invalidate(); - this.onLanguageSelected(); - } - }, - - _handleButtonDisabling: function(aTree, aIdPart) { - let empty = aTree.isEmpty; - document.getElementById("removeAll" + aIdPart + "s").disabled = empty; - document.getElementById("remove" + aIdPart).disabled = - empty || !aTree.hasSelection; - }, - - onLanguageSelected: function() { - this._handleButtonDisabling(this._langTree, "Language"); - }, - - onSiteSelected: function() { - this._handleButtonDisabling(this._siteTree, "Site"); - }, - - onLanguageDeleted: function() { - let langs = Services.prefs.getCharPref(kLanguagesPref); - if (!langs) - return; - - let removed = this._langTree.getSelectedItems().map(l => l.langCode); - - langs = langs.split(",").filter(l => removed.indexOf(l) == -1); - Services.prefs.setCharPref(kLanguagesPref, langs.join(",")); - }, - - onAllLanguagesDeleted: function() { - Services.prefs.setCharPref(kLanguagesPref, ""); - }, - - onSiteDeleted: function() { - let removedSites = this._siteTree.getSelectedItems(); - for (let origin of removedSites) { - let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin); - Services.perms.removeFromPrincipal(principal, kPermissionType); - } - }, - - onAllSitesDeleted: function() { - if (this._siteTree.isEmpty) - return; - - let removedSites = this._sites.splice(0, this._sites.length); - this._siteTree.boxObject.rowCountChanged(0, -removedSites.length); - - for (let origin of removedSites) { - let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin); - Services.perms.removeFromPrincipal(principal, kPermissionType); - } - - this.onSiteSelected(); - }, - - onSiteKeyPress: function(aEvent) { - if (aEvent.keyCode == KeyEvent.DOM_VK_DELETE) - this.onSiteDeleted(); - }, - - onLanguageKeyPress: function(aEvent) { - if (aEvent.keyCode == KeyEvent.DOM_VK_DELETE) - this.onLanguageDeleted(); - }, - - onWindowKeyPress: function(aEvent) { - if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE) - window.close(); - }, - - uninit: function() { - Services.obs.removeObserver(this, "perm-changed"); - Services.prefs.removeObserver(kLanguagesPref, this); - } -}; diff --git a/application/basilisk/components/preferences/translation.xul b/application/basilisk/components/preferences/translation.xul deleted file mode 100644 index b5dfd1b9b..000000000 --- a/application/basilisk/components/preferences/translation.xul +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.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/. --> - -<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> -<?xml-stylesheet href="chrome://browser/skin/preferences/preferences.css" type="text/css"?> - -<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/translation.dtd"> - -<window id="TranslationDialog" class="windowDialog" - windowtype="Browser:TranslationExceptions" - title="&window.title;" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - style="width: &window.width;;" - onload="gTranslationExceptions.onLoad();" - onunload="gTranslationExceptions.uninit();" - persist="screenX screenY width height" - onkeypress="gTranslationExceptions.onWindowKeyPress(event);"> - - <script src="chrome://browser/content/preferences/translation.js"/> - - <stringbundle id="bundlePreferences" - src="chrome://browser/locale/preferences/preferences.properties"/> - - <keyset> - <key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/> - </keyset> - - <vbox class="largeDialogContainer"> - <vbox class="contentPane" flex="1"> - <label id="languagesLabel" control="permissionsTree">&noTranslationForLanguages.label;</label> - <separator class="thin"/> - <tree id="languagesTree" flex="1" style="height: 12em;" - hidecolumnpicker="true" - onkeypress="gTranslationExceptions.onLanguageKeyPress(event)" - onselect="gTranslationExceptions.onLanguageSelected();"> - <treecols> - <treecol id="languageCol" label="&treehead.languageName.label;" flex="1"/> - </treecols> - <treechildren/> - </tree> - </vbox> - <hbox align="end"> - <hbox class="actionButtons" flex="1"> - <button id="removeLanguage" disabled="true" - accesskey="&removeLanguage.accesskey;" - icon="remove" label="&removeLanguage.label;" - oncommand="gTranslationExceptions.onLanguageDeleted();"/> - <button id="removeAllLanguages" - icon="clear" label="&removeAllLanguages.label;" - accesskey="&removeAllLanguages.accesskey;" - oncommand="gTranslationExceptions.onAllLanguagesDeleted();"/> - <spacer flex="1"/> - </hbox> - </hbox> - <separator/> - <vbox class="contentPane" flex="1"> - <label id="languagesLabel" control="permissionsTree">&noTranslationForSites.label;</label> - <separator class="thin"/> - <tree id="sitesTree" flex="1" style="height: 12em;" - hidecolumnpicker="true" - onkeypress="gTranslationExceptions.onSiteKeyPress(event)" - onselect="gTranslationExceptions.onSiteSelected();"> - <treecols> - <treecol id="siteCol" label="&treehead.siteName.label;" flex="1"/> - </treecols> - <treechildren/> - </tree> - </vbox> - </vbox> - <hbox align="end"> - <hbox class="actionButtons" flex="1"> - <button id="removeSite" disabled="true" - accesskey="&removeSite.accesskey;" - icon="remove" label="&removeSite.label;" - oncommand="gTranslationExceptions.onSiteDeleted();"/> - <button id="removeAllSites" - icon="clear" label="&removeAllSites.label;" - accesskey="&removeAllSites.accesskey;" - oncommand="gTranslationExceptions.onAllSitesDeleted();"/> - <spacer flex="1"/> - <button oncommand="close();" icon="close" - label="&button.close.label;" accesskey="&button.close.accesskey;"/> - </hbox> - </hbox> -</window> diff --git a/application/basilisk/components/search/moz.build b/application/basilisk/components/search/moz.build index aac3a838c..b406d5f16 100644 --- a/application/basilisk/components/search/moz.build +++ b/application/basilisk/components/search/moz.build @@ -4,4 +4,6 @@ # 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/. +DIRS += ['service'] + JAR_MANIFESTS += ['jar.mn'] diff --git a/application/basilisk/components/search/service/SearchStaticData.jsm b/application/basilisk/components/search/service/SearchStaticData.jsm new file mode 100644 index 000000000..de2be695c --- /dev/null +++ b/application/basilisk/components/search/service/SearchStaticData.jsm @@ -0,0 +1,43 @@ +/* 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/. */ + +/* + * This module contains additional data about default search engines that is the + * same across all languages. This information is defined outside of the actual + * search engine definition files, so that localizers don't need to update them + * when a change is made. + * + * This separate module is also easily overridable, in case a hotfix is needed. + * No high-level processing logic is applied here. + */ + +"use strict"; + +this.EXPORTED_SYMBOLS = [ + "SearchStaticData", +]; + +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; + +// To update this list of known alternate domains, just cut-and-paste from +// https://www.google.com/supported_domains +const gGoogleDomainsSource = ".google.com .google.ad .google.ae .google.com.af .google.com.ag .google.com.ai .google.al .google.am .google.co.ao .google.com.ar .google.as .google.at .google.com.au .google.az .google.ba .google.com.bd .google.be .google.bf .google.bg .google.com.bh .google.bi .google.bj .google.com.bn .google.com.bo .google.com.br .google.bs .google.bt .google.co.bw .google.by .google.com.bz .google.ca .google.cd .google.cf .google.cg .google.ch .google.ci .google.co.ck .google.cl .google.cm .google.cn .google.com.co .google.co.cr .google.com.cu .google.cv .google.com.cy .google.cz .google.de .google.dj .google.dk .google.dm .google.com.do .google.dz .google.com.ec .google.ee .google.com.eg .google.es .google.com.et .google.fi .google.com.fj .google.fm .google.fr .google.ga .google.ge .google.gg .google.com.gh .google.com.gi .google.gl .google.gm .google.gp .google.gr .google.com.gt .google.gy .google.com.hk .google.hn .google.hr .google.ht .google.hu .google.co.id .google.ie .google.co.il .google.im .google.co.in .google.iq .google.is .google.it .google.je .google.com.jm .google.jo .google.co.jp .google.co.ke .google.com.kh .google.ki .google.kg .google.co.kr .google.com.kw .google.kz .google.la .google.com.lb .google.li .google.lk .google.co.ls .google.lt .google.lu .google.lv .google.com.ly .google.co.ma .google.md .google.me .google.mg .google.mk .google.ml .google.com.mm .google.mn .google.ms .google.com.mt .google.mu .google.mv .google.mw .google.com.mx .google.com.my .google.co.mz .google.com.na .google.com.nf .google.com.ng .google.com.ni .google.ne .google.nl .google.no .google.com.np .google.nr .google.nu .google.co.nz .google.com.om .google.com.pa .google.com.pe .google.com.pg .google.com.ph .google.com.pk .google.pl .google.pn .google.com.pr .google.ps .google.pt .google.com.py .google.com.qa .google.ro .google.ru .google.rw .google.com.sa .google.com.sb .google.sc .google.se .google.com.sg .google.sh .google.si .google.sk .google.com.sl .google.sn .google.so .google.sm .google.sr .google.st .google.com.sv .google.td .google.tg .google.co.th .google.com.tj .google.tk .google.tl .google.tm .google.tn .google.to .google.com.tr .google.tt .google.com.tw .google.co.tz .google.com.ua .google.co.ug .google.co.uk .google.com.uy .google.co.uz .google.com.vc .google.co.ve .google.vg .google.co.vi .google.com.vn .google.vu .google.ws .google.rs .google.co.za .google.co.zm .google.co.zw .google.cat"; +const gGoogleDomains = gGoogleDomainsSource.split(" ").map(d => "www" + d); + +this.SearchStaticData = { + /** + * Returns a list of alternate domains for a given search engine domain. + * + * @param aDomain + * Lowercase host name to look up. For example, if this argument is + * "www.google.com" or "www.google.co.uk", the function returns the + * full list of supported Google domains. + * + * @return Array containing one entry for each alternate host name, or empty + * array if none is known. The returned array should not be modified. + */ + getAlternateDomains: function (aDomain) { + return gGoogleDomains.indexOf(aDomain) == -1 ? [] : gGoogleDomains; + }, +}; diff --git a/application/basilisk/components/search/service/SearchSuggestionController.jsm b/application/basilisk/components/search/service/SearchSuggestionController.jsm new file mode 100644 index 000000000..952838c0c --- /dev/null +++ b/application/basilisk/components/search/service/SearchSuggestionController.jsm @@ -0,0 +1,398 @@ +/* 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"; + +this.EXPORTED_SYMBOLS = ["SearchSuggestionController"]; + +const { classes: Cc, interfaces: Ci, utils: Cu } = Components; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/Promise.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "NS_ASSERT", "resource://gre/modules/debug.js"); + +const SEARCH_RESPONSE_SUGGESTION_JSON = "application/x-suggestions+json"; +const DEFAULT_FORM_HISTORY_PARAM = "searchbar-history"; +const HTTP_OK = 200; +const REMOTE_TIMEOUT = 500; // maximum time (ms) to wait before giving up on a remote suggestions +const BROWSER_SUGGEST_PREF = "browser.search.suggest.enabled"; + +/** + * Remote search suggestions will be shown if gRemoteSuggestionsEnabled + * is true. Global because only one pref observer is needed for all instances. + */ +var gRemoteSuggestionsEnabled = Services.prefs.getBoolPref(BROWSER_SUGGEST_PREF); +Services.prefs.addObserver(BROWSER_SUGGEST_PREF, function(aSubject, aTopic, aData) { + gRemoteSuggestionsEnabled = Services.prefs.getBoolPref(BROWSER_SUGGEST_PREF); +}, false); + +/** + * SearchSuggestionController.jsm exists as a helper module to allow multiple consumers to request and display + * search suggestions from a given engine, regardless of the base implementation. Much of this + * code was originally in nsSearchSuggestions.js until it was refactored to separate it from the + * nsIAutoCompleteSearch dependency. + * One instance of SearchSuggestionController should be used per field since form history results are cached. + */ + +/** + * @param {function} [callback] - Callback for search suggestion results. You can use the promise + * returned by the search method instead if you prefer. + * @constructor + */ +this.SearchSuggestionController = function SearchSuggestionController(callback = null) { + this._callback = callback; +}; + +this.SearchSuggestionController.prototype = { + /** + * The maximum number of local form history results to return. This limit is + * only enforced if remote results are also returned. + */ + maxLocalResults: 5, + + /** + * The maximum number of remote search engine results to return. + * We'll actually only display at most + * maxRemoteResults - <displayed local results count> remote results. + */ + maxRemoteResults: 10, + + /** + * The maximum time (ms) to wait before giving up on a remote suggestions. + */ + remoteTimeout: REMOTE_TIMEOUT, + + /** + * The additional parameter used when searching form history. + */ + formHistoryParam: DEFAULT_FORM_HISTORY_PARAM, + + // Private properties + /** + * The last form history result used to improve the performance of subsequent searches. + * This shouldn't be used for any other purpose as it is never cleared and therefore could be stale. + */ + _formHistoryResult: null, + + /** + * The remote server timeout timer, if applicable. The timer starts when form history + * search is completed. + */ + _remoteResultTimer: null, + + /** + * The deferred for the remote results before its promise is resolved. + */ + _deferredRemoteResult: null, + + /** + * The optional result callback registered from the constructor. + */ + _callback: null, + + /** + * The XMLHttpRequest object for remote results. + */ + _request: null, + + // Public methods + + /** + * Fetch search suggestions from all of the providers. Fetches in progress will be stopped and + * results from them will not be provided. + * + * @param {string} searchTerm - the term to provide suggestions for + * @param {bool} privateMode - whether the request is being made in the context of private browsing + * @param {nsISearchEngine} engine - search engine for the suggestions. + * @param {int} userContextId - the userContextId of the selected tab. + * + * @return {Promise} resolving to an object containing results or null. + */ + fetch: function(searchTerm, privateMode, engine, userContextId) { + // There is no smart filtering from previous results here (as there is when looking through + // history/form data) because the result set returned by the server is different for every typed + // value - e.g. "ocean breathes" does not return a subset of the results returned for "ocean". + + this.stop(); + + if (!Services.search.isInitialized) { + throw new Error("Search not initialized yet (how did you get here?)"); + } + if (typeof privateMode === "undefined") { + throw new Error("The privateMode argument is required to avoid unintentional privacy leaks"); + } + if (!(engine instanceof Ci.nsISearchEngine)) { + throw new Error("Invalid search engine"); + } + if (!this.maxLocalResults && !this.maxRemoteResults) { + throw new Error("Zero results expected, what are you trying to do?"); + } + if (this.maxLocalResults < 0 || this.maxRemoteResults < 0) { + throw new Error("Number of requested results must be positive"); + } + + // Array of promises to resolve before returning results. + let promises = []; + this._searchString = searchTerm; + + // Remote results + if (searchTerm && gRemoteSuggestionsEnabled && this.maxRemoteResults && + engine.supportsResponseType(SEARCH_RESPONSE_SUGGESTION_JSON)) { + this._deferredRemoteResult = this._fetchRemote(searchTerm, engine, privateMode, userContextId); + promises.push(this._deferredRemoteResult.promise); + } + + // Local results from form history + if (this.maxLocalResults) { + let deferredHistoryResult = this._fetchFormHistory(searchTerm); + promises.push(deferredHistoryResult.promise); + } + + function handleRejection(reason) { + if (reason == "HTTP request aborted") { + // Do nothing since this is normal. + return null; + } + Cu.reportError("SearchSuggestionController rejection: " + reason); + return null; + } + return Promise.all(promises).then(this._dedupeAndReturnResults.bind(this), handleRejection); + }, + + /** + * Stop pending fetches so no results are returned from them. + * + * Note: If there was no remote results fetched, the fetching cannot be stopped and local results + * will still be returned because stopping relies on aborting the XMLHTTPRequest to reject the + * promise for Promise.all. + */ + stop: function() { + if (this._request) { + this._request.abort(); + } else if (!this.maxRemoteResults) { + Cu.reportError("SearchSuggestionController: Cannot stop fetching if remote results were not "+ + "requested"); + } + this._reset(); + }, + + // Private methods + + _fetchFormHistory: function(searchTerm) { + let deferredFormHistory = Promise.defer(); + + let acSearchObserver = { + // Implements nsIAutoCompleteSearch + onSearchResult: (search, result) => { + this._formHistoryResult = result; + + if (this._request) { + this._remoteResultTimer = Cc["@mozilla.org/timer;1"]. + createInstance(Ci.nsITimer); + this._remoteResultTimer.initWithCallback(this._onRemoteTimeout.bind(this), + this.remoteTimeout || REMOTE_TIMEOUT, + Ci.nsITimer.TYPE_ONE_SHOT); + } + + switch (result.searchResult) { + case Ci.nsIAutoCompleteResult.RESULT_SUCCESS: + case Ci.nsIAutoCompleteResult.RESULT_NOMATCH: + if (result.searchString !== this._searchString) { + deferredFormHistory.resolve("Unexpected response, this._searchString does not match form history response"); + return; + } + let fhEntries = []; + for (let i = 0; i < result.matchCount; ++i) { + fhEntries.push(result.getValueAt(i)); + } + deferredFormHistory.resolve({ + result: fhEntries, + formHistoryResult: result, + }); + break; + case Ci.nsIAutoCompleteResult.RESULT_FAILURE: + case Ci.nsIAutoCompleteResult.RESULT_IGNORED: + deferredFormHistory.resolve("Form History returned RESULT_FAILURE or RESULT_IGNORED"); + break; + } + }, + }; + + let formHistory = Cc["@mozilla.org/autocomplete/search;1?name=form-history"]. + createInstance(Ci.nsIAutoCompleteSearch); + formHistory.startSearch(searchTerm, this.formHistoryParam || DEFAULT_FORM_HISTORY_PARAM, + this._formHistoryResult, + acSearchObserver); + return deferredFormHistory; + }, + + /** + * Fetch suggestions from the search engine over the network. + */ + _fetchRemote: function(searchTerm, engine, privateMode, userContextId) { + let deferredResponse = Promise.defer(); + this._request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]. + createInstance(Ci.nsIXMLHttpRequest); + let submission = engine.getSubmission(searchTerm, + SEARCH_RESPONSE_SUGGESTION_JSON); + let method = (submission.postData ? "POST" : "GET"); + this._request.open(method, submission.uri.spec, true); + + this._request.setOriginAttributes({userContextId, + privateBrowsingId: privateMode ? 1 : 0}); + + this._request.mozBackgroundRequest = true; // suppress dialogs and fail silently + + this._request.addEventListener("load", this._onRemoteLoaded.bind(this, deferredResponse)); + this._request.addEventListener("error", (evt) => deferredResponse.resolve("HTTP error")); + // Reject for an abort assuming it's always from .stop() in which case we shouldn't return local + // or remote results for existing searches. + this._request.addEventListener("abort", (evt) => deferredResponse.reject("HTTP request aborted")); + + this._request.send(submission.postData); + + return deferredResponse; + }, + + /** + * Called when the request completed successfully (thought the HTTP status could be anything) + * so we can handle the response data. + * @private + */ + _onRemoteLoaded: function(deferredResponse) { + if (!this._request) { + deferredResponse.resolve("Got HTTP response after the request was cancelled"); + return; + } + + let status, serverResults; + try { + status = this._request.status; + } catch (e) { + // The XMLHttpRequest can throw NS_ERROR_NOT_AVAILABLE. + deferredResponse.resolve("Unknown HTTP status: " + e); + return; + } + + if (status != HTTP_OK || this._request.responseText == "") { + deferredResponse.resolve("Non-200 status or empty HTTP response: " + status); + return; + } + + try { + serverResults = JSON.parse(this._request.responseText); + } catch (ex) { + deferredResponse.resolve("Failed to parse suggestion JSON: " + ex); + return; + } + + if (!serverResults[0] || + this._searchString.localeCompare(serverResults[0], undefined, + { sensitivity: "base" })) { + // something is wrong here so drop remote results + deferredResponse.resolve("Unexpected response, this._searchString does not match remote response"); + return; + } + let results = serverResults[1] || []; + deferredResponse.resolve({ result: results }); + }, + + /** + * Called when this._remoteResultTimer fires indicating the remote request took too long. + */ + _onRemoteTimeout: function () { + this._request = null; + + // FIXME: bug 387341 + // Need to break the cycle between us and the timer. + this._remoteResultTimer = null; + + // The XMLHTTPRequest for suggest results is taking too long + // so send out the form history results and cancel the request. + if (this._deferredRemoteResult) { + this._deferredRemoteResult.resolve("HTTP Timeout"); + this._deferredRemoteResult = null; + } + }, + + /** + * @param {Array} suggestResults - an array of result objects from different sources (local or remote) + * @return {Object} + */ + _dedupeAndReturnResults: function(suggestResults) { + if (this._searchString === null) { + // _searchString can be null if stop() was called and remote suggestions + // were disabled (stopping if we are fetching remote suggestions will + // cause a promise rejection before we reach _dedupeAndReturnResults). + return null; + } + + let results = { + term: this._searchString, + remote: [], + local: [], + formHistoryResult: null, + }; + + for (let result of suggestResults) { + if (typeof result === "string") { // Failure message + Cu.reportError("SearchSuggestionController: " + result); + } else if (result.formHistoryResult) { // Local results have a formHistoryResult property. + results.formHistoryResult = result.formHistoryResult; + results.local = result.result || []; + } else { // Remote result + results.remote = result.result || []; + } + } + + // If we have remote results, cap the number of local results + if (results.remote.length) { + results.local = results.local.slice(0, this.maxLocalResults); + } + + // We don't want things to appear in both history and suggestions so remove entries from + // remote results that are already in local. + if (results.remote.length && results.local.length) { + for (let i = 0; i < results.local.length; ++i) { + let term = results.local[i]; + let dupIndex = results.remote.indexOf(term); + if (dupIndex != -1) { + results.remote.splice(dupIndex, 1); + } + } + } + + // Trim the number of results to the maximum requested (now that we've pruned dupes). + results.remote = + results.remote.slice(0, this.maxRemoteResults - results.local.length); + + if (this._callback) { + this._callback(results); + } + this._reset(); + + return results; + }, + + _reset: function() { + this._request = null; + if (this._remoteResultTimer) { + this._remoteResultTimer.cancel(); + this._remoteResultTimer = null; + } + this._deferredRemoteResult = null; + this._searchString = null; + }, +}; + +/** + * Determines whether the given engine offers search suggestions. + * + * @param {nsISearchEngine} engine - The search engine + * @return {boolean} True if the engine offers suggestions and false otherwise. + */ +this.SearchSuggestionController.engineOffersSuggestions = function(engine) { + return engine.supportsResponseType(SEARCH_RESPONSE_SUGGESTION_JSON); +}; diff --git a/application/basilisk/components/search/service/moz.build b/application/basilisk/components/search/service/moz.build new file mode 100644 index 000000000..423faeffd --- /dev/null +++ b/application/basilisk/components/search/service/moz.build @@ -0,0 +1,24 @@ +# -*- Mode: python; 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/. + +DIST_SUBDIR = '' + +DEFINES['HAVE_SIDEBAR'] = True + +EXTRA_COMPONENTS += [ + 'nsSearchSuggestions.js', + 'nsSidebar.js', +] + +EXTRA_PP_COMPONENTS += [ + 'nsSearchService.js', + 'toolkitsearch.manifest', +] + +EXTRA_JS_MODULES += [ + 'SearchStaticData.jsm', + 'SearchSuggestionController.jsm', +] diff --git a/application/basilisk/components/search/service/nsSearchService.js b/application/basilisk/components/search/service/nsSearchService.js new file mode 100644 index 000000000..b4db31dee --- /dev/null +++ b/application/basilisk/components/search/service/nsSearchService.js @@ -0,0 +1,4324 @@ +/* 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/. */ + +const Ci = Components.interfaces; +const Cc = Components.classes; +const Cr = Components.results; +const Cu = Components.utils; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/Promise.jsm"); +Cu.import("resource://gre/modules/debug.js"); +Cu.import("resource://gre/modules/AppConstants.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown", + "resource://gre/modules/AsyncShutdown.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask", + "resource://gre/modules/DeferredTask.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "OS", + "resource://gre/modules/osfile.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Task", + "resource://gre/modules/Task.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Deprecated", + "resource://gre/modules/Deprecated.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "SearchStaticData", + "resource://gre/modules/SearchStaticData.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "setTimeout", + "resource://gre/modules/Timer.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout", + "resource://gre/modules/Timer.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Lz4", + "resource://gre/modules/lz4.js"); + +XPCOMUtils.defineLazyServiceGetter(this, "gTextToSubURI", + "@mozilla.org/intl/texttosuburi;1", + "nsITextToSubURI"); +XPCOMUtils.defineLazyServiceGetter(this, "gEnvironment", + "@mozilla.org/process/environment;1", + "nsIEnvironment"); + +Cu.importGlobalProperties(["XMLHttpRequest"]); + +// A text encoder to UTF8, used whenever we commit the cache to disk. +XPCOMUtils.defineLazyGetter(this, "gEncoder", + function() { + return new TextEncoder(); + }); + +const MODE_RDONLY = 0x01; +const MODE_WRONLY = 0x02; +const MODE_CREATE = 0x08; +const MODE_APPEND = 0x10; +const MODE_TRUNCATE = 0x20; + +// Directory service keys +const NS_APP_SEARCH_DIR_LIST = "SrchPluginsDL"; +const NS_APP_DISTRIBUTION_SEARCH_DIR_LIST = "SrchPluginsDistDL"; +const NS_APP_USER_SEARCH_DIR = "UsrSrchPlugns"; +const NS_APP_SEARCH_DIR = "SrchPlugns"; +const NS_APP_USER_PROFILE_50_DIR = "ProfD"; + +// Loading plugins from NS_APP_SEARCH_DIR is no longer supported. +// Instead, we now load plugins from APP_SEARCH_PREFIX, where a +// list.txt file needs to exist to list available engines. +const APP_SEARCH_PREFIX = "resource://search-plugins/"; + +// See documentation in nsIBrowserSearchService.idl. +const SEARCH_ENGINE_TOPIC = "browser-search-engine-modified"; +const QUIT_APPLICATION_TOPIC = "quit-application"; + +const SEARCH_ENGINE_REMOVED = "engine-removed"; +const SEARCH_ENGINE_ADDED = "engine-added"; +const SEARCH_ENGINE_CHANGED = "engine-changed"; +const SEARCH_ENGINE_LOADED = "engine-loaded"; +const SEARCH_ENGINE_CURRENT = "engine-current"; +const SEARCH_ENGINE_DEFAULT = "engine-default"; + +// The following constants are left undocumented in nsIBrowserSearchService.idl +// For the moment, they are meant for testing/debugging purposes only. + +/** + * Topic used for events involving the service itself. + */ +const SEARCH_SERVICE_TOPIC = "browser-search-service"; + +/** + * Sent whenever the cache is fully written to disk. + */ +const SEARCH_SERVICE_CACHE_WRITTEN = "write-cache-to-disk-complete"; + +// Delay for lazy serialization (ms) +const LAZY_SERIALIZE_DELAY = 100; + +// Delay for batching invalidation of the JSON cache (ms) +const CACHE_INVALIDATION_DELAY = 1000; + +// Current cache version. This should be incremented if the format of the cache +// file is modified. +const CACHE_VERSION = 1; + +const CACHE_FILENAME = "search.json.mozlz4"; + +const NEW_LINES = /(\r\n|\r|\n)/; + +// Set an arbitrary cap on the maximum icon size. Without this, large icons can +// cause big delays when loading them at startup. +const MAX_ICON_SIZE = 32768; + +// Default charset to use for sending search parameters. ISO-8859-1 is used to +// match previous nsInternetSearchService behavior. +const DEFAULT_QUERY_CHARSET = "ISO-8859-1"; + +const SEARCH_BUNDLE = "chrome://global/locale/search/search.properties"; +const BRAND_BUNDLE = "chrome://branding/locale/brand.properties"; + +const OPENSEARCH_NS_10 = "http://a9.com/-/spec/opensearch/1.0/"; +const OPENSEARCH_NS_11 = "http://a9.com/-/spec/opensearch/1.1/"; + +// Although the specification at http://opensearch.a9.com/spec/1.1/description/ +// gives the namespace names defined above, many existing OpenSearch engines +// are using the following versions. We therefore allow either. +const OPENSEARCH_NAMESPACES = [ + OPENSEARCH_NS_11, OPENSEARCH_NS_10, + "http://a9.com/-/spec/opensearchdescription/1.1/", + "http://a9.com/-/spec/opensearchdescription/1.0/" +]; + +const OPENSEARCH_LOCALNAME = "OpenSearchDescription"; + +const MOZSEARCH_NS_10 = "http://www.mozilla.org/2006/browser/search/"; +const MOZSEARCH_LOCALNAME = "SearchPlugin"; + +const URLTYPE_SUGGEST_JSON = "application/x-suggestions+json"; +const URLTYPE_SEARCH_HTML = "text/html"; +const URLTYPE_OPENSEARCH = "application/opensearchdescription+xml"; + +const BROWSER_SEARCH_PREF = "browser.search."; +const LOCALE_PREF = "general.useragent.locale"; + +const USER_DEFINED = "{searchTerms}"; + +// Custom search parameters +const MOZ_OFFICIAL = AppConstants.MOZ_OFFICIAL_BRANDING ? "official" : "unofficial"; + +const MOZ_PARAM_LOCALE = /\{moz:locale\}/g; +const MOZ_PARAM_DIST_ID = /\{moz:distributionID\}/g; +const MOZ_PARAM_OFFICIAL = /\{moz:official\}/g; + +// Supported OpenSearch parameters +// See http://opensearch.a9.com/spec/1.1/querysyntax/#core +const OS_PARAM_USER_DEFINED = /\{searchTerms\??\}/g; +const OS_PARAM_INPUT_ENCODING = /\{inputEncoding\??\}/g; +const OS_PARAM_LANGUAGE = /\{language\??\}/g; +const OS_PARAM_OUTPUT_ENCODING = /\{outputEncoding\??\}/g; + +// Default values +const OS_PARAM_LANGUAGE_DEF = "*"; +const OS_PARAM_OUTPUT_ENCODING_DEF = "UTF-8"; +const OS_PARAM_INPUT_ENCODING_DEF = "UTF-8"; + +// "Unsupported" OpenSearch parameters. For example, we don't support +// page-based results, so if the engine requires that we send the "page index" +// parameter, we'll always send "1". +const OS_PARAM_COUNT = /\{count\??\}/g; +const OS_PARAM_START_INDEX = /\{startIndex\??\}/g; +const OS_PARAM_START_PAGE = /\{startPage\??\}/g; + +// Default values +const OS_PARAM_COUNT_DEF = "20"; // 20 results +const OS_PARAM_START_INDEX_DEF = "1"; // start at 1st result +const OS_PARAM_START_PAGE_DEF = "1"; // 1st page + +// Optional parameter +const OS_PARAM_OPTIONAL = /\{(?:\w+:)?\w+\?\}/g; + +// A array of arrays containing parameters that we don't fully support, and +// their default values. We will only send values for these parameters if +// required, since our values are just really arbitrary "guesses" that should +// give us the output we want. +var OS_UNSUPPORTED_PARAMS = [ + [OS_PARAM_COUNT, OS_PARAM_COUNT_DEF], + [OS_PARAM_START_INDEX, OS_PARAM_START_INDEX_DEF], + [OS_PARAM_START_PAGE, OS_PARAM_START_PAGE_DEF], +]; + +// The default engine update interval, in days. This is only used if an engine +// specifies an updateURL, but not an updateInterval. +const SEARCH_DEFAULT_UPDATE_INTERVAL = 7; + +// The default interval before checking again for the name of the +// default engine for the region, in seconds. Only used if the response +// from the server doesn't specify an interval. +const SEARCH_GEO_DEFAULT_UPDATE_INTERVAL = 2592000; // 30 days. + +this.__defineGetter__("FileUtils", function() { + delete this.FileUtils; + Components.utils.import("resource://gre/modules/FileUtils.jsm"); + return FileUtils; +}); + +this.__defineGetter__("NetUtil", function() { + delete this.NetUtil; + Components.utils.import("resource://gre/modules/NetUtil.jsm"); + return NetUtil; +}); + +this.__defineGetter__("gChromeReg", function() { + delete this.gChromeReg; + return this.gChromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"]. + getService(Ci.nsIChromeRegistry); +}); + +/** + * Prefixed to all search debug output. + */ +const SEARCH_LOG_PREFIX = "*** Search: "; + +/** + * Outputs aText to the JavaScript console as well as to stdout. + */ +function DO_LOG(aText) { + dump(SEARCH_LOG_PREFIX + aText + "\n"); + Services.console.logStringMessage(aText); +} + +/** + * In debug builds, use a live, pref-based (browser.search.log) LOG function + * to allow enabling/disabling without a restart. Otherwise, don't log at all by + * default. This can be overridden at startup by the pref, see SearchService's + * _init method. + */ +var LOG = function() {}; + +if (AppConstants.DEBUG) { + LOG = function (aText) { + if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "log", false)) { + DO_LOG(aText); + } + }; +} + +/** + * Presents an assertion dialog in non-release builds and throws. + * @param message + * A message to display + * @param resultCode + * The NS_ERROR_* value to throw. + * @throws resultCode + */ +function ERROR(message, resultCode) { + NS_ASSERT(false, SEARCH_LOG_PREFIX + message); + throw Components.Exception(message, resultCode); +} + +/** + * Logs the failure message (if browser.search.log is enabled) and throws. + * @param message + * A message to display + * @param resultCode + * The NS_ERROR_* value to throw. + * @throws resultCode or NS_ERROR_INVALID_ARG if resultCode isn't specified. + */ +function FAIL(message, resultCode) { + LOG(message); + throw Components.Exception(message, resultCode || Cr.NS_ERROR_INVALID_ARG); +} + +/** + * Truncates big blobs of (data-)URIs to console-friendly sizes + * @param str + * String to tone down + * @param len + * Maximum length of the string to return. Defaults to the length of a tweet. + */ +function limitURILength(str, len) { + len = len || 140; + if (str.length > len) + return str.slice(0, len) + "..."; + return str; +} + +/** + * Ensures an assertion is met before continuing. Should be used to indicate + * fatal errors. + * @param assertion + * An assertion that must be met + * @param message + * A message to display if the assertion is not met + * @param resultCode + * The NS_ERROR_* value to throw if the assertion is not met + * @throws resultCode + */ +function ENSURE_WARN(assertion, message, resultCode) { + NS_ASSERT(assertion, SEARCH_LOG_PREFIX + message); + if (!assertion) + throw Components.Exception(message, resultCode); +} + +function loadListener(aChannel, aEngine, aCallback) { + this._channel = aChannel; + this._bytes = []; + this._engine = aEngine; + this._callback = aCallback; +} +loadListener.prototype = { + _callback: null, + _channel: null, + _countRead: 0, + _engine: null, + _stream: null, + + QueryInterface: XPCOMUtils.generateQI([ + Ci.nsIRequestObserver, + Ci.nsIStreamListener, + Ci.nsIChannelEventSink, + Ci.nsIInterfaceRequestor, + // See FIXME comment below. + Ci.nsIHttpEventSink, + Ci.nsIProgressEventSink + ]), + + // nsIRequestObserver + onStartRequest: function SRCH_loadStartR(aRequest, aContext) { + LOG("loadListener: Starting request: " + aRequest.name); + this._stream = Cc["@mozilla.org/binaryinputstream;1"]. + createInstance(Ci.nsIBinaryInputStream); + }, + + onStopRequest: function SRCH_loadStopR(aRequest, aContext, aStatusCode) { + LOG("loadListener: Stopping request: " + aRequest.name); + + var requestFailed = !Components.isSuccessCode(aStatusCode); + if (!requestFailed && (aRequest instanceof Ci.nsIHttpChannel)) + requestFailed = !aRequest.requestSucceeded; + + if (requestFailed || this._countRead == 0) { + LOG("loadListener: request failed!"); + // send null so the callback can deal with the failure + this._callback(null, this._engine); + } else + this._callback(this._bytes, this._engine); + this._channel = null; + this._engine = null; + }, + + // nsIStreamListener + onDataAvailable: function SRCH_loadDAvailable(aRequest, aContext, + aInputStream, aOffset, + aCount) { + this._stream.setInputStream(aInputStream); + + // Get a byte array of the data + this._bytes = this._bytes.concat(this._stream.readByteArray(aCount)); + this._countRead += aCount; + }, + + // nsIChannelEventSink + asyncOnChannelRedirect: function SRCH_loadCRedirect(aOldChannel, aNewChannel, + aFlags, callback) { + this._channel = aNewChannel; + callback.onRedirectVerifyCallback(Components.results.NS_OK); + }, + + // nsIInterfaceRequestor + getInterface: function SRCH_load_GI(aIID) { + return this.QueryInterface(aIID); + }, + + // FIXME: bug 253127 + // nsIHttpEventSink + onRedirect: function (aChannel, aNewChannel) {}, + // nsIProgressEventSink + onProgress: function (aRequest, aContext, aProgress, aProgressMax) {}, + onStatus: function (aRequest, aContext, aStatus, aStatusArg) {} +} + +function isPartnerBuild() { + try { + let distroID = Services.prefs.getCharPref("distribution.id"); + + // Mozilla-provided builds (i.e. funnelcake) are not partner builds + if (distroID && !distroID.startsWith("mozilla")) { + return true; + } + } catch (e) {} + + return false; +} + +function getVerificationHash(aName) { + let disclaimer = "By modifying this file, I agree that I am doing so " + + "only within $appName itself, using official, user-driven search " + + "engine selection processes, and in a way which does not circumvent " + + "user consent. I acknowledge that any attempt to change this file " + + "from outside of $appName is a malicious act, and will be responded " + + "to accordingly." + + let salt = OS.Path.basename(OS.Constants.Path.profileDir) + aName + + disclaimer.replace(/\$appName/g, Services.appinfo.name); + + let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] + .createInstance(Ci.nsIScriptableUnicodeConverter); + converter.charset = "UTF-8"; + + // Data is an array of bytes. + let data = converter.convertToByteArray(salt, {}); + let hasher = Cc["@mozilla.org/security/hash;1"] + .createInstance(Ci.nsICryptoHash); + hasher.init(hasher.SHA256); + hasher.update(data, data.length); + + return hasher.finish(true); +} + +/** + * Safely close a nsISafeOutputStream. + * @param aFOS + * The file output stream to close. + */ +function closeSafeOutputStream(aFOS) { + if (aFOS instanceof Ci.nsISafeOutputStream) { + try { + aFOS.finish(); + return; + } catch (e) { } + } + aFOS.close(); +} + +/** + * Wrapper function for nsIIOService::newURI. + * @param aURLSpec + * The URL string from which to create an nsIURI. + * @returns an nsIURI object, or null if the creation of the URI failed. + */ +function makeURI(aURLSpec, aCharset) { + try { + return NetUtil.newURI(aURLSpec, aCharset); + } catch (ex) { } + + return null; +} + +/** + * Wrapper function for nsIIOService::newChannel2. + * @param url + * The URL string from which to create an nsIChannel. + * @returns an nsIChannel object, or null if the url is invalid. + */ +function makeChannel(url) { + try { + return NetUtil.newChannel({ + uri: url, + loadUsingSystemPrincipal: true + }); + } catch (ex) { } + + return null; +} + +/** + * Gets a directory from the directory service. + * @param aKey + * The directory service key indicating the directory to get. + */ +function getDir(aKey, aIFace) { + if (!aKey) + FAIL("getDir requires a directory key!"); + + return Services.dirsvc.get(aKey, aIFace || Ci.nsIFile); +} + +/** + * Gets the current value of the locale. It's possible for this preference to + * be localized, so we have to do a little extra work here. Similar code + * exists in nsHttpHandler.cpp when building the UA string. + */ +function getLocale() { + let locale = getLocalizedPref(LOCALE_PREF); + if (locale) + return locale; + + // Not localized. + return Services.prefs.getCharPref(LOCALE_PREF); +} + +/** + * Wrapper for nsIPrefBranch::getComplexValue. + * @param aPrefName + * The name of the pref to get. + * @returns aDefault if the requested pref doesn't exist. + */ +function getLocalizedPref(aPrefName, aDefault) { + const nsIPLS = Ci.nsIPrefLocalizedString; + try { + return Services.prefs.getComplexValue(aPrefName, nsIPLS).data; + } catch (ex) {} + + return aDefault; +} + +/** + * @return a sanitized name to be used as a filename, or a random name + * if a sanitized name cannot be obtained (if aName contains + * no valid characters). + */ +function sanitizeName(aName) { + const maxLength = 60; + const minLength = 1; + var name = aName.toLowerCase(); + name = name.replace(/\s+/g, "-"); + name = name.replace(/[^-a-z0-9]/g, ""); + + // Use a random name if our input had no valid characters. + if (name.length < minLength) + name = Math.random().toString(36).replace(/^.*\./, ''); + + // Force max length. + return name.substring(0, maxLength); +} + +/** + * Retrieve a pref from the search param branch. + * + * @param prefName + * The name of the pref. + **/ +function getMozParamPref(prefName) { + let branch = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF + "param."); + return encodeURIComponent(branch.getCharPref(prefName)); +} + +/** + * Notifies watchers of SEARCH_ENGINE_TOPIC about changes to an engine or to + * the state of the search service. + * + * @param aEngine + * The nsISearchEngine object to which the change applies. + * @param aVerb + * A verb describing the change. + * + * @see nsIBrowserSearchService.idl + */ +var gInitialized = false; +function notifyAction(aEngine, aVerb) { + if (gInitialized) { + LOG("NOTIFY: Engine: \"" + aEngine.name + "\"; Verb: \"" + aVerb + "\""); + Services.obs.notifyObservers(aEngine, SEARCH_ENGINE_TOPIC, aVerb); + } +} + +function parseJsonFromStream(aInputStream) { + const json = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON); + const data = json.decodeFromStream(aInputStream, aInputStream.available()); + return data; +} + +/** + * Simple object representing a name/value pair. + */ +function QueryParameter(aName, aValue, aPurpose) { + if (!aName || (aValue == null)) + FAIL("missing name or value for QueryParameter!"); + + this.name = aName; + this.value = aValue; + this.purpose = aPurpose; +} + +/** + * Perform OpenSearch parameter substitution on aParamValue. + * + * @param aParamValue + * A string containing OpenSearch search parameters. + * @param aSearchTerms + * The user-provided search terms. This string will inserted into + * aParamValue as the value of the OS_PARAM_USER_DEFINED parameter. + * This value must already be escaped appropriately - it is inserted + * as-is. + * @param aEngine + * The engine which owns the string being acted on. + * + * @see http://opensearch.a9.com/spec/1.1/querysyntax/#core + */ +function ParamSubstitution(aParamValue, aSearchTerms, aEngine) { + var value = aParamValue; + + var distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID", + Services.appinfo.distributionID || ""); + var official = MOZ_OFFICIAL; + try { + if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official")) + official = "official"; + else + official = "unofficial"; + } + catch (ex) { } + + // Custom search parameters. These are only available to default search + // engines. + if (aEngine._isDefault) { + value = value.replace(MOZ_PARAM_LOCALE, getLocale()); + value = value.replace(MOZ_PARAM_DIST_ID, distributionID); + value = value.replace(MOZ_PARAM_OFFICIAL, official); + } + + // Insert the OpenSearch parameters we're confident about + value = value.replace(OS_PARAM_USER_DEFINED, aSearchTerms); + value = value.replace(OS_PARAM_INPUT_ENCODING, aEngine.queryCharset); + value = value.replace(OS_PARAM_LANGUAGE, + getLocale() || OS_PARAM_LANGUAGE_DEF); + value = value.replace(OS_PARAM_OUTPUT_ENCODING, + OS_PARAM_OUTPUT_ENCODING_DEF); + + // Replace any optional parameters + value = value.replace(OS_PARAM_OPTIONAL, ""); + + // Insert any remaining required params with our default values + for (var i = 0; i < OS_UNSUPPORTED_PARAMS.length; ++i) { + value = value.replace(OS_UNSUPPORTED_PARAMS[i][0], + OS_UNSUPPORTED_PARAMS[i][1]); + } + + return value; +} + +/** + * Creates an engineURL object, which holds the query URL and all parameters. + * + * @param aType + * A string containing the name of the MIME type of the search results + * returned by this URL. + * @param aMethod + * The HTTP request method. Must be a case insensitive value of either + * "GET" or "POST". + * @param aTemplate + * The URL to which search queries should be sent. For GET requests, + * must contain the string "{searchTerms}", to indicate where the user + * entered search terms should be inserted. + * @param aResultDomain + * The root domain for this URL. Defaults to the template's host. + * + * @see http://opensearch.a9.com/spec/1.1/querysyntax/#urltag + * + * @throws NS_ERROR_NOT_IMPLEMENTED if aType is unsupported. + */ +function EngineURL(aType, aMethod, aTemplate, aResultDomain) { + if (!aType || !aMethod || !aTemplate) + FAIL("missing type, method or template for EngineURL!"); + + var method = aMethod.toUpperCase(); + var type = aType.toLowerCase(); + + if (method != "GET" && method != "POST") + FAIL("method passed to EngineURL must be \"GET\" or \"POST\""); + + this.type = type; + this.method = method; + this.params = []; + this.rels = []; + // Don't serialize expanded mozparams + this.mozparams = {}; + + var templateURI = makeURI(aTemplate); + if (!templateURI) + FAIL("new EngineURL: template is not a valid URI!", Cr.NS_ERROR_FAILURE); + + switch (templateURI.scheme) { + case "http": + case "https": + // Disable these for now, see bug 295018 + // case "file": + // case "resource": + this.template = aTemplate; + break; + default: + FAIL("new EngineURL: template uses invalid scheme!", Cr.NS_ERROR_FAILURE); + } + + // If no resultDomain was specified in the engine definition file, use the + // host from the template. + this.resultDomain = aResultDomain || templateURI.host; + // We never want to return a "www." prefix, so eventually strip it. + if (this.resultDomain.startsWith("www.")) { + this.resultDomain = this.resultDomain.substr(4); + } +} +EngineURL.prototype = { + + addParam: function SRCH_EURL_addParam(aName, aValue, aPurpose) { + this.params.push(new QueryParameter(aName, aValue, aPurpose)); + }, + + // Note: This method requires that aObj has a unique name or the previous MozParams entry with + // that name will be overwritten. + _addMozParam: function SRCH_EURL__addMozParam(aObj) { + aObj.mozparam = true; + this.mozparams[aObj.name] = aObj; + }, + + getSubmission: function SRCH_EURL_getSubmission(aSearchTerms, aEngine, aPurpose) { + var url = ParamSubstitution(this.template, aSearchTerms, aEngine); + // Default to searchbar if the purpose is not provided + var purpose = aPurpose || "searchbar"; + + // If a particular purpose isn't defined in the plugin, fallback to 'searchbar'. + if (!this.params.some(p => p.purpose !== undefined && p.purpose == purpose)) + purpose = "searchbar"; + + // Create an application/x-www-form-urlencoded representation of our params + // (name=value&name=value&name=value) + var dataString = ""; + for (var i = 0; i < this.params.length; ++i) { + var param = this.params[i]; + + // If this parameter has a purpose, only add it if the purpose matches + if (param.purpose !== undefined && param.purpose != purpose) + continue; + + var value = ParamSubstitution(param.value, aSearchTerms, aEngine); + + dataString += (i > 0 ? "&" : "") + param.name + "=" + value; + } + + var postData = null; + if (this.method == "GET") { + // GET method requests have no post data, and append the encoded + // query string to the url... + if (url.indexOf("?") == -1 && dataString) + url += "?"; + url += dataString; + } else if (this.method == "POST") { + // POST method requests must wrap the encoded text in a MIME + // stream and supply that as POSTDATA. + var stringStream = Cc["@mozilla.org/io/string-input-stream;1"]. + createInstance(Ci.nsIStringInputStream); + stringStream.data = dataString; + + postData = Cc["@mozilla.org/network/mime-input-stream;1"]. + createInstance(Ci.nsIMIMEInputStream); + postData.addHeader("Content-Type", "application/x-www-form-urlencoded"); + postData.addContentLength = true; + postData.setData(stringStream); + } + + return new Submission(makeURI(url), postData); + }, + + _getTermsParameterName: function SRCH_EURL__getTermsParameterName() { + let queryParam = this.params.find(p => p.value == USER_DEFINED); + return queryParam ? queryParam.name : ""; + }, + + _hasRelation: function SRC_EURL__hasRelation(aRel) { + return this.rels.some(e => e == aRel.toLowerCase()); + }, + + _initWithJSON: function SRC_EURL__initWithJSON(aJson, aEngine) { + if (!aJson.params) + return; + + this.rels = aJson.rels; + + for (let i = 0; i < aJson.params.length; ++i) { + let param = aJson.params[i]; + if (param.mozparam) { + if (param.condition == "pref") { + let value = getMozParamPref(param.pref); + this.addParam(param.name, value); + } + this._addMozParam(param); + } + else + this.addParam(param.name, param.value, param.purpose || undefined); + } + }, + + /** + * Creates a JavaScript object that represents this URL. + * @returns An object suitable for serialization as JSON. + **/ + toJSON: function SRCH_EURL_toJSON() { + var json = { + template: this.template, + rels: this.rels, + resultDomain: this.resultDomain + }; + + if (this.type != URLTYPE_SEARCH_HTML) + json.type = this.type; + if (this.method != "GET") + json.method = this.method; + + function collapseMozParams(aParam) { + return this.mozparams[aParam.name] || aParam; + } + json.params = this.params.map(collapseMozParams, this); + + return json; + } +}; + +/** + * nsISearchEngine constructor. + * @param aLocation + * A nsILocalFile or nsIURI object representing the location of the + * search engine data file. + * @param aIsReadOnly + * Boolean indicating whether the engine should be treated as read-only. + */ +function Engine(aLocation, aIsReadOnly) { + this._readOnly = aIsReadOnly; + this._urls = []; + this._metaData = {}; + + let file, uri; + if (typeof aLocation == "string") { + this._shortName = aLocation; + } else if (aLocation instanceof Ci.nsILocalFile) { + if (!aIsReadOnly) { + // This is an engine that was installed in NS_APP_USER_SEARCH_DIR by a + // previous version. We are converting the file to an engine stored only + // in JSON, but we need to keep the reference to the profile file to + // remove it if the user ever removes the engine. + this._filePath = aLocation.persistentDescriptor; + } + file = aLocation; + } else if (aLocation instanceof Ci.nsIURI) { + switch (aLocation.scheme) { + case "https": + case "http": + case "ftp": + case "data": + case "file": + case "resource": + case "chrome": + uri = aLocation; + break; + default: + ERROR("Invalid URI passed to the nsISearchEngine constructor", + Cr.NS_ERROR_INVALID_ARG); + } + } else + ERROR("Engine location is neither a File nor a URI object", + Cr.NS_ERROR_INVALID_ARG); + + if (!this._shortName) { + // If we don't have a shortName at this point, it's the first time we load + // this engine, so let's generate the shortName, id and loadPath values. + let shortName; + if (file) { + shortName = file.leafName; + } + else if (uri && uri instanceof Ci.nsIURL) { + if (aIsReadOnly || (gEnvironment.get("XPCSHELL_TEST_PROFILE_DIR") && + uri.scheme == "resource")) { + shortName = uri.fileName; + } + } + if (shortName && shortName.endsWith(".xml")) { + this._shortName = shortName.slice(0, -4); + } + this._loadPath = this.getAnonymizedLoadPath(file, uri); + + if (!shortName && !aIsReadOnly) { + // We are in the process of downloading and installing the engine. + // We'll have the shortName and id once we are done parsing it. + return; + } + + // Build the id used for the legacy metadata storage, so that we + // can do a one-time import of data from old profiles. + if (this._isDefault || + (uri && uri.spec.startsWith(APP_SEARCH_PREFIX))) { + // The second part of the check is to catch engines from language packs. + // They aren't default engines (because they aren't app-shipped), but we + // still need to give their id an [app] prefix for backward compat. + this._id = "[app]/" + this._shortName + ".xml"; + } + else if (!aIsReadOnly) { + this._id = "[profile]/" + this._shortName + ".xml"; + } + else { + // If the engine is neither a default one, nor a user-installed one, + // it must be extension-shipped, so use the full path as id. + LOG("Setting _id to full path for engine from " + this._loadPath); + this._id = file ? file.path : uri.spec; + } + } +} + +Engine.prototype = { + // Data set by the user. + _metaData: null, + // The data describing the engine, in the form of an XML document element. + _data: null, + // Whether or not the engine is readonly. + _readOnly: true, + // Anonymized path of where we initially loaded the engine from. + // This will stay null for engines installed in the profile before we moved + // to a JSON storage. + _loadPath: null, + // The engine's description + _description: "", + // Used to store the engine to replace, if we're an update to an existing + // engine. + _engineToUpdate: null, + // Set to true if the engine has a preferred icon (an icon that should not be + // overridden by a non-preferred icon). + _hasPreferredIcon: null, + // The engine's name. + _name: null, + // The name of the charset used to submit the search terms. + _queryCharset: null, + // The engine's raw SearchForm value (URL string pointing to a search form). + __searchForm: null, + get _searchForm() { + return this.__searchForm; + }, + set _searchForm(aValue) { + if (/^https?:/i.test(aValue)) + this.__searchForm = aValue; + else + LOG("_searchForm: Invalid URL dropped for " + this._name || + "the current engine"); + }, + // Whether to obtain user confirmation before adding the engine. This is only + // used when the engine is first added to the list. + _confirm: false, + // Whether to set this as the current engine as soon as it is loaded. This + // is only used when the engine is first added to the list. + _useNow: false, + // A function to be invoked when this engine object's addition completes (or + // fails). Only used for installation via addEngine. + _installCallback: null, + // The number of days between update checks for new versions + _updateInterval: null, + // The url to check at for a new update + _updateURL: null, + // The url to check for a new icon + _iconUpdateURL: null, + /* The extension ID if added by an extension. */ + _extensionID: null, + + /** + * Retrieves the data from the engine's file. + * The document element is placed in the engine's data field. + */ + _initFromFile: function SRCH_ENG_initFromFile(file) { + if (!file || !file.exists()) + FAIL("File must exist before calling initFromFile!", Cr.NS_ERROR_UNEXPECTED); + + var fileInStream = Cc["@mozilla.org/network/file-input-stream;1"]. + createInstance(Ci.nsIFileInputStream); + + fileInStream.init(file, MODE_RDONLY, FileUtils.PERMS_FILE, false); + + var domParser = Cc["@mozilla.org/xmlextras/domparser;1"]. + createInstance(Ci.nsIDOMParser); + var doc = domParser.parseFromStream(fileInStream, "UTF-8", + file.fileSize, + "text/xml"); + + this._data = doc.documentElement; + fileInStream.close(); + + // Now that the data is loaded, initialize the engine object + this._initFromData(); + }, + + /** + * Retrieves the data from the engine's file asynchronously. + * The document element is placed in the engine's data field. + * + * @param file The file to load the search plugin from. + * + * @returns {Promise} A promise, resolved successfully if initializing from + * data succeeds, rejected if it fails. + */ + _asyncInitFromFile: Task.async(function* (file) { + if (!file || !(yield OS.File.exists(file.path))) + FAIL("File must exist before calling initFromFile!", Cr.NS_ERROR_UNEXPECTED); + + let fileURI = NetUtil.ioService.newFileURI(file); + yield this._retrieveSearchXMLData(fileURI.spec); + + // Now that the data is loaded, initialize the engine object + this._initFromData(); + }), + + /** + * Retrieves the engine data from a URI. Initializes the engine, flushes to + * disk, and notifies the search service once initialization is complete. + * + * @param uri The uri to load the search plugin from. + */ + _initFromURIAndLoad: function SRCH_ENG_initFromURIAndLoad(uri) { + ENSURE_WARN(uri instanceof Ci.nsIURI, + "Must have URI when calling _initFromURIAndLoad!", + Cr.NS_ERROR_UNEXPECTED); + + LOG("_initFromURIAndLoad: Downloading engine from: \"" + uri.spec + "\"."); + + var chan = NetUtil.newChannel({ + uri: uri, + loadUsingSystemPrincipal: true + }); + + if (this._engineToUpdate && (chan instanceof Ci.nsIHttpChannel)) { + var lastModified = this._engineToUpdate.getAttr("updatelastmodified"); + if (lastModified) + chan.setRequestHeader("If-Modified-Since", lastModified, false); + } + this._uri = uri; + var listener = new loadListener(chan, this, this._onLoad); + chan.notificationCallbacks = listener; + chan.asyncOpen2(listener); + }, + + /** + * Retrieves the engine data from a URI asynchronously and initializes it. + * + * @param uri The uri to load the search plugin from. + * + * @returns {Promise} A promise, resolved successfully if retrieveing data + * succeeds. + */ + _asyncInitFromURI: Task.async(function* (uri) { + LOG("_asyncInitFromURI: Loading engine from: \"" + uri.spec + "\"."); + yield this._retrieveSearchXMLData(uri.spec); + // Now that the data is loaded, initialize the engine object + this._initFromData(); + }), + + /** + * Retrieves the engine data for a given URI asynchronously. + * + * @returns {Promise} A promise, resolved successfully if retrieveing data + * succeeds. + */ + _retrieveSearchXMLData: function SRCH_ENG__retrieveSearchXMLData(aURL) { + let deferred = Promise.defer(); + let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]. + createInstance(Ci.nsIXMLHttpRequest); + request.overrideMimeType("text/xml"); + request.onload = (aEvent) => { + let responseXML = aEvent.target.responseXML; + this._data = responseXML.documentElement; + deferred.resolve(); + }; + request.onerror = function(aEvent) { + deferred.resolve(); + }; + request.open("GET", aURL, true); + request.send(); + + return deferred.promise; + }, + + _initFromURISync: function SRCH_ENG_initFromURISync(uri) { + ENSURE_WARN(uri instanceof Ci.nsIURI, + "Must have URI when calling _initFromURISync!", + Cr.NS_ERROR_UNEXPECTED); + + ENSURE_WARN(uri.schemeIs("resource"), "_initFromURISync called for non-resource URI", + Cr.NS_ERROR_FAILURE); + + LOG("_initFromURISync: Loading engine from: \"" + uri.spec + "\"."); + + var chan = NetUtil.newChannel({ + uri: uri, + loadUsingSystemPrincipal: true + }); + + var stream = chan.open2(); + var parser = Cc["@mozilla.org/xmlextras/domparser;1"]. + createInstance(Ci.nsIDOMParser); + var doc = parser.parseFromStream(stream, "UTF-8", stream.available(), "text/xml"); + + this._data = doc.documentElement; + + // Now that the data is loaded, initialize the engine object + this._initFromData(); + }, + + /** + * Attempts to find an EngineURL object in the set of EngineURLs for + * this Engine that has the given type string. (This corresponds to the + * "type" attribute in the "Url" node in the OpenSearch spec.) + * This method will return the first matching URL object found, or null + * if no matching URL is found. + * + * @param aType string to match the EngineURL's type attribute + * @param aRel [optional] only return URLs that with this rel value + */ + _getURLOfType: function SRCH_ENG__getURLOfType(aType, aRel) { + for (var i = 0; i < this._urls.length; ++i) { + if (this._urls[i].type == aType && (!aRel || this._urls[i]._hasRelation(aRel))) + return this._urls[i]; + } + + return null; + }, + + _confirmAddEngine: function SRCH_SVC_confirmAddEngine() { + var stringBundle = Services.strings.createBundle(SEARCH_BUNDLE); + var titleMessage = stringBundle.GetStringFromName("addEngineConfirmTitle"); + + // Display only the hostname portion of the URL. + var dialogMessage = + stringBundle.formatStringFromName("addEngineConfirmation", + [this._name, this._uri.host], 2); + var checkboxMessage = null; + if (!Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "noCurrentEngine", false)) + checkboxMessage = stringBundle.GetStringFromName("addEngineAsCurrentText"); + + var addButtonLabel = + stringBundle.GetStringFromName("addEngineAddButtonLabel"); + + var ps = Services.prompt; + var buttonFlags = (ps.BUTTON_TITLE_IS_STRING * ps.BUTTON_POS_0) + + (ps.BUTTON_TITLE_CANCEL * ps.BUTTON_POS_1) + + ps.BUTTON_POS_0_DEFAULT; + + var checked = {value: false}; + // confirmEx returns the index of the button that was pressed. Since "Add" + // is button 0, we want to return the negation of that value. + var confirm = !ps.confirmEx(null, + titleMessage, + dialogMessage, + buttonFlags, + addButtonLabel, + null, null, // button 1 & 2 names not used + checkboxMessage, + checked); + + return {confirmed: confirm, useNow: checked.value}; + }, + + /** + * Handle the successful download of an engine. Initializes the engine and + * triggers parsing of the data. The engine is then flushed to disk. Notifies + * the search service once initialization is complete. + */ + _onLoad: function SRCH_ENG_onLoad(aBytes, aEngine) { + /** + * Handle an error during the load of an engine by notifying the engine's + * error callback, if any. + */ + function onError(errorCode = Ci.nsISearchInstallCallback.ERROR_UNKNOWN_FAILURE) { + // Notify the callback of the failure + if (aEngine._installCallback) { + aEngine._installCallback(errorCode); + } + } + + function promptError(strings = {}, error = undefined) { + onError(error); + + if (aEngine._engineToUpdate) { + // We're in an update, so just fail quietly + LOG("updating " + aEngine._engineToUpdate.name + " failed"); + return; + } + var brandBundle = Services.strings.createBundle(BRAND_BUNDLE); + var brandName = brandBundle.GetStringFromName("brandShortName"); + + var searchBundle = Services.strings.createBundle(SEARCH_BUNDLE); + var msgStringName = strings.error || "error_loading_engine_msg2"; + var titleStringName = strings.title || "error_loading_engine_title"; + var title = searchBundle.GetStringFromName(titleStringName); + var text = searchBundle.formatStringFromName(msgStringName, + [brandName, aEngine._location], + 2); + + Services.ww.getNewPrompter(null).alert(title, text); + } + + if (!aBytes) { + promptError(); + return; + } + + var parser = Cc["@mozilla.org/xmlextras/domparser;1"]. + createInstance(Ci.nsIDOMParser); + var doc = parser.parseFromBuffer(aBytes, aBytes.length, "text/xml"); + aEngine._data = doc.documentElement; + + try { + // Initialize the engine from the obtained data + aEngine._initFromData(); + } catch (ex) { + LOG("_onLoad: Failed to init engine!\n" + ex); + // Report an error to the user + promptError(); + return; + } + + if (aEngine._engineToUpdate) { + let engineToUpdate = aEngine._engineToUpdate.wrappedJSObject; + + // Make this new engine use the old engine's shortName, and preserve + // metadata. + aEngine._shortName = engineToUpdate._shortName; + Object.keys(engineToUpdate._metaData).forEach(key => { + aEngine.setAttr(key, engineToUpdate.getAttr(key)); + }); + aEngine._loadPath = engineToUpdate._loadPath; + + // Keep track of the last modified date, so that we can make conditional + // requests for future updates. + aEngine.setAttr("updatelastmodified", (new Date()).toUTCString()); + + // Set the new engine's icon, if it doesn't yet have one. + if (!aEngine._iconURI && engineToUpdate._iconURI) + aEngine._iconURI = engineToUpdate._iconURI; + } else { + // Check that when adding a new engine (e.g., not updating an + // existing one), a duplicate engine does not already exist. + if (Services.search.getEngineByName(aEngine.name)) { + // If we're confirming the engine load, then display a "this is a + // duplicate engine" prompt; otherwise, fail silently. + if (aEngine._confirm) { + promptError({ error: "error_duplicate_engine_msg", + title: "error_invalid_engine_title" + }, Ci.nsISearchInstallCallback.ERROR_DUPLICATE_ENGINE); + } else { + onError(Ci.nsISearchInstallCallback.ERROR_DUPLICATE_ENGINE); + } + LOG("_onLoad: duplicate engine found, bailing"); + return; + } + + // If requested, confirm the addition now that we have the title. + // This property is only ever true for engines added via + // nsIBrowserSearchService::addEngine. + if (aEngine._confirm) { + var confirmation = aEngine._confirmAddEngine(); + LOG("_onLoad: confirm is " + confirmation.confirmed + + "; useNow is " + confirmation.useNow); + if (!confirmation.confirmed) { + onError(); + return; + } + aEngine._useNow = confirmation.useNow; + } + + aEngine._shortName = sanitizeName(aEngine.name); + aEngine._loadPath = aEngine.getAnonymizedLoadPath(null, aEngine._uri); + aEngine.setAttr("loadPathHash", getVerificationHash(aEngine._loadPath)); + } + + // Notify the search service of the successful load. It will deal with + // updates by checking aEngine._engineToUpdate. + notifyAction(aEngine, SEARCH_ENGINE_LOADED); + + // Notify the callback if needed + if (aEngine._installCallback) { + aEngine._installCallback(); + } + }, + + /** + * Creates a key by serializing an object that contains the icon's width + * and height. + * + * @param aWidth + * Width of the icon. + * @param aHeight + * Height of the icon. + * @returns key string + */ + _getIconKey: function SRCH_ENG_getIconKey(aWidth, aHeight) { + let keyObj = { + width: aWidth, + height: aHeight + }; + + return JSON.stringify(keyObj); + }, + + /** + * Add an icon to the icon map used by getIconURIBySize() and getIcons(). + * + * @param aWidth + * Width of the icon. + * @param aHeight + * Height of the icon. + * @param aURISpec + * String with the icon's URI. + */ + _addIconToMap: function SRCH_ENG_addIconToMap(aWidth, aHeight, aURISpec) { + if (aWidth == 16 && aHeight == 16) { + // The 16x16 icon is stored in _iconURL, we don't need to store it twice. + return; + } + + // Use an object instead of a Map() because it needs to be serializable. + this._iconMapObj = this._iconMapObj || {}; + let key = this._getIconKey(aWidth, aHeight); + this._iconMapObj[key] = aURISpec; + }, + + /** + * Sets the .iconURI property of the engine. If both aWidth and aHeight are + * provided an entry will be added to _iconMapObj that will enable accessing + * icon's data through getIcons() and getIconURIBySize() APIs. + * + * @param aIconURL + * A URI string pointing to the engine's icon. Must have a http[s], + * ftp, or data scheme. Icons with HTTP[S] or FTP schemes will be + * downloaded and converted to data URIs for storage in the engine + * XML files, if the engine is not readonly. + * @param aIsPreferred + * Whether or not this icon is to be preferred. Preferred icons can + * override non-preferred icons. + * @param aWidth (optional) + * Width of the icon. + * @param aHeight (optional) + * Height of the icon. + */ + _setIcon: function SRCH_ENG_setIcon(aIconURL, aIsPreferred, aWidth, aHeight) { + var uri = makeURI(aIconURL); + + // Ignore bad URIs + if (!uri) + return; + + LOG("_setIcon: Setting icon url \"" + limitURILength(uri.spec) + "\" for engine \"" + + this.name + "\"."); + // Only accept remote icons from http[s] or ftp + switch (uri.scheme) { + case "resource": + case "chrome": + // We only allow chrome and resource icon URLs for built-in search engines + if (!this._isDefault) { + return; + } + // Fall through to the data case + case "data": + if (!this._hasPreferredIcon || aIsPreferred) { + this._iconURI = uri; + notifyAction(this, SEARCH_ENGINE_CHANGED); + this._hasPreferredIcon = aIsPreferred; + } + + if (aWidth && aHeight) { + this._addIconToMap(aWidth, aHeight, aIconURL) + } + break; + case "http": + case "https": + case "ftp": + LOG("_setIcon: Downloading icon: \"" + uri.spec + + "\" for engine: \"" + this.name + "\""); + var chan = NetUtil.newChannel({ + uri: uri, + loadUsingSystemPrincipal: true + }); + + let iconLoadCallback = function (aByteArray, aEngine) { + // This callback may run after we've already set a preferred icon, + // so check again. + if (aEngine._hasPreferredIcon && !aIsPreferred) + return; + + if (!aByteArray || aByteArray.length > MAX_ICON_SIZE) { + LOG("iconLoadCallback: load failed, or the icon was too large!"); + return; + } + + let type = chan.contentType; + if (!type.startsWith("image/")) + type = "image/x-icon"; + let dataURL = "data:" + type + ";base64," + + btoa(String.fromCharCode.apply(null, aByteArray)); + + aEngine._iconURI = makeURI(dataURL); + + if (aWidth && aHeight) { + aEngine._addIconToMap(aWidth, aHeight, dataURL) + } + + notifyAction(aEngine, SEARCH_ENGINE_CHANGED); + aEngine._hasPreferredIcon = aIsPreferred; + }; + + // If we're currently acting as an "update engine", then the callback + // should set the icon on the engine we're updating and not us, since + // |this| might be gone by the time the callback runs. + var engineToSet = this._engineToUpdate || this; + + var listener = new loadListener(chan, engineToSet, iconLoadCallback); + chan.notificationCallbacks = listener; + chan.asyncOpen2(listener); + break; + } + }, + + /** + * Initialize this Engine object from the collected data. + */ + _initFromData: function SRCH_ENG_initFromData() { + ENSURE_WARN(this._data, "Can't init an engine with no data!", + Cr.NS_ERROR_UNEXPECTED); + + // Ensure we have a supported engine type before attempting to parse it. + let element = this._data; + if ((element.localName == MOZSEARCH_LOCALNAME && + element.namespaceURI == MOZSEARCH_NS_10) || + (element.localName == OPENSEARCH_LOCALNAME && + OPENSEARCH_NAMESPACES.indexOf(element.namespaceURI) != -1)) { + LOG("_init: Initing search plugin from " + this._location); + + this._parse(); + + } else + FAIL(this._location + " is not a valid search plugin.", Cr.NS_ERROR_FAILURE); + + // No need to keep a ref to our data (which in some cases can be a document + // element) past this point + this._data = null; + }, + + /** + * Initialize this Engine object from a collection of metadata. + */ + _initFromMetadata: function SRCH_ENG_initMetaData(aName, aIconURL, aAlias, + aDescription, aMethod, + aTemplate, aExtensionID) { + ENSURE_WARN(!this._readOnly, + "Can't call _initFromMetaData on a readonly engine!", + Cr.NS_ERROR_FAILURE); + + this._urls.push(new EngineURL(URLTYPE_SEARCH_HTML, aMethod, aTemplate)); + + this._name = aName; + this.alias = aAlias; + this._description = aDescription; + this._setIcon(aIconURL, true); + this._extensionID = aExtensionID; + }, + + /** + * Extracts data from an OpenSearch URL element and creates an EngineURL + * object which is then added to the engine's list of URLs. + * + * @throws NS_ERROR_FAILURE if a URL object could not be created. + * + * @see http://opensearch.a9.com/spec/1.1/querysyntax/#urltag. + * @see EngineURL() + */ + _parseURL: function SRCH_ENG_parseURL(aElement) { + var type = aElement.getAttribute("type"); + // According to the spec, method is optional, defaulting to "GET" if not + // specified + var method = aElement.getAttribute("method") || "GET"; + var template = aElement.getAttribute("template"); + var resultDomain = aElement.getAttribute("resultdomain"); + + try { + var url = new EngineURL(type, method, template, resultDomain); + } catch (ex) { + FAIL("_parseURL: failed to add " + template + " as a URL", + Cr.NS_ERROR_FAILURE); + } + + if (aElement.hasAttribute("rel")) + url.rels = aElement.getAttribute("rel").toLowerCase().split(/\s+/); + + for (var i = 0; i < aElement.childNodes.length; ++i) { + var param = aElement.childNodes[i]; + if (param.localName == "Param") { + try { + url.addParam(param.getAttribute("name"), param.getAttribute("value")); + } catch (ex) { + // Ignore failure + LOG("_parseURL: Url element has an invalid param"); + } + } else if (param.localName == "MozParam" && + // We only support MozParams for default search engines + this._isDefault) { + var value; + let condition = param.getAttribute("condition"); + + // MozParams must have a condition to be valid + if (!condition) { + let engineLoc = this._location; + let paramName = param.getAttribute("name"); + LOG("_parseURL: MozParam (" + paramName + ") without a condition attribute found parsing engine: " + engineLoc); + continue; + } + + switch (condition) { + case "purpose": + url.addParam(param.getAttribute("name"), + param.getAttribute("value"), + param.getAttribute("purpose")); + // _addMozParam is not needed here since it can be serialized fine without. _addMozParam + // also requires a unique "name" which is not normally the case when @purpose is used. + break; + case "pref": + try { + value = getMozParamPref(param.getAttribute("pref"), value); + url.addParam(param.getAttribute("name"), value); + url._addMozParam({"pref": param.getAttribute("pref"), + "name": param.getAttribute("name"), + "condition": "pref"}); + } catch (e) { } + break; + default: + let engineLoc = this._location; + let paramName = param.getAttribute("name"); + LOG("_parseURL: MozParam (" + paramName + ") has an unknown condition: " + condition + ". Found parsing engine: " + engineLoc); + break; + } + } + } + + this._urls.push(url); + }, + + /** + * Get the icon from an OpenSearch Image element. + * @see http://opensearch.a9.com/spec/1.1/description/#image + */ + _parseImage: function SRCH_ENG_parseImage(aElement) { + LOG("_parseImage: Image textContent: \"" + limitURILength(aElement.textContent) + "\""); + + let width = parseInt(aElement.getAttribute("width"), 10); + let height = parseInt(aElement.getAttribute("height"), 10); + let isPrefered = width == 16 && height == 16; + + if (isNaN(width) || isNaN(height) || width <= 0 || height <=0) { + LOG("OpenSearch image element must have positive width and height."); + return; + } + + this._setIcon(aElement.textContent, isPrefered, width, height); + }, + + /** + * Extract search engine information from the collected data to initialize + * the engine object. + */ + _parse: function SRCH_ENG_parse() { + var doc = this._data; + + // The OpenSearch spec sets a default value for the input encoding. + this._queryCharset = OS_PARAM_INPUT_ENCODING_DEF; + + for (var i = 0; i < doc.childNodes.length; ++i) { + var child = doc.childNodes[i]; + switch (child.localName) { + case "ShortName": + this._name = child.textContent; + break; + case "Description": + this._description = child.textContent; + break; + case "Url": + try { + this._parseURL(child); + } catch (ex) { + // Parsing of the element failed, just skip it. + LOG("_parse: failed to parse URL child: " + ex); + } + break; + case "Image": + this._parseImage(child); + break; + case "InputEncoding": + this._queryCharset = child.textContent.toUpperCase(); + break; + + // Non-OpenSearch elements + case "SearchForm": + this._searchForm = child.textContent; + break; + case "UpdateUrl": + this._updateURL = child.textContent; + break; + case "UpdateInterval": + this._updateInterval = parseInt(child.textContent); + break; + case "IconUpdateUrl": + this._iconUpdateURL = child.textContent; + break; + case "ExtensionID": + this._extensionID = child.textContent; + break; + } + } + if (!this.name || (this._urls.length == 0)) + FAIL("_parse: No name, or missing URL!", Cr.NS_ERROR_FAILURE); + if (!this.supportsResponseType(URLTYPE_SEARCH_HTML)) + FAIL("_parse: No text/html result type!", Cr.NS_ERROR_FAILURE); + }, + + /** + * Init from a JSON record. + **/ + _initWithJSON: function SRCH_ENG__initWithJSON(aJson) { + this._name = aJson._name; + this._shortName = aJson._shortName; + this._loadPath = aJson._loadPath; + this._description = aJson.description; + this._hasPreferredIcon = aJson._hasPreferredIcon == undefined; + this._queryCharset = aJson.queryCharset || DEFAULT_QUERY_CHARSET; + this.__searchForm = aJson.__searchForm; + this._updateInterval = aJson._updateInterval || null; + this._updateURL = aJson._updateURL || null; + this._iconUpdateURL = aJson._iconUpdateURL || null; + this._readOnly = aJson._readOnly == undefined; + this._iconURI = makeURI(aJson._iconURL); + this._iconMapObj = aJson._iconMapObj; + this._metaData = aJson._metaData || {}; + if (aJson.filePath) { + this._filePath = aJson.filePath; + } + if (aJson.dirPath) { + this._dirPath = aJson.dirPath; + this._dirLastModifiedTime = aJson.dirLastModifiedTime; + } + if (aJson.extensionID) { + this._extensionID = aJson.extensionID; + } + for (let i = 0; i < aJson._urls.length; ++i) { + let url = aJson._urls[i]; + let engineURL = new EngineURL(url.type || URLTYPE_SEARCH_HTML, + url.method || "GET", url.template, + url.resultDomain || undefined); + engineURL._initWithJSON(url, this); + this._urls.push(engineURL); + } + }, + + /** + * Creates a JavaScript object that represents this engine. + * @returns An object suitable for serialization as JSON. + **/ + toJSON: function SRCH_ENG_toJSON() { + var json = { + _name: this._name, + _shortName: this._shortName, + _loadPath: this._loadPath, + description: this.description, + __searchForm: this.__searchForm, + _iconURL: this._iconURL, + _iconMapObj: this._iconMapObj, + _metaData: this._metaData, + _urls: this._urls + }; + + if (this._updateInterval) + json._updateInterval = this._updateInterval; + if (this._updateURL) + json._updateURL = this._updateURL; + if (this._iconUpdateURL) + json._iconUpdateURL = this._iconUpdateURL; + if (!this._hasPreferredIcon) + json._hasPreferredIcon = this._hasPreferredIcon; + if (this.queryCharset != DEFAULT_QUERY_CHARSET) + json.queryCharset = this.queryCharset; + if (!this._readOnly) + json._readOnly = this._readOnly; + if (this._filePath) { + // File path is stored so that we can remove legacy xml files + // from the profile if the user removes the engine. + json.filePath = this._filePath; + } + if (this._dirPath) { + // The directory path is only stored for extension-shipped engines, + // it's used to invalidate the cache. + json.dirPath = this._dirPath; + json.dirLastModifiedTime = this._dirLastModifiedTime; + } + if (this._extensionID) { + json.extensionID = this._extensionID; + } + + return json; + }, + + setAttr(name, val) { + this._metaData[name] = val; + }, + + getAttr(name) { + return this._metaData[name] || undefined; + }, + + // nsISearchEngine + get alias() { + return this.getAttr("alias"); + }, + set alias(val) { + var value = val ? val.trim() : null; + this.setAttr("alias", value); + notifyAction(this, SEARCH_ENGINE_CHANGED); + }, + + /** + * Return the built-in identifier of app-provided engines. + * + * Note that this identifier is substantially similar to _id, with the + * following exceptions: + * + * * There is no trailing file extension. + * * There is no [app] prefix. + * + * @return a string identifier, or null. + */ + get identifier() { + // No identifier if If the engine isn't app-provided + return this._isDefault ? this._shortName : null; + }, + + get description() { + return this._description; + }, + + get hidden() { + return this.getAttr("hidden") || false; + }, + set hidden(val) { + var value = !!val; + if (value != this.hidden) { + this.setAttr("hidden", value); + notifyAction(this, SEARCH_ENGINE_CHANGED); + } + }, + + get iconURI() { + if (this._iconURI) + return this._iconURI; + return null; + }, + + get _iconURL() { + if (!this._iconURI) + return ""; + return this._iconURI.spec; + }, + + // Where the engine is being loaded from: will return the URI's spec if the + // engine is being downloaded and does not yet have a file. This is only used + // for logging and error messages. + get _location() { + if (this._uri) + return this._uri.spec; + + return this._loadPath; + }, + + // This indicates where we found the .xml file to load the engine, + // and attempts to hide user-identifiable data (such as username). + getAnonymizedLoadPath(file, uri) { + /* Examples of expected output: + * jar:[app]/omni.ja!browser/engine.xml + * 'browser' here is the name of the chrome package, not a folder. + * [profile]/searchplugins/engine.xml + * [distribution]/searchplugins/common/engine.xml + * [other]/engine.xml + */ + + const NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProcD"; + const NS_APP_USER_PROFILE_50_DIR = "ProfD"; + const XRE_APP_DISTRIBUTION_DIR = "XREAppDist"; + + const knownDirs = { + app: NS_XPCOM_CURRENT_PROCESS_DIR, + profile: NS_APP_USER_PROFILE_50_DIR, + distribution: XRE_APP_DISTRIBUTION_DIR + }; + + let leafName = this._shortName; + if (!leafName) + return "null"; + leafName += ".xml"; + + let prefix = "", suffix = ""; + if (!file) { + if (uri.schemeIs("resource")) { + uri = makeURI(Services.io.getProtocolHandler("resource") + .QueryInterface(Ci.nsISubstitutingProtocolHandler) + .resolveURI(uri)); + } + let scheme = uri.scheme; + let packageName = ""; + if (scheme == "chrome") { + packageName = uri.hostPort; + uri = gChromeReg.convertChromeURL(uri); + } + + if (AppConstants.platform == "android") { + // On Android the omni.ja file isn't at the same path as the binary + // used to start the process. We tweak the path here so that the code + // shared with Desktop will correctly identify files from the omni.ja + // file as coming from the [app] folder. + let appPath = Services.io.getProtocolHandler("resource") + .QueryInterface(Ci.nsIResProtocolHandler) + .getSubstitution("android"); + if (appPath) { + appPath = appPath.spec; + let spec = uri.spec; + if (spec.includes(appPath)) { + let appURI = Services.io.newFileURI(getDir(knownDirs["app"])); + uri = NetUtil.newURI(spec.replace(appPath, appURI.spec)); + } + } + } + + if (uri instanceof Ci.nsINestedURI) { + prefix = "jar:"; + suffix = "!" + packageName + "/" + leafName; + uri = uri.innermostURI; + } + if (uri instanceof Ci.nsIFileURL) { + file = uri.file; + } else { + let path = "[" + scheme + "]"; + if (/^(?:https?|ftp)$/.test(scheme)) { + path += uri.host; + } + return path + "/" + leafName; + } + } + + let id; + let enginePath = file.path; + + for (let key in knownDirs) { + let path; + try { + path = getDir(knownDirs[key]).path; + } catch (e) { + // Getting XRE_APP_DISTRIBUTION_DIR throws during unit tests. + continue; + } + if (enginePath.startsWith(path)) { + id = "[" + key + "]" + enginePath.slice(path.length).replace(/\\/g, "/"); + break; + } + } + + // If the folder doesn't have a known ancestor, don't record its path to + // avoid leaking user identifiable data. + if (!id) + id = "[other]/" + file.leafName; + + return prefix + id + suffix; + }, + + get _isDefault() { + // If we don't have a shortName, the engine is being parsed from a + // downloaded file, so this can't be a default engine. + if (!this._shortName) + return false; + + // An engine is a default one if we initially loaded it from the application + // or distribution directory. + if (/^(?:jar:)?(?:\[app\]|\[distribution\])/.test(this._loadPath)) + return true; + + // If we are using a non-default locale or in the xpcshell test case, + // we'll accept as a 'default' engine anything that has been registered at + // resource://search-plugins/ even if the file doesn't come from the + // application folder. If not, skip costly additional checks. + if (!Services.prefs.prefHasUserValue(LOCALE_PREF) && + !gEnvironment.get("XPCSHELL_TEST_PROFILE_DIR")) + return false; + + // Some xpcshell tests use the search service without registering + // resource://search-plugins/. + if (!Services.io.getProtocolHandler("resource") + .QueryInterface(Ci.nsIResProtocolHandler) + .hasSubstitution("search-plugins")) + return false; + + let uri = makeURI(APP_SEARCH_PREFIX + this._shortName + ".xml"); + if (this.getAnonymizedLoadPath(null, uri) == this._loadPath) { + // This isn't a real default engine, but it's very close. + LOG("_isDefault, pretending " + this._loadPath + " is a default engine"); + return true; + } + + return false; + }, + + get _hasUpdates() { + // Whether or not the engine has an update URL + let selfURL = this._getURLOfType(URLTYPE_OPENSEARCH, "self"); + return !!(this._updateURL || this._iconUpdateURL || selfURL); + }, + + get name() { + return this._name; + }, + + get searchForm() { + return this._getSearchFormWithPurpose(); + }, + + _getSearchFormWithPurpose(aPurpose = "") { + // First look for a <Url rel="searchform"> + var searchFormURL = this._getURLOfType(URLTYPE_SEARCH_HTML, "searchform"); + if (searchFormURL) { + let submission = searchFormURL.getSubmission("", this, aPurpose); + + // If the rel=searchform URL is not type="get" (i.e. has postData), + // ignore it, since we can only return a URL. + if (!submission.postData) + return submission.uri.spec; + } + + if (!this._searchForm) { + // No SearchForm specified in the engine definition file, use the prePath + // (e.g. https://foo.com for https://foo.com/search.php?q=bar). + var htmlUrl = this._getURLOfType(URLTYPE_SEARCH_HTML); + ENSURE_WARN(htmlUrl, "Engine has no HTML URL!", Cr.NS_ERROR_UNEXPECTED); + this._searchForm = makeURI(htmlUrl.template).prePath; + } + + return ParamSubstitution(this._searchForm, "", this); + }, + + get queryCharset() { + if (this._queryCharset) + return this._queryCharset; + return this._queryCharset = "windows-1252"; // the default + }, + + // from nsISearchEngine + addParam: function SRCH_ENG_addParam(aName, aValue, aResponseType) { + if (!aName || (aValue == null)) + FAIL("missing name or value for nsISearchEngine::addParam!"); + ENSURE_WARN(!this._readOnly, + "called nsISearchEngine::addParam on a read-only engine!", + Cr.NS_ERROR_FAILURE); + if (!aResponseType) + aResponseType = URLTYPE_SEARCH_HTML; + + var url = this._getURLOfType(aResponseType); + if (!url) + FAIL("Engine object has no URL for response type " + aResponseType, + Cr.NS_ERROR_FAILURE); + + url.addParam(aName, aValue); + }, + + get _defaultMobileResponseType() { + let type = URLTYPE_SEARCH_HTML; + + let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2); + let isTablet = sysInfo.get("tablet"); + if (isTablet && this.supportsResponseType("application/x-moz-tabletsearch")) { + // Check for a tablet-specific search URL override + type = "application/x-moz-tabletsearch"; + } else if (!isTablet && this.supportsResponseType("application/x-moz-phonesearch")) { + // Check for a phone-specific search URL override + type = "application/x-moz-phonesearch"; + } + + delete this._defaultMobileResponseType; + return this._defaultMobileResponseType = type; + }, + + get _isWhiteListed() { + let url = this._getURLOfType(URLTYPE_SEARCH_HTML).template; + let hostname = makeURI(url).host; + let whitelist = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF) + .getCharPref("reset.whitelist") + .split(","); + if (whitelist.includes(hostname)) { + LOG("The hostname " + hostname + " is white listed, " + + "we won't show the search reset prompt"); + return true; + } + + return false; + }, + + // from nsISearchEngine + getSubmission: function SRCH_ENG_getSubmission(aData, aResponseType, aPurpose) { + if (!aResponseType) { + aResponseType = AppConstants.platform == "android" ? this._defaultMobileResponseType : + URLTYPE_SEARCH_HTML; + } + + if (aResponseType == URLTYPE_SEARCH_HTML && + Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF).getBoolPref("reset.enabled") && + this.name == Services.search.currentEngine.name && + !this._isDefault && + this.name != Services.search.originalDefaultEngine.name && + (!this.getAttr("loadPathHash") || + this.getAttr("loadPathHash") != getVerificationHash(this._loadPath)) && + !this._isWhiteListed) { + let url = "about:searchreset"; + let data = []; + if (aData) + data.push("data=" + encodeURIComponent(aData)); + if (aPurpose) + data.push("purpose=" + aPurpose); + if (data.length) + url += "?" + data.join("&"); + return new Submission(makeURI(url)); + } + + var url = this._getURLOfType(aResponseType); + + if (!url) + return null; + + if (!aData) { + // Return a dummy submission object with our searchForm attribute + return new Submission(makeURI(this._getSearchFormWithPurpose(aPurpose))); + } + + LOG("getSubmission: In data: \"" + aData + "\"; Purpose: \"" + aPurpose + "\""); + var data = ""; + try { + data = gTextToSubURI.ConvertAndEscape(this.queryCharset, aData); + } catch (ex) { + LOG("getSubmission: Falling back to default queryCharset!"); + data = gTextToSubURI.ConvertAndEscape(DEFAULT_QUERY_CHARSET, aData); + } + LOG("getSubmission: Out data: \"" + data + "\""); + return url.getSubmission(data, this, aPurpose); + }, + + // from nsISearchEngine + supportsResponseType: function SRCH_ENG_supportsResponseType(type) { + return (this._getURLOfType(type) != null); + }, + + // from nsISearchEngine + getResultDomain: function SRCH_ENG_getResultDomain(aResponseType) { + if (!aResponseType) { + aResponseType = AppConstants.platform == "android" ? this._defaultMobileResponseType : + URLTYPE_SEARCH_HTML; + } + + LOG("getResultDomain: responseType: \"" + aResponseType + "\""); + + let url = this._getURLOfType(aResponseType); + if (url) + return url.resultDomain; + return ""; + }, + + /** + * Returns URL parsing properties used by _buildParseSubmissionMap. + */ + getURLParsingInfo: function () { + let responseType = AppConstants.platform == "android" ? this._defaultMobileResponseType : + URLTYPE_SEARCH_HTML; + + LOG("getURLParsingInfo: responseType: \"" + responseType + "\""); + + let url = this._getURLOfType(responseType); + if (!url || url.method != "GET") { + return null; + } + + let termsParameterName = url._getTermsParameterName(); + if (!termsParameterName) { + return null; + } + + let templateUrl = NetUtil.newURI(url.template).QueryInterface(Ci.nsIURL); + return { + mainDomain: templateUrl.host, + path: templateUrl.filePath.toLowerCase(), + termsParameterName: termsParameterName, + }; + }, + + // nsISupports + QueryInterface: XPCOMUtils.generateQI([Ci.nsISearchEngine]), + + get wrappedJSObject() { + return this; + }, + + /** + * Returns a string with the URL to an engine's icon matching both width and + * height. Returns null if icon with specified dimensions is not found. + * + * @param width + * Width of the requested icon. + * @param height + * Height of the requested icon. + */ + getIconURLBySize: function SRCH_ENG_getIconURLBySize(aWidth, aHeight) { + if (aWidth == 16 && aHeight == 16) + return this._iconURL; + + if (!this._iconMapObj) + return null; + + let key = this._getIconKey(aWidth, aHeight); + if (key in this._iconMapObj) { + return this._iconMapObj[key]; + } + return null; + }, + + /** + * Gets an array of all available icons. Each entry is an object with + * width, height and url properties. width and height are numeric and + * represent the icon's dimensions. url is a string with the URL for + * the icon. + */ + getIcons: function SRCH_ENG_getIcons() { + let result = []; + if (this._iconURL) + result.push({width: 16, height: 16, url: this._iconURL}); + + if (!this._iconMapObj) + return result; + + for (let key of Object.keys(this._iconMapObj)) { + let iconSize = JSON.parse(key); + result.push({ + width: iconSize.width, + height: iconSize.height, + url: this._iconMapObj[key] + }); + } + + return result; + }, + + /** + * Opens a speculative connection to the engine's search URI + * (and suggest URI, if different) to reduce request latency + * + * @param options + * An object that must contain the following fields: + * {window} the content window for the window performing the search + * + * @throws NS_ERROR_INVALID_ARG if options is omitted or lacks required + * elemeents + */ + speculativeConnect: function SRCH_ENG_speculativeConnect(options) { + if (!options || !options.window) { + Cu.reportError("invalid options arg passed to nsISearchEngine.speculativeConnect"); + throw Cr.NS_ERROR_INVALID_ARG; + } + let connector = + Services.io.QueryInterface(Components.interfaces.nsISpeculativeConnect); + + let searchURI = this.getSubmission("dummy").uri; + + let callbacks = options.window.QueryInterface(Components.interfaces.nsIInterfaceRequestor) + .getInterface(Components.interfaces.nsIWebNavigation) + .QueryInterface(Components.interfaces.nsILoadContext); + + connector.speculativeConnect(searchURI, callbacks); + + if (this.supportsResponseType(URLTYPE_SUGGEST_JSON)) { + let suggestURI = this.getSubmission("dummy", URLTYPE_SUGGEST_JSON).uri; + if (suggestURI.prePath != searchURI.prePath) + connector.speculativeConnect(suggestURI, callbacks); + } + }, +}; + +// nsISearchSubmission +function Submission(aURI, aPostData = null) { + this._uri = aURI; + this._postData = aPostData; +} +Submission.prototype = { + get uri() { + return this._uri; + }, + get postData() { + return this._postData; + }, + QueryInterface: XPCOMUtils.generateQI([Ci.nsISearchSubmission]) +} + +// nsISearchParseSubmissionResult +function ParseSubmissionResult(aEngine, aTerms, aTermsOffset, aTermsLength) { + this._engine = aEngine; + this._terms = aTerms; + this._termsOffset = aTermsOffset; + this._termsLength = aTermsLength; +} +ParseSubmissionResult.prototype = { + get engine() { + return this._engine; + }, + get terms() { + return this._terms; + }, + get termsOffset() { + return this._termsOffset; + }, + get termsLength() { + return this._termsLength; + }, + QueryInterface: XPCOMUtils.generateQI([Ci.nsISearchParseSubmissionResult]), +} + +const gEmptyParseSubmissionResult = + Object.freeze(new ParseSubmissionResult(null, "", -1, 0)); + +function executeSoon(func) { + Services.tm.mainThread.dispatch(func, Ci.nsIThread.DISPATCH_NORMAL); +} + +/** + * Check for sync initialization has completed or not. + * + * @param {aPromise} A promise. + * + * @returns the value returned by the invoked method. + * @throws NS_ERROR_ALREADY_INITIALIZED if sync initialization has completed. + */ +function checkForSyncCompletion(aPromise) { + return aPromise.then(function(aValue) { + if (gInitialized) { + throw Components.Exception("Synchronous fallback was called and has " + + "finished so no need to pursue asynchronous " + + "initialization", + Cr.NS_ERROR_ALREADY_INITIALIZED); + } + return aValue; + }); +} + +// nsIBrowserSearchService +function SearchService() { + // Replace empty LOG function with the useful one if the log pref is set. + if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "log", false)) + LOG = DO_LOG; + + this._initObservers = Promise.defer(); +} + +SearchService.prototype = { + classID: Components.ID("{7319788a-fe93-4db3-9f39-818cf08f4256}"), + + // The current status of initialization. Note that it does not determine if + // initialization is complete, only if an error has been encountered so far. + _initRV: Cr.NS_OK, + + // The boolean indicates that the initialization has started or not. + _initStarted: null, + + // Reading the JSON cache file is the first thing done during initialization. + // During the async init, we save it in a field so that if we have to do a + // sync init before the async init finishes, we can avoid reading the cache + // with sync disk I/O and handling lz4 decompression synchronously. + // This is set back to null as soon as the initialization is finished. + _cacheFileJSON: null, + + // If initialization has not been completed yet, perform synchronous + // initialization. + // Throws in case of initialization error. + _ensureInitialized: function SRCH_SVC__ensureInitialized() { + if (gInitialized) { + if (!Components.isSuccessCode(this._initRV)) { + LOG("_ensureInitialized: failure"); + throw this._initRV; + } + return; + } + + let performanceWarning = + "Search service falling back to synchronous initialization. " + + "This is generally the consequence of an add-on using a deprecated " + + "search service API."; + Deprecated.perfWarning(performanceWarning, "https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsIBrowserSearchService#async_warning"); + LOG(performanceWarning); + + this._syncInit(); + if (!Components.isSuccessCode(this._initRV)) { + throw this._initRV; + } + }, + + // Synchronous implementation of the initializer. + // Used by |_ensureInitialized| as a fallback if initialization is not + // complete. + _syncInit: function SRCH_SVC__syncInit() { + LOG("_syncInit start"); + this._initStarted = true; + + let cache = this._readCacheFile(); + if (cache.metaData) + this._metaData = cache.metaData; + + try { + this._syncLoadEngines(cache); + } catch (ex) { + this._initRV = Cr.NS_ERROR_FAILURE; + LOG("_syncInit: failure loading engines: " + ex); + } + this._addObservers(); + + gInitialized = true; + this._cacheFileJSON = null; + + this._initObservers.resolve(this._initRV); + + Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete"); + Services.telemetry.getHistogramById("SEARCH_SERVICE_INIT_SYNC").add(true); + this._recordEngineTelemetry(); + + LOG("_syncInit end"); + }, + + /** + * Asynchronous implementation of the initializer. + * + * @returns {Promise} A promise, resolved successfully if the initialization + * succeeds. + */ + _asyncInit: Task.async(function* () { + LOG("_asyncInit start"); + + // See if we have a cache file so we don't have to parse a bunch of XML. + let cache = {}; + // Not using checkForSyncCompletion here because we want to ensure we + // fetch the country code and geo specific defaults asynchronously even + // if a sync init has been forced. + cache = yield this._asyncReadCacheFile(); + + if (!gInitialized && cache.metaData) + this._metaData = cache.metaData; + + try { + yield checkForSyncCompletion(this._asyncLoadEngines(cache)); + } catch (ex) { + if (ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) { + throw ex; + } + this._initRV = Cr.NS_ERROR_FAILURE; + LOG("_asyncInit: failure loading engines: " + ex); + } + this._addObservers(); + gInitialized = true; + this._cacheFileJSON = null; + this._initObservers.resolve(this._initRV); + Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete"); + Services.telemetry.getHistogramById("SEARCH_SERVICE_INIT_SYNC").add(false); + this._recordEngineTelemetry(); + + LOG("_asyncInit: Completed _asyncInit"); + }), + + _metaData: { }, + setGlobalAttr(name, val) { + this._metaData[name] = val; + this.batchTask.disarm(); + this.batchTask.arm(); + }, + setVerifiedGlobalAttr(name, val) { + this.setGlobalAttr(name, val); + this.setGlobalAttr(name + "Hash", getVerificationHash(val)); + }, + + getGlobalAttr(name) { + return this._metaData[name] || undefined; + }, + getVerifiedGlobalAttr(name) { + let val = this.getGlobalAttr(name); + if (val && this.getGlobalAttr(name + "Hash") != getVerificationHash(val)) { + LOG("getVerifiedGlobalAttr, invalid hash for " + name); + return ""; + } + return val; + }, + + _engines: { }, + __sortedEngines: null, + _visibleDefaultEngines: [], + get _sortedEngines() { + if (!this.__sortedEngines) + return this._buildSortedEngineList(); + return this.__sortedEngines; + }, + + // Get the original Engine object that is the default for this region, + // ignoring changes the user may have subsequently made. + get originalDefaultEngine() { + let defaultEngine = this.getVerifiedGlobalAttr("searchDefault"); + if (!defaultEngine) { + let defaultPrefB = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF); + let nsIPLS = Ci.nsIPrefLocalizedString; + + try { + defaultEngine = defaultPrefB.getComplexValue("defaultenginename", nsIPLS).data; + } catch (ex) { + // If the default pref is invalid (e.g. an add-on set it to a bogus value) + // getEngineByName will just return null, which is the best we can do. + } + } + + return this.getEngineByName(defaultEngine); + }, + + resetToOriginalDefaultEngine: function SRCH_SVC__resetToOriginalDefaultEngine() { + this.currentEngine = this.originalDefaultEngine; + }, + + _buildCache: function SRCH_SVC__buildCache() { + if (this._batchTask) + this._batchTask.disarm(); + + let cache = {}; + let locale = getLocale(); + let buildID = Services.appinfo.platformBuildID; + + // Allows us to force a cache refresh should the cache format change. + cache.version = CACHE_VERSION; + // We don't want to incur the costs of stat()ing each plugin on every + // startup when the only (supported) time they will change is during + // app updates (where the buildID is obviously going to change). + // Extension-shipped plugins are the only exception to this, but their + // directories are blown away during updates, so we'll detect their changes. + cache.buildID = buildID; + cache.locale = locale; + + cache.visibleDefaultEngines = this._visibleDefaultEngines; + cache.metaData = this._metaData; + cache.engines = []; + + for (let name in this._engines) { + cache.engines.push(this._engines[name]); + } + + try { + if (!cache.engines.length) + throw "cannot write without any engine."; + + LOG("_buildCache: Writing to cache file."); + let path = OS.Path.join(OS.Constants.Path.profileDir, CACHE_FILENAME); + let data = gEncoder.encode(JSON.stringify(cache)); + let promise = OS.File.writeAtomic(path, data, {compression: "lz4", + tmpPath: path + ".tmp"}); + + promise.then( + function onSuccess() { + Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, SEARCH_SERVICE_CACHE_WRITTEN); + }, + function onError(e) { + LOG("_buildCache: failure during writeAtomic: " + e); + } + ); + } catch (ex) { + LOG("_buildCache: Could not write to cache file: " + ex); + } + }, + + _syncLoadEngines: function SRCH_SVC__syncLoadEngines(cache) { + LOG("_syncLoadEngines: start"); + // See if we have a cache file so we don't have to parse a bunch of XML. + let chromeURIs = this._findJAREngines(); + + let distDirs = []; + let locations; + try { + locations = getDir(NS_APP_DISTRIBUTION_SEARCH_DIR_LIST, + Ci.nsISimpleEnumerator); + } catch (e) { + // NS_APP_DISTRIBUTION_SEARCH_DIR_LIST is defined by each app + // so this throws during unit tests (but not xpcshell tests). + locations = {hasMoreElements: () => false}; + } + while (locations.hasMoreElements()) { + let dir = locations.getNext().QueryInterface(Ci.nsIFile); + if (dir.directoryEntries.hasMoreElements()) + distDirs.push(dir); + } + + let otherDirs = []; + let userSearchDir = getDir(NS_APP_USER_SEARCH_DIR); + locations = getDir(NS_APP_SEARCH_DIR_LIST, Ci.nsISimpleEnumerator); + while (locations.hasMoreElements()) { + let dir = locations.getNext().QueryInterface(Ci.nsIFile); + if ((!cache.engines || !dir.equals(userSearchDir)) && + dir.directoryEntries.hasMoreElements()) + otherDirs.push(dir); + } + + function modifiedDir(aDir) { + return cacheOtherPaths.get(aDir.path) != aDir.lastModifiedTime; + } + + function notInCacheVisibleEngines(aEngineName) { + return cache.visibleDefaultEngines.indexOf(aEngineName) == -1; + } + + let buildID = Services.appinfo.platformBuildID; + let cacheOtherPaths = new Map(); + if (cache.engines) { + for (let engine of cache.engines) { + if (engine._dirPath) { + cacheOtherPaths.set(engine._dirPath, engine._dirLastModifiedTime); + } + } + } + + let rebuildCache = !cache.engines || + cache.version != CACHE_VERSION || + cache.locale != getLocale() || + cache.buildID != buildID || + cacheOtherPaths.size != otherDirs.length || + otherDirs.some(d => !cacheOtherPaths.has(d.path)) || + cache.visibleDefaultEngines.length != this._visibleDefaultEngines.length || + this._visibleDefaultEngines.some(notInCacheVisibleEngines) || + otherDirs.some(modifiedDir); + + if (rebuildCache) { + LOG("_loadEngines: Absent or outdated cache. Loading engines from disk."); + distDirs.forEach(this._loadEnginesFromDir, this); + + this._loadFromChromeURLs(chromeURIs); + + LOG("_loadEngines: load user-installed engines from the obsolete cache"); + this._loadEnginesFromCache(cache, true); + + otherDirs.forEach(this._loadEnginesFromDir, this); + + this._loadEnginesMetadataFromCache(cache); + this._buildCache(); + return; + } + + LOG("_loadEngines: loading from cache directories"); + this._loadEnginesFromCache(cache); + + LOG("_loadEngines: done"); + }, + + /** + * Loads engines asynchronously. + * + * @returns {Promise} A promise, resolved successfully if loading data + * succeeds. + */ + _asyncLoadEngines: Task.async(function* (cache) { + LOG("_asyncLoadEngines: start"); + Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "find-jar-engines"); + let chromeURIs = + yield checkForSyncCompletion(this._asyncFindJAREngines()); + + // Get the non-empty distribution directories into distDirs... + let distDirs = []; + let locations; + try { + locations = getDir(NS_APP_DISTRIBUTION_SEARCH_DIR_LIST, + Ci.nsISimpleEnumerator); + } catch (e) { + // NS_APP_DISTRIBUTION_SEARCH_DIR_LIST is defined by each app + // so this throws during unit tests (but not xpcshell tests). + locations = {hasMoreElements: () => false}; + } + while (locations.hasMoreElements()) { + let dir = locations.getNext().QueryInterface(Ci.nsIFile); + let iterator = new OS.File.DirectoryIterator(dir.path, + { winPattern: "*.xml" }); + try { + // Add dir to distDirs if it contains any files. + yield checkForSyncCompletion(iterator.next()); + distDirs.push(dir); + } catch (ex) { + // Catch for StopIteration exception. + if (ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) { + throw ex; + } + } finally { + iterator.close(); + } + } + + // Add the non-empty directories of NS_APP_SEARCH_DIR_LIST to + // otherDirs... + let otherDirs = []; + let userSearchDir = getDir(NS_APP_USER_SEARCH_DIR); + locations = getDir(NS_APP_SEARCH_DIR_LIST, Ci.nsISimpleEnumerator); + while (locations.hasMoreElements()) { + let dir = locations.getNext().QueryInterface(Ci.nsIFile); + if (cache.engines && dir.equals(userSearchDir)) + continue; + let iterator = new OS.File.DirectoryIterator(dir.path, + { winPattern: "*.xml" }); + try { + // Add dir to otherDirs if it contains any files. + yield checkForSyncCompletion(iterator.next()); + otherDirs.push(dir); + } catch (ex) { + // Catch for StopIteration exception. + if (ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) { + throw ex; + } + } finally { + iterator.close(); + } + } + + let hasModifiedDir = Task.async(function* (aList) { + let modifiedDir = false; + + for (let dir of aList) { + let lastModifiedTime = cacheOtherPaths.get(dir.path); + if (!lastModifiedTime) { + continue; + } + + let info = yield OS.File.stat(dir.path); + if (lastModifiedTime != info.lastModificationDate.getTime()) { + modifiedDir = true; + break; + } + } + return modifiedDir; + }); + + function notInCacheVisibleEngines(aEngineName) { + return cache.visibleDefaultEngines.indexOf(aEngineName) == -1; + } + + let buildID = Services.appinfo.platformBuildID; + let cacheOtherPaths = new Map(); + if (cache.engines) { + for (let engine of cache.engines) { + if (engine._dirPath) { + cacheOtherPaths.set(engine._dirPath, engine._dirLastModifiedTime); + } + } + } + + let rebuildCache = !cache.engines || + cache.version != CACHE_VERSION || + cache.locale != getLocale() || + cache.buildID != buildID || + cacheOtherPaths.size != otherDirs.length || + otherDirs.some(d => !cacheOtherPaths.has(d.path)) || + cache.visibleDefaultEngines.length != this._visibleDefaultEngines.length || + this._visibleDefaultEngines.some(notInCacheVisibleEngines) || + (yield checkForSyncCompletion(hasModifiedDir(otherDirs))); + + if (rebuildCache) { + LOG("_asyncLoadEngines: Absent or outdated cache. Loading engines from disk."); + for (let loadDir of distDirs) { + let enginesFromDir = + yield checkForSyncCompletion(this._asyncLoadEnginesFromDir(loadDir)); + enginesFromDir.forEach(this._addEngineToStore, this); + } + let enginesFromURLs = + yield checkForSyncCompletion(this._asyncLoadFromChromeURLs(chromeURIs)); + enginesFromURLs.forEach(this._addEngineToStore, this); + + LOG("_asyncLoadEngines: loading user-installed engines from the obsolete cache"); + this._loadEnginesFromCache(cache, true); + + for (let loadDir of otherDirs) { + let enginesFromDir = + yield checkForSyncCompletion(this._asyncLoadEnginesFromDir(loadDir)); + enginesFromDir.forEach(this._addEngineToStore, this); + } + + this._loadEnginesMetadataFromCache(cache); + this._buildCache(); + return; + } + + LOG("_asyncLoadEngines: loading from cache directories"); + this._loadEnginesFromCache(cache); + + LOG("_asyncLoadEngines: done"); + }), + + _asyncReInit: function () { + LOG("_asyncReInit"); + // Start by clearing the initialized state, so we don't abort early. + gInitialized = false; + + Task.spawn(function* () { + try { + if (this._batchTask) { + LOG("finalizing batch task"); + let task = this._batchTask; + this._batchTask = null; + yield task.finalize(); + } + + // Clear the engines, too, so we don't stick with the stale ones. + this._engines = {}; + this.__sortedEngines = null; + this._currentEngine = null; + this._visibleDefaultEngines = []; + this._metaData = {}; + this._cacheFileJSON = null; + + // Tests that want to force a synchronous re-initialization need to + // be notified when we are done uninitializing. + Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, + "uninit-complete"); + + let cache = {}; + cache = yield this._asyncReadCacheFile(); + if (!gInitialized && cache.metaData) + this._metaData = cache.metaData; + + yield this._asyncLoadEngines(cache); + + // Typically we'll re-init as a result of a pref observer, + // so signal to 'callers' that we're done. + Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "init-complete"); + this._recordEngineTelemetry(); + gInitialized = true; + } catch (err) { + LOG("Reinit failed: " + err); + Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "reinit-failed"); + } finally { + Services.obs.notifyObservers(null, SEARCH_SERVICE_TOPIC, "reinit-complete"); + } + }.bind(this)); + }, + + /** + * Read the cache file synchronously. This also imports data from the old + * search-metadata.json file if needed. + * + * @returns A JS object containing the cached data. + */ + _readCacheFile: function SRCH_SVC__readCacheFile() { + if (this._cacheFileJSON) { + return this._cacheFileJSON; + } + + let cacheFile = getDir(NS_APP_USER_PROFILE_50_DIR); + cacheFile.append(CACHE_FILENAME); + + let stream; + try { + stream = Cc["@mozilla.org/network/file-input-stream;1"]. + createInstance(Ci.nsIFileInputStream); + stream.init(cacheFile, MODE_RDONLY, FileUtils.PERMS_FILE, 0); + + let bis = Cc["@mozilla.org/binaryinputstream;1"] + .createInstance(Ci.nsIBinaryInputStream); + bis.setInputStream(stream); + + let count = stream.available(); + let array = new Uint8Array(count); + bis.readArrayBuffer(count, array.buffer); + + let bytes = Lz4.decompressFileContent(array); + let json = JSON.parse(new TextDecoder().decode(bytes)); + if (!json.engines || !json.engines.length) + throw "no engine in the file"; + return json; + } catch (ex) { + LOG("_readCacheFile: Error reading cache file: " + ex); + } finally { + stream.close(); + } + + try { + cacheFile.leafName = "search-metadata.json"; + stream = Cc["@mozilla.org/network/file-input-stream;1"]. + createInstance(Ci.nsIFileInputStream); + stream.init(cacheFile, MODE_RDONLY, FileUtils.PERMS_FILE, 0); + let metadata = parseJsonFromStream(stream); + let json = {}; + if ("[global]" in metadata) { + LOG("_readCacheFile: migrating metadata from search-metadata.json"); + let data = metadata["[global]"]; + json.metaData = {}; + let fields = ["searchDefault", "searchDefaultHash", "searchDefaultExpir", + "current", "hash", + "visibleDefaultEngines", "visibleDefaultEnginesHash"]; + for (let field of fields) { + let name = field.toLowerCase(); + if (name in data) + json.metaData[field] = data[name]; + } + } + delete metadata["[global]"]; + json._oldMetadata = metadata; + + return json; + } catch (ex) { + LOG("_readCacheFile: failed to read old metadata: " + ex); + return {}; + } finally { + stream.close(); + } + }, + + /** + * Read the cache file asynchronously. This also imports data from the old + * search-metadata.json file if needed. + * + * @returns {Promise} A promise, resolved successfully if retrieveing data + * succeeds. + */ + _asyncReadCacheFile: Task.async(function* () { + let json; + try { + let cacheFilePath = OS.Path.join(OS.Constants.Path.profileDir, CACHE_FILENAME); + let bytes = yield OS.File.read(cacheFilePath, {compression: "lz4"}); + json = JSON.parse(new TextDecoder().decode(bytes)); + if (!json.engines || !json.engines.length) + throw "no engine in the file"; + this._cacheFileJSON = json; + } catch (ex) { + LOG("_asyncReadCacheFile: Error reading cache file: " + ex); + json = {}; + + let oldMetadata = + OS.Path.join(OS.Constants.Path.profileDir, "search-metadata.json"); + try { + let bytes = yield OS.File.read(oldMetadata); + let metadata = JSON.parse(new TextDecoder().decode(bytes)); + if ("[global]" in metadata) { + LOG("_asyncReadCacheFile: migrating metadata from search-metadata.json"); + let data = metadata["[global]"]; + json.metaData = {}; + let fields = ["searchDefault", "searchDefaultHash", "searchDefaultExpir", + "current", "hash", + "visibleDefaultEngines", "visibleDefaultEnginesHash"]; + for (let field of fields) { + let name = field.toLowerCase(); + if (name in data) + json.metaData[field] = data[name]; + } + } + delete metadata["[global]"]; + json._oldMetadata = metadata; + } catch (ex) {} + } + return json; + }), + + _batchTask: null, + get batchTask() { + if (!this._batchTask) { + let task = function taskCallback() { + LOG("batchTask: Invalidating engine cache"); + this._buildCache(); + }.bind(this); + this._batchTask = new DeferredTask(task, CACHE_INVALIDATION_DELAY); + } + return this._batchTask; + }, + + _addEngineToStore: function SRCH_SVC_addEngineToStore(aEngine) { + LOG("_addEngineToStore: Adding engine: \"" + aEngine.name + "\""); + + // See if there is an existing engine with the same name. However, if this + // engine is updating another engine, it's allowed to have the same name. + var hasSameNameAsUpdate = (aEngine._engineToUpdate && + aEngine.name == aEngine._engineToUpdate.name); + if (aEngine.name in this._engines && !hasSameNameAsUpdate) { + LOG("_addEngineToStore: Duplicate engine found, aborting!"); + return; + } + + if (aEngine._engineToUpdate) { + // We need to replace engineToUpdate with the engine that just loaded. + var oldEngine = aEngine._engineToUpdate; + + // Remove the old engine from the hash, since it's keyed by name, and our + // name might change (the update might have a new name). + delete this._engines[oldEngine.name]; + + // Hack: we want to replace the old engine with the new one, but since + // people may be holding refs to the nsISearchEngine objects themselves, + // we'll just copy over all "private" properties (those without a getter + // or setter) from one object to the other. + for (var p in aEngine) { + if (!(aEngine.__lookupGetter__(p) || aEngine.__lookupSetter__(p))) + oldEngine[p] = aEngine[p]; + } + aEngine = oldEngine; + aEngine._engineToUpdate = null; + + // Add the engine back + this._engines[aEngine.name] = aEngine; + notifyAction(aEngine, SEARCH_ENGINE_CHANGED); + } else { + // Not an update, just add the new engine. + this._engines[aEngine.name] = aEngine; + // Only add the engine to the list of sorted engines if the initial list + // has already been built (i.e. if this.__sortedEngines is non-null). If + // it hasn't, we're loading engines from disk and the sorted engine list + // will be built once we need it. + if (this.__sortedEngines) { + this.__sortedEngines.push(aEngine); + this._saveSortedEngineList(); + } + notifyAction(aEngine, SEARCH_ENGINE_ADDED); + } + + if (aEngine._hasUpdates) { + // Schedule the engine's next update, if it isn't already. + if (!aEngine.getAttr("updateexpir")) + engineUpdateService.scheduleNextUpdate(aEngine); + } + }, + + _loadEnginesMetadataFromCache: function SRCH_SVC__loadEnginesMetadataFromCache(cache) { + if (cache._oldMetadata) { + // If we have old metadata in the cache, we had no valid cache + // file and read data from search-metadata.json. + for (let name in this._engines) { + let engine = this._engines[name]; + if (engine._id && cache._oldMetadata[engine._id]) + engine._metaData = cache._oldMetadata[engine._id]; + } + return; + } + + if (!cache.engines) + return; + + for (let engine of cache.engines) { + let name = engine._name; + if (name in this._engines) { + LOG("_loadEnginesMetadataFromCache, transfering metadata for " + name); + this._engines[name]._metaData = engine._metaData; + } + } + }, + + _loadEnginesFromCache: function SRCH_SVC__loadEnginesFromCache(cache, + skipReadOnly) { + if (!cache.engines) + return; + + LOG("_loadEnginesFromCache: Loading " + + cache.engines.length + " engines from cache"); + + let skippedEngines = 0; + for (let engine of cache.engines) { + if (skipReadOnly && engine._readOnly == undefined) { + ++skippedEngines; + continue; + } + + this._loadEngineFromCache(engine); + } + + if (skippedEngines) { + LOG("_loadEnginesFromCache: skipped " + skippedEngines + " read-only engines."); + } + }, + + _loadEngineFromCache: function SRCH_SVC__loadEngineFromCache(json) { + try { + let engine = new Engine(json._shortName, json._readOnly == undefined); + engine._initWithJSON(json); + this._addEngineToStore(engine); + } catch (ex) { + LOG("Failed to load " + json._name + " from cache: " + ex); + LOG("Engine JSON: " + json.toSource()); + } + }, + + _loadEnginesFromDir: function SRCH_SVC__loadEnginesFromDir(aDir) { + LOG("_loadEnginesFromDir: Searching in " + aDir.path + " for search engines."); + + // Check whether aDir is the user profile dir + var isInProfile = aDir.equals(getDir(NS_APP_USER_SEARCH_DIR)); + + var files = aDir.directoryEntries + .QueryInterface(Ci.nsIDirectoryEnumerator); + + while (files.hasMoreElements()) { + var file = files.nextFile; + + // Ignore hidden and empty files, and directories + if (!file.isFile() || file.fileSize == 0 || file.isHidden()) + continue; + + var fileURL = NetUtil.ioService.newFileURI(file).QueryInterface(Ci.nsIURL); + var fileExtension = fileURL.fileExtension.toLowerCase(); + + if (fileExtension != "xml") { + // Not an engine + continue; + } + + var addedEngine = null; + try { + addedEngine = new Engine(file, !isInProfile); + addedEngine._initFromFile(file); + if (!isInProfile && !addedEngine._isDefault) { + addedEngine._dirPath = aDir.path; + addedEngine._dirLastModifiedTime = aDir.lastModifiedTime; + } + } catch (ex) { + LOG("_loadEnginesFromDir: Failed to load " + file.path + "!\n" + ex); + continue; + } + + this._addEngineToStore(addedEngine); + } + }, + + /** + * Loads engines from a given directory asynchronously. + * + * @param aDir the directory. + * + * @returns {Promise} A promise, resolved successfully if retrieveing data + * succeeds. + */ + _asyncLoadEnginesFromDir: Task.async(function* (aDir) { + LOG("_asyncLoadEnginesFromDir: Searching in " + aDir.path + " for search engines."); + + // Check whether aDir is the user profile dir + let isInProfile = aDir.equals(getDir(NS_APP_USER_SEARCH_DIR)); + let dirPath = aDir.path; + let iterator = new OS.File.DirectoryIterator(dirPath); + + let osfiles = yield iterator.nextBatch(); + iterator.close(); + + let engines = []; + for (let osfile of osfiles) { + if (osfile.isDir || osfile.isSymLink) + continue; + + let fileInfo = yield OS.File.stat(osfile.path); + if (fileInfo.size == 0) + continue; + + let parts = osfile.path.split("."); + if (parts.length <= 1 || (parts.pop()).toLowerCase() != "xml") { + // Not an engine + continue; + } + + let addedEngine = null; + try { + let file = new FileUtils.File(osfile.path); + addedEngine = new Engine(file, !isInProfile); + yield checkForSyncCompletion(addedEngine._asyncInitFromFile(file)); + if (!isInProfile && !addedEngine._isDefault) { + addedEngine._dirPath = dirPath; + let info = yield OS.File.stat(dirPath); + addedEngine._dirLastModifiedTime = + info.lastModificationDate.getTime(); + } + engines.push(addedEngine); + } catch (ex) { + if (ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) { + throw ex; + } + LOG("_asyncLoadEnginesFromDir: Failed to load " + osfile.path + "!\n" + ex); + } + } + return engines; + }), + + _loadFromChromeURLs: function SRCH_SVC_loadFromChromeURLs(aURLs) { + aURLs.forEach(function (url) { + try { + LOG("_loadFromChromeURLs: loading engine from chrome url: " + url); + + let uri = makeURI(url); + let engine = new Engine(uri, true); + + engine._initFromURISync(uri); + + this._addEngineToStore(engine); + } catch (ex) { + LOG("_loadFromChromeURLs: failed to load engine: " + ex); + } + }, this); + }, + + /** + * Loads engines from Chrome URLs asynchronously. + * + * @param aURLs a list of URLs. + * + * @returns {Promise} A promise, resolved successfully if loading data + * succeeds. + */ + _asyncLoadFromChromeURLs: Task.async(function* (aURLs) { + let engines = []; + for (let url of aURLs) { + try { + LOG("_asyncLoadFromChromeURLs: loading engine from chrome url: " + url); + let uri = NetUtil.newURI(url); + let engine = new Engine(uri, true); + yield checkForSyncCompletion(engine._asyncInitFromURI(uri)); + engines.push(engine); + } catch (ex) { + if (ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) { + throw ex; + } + LOG("_asyncLoadFromChromeURLs: failed to load engine: " + ex); + } + } + return engines; + }), + + _convertChannelToFile: function(chan) { + let fileURI = chan.URI; + while (fileURI instanceof Ci.nsIJARURI) + fileURI = fileURI.JARFile; + fileURI.QueryInterface(Ci.nsIFileURL); + + return fileURI.file; + }, + + _findJAREngines: function SRCH_SVC_findJAREngines() { + LOG("_findJAREngines: looking for engines in JARs") + + let chan = makeChannel(APP_SEARCH_PREFIX + "list.json"); + if (!chan) { + LOG("_findJAREngines: " + APP_SEARCH_PREFIX + " isn't registered"); + return []; + } + + let uris = []; + + let sis = Cc["@mozilla.org/scriptableinputstream;1"]. + createInstance(Ci.nsIScriptableInputStream); + try { + sis.init(chan.open2()); + this._parseListJSON(sis.read(sis.available()), uris); + // parseListJSON will catch its own errors, so we + // should only go into this catch if list.json + // doesn't exist + } catch (e) { + chan = makeChannel(APP_SEARCH_PREFIX + "list.txt"); + sis.init(chan.open2()); + this._parseListTxt(sis.read(sis.available()), uris); + } + return uris; + }, + + /** + * Loads jar engines asynchronously. + * + * @returns {Promise} A promise, resolved successfully if finding jar engines + * succeeds. + */ + _asyncFindJAREngines: Task.async(function* () { + LOG("_asyncFindJAREngines: looking for engines in JARs") + + let listURL = APP_SEARCH_PREFIX + "list.json"; + let chan = makeChannel(listURL); + if (!chan) { + LOG("_asyncFindJAREngines: " + APP_SEARCH_PREFIX + " isn't registered"); + return []; + } + + let uris = []; + + // Read list.json to find the engines we need to load. + let deferred = Promise.defer(); + let request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]. + createInstance(Ci.nsIXMLHttpRequest); + request.overrideMimeType("text/plain"); + request.onload = function(aEvent) { + deferred.resolve(aEvent.target.responseText); + }; + request.onerror = function(aEvent) { + LOG("_asyncFindJAREngines: failed to read " + listURL); + // Couldn't find list.json, try list.txt + request.onerror = function(aEvent) { + LOG("_asyncFindJAREngines: failed to read " + APP_SEARCH_PREFIX + "list.txt"); + deferred.resolve(""); + } + request.open("GET", NetUtil.newURI(APP_SEARCH_PREFIX + "list.txt").spec, true); + request.send(); + }; + request.open("GET", NetUtil.newURI(listURL).spec, true); + request.send(); + let list = yield deferred.promise; + + if (request.responseURL.endsWith(".txt")) { + this._parseListTxt(list, uris); + } else { + this._parseListJSON(list, uris); + } + return uris; + }), + + _parseListJSON: function SRCH_SVC_parseListJSON(list, uris) { + let searchSettings; + try { + searchSettings = JSON.parse(list); + } catch (e) { + LOG("failing to parse list.json: " + e); + return; + } + + let jarNames = new Set(); + for (let region in searchSettings) { + // Artifact builds use the full list.json which parses + // slightly differently + if (!("visibleDefaultEngines" in searchSettings[region])) { + continue; + } + for (let engine of searchSettings[region]["visibleDefaultEngines"]) { + jarNames.add(engine); + } + } + + // Check if we have a useable country specific list of visible default engines. + let engineNames; + let visibleDefaultEngines = this.getVerifiedGlobalAttr("visibleDefaultEngines"); + if (visibleDefaultEngines) { + engineNames = visibleDefaultEngines.split(","); + for (let engineName of engineNames) { + // If all engineName values are part of jarNames, + // then we can use the country specific list, otherwise ignore it. + // The visibleDefaultEngines string containing the name of an engine we + // don't ship indicates the server is misconfigured to answer requests + // from the specific Firefox version we are running, so ignoring the + // value altogether is safer. + if (!jarNames.has(engineName)) { + LOG("_parseListJSON: ignoring visibleDefaultEngines value because " + + engineName + " is not in the jar engines we have found"); + engineNames = null; + break; + } + } + } + + // Fallback to building a list based on the regions in the JSON + if (!engineNames || !engineNames.length) { + engineNames = searchSettings["default"]["visibleDefaultEngines"]; + } + + for (let name of engineNames) { + uris.push(APP_SEARCH_PREFIX + name + ".xml"); + } + + // Store this so that it can be used while writing the cache file. + this._visibleDefaultEngines = engineNames; + }, + + _parseListTxt: function SRCH_SVC_parseListTxt(list, uris) { + let names = list.split("\n").filter(n => !!n); + // This maps the names of our built-in engines to a boolean + // indicating whether it should be hidden by default. + let jarNames = new Map(); + for (let name of names) { + if (name.endsWith(":hidden")) { + name = name.split(":")[0]; + jarNames.set(name, true); + } else { + jarNames.set(name, false); + } + } + + // Check if we have a useable country specific list of visible default engines. + let engineNames; + let visibleDefaultEngines = this.getVerifiedGlobalAttr("visibleDefaultEngines"); + if (visibleDefaultEngines) { + engineNames = visibleDefaultEngines.split(","); + + for (let engineName of engineNames) { + // If all engineName values are part of jarNames, + // then we can use the country specific list, otherwise ignore it. + // The visibleDefaultEngines string containing the name of an engine we + // don't ship indicates the server is misconfigured to answer requests + // from the specific Firefox version we are running, so ignoring the + // value altogether is safer. + if (!jarNames.has(engineName)) { + LOG("_parseListTxt: ignoring visibleDefaultEngines value because " + + engineName + " is not in the jar engines we have found"); + engineNames = null; + break; + } + } + } + + // Fallback to building a list based on the :hidden suffixes found in list.txt. + if (!engineNames) { + engineNames = []; + for (let [name, hidden] of jarNames) { + if (!hidden) + engineNames.push(name); + } + } + + for (let name of engineNames) { + uris.push(APP_SEARCH_PREFIX + name + ".xml"); + } + + // Store this so that it can be used while writing the cache file. + this._visibleDefaultEngines = engineNames; + }, + + + _saveSortedEngineList: function SRCH_SVC_saveSortedEngineList() { + LOG("SRCH_SVC_saveSortedEngineList: starting"); + + // Set the useDB pref to indicate that from now on we should use the order + // information stored in the database. + Services.prefs.setBoolPref(BROWSER_SEARCH_PREF + "useDBForOrder", true); + + var engines = this._getSortedEngines(true); + + for (var i = 0; i < engines.length; ++i) { + engines[i].setAttr("order", i + 1); + } + + LOG("SRCH_SVC_saveSortedEngineList: done"); + }, + + _buildSortedEngineList: function SRCH_SVC_buildSortedEngineList() { + LOG("_buildSortedEngineList: building list"); + var addedEngines = { }; + this.__sortedEngines = []; + var engine; + + // If the user has specified a custom engine order, read the order + // information from the metadata instead of the default prefs. + if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "useDBForOrder", false)) { + LOG("_buildSortedEngineList: using db for order"); + + // Flag to keep track of whether or not we need to call _saveSortedEngineList. + let needToSaveEngineList = false; + + for (let name in this._engines) { + let engine = this._engines[name]; + var orderNumber = engine.getAttr("order"); + + // Since the DB isn't regularly cleared, and engine files may disappear + // without us knowing, we may already have an engine in this slot. If + // that happens, we just skip it - it will be added later on as an + // unsorted engine. + if (orderNumber && !this.__sortedEngines[orderNumber-1]) { + this.__sortedEngines[orderNumber-1] = engine; + addedEngines[engine.name] = engine; + } else { + // We need to call _saveSortedEngineList so this gets sorted out. + needToSaveEngineList = true; + } + } + + // Filter out any nulls for engines that may have been removed + var filteredEngines = this.__sortedEngines.filter(function(a) { return !!a; }); + if (this.__sortedEngines.length != filteredEngines.length) + needToSaveEngineList = true; + this.__sortedEngines = filteredEngines; + + if (needToSaveEngineList) + this._saveSortedEngineList(); + } else { + // The DB isn't being used, so just read the engine order from the prefs + var i = 0; + var engineName; + var prefName; + + try { + var extras = + Services.prefs.getChildList(BROWSER_SEARCH_PREF + "order.extra."); + + for (prefName of extras) { + engineName = Services.prefs.getCharPref(prefName); + + engine = this._engines[engineName]; + if (!engine || engine.name in addedEngines) + continue; + + this.__sortedEngines.push(engine); + addedEngines[engine.name] = engine; + } + } + catch (e) { } + + while (true) { + engineName = getLocalizedPref(BROWSER_SEARCH_PREF + "order." + (++i)); + if (!engineName) + break; + + engine = this._engines[engineName]; + if (!engine || engine.name in addedEngines) + continue; + + this.__sortedEngines.push(engine); + addedEngines[engine.name] = engine; + } + } + + // Array for the remaining engines, alphabetically sorted. + let alphaEngines = []; + + for (let name in this._engines) { + let engine = this._engines[name]; + if (!(engine.name in addedEngines)) + alphaEngines.push(this._engines[engine.name]); + } + + let locale = Cc["@mozilla.org/intl/nslocaleservice;1"] + .getService(Ci.nsILocaleService) + .newLocale(getLocale()); + let collation = Cc["@mozilla.org/intl/collation-factory;1"] + .createInstance(Ci.nsICollationFactory) + .CreateCollation(locale); + const strength = Ci.nsICollation.kCollationCaseInsensitiveAscii; + let comparator = (a, b) => collation.compareString(strength, a.name, b.name); + alphaEngines.sort(comparator); + return this.__sortedEngines = this.__sortedEngines.concat(alphaEngines); + }, + + /** + * Get a sorted array of engines. + * @param aWithHidden + * True if hidden plugins should be included in the result. + */ + _getSortedEngines: function SRCH_SVC_getSorted(aWithHidden) { + if (aWithHidden) + return this._sortedEngines; + + return this._sortedEngines.filter(function (engine) { + return !engine.hidden; + }); + }, + + // nsIBrowserSearchService + init: function SRCH_SVC_init(observer) { + LOG("SearchService.init"); + let self = this; + if (!this._initStarted) { + this._initStarted = true; + Task.spawn(function* task() { + try { + // Complete initialization by calling asynchronous initializer. + yield self._asyncInit(); + } catch (ex) { + if (ex.result == Cr.NS_ERROR_ALREADY_INITIALIZED) { + // No need to pursue asynchronous because synchronous fallback was + // called and has finished. + } else { + self._initObservers.reject(ex); + } + } + }); + } + if (observer) { + this._initObservers.promise.then( + function onSuccess() { + try { + observer.onInitComplete(self._initRV); + } catch (e) { + Cu.reportError(e); + } + }, + function onError(aReason) { + Cu.reportError("Internal error while initializing SearchService: " + aReason); + observer.onInitComplete(Components.results.NS_ERROR_UNEXPECTED); + } + ); + } + }, + + get isInitialized() { + return gInitialized; + }, + + getEngines: function SRCH_SVC_getEngines(aCount) { + this._ensureInitialized(); + LOG("getEngines: getting all engines"); + var engines = this._getSortedEngines(true); + aCount.value = engines.length; + return engines; + }, + + getVisibleEngines: function SRCH_SVC_getVisible(aCount) { + this._ensureInitialized(); + LOG("getVisibleEngines: getting all visible engines"); + var engines = this._getSortedEngines(false); + aCount.value = engines.length; + return engines; + }, + + getDefaultEngines: function SRCH_SVC_getDefault(aCount) { + this._ensureInitialized(); + function isDefault(engine) { + return engine._isDefault; + } + var engines = this._sortedEngines.filter(isDefault); + var engineOrder = {}; + var engineName; + var i = 1; + + // Build a list of engines which we have ordering information for. + // We're rebuilding the list here because _sortedEngines contain the + // current order, but we want the original order. + + // First, look at the "browser.search.order.extra" branch. + try { + var extras = Services.prefs.getChildList(BROWSER_SEARCH_PREF + "order.extra."); + + for (var prefName of extras) { + engineName = Services.prefs.getCharPref(prefName); + + if (!(engineName in engineOrder)) + engineOrder[engineName] = i++; + } + } catch (e) { + LOG("Getting extra order prefs failed: " + e); + } + + // Now look through the "browser.search.order" branch. + for (var j = 1; ; j++) { + engineName = getLocalizedPref(BROWSER_SEARCH_PREF + "order." + j); + if (!engineName) + break; + + if (!(engineName in engineOrder)) + engineOrder[engineName] = i++; + } + + LOG("getDefaultEngines: engineOrder: " + engineOrder.toSource()); + + function compareEngines (a, b) { + var aIdx = engineOrder[a.name]; + var bIdx = engineOrder[b.name]; + + if (aIdx && bIdx) + return aIdx - bIdx; + if (aIdx) + return -1; + if (bIdx) + return 1; + + return a.name.localeCompare(b.name); + } + engines.sort(compareEngines); + + aCount.value = engines.length; + return engines; + }, + + getEngineByName: function SRCH_SVC_getEngineByName(aEngineName) { + this._ensureInitialized(); + return this._engines[aEngineName] || null; + }, + + getEngineByAlias: function SRCH_SVC_getEngineByAlias(aAlias) { + this._ensureInitialized(); + for (var engineName in this._engines) { + var engine = this._engines[engineName]; + if (engine && engine.alias == aAlias) + return engine; + } + return null; + }, + + addEngineWithDetails: function SRCH_SVC_addEWD(aName, aIconURL, aAlias, + aDescription, aMethod, + aTemplate, aExtensionID) { + this._ensureInitialized(); + if (!aName) + FAIL("Invalid name passed to addEngineWithDetails!"); + if (!aMethod) + FAIL("Invalid method passed to addEngineWithDetails!"); + if (!aTemplate) + FAIL("Invalid template passed to addEngineWithDetails!"); + if (this._engines[aName]) + FAIL("An engine with that name already exists!", Cr.NS_ERROR_FILE_ALREADY_EXISTS); + + var engine = new Engine(sanitizeName(aName), false); + engine._initFromMetadata(aName, aIconURL, aAlias, aDescription, + aMethod, aTemplate, aExtensionID); + engine._loadPath = "[other]addEngineWithDetails"; + this._addEngineToStore(engine); + }, + + addEngine: function SRCH_SVC_addEngine(aEngineURL, aDataType, aIconURL, + aConfirm, aCallback) { + LOG("addEngine: Adding \"" + aEngineURL + "\"."); + this._ensureInitialized(); + try { + var uri = makeURI(aEngineURL); + var engine = new Engine(uri, false); + if (aCallback) { + engine._installCallback = function (errorCode) { + try { + if (errorCode == null) + aCallback.onSuccess(engine); + else + aCallback.onError(errorCode); + } catch (ex) { + Cu.reportError("Error invoking addEngine install callback: " + ex); + } + // Clear the reference to the callback now that it's been invoked. + engine._installCallback = null; + }; + } + engine._initFromURIAndLoad(uri); + } catch (ex) { + // Drop the reference to the callback, if set + if (engine) + engine._installCallback = null; + FAIL("addEngine: Error adding engine:\n" + ex, Cr.NS_ERROR_FAILURE); + } + engine._setIcon(aIconURL, false); + engine._confirm = aConfirm; + }, + + removeEngine: function SRCH_SVC_removeEngine(aEngine) { + this._ensureInitialized(); + if (!aEngine) + FAIL("no engine passed to removeEngine!"); + + var engineToRemove = null; + for (var e in this._engines) { + if (aEngine.wrappedJSObject == this._engines[e]) + engineToRemove = this._engines[e]; + } + + if (!engineToRemove) + FAIL("removeEngine: Can't find engine to remove!", Cr.NS_ERROR_FILE_NOT_FOUND); + + if (engineToRemove == this.currentEngine) { + this._currentEngine = null; + } + + if (engineToRemove._readOnly) { + // Just hide it (the "hidden" setter will notify) and remove its alias to + // avoid future conflicts with other engines. + engineToRemove.hidden = true; + engineToRemove.alias = null; + } else { + // Remove the engine file from disk if we had a legacy file in the profile. + if (engineToRemove._filePath) { + let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); + file.persistentDescriptor = engineToRemove._filePath; + if (file.exists()) { + file.remove(false); + } + engineToRemove._filePath = null; + } + + // Remove the engine from _sortedEngines + var index = this._sortedEngines.indexOf(engineToRemove); + if (index == -1) + FAIL("Can't find engine to remove in _sortedEngines!", Cr.NS_ERROR_FAILURE); + this.__sortedEngines.splice(index, 1); + + // Remove the engine from the internal store + delete this._engines[engineToRemove.name]; + + // Since we removed an engine, we need to update the preferences. + this._saveSortedEngineList(); + } + notifyAction(engineToRemove, SEARCH_ENGINE_REMOVED); + }, + + moveEngine: function SRCH_SVC_moveEngine(aEngine, aNewIndex) { + this._ensureInitialized(); + if ((aNewIndex > this._sortedEngines.length) || (aNewIndex < 0)) + FAIL("SRCH_SVC_moveEngine: Index out of bounds!"); + if (!(aEngine instanceof Ci.nsISearchEngine)) + FAIL("SRCH_SVC_moveEngine: Invalid engine passed to moveEngine!"); + if (aEngine.hidden) + FAIL("moveEngine: Can't move a hidden engine!", Cr.NS_ERROR_FAILURE); + + var engine = aEngine.wrappedJSObject; + + var currentIndex = this._sortedEngines.indexOf(engine); + if (currentIndex == -1) + FAIL("moveEngine: Can't find engine to move!", Cr.NS_ERROR_UNEXPECTED); + + // Our callers only take into account non-hidden engines when calculating + // aNewIndex, but we need to move it in the array of all engines, so we + // need to adjust aNewIndex accordingly. To do this, we count the number + // of hidden engines in the list before the engine that we're taking the + // place of. We do this by first finding newIndexEngine (the engine that + // we were supposed to replace) and then iterating through the complete + // engine list until we reach it, increasing aNewIndex for each hidden + // engine we find on our way there. + // + // This could be further simplified by having our caller pass in + // newIndexEngine directly instead of aNewIndex. + var newIndexEngine = this._getSortedEngines(false)[aNewIndex]; + if (!newIndexEngine) + FAIL("moveEngine: Can't find engine to replace!", Cr.NS_ERROR_UNEXPECTED); + + for (var i = 0; i < this._sortedEngines.length; ++i) { + if (newIndexEngine == this._sortedEngines[i]) + break; + if (this._sortedEngines[i].hidden) + aNewIndex++; + } + + if (currentIndex == aNewIndex) + return; // nothing to do! + + // Move the engine + var movedEngine = this.__sortedEngines.splice(currentIndex, 1)[0]; + this.__sortedEngines.splice(aNewIndex, 0, movedEngine); + + notifyAction(engine, SEARCH_ENGINE_CHANGED); + + // Since we moved an engine, we need to update the preferences. + this._saveSortedEngineList(); + }, + + restoreDefaultEngines: function SRCH_SVC_resetDefaultEngines() { + this._ensureInitialized(); + for (let name in this._engines) { + let e = this._engines[name]; + // Unhide all default engines + if (e.hidden && e._isDefault) + e.hidden = false; + } + }, + + get defaultEngine() { return this.currentEngine; }, + + set defaultEngine(val) { + this.currentEngine = val; + }, + + get currentEngine() { + this._ensureInitialized(); + if (!this._currentEngine) { + let name = this.getGlobalAttr("current"); + let engine = this.getEngineByName(name); + if (engine && (this.getGlobalAttr("hash") == getVerificationHash(name) || + engine._isDefault)) { + // If the current engine is a default one, we can relax the + // verification hash check to reduce the annoyance for users who + // backup/sync their profile in custom ways. + this._currentEngine = engine; + } + if (!name) + this._currentEngine = this.originalDefaultEngine; + } + + // If the current engine is not set or hidden, we fallback... + if (!this._currentEngine || this._currentEngine.hidden) { + // first to the original default engine + let originalDefault = this.originalDefaultEngine; + if (!originalDefault || originalDefault.hidden) { + // then to the first visible engine + let firstVisible = this._getSortedEngines(false)[0]; + if (firstVisible && !firstVisible.hidden) { + this.currentEngine = firstVisible; + return firstVisible; + } + // and finally as a last resort we unhide the original default engine. + if (originalDefault) + originalDefault.hidden = false; + } + if (!originalDefault) + return null; + + // If the current engine wasn't set or was hidden, we used a fallback + // to pick a new current engine. As soon as we return it, this new + // current engine will become user-visible, so we should persist it. + // by calling the setter. + this.currentEngine = originalDefault; + } + + return this._currentEngine; + }, + + set currentEngine(val) { + this._ensureInitialized(); + // Sometimes we get wrapped nsISearchEngine objects (external XPCOM callers), + // and sometimes we get raw Engine JS objects (callers in this file), so + // handle both. + if (!(val instanceof Ci.nsISearchEngine) && !(val instanceof Engine)) + FAIL("Invalid argument passed to currentEngine setter"); + + var newCurrentEngine = this.getEngineByName(val.name); + if (!newCurrentEngine) + FAIL("Can't find engine in store!", Cr.NS_ERROR_UNEXPECTED); + + if (!newCurrentEngine._isDefault) { + // If a non default engine is being set as the current engine, ensure + // its loadPath has a verification hash. + if (!newCurrentEngine._loadPath) + newCurrentEngine._loadPath = "[other]unknown"; + let loadPathHash = getVerificationHash(newCurrentEngine._loadPath); + let currentHash = newCurrentEngine.getAttr("loadPathHash"); + if (!currentHash || currentHash != loadPathHash) { + newCurrentEngine.setAttr("loadPathHash", loadPathHash); + notifyAction(newCurrentEngine, SEARCH_ENGINE_CHANGED); + } + } + + if (newCurrentEngine == this._currentEngine) + return; + + this._currentEngine = newCurrentEngine; + + // If we change the default engine in the future, that change should impact + // users who have switched away from and then back to the build's "default" + // engine. So clear the user pref when the currentEngine is set to the + // build's default engine, so that the currentEngine getter falls back to + // whatever the default is. + let newName = this._currentEngine.name; + if (this._currentEngine == this.originalDefaultEngine) { + newName = ""; + } + + this.setGlobalAttr("current", newName); + this.setGlobalAttr("hash", getVerificationHash(newName)); + + notifyAction(this._currentEngine, SEARCH_ENGINE_DEFAULT); + notifyAction(this._currentEngine, SEARCH_ENGINE_CURRENT); + }, + + getDefaultEngineInfo() { + let result = {}; + + let engine; + try { + engine = this.defaultEngine; + } catch (e) { + // The defaultEngine getter will throw if there's no engine at all, + // which shouldn't happen unless an add-on or a test deleted all of them. + // Our preferences UI doesn't let users do that. + Cu.reportError("getDefaultEngineInfo: No default engine"); + } + + if (!engine) { + result.name = "NONE"; + } else { + if (engine.name) + result.name = engine.name; + + result.loadPath = engine._loadPath; + + let origin; + if (engine._isDefault) + origin = "default"; + else { + let currentHash = engine.getAttr("loadPathHash"); + if (!currentHash) + origin = "unverified"; + else { + let loadPathHash = getVerificationHash(engine._loadPath); + origin = currentHash == loadPathHash ? "verified" : "invalid"; + } + } + result.origin = origin; + + // For privacy, we only collect the submission URL for default engines... + let sendSubmissionURL = engine._isDefault; + + // ... or engines sorted by default near the top of the list. + if (!sendSubmissionURL) { + let extras = + Services.prefs.getChildList(BROWSER_SEARCH_PREF + "order.extra."); + + for (let prefName of extras) { + try { + if (result.name == Services.prefs.getCharPref(prefName)) { + sendSubmissionURL = true; + break; + } + } catch (e) {} + } + + let i = 0; + while (!sendSubmissionURL) { + let engineName = getLocalizedPref(BROWSER_SEARCH_PREF + "order." + (++i)); + if (!engineName) + break; + if (result.name == engineName) { + sendSubmissionURL = true; + break; + } + } + } + + if (sendSubmissionURL) { + let uri = engine._getURLOfType("text/html") + .getSubmission("", engine, "searchbar").uri; + uri.userPass = ""; // Avoid reporting a username or password. + result.submissionURL = uri.spec; + } + } + + return result; + }, + + _recordEngineTelemetry: function() { + Services.telemetry.getHistogramById("SEARCH_SERVICE_ENGINE_COUNT") + .add(Object.keys(this._engines).length); + let hasUpdates = false; + let hasIconUpdates = false; + for (let name in this._engines) { + let engine = this._engines[name]; + if (engine._hasUpdates) { + hasUpdates = true; + if (engine._iconUpdateURL) { + hasIconUpdates = true; + break; + } + } + } + Services.telemetry.getHistogramById("SEARCH_SERVICE_HAS_UPDATES").add(hasUpdates); + Services.telemetry.getHistogramById("SEARCH_SERVICE_HAS_ICON_UPDATES").add(hasIconUpdates); + }, + + /** + * This map is built lazily after the available search engines change. It + * allows quick parsing of an URL representing a search submission into the + * search engine name and original terms. + * + * The keys are strings containing the domain name and lowercase path of the + * engine submission, for example "www.google.com/search". + * + * The values are objects with these properties: + * { + * engine: The associated nsISearchEngine. + * termsParameterName: Name of the URL parameter containing the search + * terms, for example "q". + * } + */ + _parseSubmissionMap: null, + + _buildParseSubmissionMap: function SRCH_SVC__buildParseSubmissionMap() { + LOG("_buildParseSubmissionMap"); + this._parseSubmissionMap = new Map(); + + // Used only while building the map, indicates which entries do not refer to + // the main domain of the engine but to an alternate domain, for example + // "www.google.fr" for the "www.google.com" search engine. + let keysOfAlternates = new Set(); + + for (let engine of this._sortedEngines) { + LOG("Processing engine: " + engine.name); + + if (engine.hidden) { + LOG("Engine is hidden."); + continue; + } + + let urlParsingInfo = engine.getURLParsingInfo(); + if (!urlParsingInfo) { + LOG("Engine does not support URL parsing."); + continue; + } + + // Store the same object on each matching map key, as an optimization. + let mapValueForEngine = { + engine: engine, + termsParameterName: urlParsingInfo.termsParameterName, + }; + + let processDomain = (domain, isAlternate) => { + let key = domain + urlParsingInfo.path; + + // Apply the logic for which main domains take priority over alternate + // domains, even if they are found later in the ordered engine list. + let existingEntry = this._parseSubmissionMap.get(key); + if (!existingEntry) { + LOG("Adding new entry: " + key); + if (isAlternate) { + keysOfAlternates.add(key); + } + } else if (!isAlternate && keysOfAlternates.has(key)) { + LOG("Overriding alternate entry: " + key + + " (" + existingEntry.engine.name + ")"); + keysOfAlternates.delete(key); + } else { + LOG("Keeping existing entry: " + key + + " (" + existingEntry.engine.name + ")"); + return; + } + + this._parseSubmissionMap.set(key, mapValueForEngine); + }; + + processDomain(urlParsingInfo.mainDomain, false); + SearchStaticData.getAlternateDomains(urlParsingInfo.mainDomain) + .forEach(d => processDomain(d, true)); + } + }, + + /** + * Checks to see if any engine has an EngineURL of type URLTYPE_SEARCH_HTML + * for this request-method, template URL, and query params. + */ + hasEngineWithURL: function(method, template, formData) { + this._ensureInitialized(); + + // Quick helper method to ensure formData filtered/sorted for compares. + let getSortedFormData = data => { + return data.filter(a => a.name && a.value).sort((a, b) => { + if (a.name > b.name) { + return 1; + } else if (b.name > a.name) { + return -1; + } else if (a.value > b.value) { + return 1; + } + return (b.value > a.value) ? -1 : 0; + }); + }; + + // Sanitize method, ensure formData is pre-sorted. + let methodUpper = method.toUpperCase(); + let sortedFormData = getSortedFormData(formData); + let sortedFormLength = sortedFormData.length; + + return this._getSortedEngines(false).some(engine => { + return engine._urls.some(url => { + // Not an engineURL match if type, method, url, #params don't match. + if (url.type != URLTYPE_SEARCH_HTML || + url.method != methodUpper || + url.template != template || + url.params.length != sortedFormLength) { + return false; + } + + // Ensure engineURL formData is pre-sorted. Then, we're + // not an engineURL match if any queryParam doesn't compare. + let sortedParams = getSortedFormData(url.params); + for (let i = 0; i < sortedFormLength; i++) { + let formData = sortedFormData[i]; + let param = sortedParams[i]; + if (param.name != formData.name || + param.value != formData.value || + param.purpose != formData.purpose) { + return false; + } + } + // Else we're a match. + return true; + }); + }); + }, + + parseSubmissionURL: function SRCH_SVC_parseSubmissionURL(aURL) { + this._ensureInitialized(); + LOG("parseSubmissionURL: Parsing \"" + aURL + "\"."); + + if (!this._parseSubmissionMap) { + this._buildParseSubmissionMap(); + } + + // Extract the elements of the provided URL first. + let soughtKey, soughtQuery; + try { + let soughtUrl = NetUtil.newURI(aURL).QueryInterface(Ci.nsIURL); + + // Exclude any URL that is not HTTP or HTTPS from the beginning. + if (soughtUrl.scheme != "http" && soughtUrl.scheme != "https") { + LOG("The URL scheme is not HTTP or HTTPS."); + return gEmptyParseSubmissionResult; + } + + // Reading these URL properties may fail and raise an exception. + soughtKey = soughtUrl.host + soughtUrl.filePath.toLowerCase(); + soughtQuery = soughtUrl.query; + } catch (ex) { + // Errors while parsing the URL or accessing the properties are not fatal. + LOG("The value does not look like a structured URL."); + return gEmptyParseSubmissionResult; + } + + // Look up the domain and path in the map to identify the search engine. + let mapEntry = this._parseSubmissionMap.get(soughtKey); + if (!mapEntry) { + LOG("No engine associated with domain and path: " + soughtKey); + return gEmptyParseSubmissionResult; + } + + // Extract the search terms from the parameter, for example "caff%C3%A8" + // from the URL "https://www.google.com/search?q=caff%C3%A8&client=firefox". + let encodedTerms = null; + for (let param of soughtQuery.split("&")) { + let equalPos = param.indexOf("="); + if (equalPos != -1 && + param.substr(0, equalPos) == mapEntry.termsParameterName) { + // This is the parameter we are looking for. + encodedTerms = param.substr(equalPos + 1); + break; + } + } + if (encodedTerms === null) { + LOG("Missing terms parameter: " + mapEntry.termsParameterName); + return gEmptyParseSubmissionResult; + } + + let length = 0; + let offset = aURL.indexOf("?") + 1; + let query = aURL.slice(offset); + // Iterate a second time over the original input string to determine the + // correct search term offset and length in the original encoding. + for (let param of query.split("&")) { + let equalPos = param.indexOf("="); + if (equalPos != -1 && + param.substr(0, equalPos) == mapEntry.termsParameterName) { + // This is the parameter we are looking for. + offset += equalPos + 1; + length = param.length - equalPos - 1; + break; + } + offset += param.length + 1; + } + + // Decode the terms using the charset defined in the search engine. + let terms; + try { + terms = gTextToSubURI.UnEscapeAndConvert( + mapEntry.engine.queryCharset, + encodedTerms.replace(/\+/g, " ")); + } catch (ex) { + // Decoding errors will cause this match to be ignored. + LOG("Parameter decoding failed. Charset: " + + mapEntry.engine.queryCharset); + return gEmptyParseSubmissionResult; + } + + LOG("Match found. Terms: " + terms); + return new ParseSubmissionResult(mapEntry.engine, terms, offset, length); + }, + + // nsIObserver + observe: function SRCH_SVC_observe(aEngine, aTopic, aVerb) { + switch (aTopic) { + case SEARCH_ENGINE_TOPIC: + switch (aVerb) { + case SEARCH_ENGINE_LOADED: + var engine = aEngine.QueryInterface(Ci.nsISearchEngine); + LOG("nsSearchService::observe: Done installation of " + engine.name + + "."); + this._addEngineToStore(engine.wrappedJSObject); + if (engine.wrappedJSObject._useNow) { + LOG("nsSearchService::observe: setting current"); + this.currentEngine = aEngine; + } + // The addition of the engine to the store always triggers an ADDED + // or a CHANGED notification, that will trigger the task below. + break; + case SEARCH_ENGINE_ADDED: + case SEARCH_ENGINE_CHANGED: + case SEARCH_ENGINE_REMOVED: + this.batchTask.disarm(); + this.batchTask.arm(); + // Invalidate the map used to parse URLs to search engines. + this._parseSubmissionMap = null; + break; + } + break; + + case QUIT_APPLICATION_TOPIC: + this._removeObservers(); + break; + + case "nsPref:changed": + if (aVerb == LOCALE_PREF) { + // Locale changed. Re-init. We rely on observers, because we can't + // return this promise to anyone. + this._asyncReInit(); + break; + } + } + }, + + // nsITimerCallback + notify: function SRCH_SVC_notify(aTimer) { + LOG("_notify: checking for updates"); + + if (!Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "update", true)) + return; + + // Our timer has expired, but unfortunately, we can't get any data from it. + // Therefore, we need to walk our engine-list, looking for expired engines + var currentTime = Date.now(); + LOG("currentTime: " + currentTime); + for (let name in this._engines) { + let engine = this._engines[name].wrappedJSObject; + if (!engine._hasUpdates) + continue; + + LOG("checking " + engine.name); + + var expirTime = engine.getAttr("updateexpir"); + LOG("expirTime: " + expirTime + "\nupdateURL: " + engine._updateURL + + "\niconUpdateURL: " + engine._iconUpdateURL); + + var engineExpired = expirTime <= currentTime; + + if (!expirTime || !engineExpired) { + LOG("skipping engine"); + continue; + } + + LOG(engine.name + " has expired"); + + engineUpdateService.update(engine); + + // Schedule the next update + engineUpdateService.scheduleNextUpdate(engine); + + } // end engine iteration + }, + + _addObservers: function SRCH_SVC_addObservers() { + if (this._observersAdded) { + // There might be a race between synchronous and asynchronous + // initialization for which we try to register the observers twice. + return; + } + this._observersAdded = true; + + Services.obs.addObserver(this, SEARCH_ENGINE_TOPIC, false); + Services.obs.addObserver(this, QUIT_APPLICATION_TOPIC, false); + + // The current stage of shutdown. Used to help analyze crash + // signatures in case of shutdown timeout. + let shutdownState = { + step: "Not started", + latestError: { + message: undefined, + stack: undefined + } + }; + OS.File.profileBeforeChange.addBlocker( + "Search service: shutting down", + () => Task.spawn(function* () { + if (this._batchTask) { + shutdownState.step = "Finalizing batched task"; + try { + yield this._batchTask.finalize(); + shutdownState.step = "Batched task finalized"; + } catch (ex) { + shutdownState.step = "Batched task failed to finalize"; + + shutdownState.latestError.message = "" + ex; + if (ex && typeof ex == "object") { + shutdownState.latestError.stack = ex.stack || undefined; + } + + // Ensure that error is reported and that it causes tests + // to fail. + Promise.reject(ex); + } + } + }.bind(this)), + + () => shutdownState + ); + }, + _observersAdded: false, + + _removeObservers: function SRCH_SVC_removeObservers() { + Services.obs.removeObserver(this, SEARCH_ENGINE_TOPIC); + Services.obs.removeObserver(this, QUIT_APPLICATION_TOPIC); + }, + + QueryInterface: XPCOMUtils.generateQI([ + Ci.nsIBrowserSearchService, + Ci.nsIObserver, + Ci.nsITimerCallback + ]) +}; + + +const SEARCH_UPDATE_LOG_PREFIX = "*** Search update: "; + +/** + * Outputs aText to the JavaScript console as well as to stdout, if the search + * logging pref (browser.search.update.log) is set to true. + */ +function ULOG(aText) { + if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "update.log", false)) { + dump(SEARCH_UPDATE_LOG_PREFIX + aText + "\n"); + Services.console.logStringMessage(aText); + } +} + +var engineUpdateService = { + scheduleNextUpdate: function eus_scheduleNextUpdate(aEngine) { + var interval = aEngine._updateInterval || SEARCH_DEFAULT_UPDATE_INTERVAL; + var milliseconds = interval * 86400000; // |interval| is in days + aEngine.setAttr("updateexpir", Date.now() + milliseconds); + }, + + update: function eus_Update(aEngine) { + let engine = aEngine.wrappedJSObject; + ULOG("update called for " + aEngine._name); + if (!Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "update", true) || !engine._hasUpdates) + return; + + let testEngine = null; + let updateURL = engine._getURLOfType(URLTYPE_OPENSEARCH); + let updateURI = (updateURL && updateURL._hasRelation("self")) ? + updateURL.getSubmission("", engine).uri : + makeURI(engine._updateURL); + if (updateURI) { + if (engine._isDefault && !updateURI.schemeIs("https")) { + ULOG("Invalid scheme for default engine update"); + return; + } + + ULOG("updating " + engine.name + " from " + updateURI.spec); + testEngine = new Engine(updateURI, false); + testEngine._engineToUpdate = engine; + testEngine._initFromURIAndLoad(updateURI); + } else + ULOG("invalid updateURI"); + + if (engine._iconUpdateURL) { + // If we're updating the engine too, use the new engine object, + // otherwise use the existing engine object. + (testEngine || engine)._setIcon(engine._iconUpdateURL, true); + } + } +}; + +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]); diff --git a/application/basilisk/components/search/service/nsSearchSuggestions.js b/application/basilisk/components/search/service/nsSearchSuggestions.js new file mode 100644 index 000000000..a05d8b4b4 --- /dev/null +++ b/application/basilisk/components/search/service/nsSearchSuggestions.js @@ -0,0 +1,197 @@ +/* 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/. */ + +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/nsFormAutoCompleteResult.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "SearchSuggestionController", + "resource://gre/modules/SearchSuggestionController.jsm"); + +/** + * SuggestAutoComplete is a base class that implements nsIAutoCompleteSearch + * and can collect results for a given search by using this._suggestionController. + * We do it this way since the AutoCompleteController in Mozilla requires a + * unique XPCOM Service for every search provider, even if the logic for two + * providers is identical. + * @constructor + */ +function SuggestAutoComplete() { + this._init(); +} +SuggestAutoComplete.prototype = { + + _init: function() { + this._suggestionController = new SearchSuggestionController(obj => this.onResultsReturned(obj)); + this._suggestionController.maxLocalResults = this._historyLimit; + }, + + get _suggestionLabel() { + let bundle = Services.strings.createBundle("chrome://global/locale/search/search.properties"); + let label = bundle.GetStringFromName("suggestion_label"); + Object.defineProperty(SuggestAutoComplete.prototype, "_suggestionLabel", {value: label}); + return label; + }, + + /** + * The object implementing nsIAutoCompleteObserver that we notify when + * we have found results + * @private + */ + _listener: null, + + /** + * Maximum number of history items displayed. This is capped at 7 + * because the primary consumer (Firefox search bar) displays 10 rows + * by default, and so we want to leave some space for suggestions + * to be visible. + */ + _historyLimit: 7, + + /** + * Callback for handling results from SearchSuggestionController.jsm + * @private + */ + onResultsReturned: function(results) { + let finalResults = []; + let finalComments = []; + + // If form history has results, add them to the list. + for (let i = 0; i < results.local.length; ++i) { + finalResults.push(results.local[i]); + finalComments.push(""); + } + + // If there are remote matches, add them. + if (results.remote.length) { + // "comments" column values for suggestions starts as empty strings + let comments = new Array(results.remote.length).fill("", 1); + comments[0] = this._suggestionLabel; + // now put the history results above the suggestions + finalResults = finalResults.concat(results.remote); + finalComments = finalComments.concat(comments); + } + + // Notify the FE of our new results + this.onResultsReady(results.term, finalResults, finalComments, results.formHistoryResult); + }, + + /** + * Notifies the front end of new results. + * @param searchString the user's query string + * @param results an array of results to the search + * @param comments an array of metadata corresponding to the results + * @private + */ + onResultsReady: function(searchString, results, comments, formHistoryResult) { + if (this._listener) { + // Create a copy of the results array to use as labels, since + // FormAutoCompleteResult doesn't like being passed the same array + // for both. + let labels = results.slice(); + let result = new FormAutoCompleteResult( + searchString, + Ci.nsIAutoCompleteResult.RESULT_SUCCESS, + 0, + "", + results, + labels, + comments, + formHistoryResult); + + this._listener.onSearchResult(this, result); + + // Null out listener to make sure we don't notify it twice + this._listener = null; + } + }, + + /** + * Initiates the search result gathering process. Part of + * nsIAutoCompleteSearch implementation. + * + * @param searchString the user's query string + * @param searchParam unused, "an extra parameter"; even though + * this parameter and the next are unused, pass + * them through in case the form history + * service wants them + * @param previousResult unused, a client-cached store of the previous + * generated resultset for faster searching. + * @param listener object implementing nsIAutoCompleteObserver which + * we notify when results are ready. + */ + startSearch: function(searchString, searchParam, previousResult, listener) { + // Don't reuse a previous form history result when it no longer applies. + if (!previousResult) + this._formHistoryResult = null; + + var formHistorySearchParam = searchParam.split("|")[0]; + + // Receive the information about the privacy mode of the window to which + // this search box belongs. The front-end's search.xml bindings passes this + // information in the searchParam parameter. The alternative would have + // been to modify nsIAutoCompleteSearch to add an argument to startSearch + // and patch all of autocomplete to be aware of this, but the searchParam + // argument is already an opaque argument, so this solution is hopefully + // less hackish (although still gross.) + var privacyMode = (searchParam.split("|")[1] == "private"); + + // Start search immediately if possible, otherwise once the search + // service is initialized + if (Services.search.isInitialized) { + this._triggerSearch(searchString, formHistorySearchParam, listener, privacyMode); + return; + } + + Services.search.init((function startSearch_cb(aResult) { + if (!Components.isSuccessCode(aResult)) { + Cu.reportError("Could not initialize search service, bailing out: " + aResult); + return; + } + this._triggerSearch(searchString, formHistorySearchParam, listener, privacyMode); + }).bind(this)); + }, + + /** + * Actual implementation of search. + */ + _triggerSearch: function(searchString, searchParam, listener, privacyMode) { + this._listener = listener; + this._suggestionController.fetch(searchString, + privacyMode, + Services.search.currentEngine); + }, + + /** + * Ends the search result gathering process. Part of nsIAutoCompleteSearch + * implementation. + */ + stopSearch: function() { + this._suggestionController.stop(); + }, + + // nsISupports + QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteSearch, + Ci.nsIAutoCompleteObserver]) +}; + +/** + * SearchSuggestAutoComplete is a service implementation that handles suggest + * results specific to web searches. + * @constructor + */ +function SearchSuggestAutoComplete() { + // This calls _init() in the parent class (SuggestAutoComplete) via the + // prototype, below. + this._init(); +} +SearchSuggestAutoComplete.prototype = { + classID: Components.ID("{aa892eb4-ffbf-477d-9f9a-06c995ae9f27}"), + __proto__: SuggestAutoComplete.prototype, + serviceURL: "" +}; + +var component = [SearchSuggestAutoComplete]; +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/application/basilisk/components/search/service/nsSidebar.js b/application/basilisk/components/search/service/nsSidebar.js new file mode 100644 index 000000000..63976cba7 --- /dev/null +++ b/application/basilisk/components/search/service/nsSidebar.js @@ -0,0 +1,66 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */ +/* 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/. */ + +const { interfaces: Ci, utils: Cu } = Components; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); + +// File extension for Sherlock search plugin description files +const SHERLOCK_FILE_EXT_REGEXP = /\.src$/i; + +function nsSidebar() { +} + +nsSidebar.prototype = { + init: function(window) { + this.window = window; + try { + this.mm = window.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDocShell) + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIContentFrameMessageManager); + } catch (e) { + Cu.reportError(e); + } + }, + + // Deprecated, only left here to avoid breaking old browser-detection scripts. + addSearchEngine: function(engineURL, iconURL, suggestedTitle, suggestedCategory) { + if (SHERLOCK_FILE_EXT_REGEXP.test(engineURL)) { + Cu.reportError("Installing Sherlock search plugins is no longer supported."); + return; + } + + this.AddSearchProvider(engineURL); + }, + + // This function implements window.external.AddSearchProvider(). + // The capitalization, although nonstandard here, is to match other browsers' + // APIs and is therefore important. + AddSearchProvider: function(engineURL) { + if (!this.mm) { + Cu.reportError(`Installing a search provider from this context is not currently supported: ${Error().stack}.`); + return; + } + + this.mm.sendAsyncMessage("Search:AddEngine", { + pageURL: this.window.document.documentURIObject.spec, + engineURL + }); + }, + + // This function exists to implement window.external.IsSearchProviderInstalled(), + // for compatibility with other browsers. The function has been deprecated + // and so will not be implemented. + IsSearchProviderInstalled: function(engineURL) { + return 0; + }, + + classID: Components.ID("{22117140-9c6e-11d3-aaf1-00805f8a4905}"), + QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, + Ci.nsIDOMGlobalPropertyInitializer]) +} + +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]); diff --git a/application/basilisk/components/search/service/toolkitsearch.manifest b/application/basilisk/components/search/service/toolkitsearch.manifest new file mode 100644 index 000000000..b7c55da0e --- /dev/null +++ b/application/basilisk/components/search/service/toolkitsearch.manifest @@ -0,0 +1,10 @@ +component {7319788a-fe93-4db3-9f39-818cf08f4256} nsSearchService.js process=main +contract @mozilla.org/browser/search-service;1 {7319788a-fe93-4db3-9f39-818cf08f4256} process=main +# 21600 == 6 hours +category update-timer nsSearchService @mozilla.org/browser/search-service;1,getService,search-engine-update-timer,browser.search.update.interval,21600 +component {aa892eb4-ffbf-477d-9f9a-06c995ae9f27} nsSearchSuggestions.js +contract @mozilla.org/autocomplete/search;1?name=search-autocomplete {aa892eb4-ffbf-477d-9f9a-06c995ae9f27} +#ifdef HAVE_SIDEBAR +component {22117140-9c6e-11d3-aaf1-00805f8a4905} nsSidebar.js +contract @mozilla.org/sidebar;1 {22117140-9c6e-11d3-aaf1-00805f8a4905} +#endif diff --git a/application/basilisk/components/sessionstore/ContentRestore.jsm b/application/basilisk/components/sessionstore/ContentRestore.jsm index d4972bcaf..8b3867624 100644 --- a/application/basilisk/components/sessionstore/ContentRestore.jsm +++ b/application/basilisk/components/sessionstore/ContentRestore.jsm @@ -208,10 +208,6 @@ ContentRestoreInternal.prototype = { ? Utils.deserializePrincipal(loadArguments.triggeringPrincipal) : null; - if (loadArguments.userContextId) { - webNavigation.setOriginAttributesBeforeLoading({ userContextId: loadArguments.userContextId }); - } - webNavigation.loadURIWithOptions(loadArguments.uri, loadArguments.flags, referrer, referrerPolicy, postData, null, null, triggeringPrincipal); diff --git a/application/basilisk/components/sessionstore/SessionFile.jsm b/application/basilisk/components/sessionstore/SessionFile.jsm index 80c4e7790..3c55101e4 100644 --- a/application/basilisk/components/sessionstore/SessionFile.jsm +++ b/application/basilisk/components/sessionstore/SessionFile.jsm @@ -43,8 +43,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils", "resource://gre/modules/PromiseUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "RunState", "resource:///modules/sessionstore/RunState.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch", - "resource://gre/modules/TelemetryStopwatch.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); XPCOMUtils.defineLazyServiceGetter(this, "Telemetry", diff --git a/application/basilisk/components/sessionstore/SessionHistory.jsm b/application/basilisk/components/sessionstore/SessionHistory.jsm index 3d28d87db..907a60839 100644 --- a/application/basilisk/components/sessionstore/SessionHistory.jsm +++ b/application/basilisk/components/sessionstore/SessionHistory.jsm @@ -64,11 +64,10 @@ var SessionHistoryInternal = { * The docShell that owns the session history. */ collect: function (docShell) { - let loadContext = docShell.QueryInterface(Ci.nsILoadContext); let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation); let history = webNavigation.sessionHistory.QueryInterface(Ci.nsISHistoryInternal); - let data = {entries: [], userContextId: loadContext.originAttributes.userContextId }; + let data = {entries: []}; if (history && history.count > 0) { // Loop over the transaction linked list directly so we can get the diff --git a/application/basilisk/components/sessionstore/SessionSaver.jsm b/application/basilisk/components/sessionstore/SessionSaver.jsm index d672f8877..fa3a67512 100644 --- a/application/basilisk/components/sessionstore/SessionSaver.jsm +++ b/application/basilisk/components/sessionstore/SessionSaver.jsm @@ -13,7 +13,6 @@ const Ci = Components.interfaces; Cu.import("resource://gre/modules/Timer.jsm", this); Cu.import("resource://gre/modules/Services.jsm", this); Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); -Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this); XPCOMUtils.defineLazyModuleGetter(this, "AppConstants", "resource://gre/modules/AppConstants.jsm"); @@ -52,19 +51,6 @@ function notify(subject, topic) { Services.obs.notifyObservers(subject, topic, ""); } -// TelemetryStopwatch helper functions. -function stopWatch(method) { - return function (...histograms) { - for (let hist of histograms) { - TelemetryStopwatch[method]("FX_SESSION_RESTORE_" + hist); - } - }; -} - -var stopWatchStart = stopWatch("start"); -var stopWatchCancel = stopWatch("cancel"); -var stopWatchFinish = stopWatch("finish"); - /** * The external API implemented by the SessionSaver module. */ @@ -182,7 +168,6 @@ var SessionSaverInternal = { return Promise.resolve(); } - stopWatchStart("COLLECT_DATA_MS", "COLLECT_DATA_LONGEST_OP_MS"); let state = SessionStore.getCurrentState(forceUpdateAllWindows); PrivacyFilter.filterPrivateWindowsAndTabs(state); @@ -226,7 +211,6 @@ var SessionSaverInternal = { } } - stopWatchFinish("COLLECT_DATA_MS", "COLLECT_DATA_LONGEST_OP_MS"); return this._writeState(state); }, diff --git a/application/basilisk/components/sessionstore/SessionStorage.jsm b/application/basilisk/components/sessionstore/SessionStorage.jsm index 705139ebf..7499f95e9 100644 --- a/application/basilisk/components/sessionstore/SessionStorage.jsm +++ b/application/basilisk/components/sessionstore/SessionStorage.jsm @@ -74,7 +74,14 @@ var SessionStorageInternal = { // Get the origin of the current history entry // and use that as a key for the per-principal storage data. - let origin = principal.origin; + let origin; + try { + // The origin getter may throw for about:blank iframes as of bug 1340710, + // but we should ignore them anyway. The same goes for custom protocols. + origin = principal.origin; + } catch (e) { + return; + } if (visitedOrigins.has(origin)) { // Don't read a host twice. return; diff --git a/application/basilisk/components/sessionstore/SessionStore.jsm b/application/basilisk/components/sessionstore/SessionStore.jsm index 6b30943f3..086bb914a 100644 --- a/application/basilisk/components/sessionstore/SessionStore.jsm +++ b/application/basilisk/components/sessionstore/SessionStore.jsm @@ -135,7 +135,6 @@ Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm", this); Cu.import("resource://gre/modules/Promise.jsm", this); Cu.import("resource://gre/modules/Services.jsm", this); Cu.import("resource://gre/modules/Task.jsm", this); -Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this); Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", this); Cu.import("resource://gre/modules/Timer.jsm", this); Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); @@ -564,7 +563,6 @@ var SessionStoreInternal = { * Initialize the session using the state provided by SessionStartup */ initSession: function () { - TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS"); let state; let ss = gSessionStartup; @@ -640,7 +638,6 @@ var SessionStoreInternal = { this._prefBranch.getBoolPref("sessionstore.resume_session_once")) this._prefBranch.setBoolPref("sessionstore.resume_session_once", false); - TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS"); return state; }, @@ -1247,9 +1244,7 @@ var SessionStoreInternal = { if (initialState) { Services.obs.notifyObservers(null, NOTIFY_RESTORING_ON_STARTUP, ""); } - TelemetryStopwatch.start("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS"); this.initializeWindow(aWindow, initialState); - TelemetryStopwatch.finish("FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS"); // Let everyone know we're done. this._deferredInitialized.resolve(); @@ -2209,10 +2204,9 @@ var SessionStoreInternal = { } // Create a new tab. - let userContextId = aTab.getAttribute("usercontextid"); let newTab = aTab == aWindow.gBrowser.selectedTab ? - aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab, userContextId}) : - aWindow.gBrowser.addTab(null, {userContextId}); + aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab}) : + aWindow.gBrowser.addTab(); // Set tab title to "Connecting..." and start the throbber to pretend we're // doing something while actually waiting for data from the frame script. @@ -2301,7 +2295,7 @@ var SessionStoreInternal = { // create a new tab let tabbrowser = aWindow.gBrowser; - let tab = tabbrowser.selectedTab = tabbrowser.addTab(null, state); + let tab = tabbrowser.selectedTab = tabbrowser.addTab(); // restore tab content this.restoreTab(tab, state); @@ -2857,7 +2851,6 @@ var SessionStoreInternal = { var activeWindow = this._getMostRecentBrowserWindow(); - TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS"); if (RunState.isRunning) { // update the data for all windows with activities since the last save operation this._forEachBrowserWindow(function(aWindow) { @@ -2872,7 +2865,6 @@ var SessionStoreInternal = { }); DirtyWindows.clear(); } - TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_ALL_WINDOWS_DATA_MS"); // An array that at the end will hold all current window data. var total = []; @@ -2892,9 +2884,7 @@ var SessionStoreInternal = { nonPopupCount++; } - TelemetryStopwatch.start("FX_SESSION_RESTORE_COLLECT_COOKIES_MS"); SessionCookies.update(total); - TelemetryStopwatch.finish("FX_SESSION_RESTORE_COLLECT_COOKIES_MS"); // collect the data for all windows yet to be restored for (ix in this._statesToRestore) { @@ -3063,8 +3053,6 @@ var SessionStoreInternal = { if (aWindow && (!aWindow.__SSi || !this._windows[aWindow.__SSi])) this.onLoad(aWindow); - TelemetryStopwatch.start("FX_SESSION_RESTORE_RESTORE_WINDOW_MS"); - // We're not returning from this before we end up calling restoreTabs // for this window, so make sure we send the SSWindowStateBusy event. this._setWindowStateBusy(aWindow); @@ -3111,30 +3099,13 @@ var SessionStoreInternal = { let numVisibleTabs = 0; for (var t = 0; t < newTabCount; t++) { - // When trying to restore into existing tab, we also take the userContextId - // into account if present. - let userContextId = winData.tabs[t].userContextId; - let reuseExisting = t < openTabCount && - (tabbrowser.tabs[t].getAttribute("usercontextid") == (userContextId || "")); - // If the tab is pinned, then we'll be loading it right away, and - // there's no need to cause a remoteness flip by loading it initially - // non-remote. - let forceNotRemote = !winData.tabs[t].pinned; - let tab = reuseExisting ? tabbrowser.tabs[t] : - tabbrowser.addTab("about:blank", - {skipAnimation: true, - forceNotRemote, - userContextId}); - - // If we inserted a new tab because the userContextId didn't match with the - // open tab, even though `t < openTabCount`, we need to remove that open tab - // and put the newly added tab in its place. - if (!reuseExisting && t < openTabCount) { - tabbrowser.removeTab(tabbrowser.tabs[t]); - tabbrowser.moveTabTo(tab, t); - } - - tabs.push(tab); + tabs.push(t < openTabCount ? + tabbrowser.tabs[t] : + tabbrowser.addTab("about:blank", { + skipAnimation: true, + forceNotRemote: true, + skipBackgroundNotify: true + })); if (winData.tabs[t].pinned) tabbrowser.pinTab(tabs[t]); @@ -3235,8 +3206,6 @@ var SessionStoreInternal = { // set smoothScroll back to the original value tabstrip.smoothScroll = smoothScroll; - TelemetryStopwatch.finish("FX_SESSION_RESTORE_RESTORE_WINDOW_MS"); - this._setWindowStateReady(aWindow); this._sendWindowRestoredNotification(aWindow); @@ -3543,9 +3512,6 @@ var SessionStoreInternal = { let uri = activePageData ? activePageData.url || null : null; if (aLoadArguments) { uri = aLoadArguments.uri; - if (aLoadArguments.userContextId) { - browser.setAttribute("usercontextid", aLoadArguments.userContextId); - } } // We have to mark this tab as restoring first, otherwise diff --git a/application/basilisk/components/sessionstore/TabAttributes.jsm b/application/basilisk/components/sessionstore/TabAttributes.jsm index 8a29680f4..c8e6d9744 100644 --- a/application/basilisk/components/sessionstore/TabAttributes.jsm +++ b/application/basilisk/components/sessionstore/TabAttributes.jsm @@ -14,7 +14,10 @@ this.EXPORTED_SYMBOLS = ["TabAttributes"]; // 'pending' is used internal by sessionstore and managed accordingly. // 'iconLoadingPrincipal' is same as 'image' that it should be handled by // using the gBrowser.getIcon()/setIcon() methods. -const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", "iconLoadingPrincipal"]); +// 'skipbackgroundnotify' is used internal by tabbrowser.xml. +const ATTRIBUTES_TO_SKIP = new Set(["image", "muted", "pending", + "iconLoadingPrincipal", + "skipbackgroundnotify"]); // A set of tab attributes to persist. We will read a given list of tab // attributes when collecting tab data and will re-set those attributes when diff --git a/application/basilisk/components/sessionstore/TabState.jsm b/application/basilisk/components/sessionstore/TabState.jsm index f22c52fe3..ac846031b 100644 --- a/application/basilisk/components/sessionstore/TabState.jsm +++ b/application/basilisk/components/sessionstore/TabState.jsm @@ -181,10 +181,6 @@ var TabStateInternal = { if (key === "history") { tabData.entries = value.entries; - if (value.hasOwnProperty("userContextId")) { - tabData.userContextId = value.userContextId; - } - if (value.hasOwnProperty("index")) { tabData.index = value.index; } diff --git a/application/basilisk/components/sessionstore/nsSessionStartup.js b/application/basilisk/components/sessionstore/nsSessionStartup.js index 7593c48ec..9cda1552e 100644 --- a/application/basilisk/components/sessionstore/nsSessionStartup.js +++ b/application/basilisk/components/sessionstore/nsSessionStartup.js @@ -37,7 +37,6 @@ const Cr = Components.results; const Cu = Components.utils; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/TelemetryStopwatch.jsm"); Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); Cu.import("resource://gre/modules/Promise.jsm"); diff --git a/application/palemoon/base/content/sync/aboutSyncTabs-bindings.xml b/application/basilisk/components/sync/aboutSyncTabs-bindings.xml index e6108209a..e6108209a 100644 --- a/application/palemoon/base/content/sync/aboutSyncTabs-bindings.xml +++ b/application/basilisk/components/sync/aboutSyncTabs-bindings.xml diff --git a/application/palemoon/base/content/sync/aboutSyncTabs.css b/application/basilisk/components/sync/aboutSyncTabs.css index 5a353175b..5a353175b 100644 --- a/application/palemoon/base/content/sync/aboutSyncTabs.css +++ b/application/basilisk/components/sync/aboutSyncTabs.css diff --git a/application/basilisk/base/content/sync/aboutSyncTabs.js b/application/basilisk/components/sync/aboutSyncTabs.js index f4bb607ea..4808c052f 100644 --- a/application/basilisk/base/content/sync/aboutSyncTabs.js +++ b/application/basilisk/components/sync/aboutSyncTabs.js @@ -11,14 +11,6 @@ Cu.import("resource://gre/modules/PlacesUtils.jsm", this); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Promise", - "resource://gre/modules/Promise.jsm"); - -#ifdef MOZ_SERVICES_CLOUDSYNC -XPCOMUtils.defineLazyModuleGetter(this, "CloudSync", - "resource://gre/modules/CloudSync.jsm"); -#endif - var RemoteTabViewer = { _tabsList: null, @@ -26,8 +18,6 @@ var RemoteTabViewer = { Services.obs.addObserver(this, "weave:service:login:finish", false); Services.obs.addObserver(this, "weave:engine:sync:finish", false); - Services.obs.addObserver(this, "cloudsync:tabs:update", false); - this._tabsList = document.getElementById("tabsList"); this.buildList(true); @@ -36,14 +26,12 @@ var RemoteTabViewer = { uninit: function () { Services.obs.removeObserver(this, "weave:service:login:finish"); Services.obs.removeObserver(this, "weave:engine:sync:finish"); - - Services.obs.removeObserver(this, "cloudsync:tabs:update"); }, - createItem: function (attrs) { + createItem: function(attrs) { let item = document.createElement("richlistitem"); - // Copy the attributes from the argument into the item. + // Copy the attributes from the argument into the item for (let attr in attrs) { item.setAttribute(attr, attrs[attr]); } @@ -55,7 +43,7 @@ var RemoteTabViewer = { return item; }, - filterTabs: function (event) { + filterTabs: function(event) { let val = event.target.value.toLowerCase(); let numTabs = this._tabsList.getRowCount(); let clientTabs = 0; @@ -65,7 +53,7 @@ var RemoteTabViewer = { let item = this._tabsList.getItemAtIndex(i); let hide = false; if (item.getAttribute("type") == "tab") { - if (!item.getAttribute("url").toLowerCase().includes(val) && + if (!item.getAttribute("url").toLowerCase().includes(val) && !item.getAttribute("title").toLowerCase().includes(val)) { hide = true; } else { @@ -88,10 +76,10 @@ var RemoteTabViewer = { } }, - openSelected: function () { + openSelected: function() { let items = this._tabsList.selectedItems; let urls = []; - for (let i = 0; i < items.length; i++) { + for (let i = 0;i < items.length;i++) { if (items[i].getAttribute("type") == "tab") { urls.push(items[i].getAttribute("url")); let index = this._tabsList.getIndexOfItem(items[i]); @@ -104,7 +92,7 @@ var RemoteTabViewer = { } }, - bookmarkSingleTab: function () { + bookmarkSingleTab: function() { let item = this._tabsList.selectedItems[0]; let uri = Weave.Utils.makeURI(item.getAttribute("url")); let title = item.getAttribute("title"); @@ -119,10 +107,10 @@ var RemoteTabViewer = { }, window.top); }, - bookmarkSelectedTabs: function () { + bookmarkSelectedTabs: function() { let items = this._tabsList.selectedItems; let URIs = []; - for (let i = 0; i < items.length; i++) { + for (let i = 0;i < items.length;i++) { if (items[i].getAttribute("type") == "tab") { let uri = Weave.Utils.makeURI(items[i].getAttribute("url")); if (!uri) { @@ -157,7 +145,7 @@ var RemoteTabViewer = { _buildListRequested: false, - buildList: function (forceSync) { + buildList: function (force) { if (this._waitingForBuildList) { this._buildListRequested = true; return; @@ -168,37 +156,27 @@ var RemoteTabViewer = { this._clearTabList(); - if (Weave.Service.isLoggedIn) { - this._refetchTabs(forceSync); + if (Weave.Service.isLoggedIn && this._refetchTabs(force)) { this._generateWeaveTabList(); } else { - // XXXzpao We should say something about not being logged in & not having data + //XXXzpao We should say something about not being logged in & not having data // or tell the appropriate condition. (bug 583344) } - let complete = () => { + function complete() { this._waitingForBuildList = false; if (this._buildListRequested) { CommonUtils.nextTick(this.buildList, this); } } -#ifdef MOZ_SERVICES_CLOUDSYNC - if (CloudSync && CloudSync.ready && CloudSync().tabsReady && CloudSync().tabs.hasRemoteTabs()) { - this._generateCloudSyncTabList() - .then(complete, complete); - } else { - complete(); - } -#else complete(); -#endif }, _clearTabList: function () { let list = this._tabsList; - // Clear out existing richlistitems. + // Clear out existing richlistitems let count = list.getRowCount(); if (count > 0) { for (let i = count - 1; i >= 0; i--) { @@ -214,7 +192,7 @@ var RemoteTabViewer = { let seenURLs = new Set(); let localURLs = engine.getOpenURLs(); - for (let [, client] of Object.entries(engine.getAllClients())) { + for (let [guid, client] in Iterator(engine.getAllClients())) { // Create the client node, but don't add it in-case we don't show any tabs let appendClient = true; @@ -248,37 +226,7 @@ var RemoteTabViewer = { } }, - _generateCloudSyncTabList: function () { - let updateTabList = function (remoteTabs) { - let list = this._tabsList; - - for (let client of remoteTabs) { - let clientAttrs = { - type: "client", - clientName: client.name, - }; - - let clientEnt = this.createItem(clientAttrs); - list.appendChild(clientEnt); - - for (let tab of client.tabs) { - let tabAttrs = { - type: "tab", - title: tab.title, - url: tab.url, - icon: this.getIcon(tab.icon), - }; - let tabEnt = this.createItem(tabAttrs); - list.appendChild(tabEnt); - } - } - }.bind(this); - - return CloudSync().tabs.getRemoteTabs() - .then(updateTabList, Promise.reject.bind(Promise)); - }, - - adjustContextMenu: function (event) { + adjustContextMenu: function(event) { let mode = "all"; switch (this._tabsList.selectedItems.length) { case 0: @@ -303,16 +251,10 @@ var RemoteTabViewer = { } }, - _refetchTabs: function (force) { + _refetchTabs: function(force) { if (!force) { // Don't bother refetching tabs if we already did so recently - let lastFetch = 0; - try { - lastFetch = Services.prefs.getIntPref("services.sync.lastTabFetch"); - } - catch (e) { - /* Just use the default value of 0 */ - } + lastFetch = Services.prefs.getIntPref("services.sync.lastTabFetch", 0); let now = Math.floor(Date.now() / 1000); if (now - lastFetch < 30) { @@ -320,40 +262,40 @@ var RemoteTabViewer = { } } - // Ask Sync to just do the tabs engine if it can. - Weave.Service.sync(["tabs"]); + // if Clients hasn't synced yet this session, we need to sync it as well. + if (Weave.Service.clientsEngine.lastSync == 0) { + Weave.Service.clientsEngine.sync(); + } + + // Force a sync only for the tabs engine + let engine = Weave.Service.engineManager.get("tabs"); + engine.lastModified = null; + engine.sync(); Services.prefs.setIntPref("services.sync.lastTabFetch", Math.floor(Date.now() / 1000)); return true; }, - observe: function (subject, topic, data) { + observe: function(subject, topic, data) { switch (topic) { case "weave:service:login:finish": - // A login has finished, which means that a Sync is about to start and - // we will eventually get to the "tabs" engine - but try and force the - // tab engine to sync first by passing |true| for the forceSync param. this.buildList(true); break; case "weave:engine:sync:finish": - if (data == "tabs") { - // The tabs engine just finished, so re-build the list without - // forcing a new sync of the tabs engine. + if (subject == "tabs") { this.buildList(false); } break; - case "cloudsync:tabs:update": - this.buildList(false); - break; } }, - handleClick: function (event) { + handleClick: function(event) { if (event.target.getAttribute("type") != "tab") { return; } + if (event.button == 1) { let url = event.target.getAttribute("url"); openUILink(url, event); @@ -362,3 +304,4 @@ var RemoteTabViewer = { } } } + diff --git a/application/palemoon/base/content/sync/aboutSyncTabs.xul b/application/basilisk/components/sync/aboutSyncTabs.xul index a4aa0032f..a4aa0032f 100644 --- a/application/palemoon/base/content/sync/aboutSyncTabs.xul +++ b/application/basilisk/components/sync/aboutSyncTabs.xul diff --git a/application/palemoon/base/content/sync/addDevice.js b/application/basilisk/components/sync/addDevice.js index 0390d4397..0390d4397 100644 --- a/application/palemoon/base/content/sync/addDevice.js +++ b/application/basilisk/components/sync/addDevice.js diff --git a/application/palemoon/base/content/sync/addDevice.xul b/application/basilisk/components/sync/addDevice.xul index f2371aad0..f2371aad0 100644 --- a/application/palemoon/base/content/sync/addDevice.xul +++ b/application/basilisk/components/sync/addDevice.xul diff --git a/application/palemoon/base/content/sync/genericChange.js b/application/basilisk/components/sync/genericChange.js index df6639178..df6639178 100644 --- a/application/palemoon/base/content/sync/genericChange.js +++ b/application/basilisk/components/sync/genericChange.js diff --git a/application/palemoon/base/content/sync/genericChange.xul b/application/basilisk/components/sync/genericChange.xul index 3c0b2cd6c..3c0b2cd6c 100644 --- a/application/palemoon/base/content/sync/genericChange.xul +++ b/application/basilisk/components/sync/genericChange.xul diff --git a/application/basilisk/components/sync/jar.mn b/application/basilisk/components/sync/jar.mn new file mode 100644 index 000000000..3782038cd --- /dev/null +++ b/application/basilisk/components/sync/jar.mn @@ -0,0 +1,22 @@ +# 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/sync/aboutSyncTabs.xul + content/browser/sync/aboutSyncTabs.js + content/browser/sync/aboutSyncTabs.css + content/browser/sync/aboutSyncTabs-bindings.xml + content/browser/sync/setup.xul + content/browser/sync/addDevice.js + content/browser/sync/addDevice.xul + content/browser/sync/setup.js + content/browser/sync/genericChange.xul + content/browser/sync/genericChange.js + content/browser/sync/key.xhtml + content/browser/sync/notification.xml + content/browser/sync/quota.xul + content/browser/sync/quota.js + content/browser/sync/utils.js + content/browser/sync/progress.js + content/browser/sync/progress.xhtml
\ No newline at end of file diff --git a/application/palemoon/base/content/sync/key.xhtml b/application/basilisk/components/sync/key.xhtml index 92abf0ee6..92abf0ee6 100644 --- a/application/palemoon/base/content/sync/key.xhtml +++ b/application/basilisk/components/sync/key.xhtml diff --git a/application/basilisk/components/webextensions/schemas/moz.build b/application/basilisk/components/sync/moz.build index aac3a838c..2d64d506c 100644 --- a/application/basilisk/components/webextensions/schemas/moz.build +++ b/application/basilisk/components/sync/moz.build @@ -1,7 +1,8 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# -*- 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/base/content/sync/notification.xml b/application/basilisk/components/sync/notification.xml index 7a2b77382..8ac881e08 100644 --- a/application/palemoon/base/content/sync/notification.xml +++ b/application/basilisk/components/sync/notification.xml @@ -88,7 +88,7 @@ tooltiptext="&closeNotification.tooltip;" oncommand="document.getBindingParent(this).close()"/> <xul:hbox anonid="details" align="center" flex="1"> - <xul:image anonid="messageImage" class="messageImage" xbl:inherits="src=image"/> + <xul:image anonid="messageImage" class="messageImage" xbl:inherits="src=image,type"/> <xul:description anonid="messageText" class="messageText" xbl:inherits="xbl:text=label"/> <!-- The children are the buttons defined by the notification. --> diff --git a/application/palemoon/base/content/sync/progress.js b/application/basilisk/components/sync/progress.js index 101160fa8..101160fa8 100644 --- a/application/palemoon/base/content/sync/progress.js +++ b/application/basilisk/components/sync/progress.js diff --git a/application/palemoon/base/content/sync/progress.xhtml b/application/basilisk/components/sync/progress.xhtml index d403cb20d..d403cb20d 100644 --- a/application/palemoon/base/content/sync/progress.xhtml +++ b/application/basilisk/components/sync/progress.xhtml diff --git a/application/palemoon/base/content/sync/quota.js b/application/basilisk/components/sync/quota.js index 1285a8d54..b416a44cc 100644 --- a/application/palemoon/base/content/sync/quota.js +++ b/application/basilisk/components/sync/quota.js @@ -174,38 +174,6 @@ var gUsageTreeView = { let collection = this._collections[row]; collection.enabled = !collection.enabled; this.treeBox.invalidateRow(row); - - // Display which ones will be removed - let freeup = 0; - let toremove = []; - for each (collection in this._collections) { - if (collection.enabled) - continue; - toremove.push(collection.name); - freeup += collection.size; - } - - let caption = document.getElementById("treeCaption"); - if (!toremove.length) { - caption.className = ""; - caption.firstChild.nodeValue = gSyncQuota.bundle.getString( - "quota.treeCaption.label"); - return; - } - - // 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", [toremovetitles]); - if (freeup) - caption.firstChild.nodeValue += gSyncQuota.bundle.getFormattedString( - "quota.freeup.label", gSyncQuota.convertKB(freeup)); - caption.className = "captionWarning"; }, /* diff --git a/application/palemoon/base/content/sync/quota.xul b/application/basilisk/components/sync/quota.xul index 99e6ed78b..99e6ed78b 100644 --- a/application/palemoon/base/content/sync/quota.xul +++ b/application/basilisk/components/sync/quota.xul diff --git a/application/palemoon/base/content/sync/setup.js b/application/basilisk/components/sync/setup.js index e8d67a5f6..e8d67a5f6 100644 --- a/application/palemoon/base/content/sync/setup.js +++ b/application/basilisk/components/sync/setup.js diff --git a/application/palemoon/base/content/sync/setup.xul b/application/basilisk/components/sync/setup.xul index cf2cc77e4..cf2cc77e4 100644 --- a/application/palemoon/base/content/sync/setup.xul +++ b/application/basilisk/components/sync/setup.xul diff --git a/application/palemoon/base/content/sync/utils.js b/application/basilisk/components/sync/utils.js index d41ecf18a..d41ecf18a 100644 --- a/application/palemoon/base/content/sync/utils.js +++ b/application/basilisk/components/sync/utils.js diff --git a/application/basilisk/components/syncedtabs/EventEmitter.jsm b/application/basilisk/components/syncedtabs/EventEmitter.jsm deleted file mode 100644 index ec3225f0f..000000000 --- a/application/basilisk/components/syncedtabs/EventEmitter.jsm +++ /dev/null @@ -1,45 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -this.EXPORTED_SYMBOLS = [ - "EventEmitter" -]; - -// Simple event emitter abstraction for storage objects to use. -function EventEmitter () { - this._events = new Map(); -} - -EventEmitter.prototype = { - on(event, listener) { - if (this._events.has(event)) { - this._events.get(event).add(listener); - } else { - this._events.set(event, new Set([listener])); - } - }, - off(event, listener) { - if (!this._events.has(event)) { - return; - } - this._events.get(event).delete(listener); - }, - emit(event, ...args) { - if (!this._events.has(event)) { - return; - } - for (let listener of this._events.get(event).values()) { - try { - listener.apply(this, args); - } catch (e) { - Cu.reportError(e); - } - } - }, -}; - diff --git a/application/basilisk/components/syncedtabs/SyncedTabsDeckComponent.js b/application/basilisk/components/syncedtabs/SyncedTabsDeckComponent.js deleted file mode 100644 index c35277795..000000000 --- a/application/basilisk/components/syncedtabs/SyncedTabsDeckComponent.js +++ /dev/null @@ -1,169 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); - -Cu.import("resource:///modules/syncedtabs/SyncedTabsDeckStore.js"); -Cu.import("resource:///modules/syncedtabs/SyncedTabsDeckView.js"); -Cu.import("resource:///modules/syncedtabs/SyncedTabsListStore.js"); -Cu.import("resource:///modules/syncedtabs/TabListComponent.js"); -Cu.import("resource:///modules/syncedtabs/TabListView.js"); -let { getChromeWindow } = Cu.import("resource:///modules/syncedtabs/util.js", {}); - -XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function () { - return Components.utils.import("resource://gre/modules/FxAccountsCommon.js", {}); -}); - -let log = Cu.import("resource://gre/modules/Log.jsm", {}) - .Log.repository.getLogger("Sync.RemoteTabs"); - -this.EXPORTED_SYMBOLS = [ - "SyncedTabsDeckComponent" -]; - -/* SyncedTabsDeckComponent - * This component instantiates views and storage objects as well as defines - * behaviors that will be passed down to the views. This helps keep the views - * isolated and easier to test. - */ - -function SyncedTabsDeckComponent({ - window, SyncedTabs, fxAccounts, deckStore, listStore, listComponent, DeckView, getChromeWindowMock, -}) { - this._window = window; - this._SyncedTabs = SyncedTabs; - this._fxAccounts = fxAccounts; - this._DeckView = DeckView || SyncedTabsDeckView; - // used to stub during tests - this._getChromeWindow = getChromeWindowMock || getChromeWindow; - - this._deckStore = deckStore || new SyncedTabsDeckStore(); - this._syncedTabsListStore = listStore || new SyncedTabsListStore(SyncedTabs); - this.tabListComponent = listComponent || new TabListComponent({ - window: this._window, - store: this._syncedTabsListStore, - View: TabListView, - SyncedTabs: SyncedTabs, - clipboardHelper: Cc["@mozilla.org/widget/clipboardhelper;1"] - .getService(Ci.nsIClipboardHelper), - getChromeWindow: this._getChromeWindow, - }); -} - -SyncedTabsDeckComponent.prototype = { - PANELS: { - TABS_CONTAINER: "tabs-container", - TABS_FETCHING: "tabs-fetching", - NOT_AUTHED_INFO: "notAuthedInfo", - SINGLE_DEVICE_INFO: "singleDeviceInfo", - TABS_DISABLED: "tabs-disabled", - }, - - get container() { - return this._deckView ? this._deckView.container : null; - }, - - init() { - Services.obs.addObserver(this, this._SyncedTabs.TOPIC_TABS_CHANGED, false); - Services.obs.addObserver(this, FxAccountsCommon.ONLOGIN_NOTIFICATION, false); - - // Go ahead and trigger sync - this._SyncedTabs.syncTabs() - .catch(Cu.reportError); - - this._deckView = new this._DeckView(this._window, this.tabListComponent, { - onAndroidClick: event => this.openAndroidLink(event), - oniOSClick: event => this.openiOSLink(event), - onSyncPrefClick: event => this.openSyncPrefs(event) - }); - - this._deckStore.on("change", state => this._deckView.render(state)); - // Trigger the initial rendering of the deck view - // Object.values only in nightly - this._deckStore.setPanels(Object.keys(this.PANELS).map(k => this.PANELS[k])); - // Set the initial panel to display - this.updatePanel(); - }, - - uninit() { - Services.obs.removeObserver(this, this._SyncedTabs.TOPIC_TABS_CHANGED); - Services.obs.removeObserver(this, FxAccountsCommon.ONLOGIN_NOTIFICATION); - this._deckView.destroy(); - }, - - observe(subject, topic, data) { - switch (topic) { - case this._SyncedTabs.TOPIC_TABS_CHANGED: - this._syncedTabsListStore.getData(); - this.updatePanel(); - break; - case FxAccountsCommon.ONLOGIN_NOTIFICATION: - this.updatePanel(); - break; - default: - break; - } - }, - - // There's no good way to mock fxAccounts in browser tests where it's already - // been instantiated, so we have this method for stubbing. - _accountStatus() { - return this._fxAccounts.accountStatus(); - }, - - getPanelStatus() { - return this._accountStatus().then(exists => { - if (!exists) { - return this.PANELS.NOT_AUTHED_INFO; - } - if (!this._SyncedTabs.isConfiguredToSyncTabs) { - return this.PANELS.TABS_DISABLED; - } - if (!this._SyncedTabs.hasSyncedThisSession) { - return this.PANELS.TABS_FETCHING; - } - return this._SyncedTabs.getTabClients().then(clients => { - if (clients.length) { - return this.PANELS.TABS_CONTAINER; - } - return this.PANELS.SINGLE_DEVICE_INFO; - }); - }) - .catch(err => { - Cu.reportError(err); - return this.PANELS.NOT_AUTHED_INFO; - }); - }, - - updatePanel() { - // return promise for tests - return this.getPanelStatus() - .then(panelId => this._deckStore.selectPanel(panelId)) - .catch(Cu.reportError); - }, - - openAndroidLink(event) { - let href = Services.prefs.getCharPref("identity.mobilepromo.android") + "synced-tabs-sidebar"; - this._openUrl(href, event); - }, - - openiOSLink(event) { - let href = Services.prefs.getCharPref("identity.mobilepromo.ios") + "synced-tabs-sidebar"; - this._openUrl(href, event); - }, - - _openUrl(url, event) { - this._window.openUILink(url, event); - }, - - openSyncPrefs() { - this._getChromeWindow(this._window).gSyncUI.openSetup(null, "tabs-sidebar"); - } -}; - diff --git a/application/basilisk/components/syncedtabs/SyncedTabsDeckStore.js b/application/basilisk/components/syncedtabs/SyncedTabsDeckStore.js deleted file mode 100644 index ede6914c8..000000000 --- a/application/basilisk/components/syncedtabs/SyncedTabsDeckStore.js +++ /dev/null @@ -1,60 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -let { EventEmitter } = Cu.import("resource:///modules/syncedtabs/EventEmitter.jsm", {}); - -this.EXPORTED_SYMBOLS = [ - "SyncedTabsDeckStore" -]; - -/** - * SyncedTabsDeckStore - * - * This store keeps track of the deck view state, including the panels and which - * one is selected. The view listens for change events on the store, which are - * triggered whenever the state changes. If it's a small change, the state - * will have `isUpdatable` set to true so the view can skip rerendering the whole - * DOM. - */ -function SyncedTabsDeckStore() { - EventEmitter.call(this); - this._panels = []; -} - -Object.assign(SyncedTabsDeckStore.prototype, EventEmitter.prototype, { - _change(isUpdatable = false) { - let panels = this._panels.map(panel => { - return {id: panel, selected: panel === this._selectedPanel}; - }); - this.emit("change", {panels, isUpdatable: isUpdatable}); - }, - - /** - * Sets the selected panelId and triggers a change event. - * @param {String} panelId - ID of the panel to select. - */ - selectPanel(panelId) { - if (this._panels.indexOf(panelId) === -1 || this._selectedPanel === panelId) { - return; - } - this._selectedPanel = panelId; - this._change(true); - }, - - /** - * Update the set of panels in the deck and trigger a change event. - * @param {Array} panels - an array of IDs for each panel in the deck. - */ - setPanels(panels) { - if (panels === this._panels) { - return; - } - this._panels = panels || []; - this._change(); - } -}); diff --git a/application/basilisk/components/syncedtabs/SyncedTabsDeckView.js b/application/basilisk/components/syncedtabs/SyncedTabsDeckView.js deleted file mode 100644 index e9efff323..000000000 --- a/application/basilisk/components/syncedtabs/SyncedTabsDeckView.js +++ /dev/null @@ -1,116 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -let { getChromeWindow } = Cu.import("resource:///modules/syncedtabs/util.js", {}); - -let log = Cu.import("resource://gre/modules/Log.jsm", {}) - .Log.repository.getLogger("Sync.RemoteTabs"); - -this.EXPORTED_SYMBOLS = [ - "SyncedTabsDeckView" -]; - -/** - * SyncedTabsDeckView - * - * Instances of SyncedTabsDeckView render DOM nodes from a given state. - * No state is kept internaly and the DOM will completely - * rerender unless the state flags `isUpdatable`, which helps - * make small changes without the overhead of a full rerender. - */ -const SyncedTabsDeckView = function (window, tabListComponent, props) { - this.props = props; - - this._window = window; - this._doc = window.document; - - this._tabListComponent = tabListComponent; - this._deckTemplate = this._doc.getElementById("deck-template"); - this.container = this._doc.createElement("div"); -}; - -SyncedTabsDeckView.prototype = { - render(state) { - if (state.isUpdatable) { - this.update(state); - } else { - this.create(state); - } - }, - - create(state) { - let deck = this._doc.importNode(this._deckTemplate.content, true).firstElementChild; - this._clearChilden(); - - let tabListWrapper = this._doc.createElement("div"); - tabListWrapper.className = "tabs-container sync-state"; - this._tabListComponent.init(); - tabListWrapper.appendChild(this._tabListComponent.container); - deck.appendChild(tabListWrapper); - this.container.appendChild(deck); - - this._generateDevicePromo(); - - this._attachListeners(); - this.update(state); - }, - - _getBrowserBundle() { - return getChromeWindow(this._window).document.getElementById("bundle_browser"); - }, - - _generateDevicePromo() { - let bundle = this._getBrowserBundle(); - let formatArgs = ["android", "ios"].map(os => { - let link = this._doc.createElement("a"); - link.textContent = bundle.getString(`appMenuRemoteTabs.mobilePromo.${os}`); - link.className = `${os}-link text-link`; - link.setAttribute("href", "#"); - return link.outerHTML; - }); - // Put it all together... - let contents = bundle.getFormattedString("appMenuRemoteTabs.mobilePromo.text2", formatArgs); - this.container.querySelector(".device-promo").innerHTML = contents; - }, - - destroy() { - this._tabListComponent.uninit(); - this.container.remove(); - }, - - update(state) { - // Note that we may also want to update elements that are outside of the - // deck, so use the document to find the class names rather than our - // container. - for (let panel of state.panels) { - if (panel.selected) { - Array.prototype.map.call(this._doc.getElementsByClassName(panel.id), - item => item.classList.add("selected")); - } else { - Array.prototype.map.call(this._doc.getElementsByClassName(panel.id), - item => item.classList.remove("selected")); - } - } - }, - - _clearChilden() { - while (this.container.firstChild) { - this.container.removeChild(this.container.firstChild); - } - }, - - _attachListeners() { - this.container.querySelector(".android-link").addEventListener("click", this.props.onAndroidClick); - this.container.querySelector(".ios-link").addEventListener("click", this.props.oniOSClick); - let syncPrefLinks = this.container.querySelectorAll(".sync-prefs"); - for (let link of syncPrefLinks) { - link.addEventListener("click", this.props.onSyncPrefClick); - } - }, -}; - diff --git a/application/basilisk/components/syncedtabs/SyncedTabsListStore.js b/application/basilisk/components/syncedtabs/SyncedTabsListStore.js deleted file mode 100644 index 8f03d9a89..000000000 --- a/application/basilisk/components/syncedtabs/SyncedTabsListStore.js +++ /dev/null @@ -1,235 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -let { EventEmitter } = Cu.import("resource:///modules/syncedtabs/EventEmitter.jsm", {}); - -this.EXPORTED_SYMBOLS = [ - "SyncedTabsListStore" -]; - -/** - * SyncedTabsListStore - * - * Instances of this store encapsulate all of the state associated with a synced tabs list view. - * The state includes the clients, their tabs, the row that is currently selected, - * and the filtered query. - */ -function SyncedTabsListStore(SyncedTabs) { - EventEmitter.call(this); - this._SyncedTabs = SyncedTabs; - this.data = []; - this._closedClients = {}; - this._selectedRow = [-1, -1]; - this.filter = ""; - this.inputFocused = false; -} - -Object.assign(SyncedTabsListStore.prototype, EventEmitter.prototype, { - // This internal method triggers the "change" event that views - // listen for. It denormalizes the state so that it's easier for - // the view to deal with. updateType hints to the view what - // actually needs to be rerendered or just updated, and can be - // empty (to (re)render everything), "searchbox" (to rerender just the tab list), - // or "all" (to skip rendering and just update all attributes of existing nodes). - _change(updateType) { - let selectedParent = this._selectedRow[0]; - let selectedChild = this._selectedRow[1]; - let rowSelected = false; - // clone the data so that consumers can't mutate internal storage - let data = Cu.cloneInto(this.data, {}); - let tabCount = 0; - - data.forEach((client, index) => { - client.closed = !!this._closedClients[client.id]; - - if (rowSelected || selectedParent < 0) { - return; - } - if (this.filter) { - if (selectedParent < tabCount + client.tabs.length) { - client.tabs[selectedParent - tabCount].selected = true; - client.tabs[selectedParent - tabCount].focused = !this.inputFocused; - rowSelected = true; - } else { - tabCount += client.tabs.length; - } - return; - } - if (selectedParent === index && selectedChild === -1) { - client.selected = true; - client.focused = !this.inputFocused; - rowSelected = true; - } else if (selectedParent === index) { - client.tabs[selectedChild].selected = true; - client.tabs[selectedChild].focused = !this.inputFocused; - rowSelected = true; - } - }); - - // If this were React the view would be smart enough - // to not re-render the whole list unless necessary. But it's - // not, so updateType is a hint to the view of what actually - // needs to be rerendered. - this.emit("change", { - clients: data, - canUpdateAll: updateType === "all", - canUpdateInput: updateType === "searchbox", - filter: this.filter, - inputFocused: this.inputFocused - }); - }, - - /** - * Moves the row selection from a child to its parent, - * which occurs when the parent of a selected row closes. - */ - _selectParentRow() { - this._selectedRow[1] = -1; - }, - - _toggleBranch(id, closed) { - this._closedClients[id] = closed; - if (this._closedClients[id]) { - this._selectParentRow(); - } - this._change("all"); - }, - - _isOpen(client) { - return !this._closedClients[client.id]; - }, - - moveSelectionDown() { - let branchRow = this._selectedRow[0]; - let childRow = this._selectedRow[1]; - let branch = this.data[branchRow]; - - if (this.filter) { - this.selectRow(branchRow + 1); - return; - } - - if (branchRow < 0) { - this.selectRow(0, -1); - } else if ((!branch.tabs.length || childRow >= branch.tabs.length - 1 || !this._isOpen(branch)) && branchRow < this.data.length) { - this.selectRow(branchRow + 1, -1); - } else if (childRow < branch.tabs.length) { - this.selectRow(branchRow, childRow + 1); - } - }, - - moveSelectionUp() { - let branchRow = this._selectedRow[0]; - let childRow = this._selectedRow[1]; - - if (this.filter) { - this.selectRow(branchRow - 1); - return; - } - - if (branchRow < 0) { - this.selectRow(0, -1); - } else if (childRow < 0 && branchRow > 0) { - let prevBranch = this.data[branchRow - 1]; - let newChildRow = this._isOpen(prevBranch) ? prevBranch.tabs.length - 1 : -1; - this.selectRow(branchRow - 1, newChildRow); - } else if (childRow >= 0) { - this.selectRow(branchRow, childRow - 1); - } - }, - - // Selects a row and makes sure the selection is within bounds - selectRow(parent, child) { - let maxParentRow = this.filter ? this._tabCount() : this.data.length; - let parentRow = parent; - if (parent <= -1) { - parentRow = 0; - } else if (parent >= maxParentRow) { - return; - } - - let childRow = child; - if (parentRow === -1 || this.filter || typeof child === "undefined" || child < -1) { - childRow = -1; - } else if (child >= this.data[parentRow].tabs.length) { - childRow = this.data[parentRow].tabs.length - 1; - } - - if (this._selectedRow[0] === parentRow && this._selectedRow[1] === childRow) { - return; - } - - this._selectedRow = [parentRow, childRow]; - this.inputFocused = false; - this._change("all"); - }, - - _tabCount() { - return this.data.reduce((prev, curr) => curr.tabs.length + prev, 0); - }, - - toggleBranch(id) { - this._toggleBranch(id, !this._closedClients[id]); - }, - - closeBranch(id) { - this._toggleBranch(id, true); - }, - - openBranch(id) { - this._toggleBranch(id, false); - }, - - focusInput() { - this.inputFocused = true; - // A change type of "all" updates rather than rebuilds, which is what we - // want here - only the selection/focus has changed. - this._change("all"); - }, - - blurInput() { - this.inputFocused = false; - // A change type of "all" updates rather than rebuilds, which is what we - // want here - only the selection/focus has changed. - this._change("all"); - }, - - clearFilter() { - this.filter = ""; - this._selectedRow = [-1, -1]; - return this.getData(); - }, - - // Fetches data from the SyncedTabs module and triggers - // and update - getData(filter) { - let updateType; - let hasFilter = typeof filter !== "undefined"; - if (hasFilter) { - this.filter = filter; - this._selectedRow = [-1, -1]; - - // When a filter is specified we tell the view that only the list - // needs to be rerendered so that it doesn't disrupt the input - // field's focus. - updateType = "searchbox"; - } - - // return promise for tests - return this._SyncedTabs.getTabClients(this.filter) - .then(result => { - if (!hasFilter) { - // Only sort clients and tabs if we're rendering the whole list. - this._SyncedTabs.sortTabClientsByLastUsed(result); - } - this.data = result; - this._change(updateType); - }) - .catch(Cu.reportError); - } -}); diff --git a/application/basilisk/components/syncedtabs/TabListComponent.js b/application/basilisk/components/syncedtabs/TabListComponent.js deleted file mode 100644 index aa60e4769..000000000 --- a/application/basilisk/components/syncedtabs/TabListComponent.js +++ /dev/null @@ -1,138 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); - -let log = Cu.import("resource://gre/modules/Log.jsm", {}) - .Log.repository.getLogger("Sync.RemoteTabs"); - -XPCOMUtils.defineLazyModuleGetter(this, "PlacesUIUtils", - "resource:///modules/PlacesUIUtils.jsm"); - -this.EXPORTED_SYMBOLS = [ - "TabListComponent" -]; - -/** - * TabListComponent - * - * The purpose of this component is to compose the view, state, and actions. - * It defines high level actions that act on the state and passes them to the - * view for it to trigger during user interaction. It also subscribes the view - * to state changes so it can rerender. - */ - -function TabListComponent({window, store, View, SyncedTabs, clipboardHelper, - getChromeWindow}) { - this._window = window; - this._store = store; - this._View = View; - this._clipboardHelper = clipboardHelper; - this._getChromeWindow = getChromeWindow; - // used to trigger Sync from context menu - this._SyncedTabs = SyncedTabs; -} - -TabListComponent.prototype = { - get container() { - return this._view.container; - }, - - init() { - log.debug("Initializing TabListComponent"); - - this._view = new this._View(this._window, { - onSelectRow: (...args) => this.onSelectRow(...args), - onOpenTab: (...args) => this.onOpenTab(...args), - onOpenTabs: (...args) => this.onOpenTabs(...args), - onMoveSelectionDown: (...args) => this.onMoveSelectionDown(...args), - onMoveSelectionUp: (...args) => this.onMoveSelectionUp(...args), - onToggleBranch: (...args) => this.onToggleBranch(...args), - onBookmarkTab: (...args) => this.onBookmarkTab(...args), - onCopyTabLocation: (...args) => this.onCopyTabLocation(...args), - onSyncRefresh: (...args) => this.onSyncRefresh(...args), - onFilter: (...args) => this.onFilter(...args), - onClearFilter: (...args) => this.onClearFilter(...args), - onFilterFocus: (...args) => this.onFilterFocus(...args), - onFilterBlur: (...args) => this.onFilterBlur(...args) - }); - - this._store.on("change", state => this._view.render(state)); - this._view.render({clients: []}); - // get what's already available... - this._store.getData(); - this._store.focusInput(); - }, - - uninit() { - this._view.destroy(); - }, - - onFilter(query) { - this._store.getData(query); - }, - - onClearFilter() { - this._store.clearFilter(); - }, - - onFilterFocus() { - this._store.focusInput(); - }, - - onFilterBlur() { - this._store.blurInput(); - }, - - onSelectRow(position) { - this._store.selectRow(position[0], position[1]); - }, - - onMoveSelectionDown() { - this._store.moveSelectionDown(); - }, - - onMoveSelectionUp() { - this._store.moveSelectionUp(); - }, - - onToggleBranch(id) { - this._store.toggleBranch(id); - }, - - onBookmarkTab(uri, title) { - this._window.top.PlacesCommandHook - .bookmarkLink(this._window.top.PlacesUtils.bookmarksMenuFolderId, uri, title) - .catch(Cu.reportError); - }, - - onOpenTab(url, where, params) { - this._window.openUILinkIn(url, where, params); - }, - - onOpenTabs(urls, where) { - if (!PlacesUIUtils.confirmOpenInTabs(urls.length, this._window)) { - return; - } - if (where == "window") { - this._window.openDialog(this._window.getBrowserURL(), "_blank", - "chrome,dialog=no,all", urls.join("|")); - } else { - let loadInBackground = where == "tabshifted" ? true : false; - this._getChromeWindow(this._window).gBrowser.loadTabs(urls, loadInBackground, false); - } - }, - - onCopyTabLocation(url) { - this._clipboardHelper.copyString(url); - }, - - onSyncRefresh() { - this._SyncedTabs.syncTabs(true); - } -}; diff --git a/application/basilisk/components/syncedtabs/TabListView.js b/application/basilisk/components/syncedtabs/TabListView.js deleted file mode 100644 index dab15101b..000000000 --- a/application/basilisk/components/syncedtabs/TabListView.js +++ /dev/null @@ -1,568 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -Cu.import("resource://gre/modules/Services.jsm"); - -let { getChromeWindow } = Cu.import("resource:///modules/syncedtabs/util.js", {}); - -let log = Cu.import("resource://gre/modules/Log.jsm", {}) - .Log.repository.getLogger("Sync.RemoteTabs"); - -this.EXPORTED_SYMBOLS = [ - "TabListView" -]; - -function getContextMenu(window) { - return getChromeWindow(window).document.getElementById("SyncedTabsSidebarContext"); -} - -function getTabsFilterContextMenu(window) { - return getChromeWindow(window).document.getElementById("SyncedTabsSidebarTabsFilterContext"); -} - -/* - * TabListView - * - * Given a state, this object will render the corresponding DOM. - * It maintains no state of it's own. It listens for DOM events - * and triggers actions that may cause the state to change and - * ultimately the view to rerender. - */ -function TabListView(window, props) { - this.props = props; - - this._window = window; - this._doc = this._window.document; - - this._tabsContainerTemplate = this._doc.getElementById("tabs-container-template"); - this._clientTemplate = this._doc.getElementById("client-template"); - this._emptyClientTemplate = this._doc.getElementById("empty-client-template"); - this._tabTemplate = this._doc.getElementById("tab-template"); - this.tabsFilter = this._doc.querySelector(".tabsFilter"); - this.clearFilter = this._doc.querySelector(".textbox-search-clear"); - this.searchBox = this._doc.querySelector(".search-box"); - this.searchIcon = this._doc.querySelector(".textbox-search-icon"); - - this.container = this._doc.createElement("div"); - - this._attachFixedListeners(); - - this._setupContextMenu(); -} - -TabListView.prototype = { - render(state) { - // Don't rerender anything; just update attributes, e.g. selection - if (state.canUpdateAll) { - this._update(state); - return; - } - // Rerender the tab list - if (state.canUpdateInput) { - this._updateSearchBox(state); - this._createList(state); - return; - } - // Create the world anew - this._create(state); - }, - - // Create the initial DOM from templates - _create(state) { - let wrapper = this._doc.importNode(this._tabsContainerTemplate.content, true).firstElementChild; - this._clearChilden(); - this.container.appendChild(wrapper); - - this.list = this.container.querySelector(".list"); - - this._createList(state); - this._updateSearchBox(state); - - this._attachListListeners(); - }, - - _createList(state) { - this._clearChilden(this.list); - for (let client of state.clients) { - if (state.filter) { - this._renderFilteredClient(client); - } else { - this._renderClient(client); - } - } - if (this.list.firstChild) { - const firstTab = this.list.firstChild.querySelector(".item.tab:first-child .item-title"); - if (firstTab) { - firstTab.setAttribute("tabindex", 2); - } - } - }, - - destroy() { - this._teardownContextMenu(); - this.container.remove(); - }, - - _update(state) { - this._updateSearchBox(state); - for (let client of state.clients) { - let clientNode = this._doc.getElementById("item-" + client.id); - if (clientNode) { - this._updateClient(client, clientNode); - } - - client.tabs.forEach((tab, index) => { - let tabNode = this._doc.getElementById('tab-' + client.id + '-' + index); - this._updateTab(tab, tabNode, index); - }); - } - }, - - // Client rows are hidden when the list is filtered - _renderFilteredClient(client, filter) { - client.tabs.forEach((tab, index) => { - let node = this._renderTab(client, tab, index); - this.list.appendChild(node); - }); - }, - - _renderClient(client) { - let itemNode = client.tabs.length ? - this._createClient(client) : - this._createEmptyClient(client); - - this._updateClient(client, itemNode); - - let tabsList = itemNode.querySelector(".item-tabs-list"); - client.tabs.forEach((tab, index) => { - let node = this._renderTab(client, tab, index); - tabsList.appendChild(node); - }); - - this.list.appendChild(itemNode); - return itemNode; - }, - - _renderTab(client, tab, index) { - let itemNode = this._createTab(tab); - this._updateTab(tab, itemNode, index); - return itemNode; - }, - - _createClient(item) { - return this._doc.importNode(this._clientTemplate.content, true).firstElementChild; - }, - - _createEmptyClient(item) { - return this._doc.importNode(this._emptyClientTemplate.content, true).firstElementChild; - }, - - _createTab(item) { - return this._doc.importNode(this._tabTemplate.content, true).firstElementChild; - }, - - _clearChilden(node) { - let parent = node || this.container; - while (parent.firstChild) { - parent.removeChild(parent.firstChild); - } - }, - - // These listeners are attached only once, when we initialize the view - _attachFixedListeners() { - this.tabsFilter.addEventListener("input", this.onFilter.bind(this)); - this.tabsFilter.addEventListener("focus", this.onFilterFocus.bind(this)); - this.tabsFilter.addEventListener("blur", this.onFilterBlur.bind(this)); - this.clearFilter.addEventListener("click", this.onClearFilter.bind(this)); - this.searchIcon.addEventListener("click", this.onFilterFocus.bind(this)); - }, - - // These listeners have to be re-created every time since we re-create the list - _attachListListeners() { - this.list.addEventListener("click", this.onClick.bind(this)); - this.list.addEventListener("mouseup", this.onMouseUp.bind(this)); - this.list.addEventListener("keydown", this.onKeyDown.bind(this)); - }, - - _updateSearchBox(state) { - if (state.filter) { - this.searchBox.classList.add("filtered"); - } else { - this.searchBox.classList.remove("filtered"); - } - this.tabsFilter.value = state.filter; - if (state.inputFocused) { - this.searchBox.setAttribute("focused", true); - this.tabsFilter.focus(); - } else { - this.searchBox.removeAttribute("focused"); - } - }, - - /** - * Update the element representing an item, ensuring it's in sync with the - * underlying data. - * @param {client} item - Item to use as a source. - * @param {Element} itemNode - Element to update. - */ - _updateClient(item, itemNode) { - itemNode.setAttribute("id", "item-" + item.id); - let lastSync = new Date(item.lastModified); - let lastSyncTitle = getChromeWindow(this._window).gSyncUI.formatLastSyncDate(lastSync); - itemNode.setAttribute("title", lastSyncTitle); - if (item.closed) { - itemNode.classList.add("closed"); - } else { - itemNode.classList.remove("closed"); - } - if (item.selected) { - itemNode.classList.add("selected"); - } else { - itemNode.classList.remove("selected"); - } - if (item.isMobile) { - itemNode.classList.add("device-image-mobile"); - } else { - itemNode.classList.add("device-image-desktop"); - } - if (item.focused) { - itemNode.focus(); - } - itemNode.dataset.id = item.id; - itemNode.querySelector(".item-title").textContent = item.name; - }, - - /** - * Update the element representing a tab, ensuring it's in sync with the - * underlying data. - * @param {tab} item - Item to use as a source. - * @param {Element} itemNode - Element to update. - */ - _updateTab(item, itemNode, index) { - itemNode.setAttribute("title", `${item.title}\n${item.url}`); - itemNode.setAttribute("id", "tab-" + item.client + '-' + index); - if (item.selected) { - itemNode.classList.add("selected"); - } else { - itemNode.classList.remove("selected"); - } - if (item.focused) { - itemNode.focus(); - } - itemNode.dataset.url = item.url; - - itemNode.querySelector(".item-title").textContent = item.title; - - if (item.icon) { - let icon = itemNode.querySelector(".item-icon-container"); - icon.style.backgroundImage = "url(" + item.icon + ")"; - } - }, - - onMouseUp(event) { - if (event.which == 2) { // Middle click - this.onClick(event); - } - }, - - onClick(event) { - let itemNode = this._findParentItemNode(event.target); - if (!itemNode) { - return; - } - - if (itemNode.classList.contains("tab")) { - let url = itemNode.dataset.url; - if (url) { - this.onOpenSelected(url, event); - } - } - - // Middle click on a client - if (itemNode.classList.contains("client")) { - let where = getChromeWindow(this._window).whereToOpenLink(event); - if (where != "current") { - const tabs = itemNode.querySelector(".item-tabs-list").childNodes; - const urls = [...tabs].map(tab => tab.dataset.url); - this.props.onOpenTabs(urls, where); - } - } - - if (event.target.classList.contains("item-twisty-container") - && event.which != 2) { - this.props.onToggleBranch(itemNode.dataset.id); - return; - } - - let position = this._getSelectionPosition(itemNode); - this.props.onSelectRow(position); - }, - - /** - * Handle a keydown event on the list box. - * @param {Event} event - Triggering event. - */ - onKeyDown(event) { - if (event.keyCode == this._window.KeyEvent.DOM_VK_DOWN) { - event.preventDefault(); - this.props.onMoveSelectionDown(); - } else if (event.keyCode == this._window.KeyEvent.DOM_VK_UP) { - event.preventDefault(); - this.props.onMoveSelectionUp(); - } else if (event.keyCode == this._window.KeyEvent.DOM_VK_RETURN) { - let selectedNode = this.container.querySelector('.item.selected'); - if (selectedNode.dataset.url) { - this.onOpenSelected(selectedNode.dataset.url, event); - } else if (selectedNode) { - this.props.onToggleBranch(selectedNode.dataset.id); - } - } - }, - - onBookmarkTab() { - let item = this._getSelectedTabNode(); - if (item) { - let title = item.querySelector(".item-title").textContent; - this.props.onBookmarkTab(item.dataset.url, title); - } - }, - - onCopyTabLocation() { - let item = this._getSelectedTabNode(); - if (item) { - this.props.onCopyTabLocation(item.dataset.url); - } - }, - - onOpenSelected(url, event) { - let where = getChromeWindow(this._window).whereToOpenLink(event); - this.props.onOpenTab(url, where, {}); - }, - - onOpenSelectedFromContextMenu(event) { - let item = this._getSelectedTabNode(); - if (item) { - let where = event.target.getAttribute("where"); - let params = { - private: event.target.hasAttribute("private"), - }; - this.props.onOpenTab(item.dataset.url, where, params); - } - }, - - onFilter(event) { - let query = event.target.value; - if (query) { - this.props.onFilter(query); - } else { - this.props.onClearFilter(); - } - }, - - onClearFilter() { - this.props.onClearFilter(); - }, - - onFilterFocus() { - this.props.onFilterFocus(); - }, - onFilterBlur() { - this.props.onFilterBlur(); - }, - - _getSelectedTabNode() { - let item = this.container.querySelector('.item.selected'); - if (this._isTab(item) && item.dataset.url) { - return item; - } - return null; - }, - - // Set up the custom context menu - _setupContextMenu() { - Services.els.addSystemEventListener(this._window, "contextmenu", this, false); - for (let getMenu of [getContextMenu, getTabsFilterContextMenu]) { - let menu = getMenu(this._window); - menu.addEventListener("popupshowing", this, true); - menu.addEventListener("command", this, true); - } - }, - - _teardownContextMenu() { - // Tear down context menu - Services.els.removeSystemEventListener(this._window, "contextmenu", this, false); - for (let getMenu of [getContextMenu, getTabsFilterContextMenu]) { - let menu = getMenu(this._window); - menu.removeEventListener("popupshowing", this, true); - menu.removeEventListener("command", this, true); - } - }, - - handleEvent(event) { - switch (event.type) { - case "contextmenu": - this.handleContextMenu(event); - break; - - case "popupshowing": { - if (event.target.getAttribute("id") == "SyncedTabsSidebarTabsFilterContext") { - this.handleTabsFilterContextMenuShown(event); - } - break; - } - - case "command": { - let menu = event.target.closest("menupopup"); - switch (menu.getAttribute("id")) { - case "SyncedTabsSidebarContext": - this.handleContentContextMenuCommand(event); - break; - - case "SyncedTabsSidebarTabsFilterContext": - this.handleTabsFilterContextMenuCommand(event); - break; - } - break; - } - } - }, - - handleTabsFilterContextMenuShown(event) { - let document = event.target.ownerDocument; - let focusedElement = document.commandDispatcher.focusedElement; - if (focusedElement != this.tabsFilter) { - this.tabsFilter.focus(); - } - for (let item of event.target.children) { - if (!item.hasAttribute("cmd")) { - continue; - } - let command = item.getAttribute("cmd"); - let controller = document.commandDispatcher.getControllerForCommand(command); - if (controller.isCommandEnabled(command)) { - item.removeAttribute("disabled"); - } else { - item.setAttribute("disabled", "true"); - } - } - }, - - handleContentContextMenuCommand(event) { - let id = event.target.getAttribute("id"); - switch (id) { - case "syncedTabsOpenSelected": - case "syncedTabsOpenSelectedInTab": - case "syncedTabsOpenSelectedInWindow": - case "syncedTabsOpenSelectedInPrivateWindow": - this.onOpenSelectedFromContextMenu(event); - break; - case "syncedTabsBookmarkSelected": - this.onBookmarkTab(); - break; - case "syncedTabsCopySelected": - this.onCopyTabLocation(); - break; - case "syncedTabsRefresh": - case "syncedTabsRefreshFilter": - this.props.onSyncRefresh(); - break; - } - }, - - handleTabsFilterContextMenuCommand(event) { - let command = event.target.getAttribute("cmd"); - let dispatcher = getChromeWindow(this._window).document.commandDispatcher; - let controller = dispatcher.focusedElement.controllers.getControllerForCommand(command); - controller.doCommand(command); - }, - - handleContextMenu(event) { - let menu; - - if (event.target == this.tabsFilter) { - menu = getTabsFilterContextMenu(this._window); - } else { - let itemNode = this._findParentItemNode(event.target); - if (itemNode) { - let position = this._getSelectionPosition(itemNode); - this.props.onSelectRow(position); - } - menu = getContextMenu(this._window); - this.adjustContextMenu(menu); - } - - menu.openPopupAtScreen(event.screenX, event.screenY, true, event); - }, - - adjustContextMenu(menu) { - let item = this.container.querySelector('.item.selected'); - let showTabOptions = this._isTab(item); - - let el = menu.firstChild; - - while (el) { - if (showTabOptions || el.getAttribute("id") === "syncedTabsRefresh") { - el.hidden = false; - } else { - el.hidden = true; - } - - el = el.nextSibling; - } - }, - - /** - * Find the parent item element, from a given child element. - * @param {Element} node - Child element. - * @return {Element} Element for the item, or null if not found. - */ - _findParentItemNode(node) { - while (node && node !== this.list && node !== this._doc.documentElement && - !node.classList.contains("item")) { - node = node.parentNode; - } - - if (node !== this.list && node !== this._doc.documentElement) { - return node; - } - - return null; - }, - - _findParentBranchNode(node) { - while (node && !node.classList.contains("list") && node !== this._doc.documentElement && - !node.parentNode.classList.contains("list")) { - node = node.parentNode; - } - - if (node !== this.list && node !== this._doc.documentElement) { - return node; - } - - return null; - }, - - _getSelectionPosition(itemNode) { - let parent = this._findParentBranchNode(itemNode); - let parentPosition = this._indexOfNode(parent.parentNode, parent); - let childPosition = -1; - // if the node is not a client, find its position within the parent - if (parent !== itemNode) { - childPosition = this._indexOfNode(itemNode.parentNode, itemNode); - } - return [parentPosition, childPosition]; - }, - - _indexOfNode(parent, child) { - return Array.prototype.indexOf.call(parent.childNodes, child); - }, - - _isTab(item) { - return item && item.classList.contains("tab"); - } -}; diff --git a/application/basilisk/components/syncedtabs/moz.build b/application/basilisk/components/syncedtabs/moz.build deleted file mode 100644 index a6515d6a1..000000000 --- a/application/basilisk/components/syncedtabs/moz.build +++ /dev/null @@ -1,17 +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/. - -JAR_MANIFESTS += ['jar.mn'] - -EXTRA_JS_MODULES.syncedtabs += [ - 'EventEmitter.jsm', - 'SyncedTabsDeckComponent.js', - 'SyncedTabsDeckStore.js', - 'SyncedTabsDeckView.js', - 'SyncedTabsListStore.js', - 'TabListComponent.js', - 'TabListView.js', - 'util.js', -] - diff --git a/application/basilisk/components/syncedtabs/sidebar.js b/application/basilisk/components/syncedtabs/sidebar.js deleted file mode 100644 index 84df95e9d..000000000 --- a/application/basilisk/components/syncedtabs/sidebar.js +++ /dev/null @@ -1,30 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://services-sync/SyncedTabs.jsm"); -Cu.import("resource:///modules/syncedtabs/SyncedTabsDeckComponent.js"); - -XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts", - "resource://gre/modules/FxAccounts.jsm"); - -this.syncedTabsDeckComponent = new SyncedTabsDeckComponent({window, SyncedTabs, fxAccounts}); - -let onLoaded = () => { - syncedTabsDeckComponent.init(); - document.getElementById("template-container").appendChild(syncedTabsDeckComponent.container); -}; - -let onUnloaded = () => { - removeEventListener("DOMContentLoaded", onLoaded); - removeEventListener("unload", onUnloaded); - syncedTabsDeckComponent.uninit(); -}; - -addEventListener("DOMContentLoaded", onLoaded); -addEventListener("unload", onUnloaded); diff --git a/application/basilisk/components/syncedtabs/sidebar.xhtml b/application/basilisk/components/syncedtabs/sidebar.xhtml deleted file mode 100644 index 3efcbea0e..000000000 --- a/application/basilisk/components/syncedtabs/sidebar.xhtml +++ /dev/null @@ -1,114 +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/. --> - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" [ - <!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd"> - %browserDTD; - <!ENTITY % globalDTD - SYSTEM "chrome://global/locale/global.dtd"> - %globalDTD; - <!ENTITY % syncBrandDTD - SYSTEM "chrome://browser/locale/syncBrand.dtd"> - %syncBrandDTD; -]> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - <head> - <script src="chrome://browser/content/syncedtabs/sidebar.js" type="application/javascript;version=1.8"></script> - <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/> - - <link rel="stylesheet" type="text/css" media="all" href="chrome://browser/skin/syncedtabs/sidebar.css"/> - <link rel="stylesheet" type="text/css" media="all" href="chrome://global/skin/"/> - <link rel="stylesheet" type="text/css" media="all" href="chrome://global/skin/textbox.css"/> - <link rel="stylesheet" type="text/css" media="all" href="chrome://browser/content/browser.css"/> - <title>&syncedTabs.sidebar.label;</title> - </head> - - <body dir="&locale.dir;" role="application"> - <template id="client-template"> - <div class="item client" role="option" tabindex="-1"> - <div class="item-title-container"> - <div class="item-twisty-container"></div> - <div class="item-icon-container"></div> - <p class="item-title"></p> - </div> - <div class="item-tabs-list"></div> - </div> - </template> - <template id="empty-client-template"> - <div class="item empty client" role="option" tabindex="-1"> - <div class="item-title-container"> - <div class="item-twisty-container"></div> - <div class="item-icon-container"></div> - <p class="item-title"></p> - </div> - <div class="item-tabs-list"> - <div class="item empty" role="option" tabindex="-1"> - <div class="item-title-container"> - <div class="item-icon-container"></div> - <p class="item-title">&syncedTabs.sidebar.notabs.label;</p> - </div> - </div> - </div> - </div> - </template> - <template id="tab-template"> - <div class="item tab" role="option" tabindex="-1"> - <div class="item-title-container"> - <div class="item-icon-container"></div> - <p class="item-title"></p> - </div> - </div> - </template> - - <template id="tabs-container-template"> - <div class="tabs-container"> - <div class="list" role="listbox"></div> - </div> - </template> - - <template id="deck-template"> - <div class="deck"> - <div class="tabs-fetching sync-state"> - <!-- Show intentionally blank panel, see bug 1239845 --> - </div> - <div class="notAuthedInfo sync-state"> - <p>&syncedTabs.sidebar.notsignedin.label;</p> - <p><a href="#" class="sync-prefs text-link">&fxaSignIn.label;</a></p> - </div> - <div class="singleDeviceInfo sync-state"> - <p>&syncedTabs.sidebar.noclients.title;</p> - <p>&syncedTabs.sidebar.noclients.subtitle;</p> - <p class="device-promo" fxAccountsBrand="&syncBrand.fxAccount.label;"></p> - </div> - <div class="tabs-disabled sync-state"> - <p>&syncedTabs.sidebar.tabsnotsyncing.label;</p> - <p><a href="#" class="sync-prefs text-link">&syncedTabs.sidebar.openprefs.label;</a></p> - </div> - </div> - </template> - - <div class="content-container"> - <!-- the non-scrollable header --> - <div class="content-header"> - <div class="sidebar-search-container tabs-container sync-state"> - <div class="search-box compact"> - <div class="textbox-input-box"> - <input type="text" class="tabsFilter textbox-input" tabindex="1"/> - <div class="textbox-search-icons"> - <a class="textbox-search-clear"></a> - <a class="textbox-search-icon"></a> - </div> - </div> - </div> - </div> - </div> - <!-- the scrollable content area where our templates are inserted --> - <div id="template-container" class="content-scrollable" tabindex="-1"> - </div> - </div> - </body> -</html> diff --git a/application/basilisk/components/syncedtabs/util.js b/application/basilisk/components/syncedtabs/util.js deleted file mode 100644 index e09a1a528..000000000 --- a/application/basilisk/components/syncedtabs/util.js +++ /dev/null @@ -1,23 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; - -this.EXPORTED_SYMBOLS = [ - "getChromeWindow" -]; - -// Get the chrome (ie, browser) window hosting this content. -function getChromeWindow(window) { - return window - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebNavigation) - .QueryInterface(Ci.nsIDocShellTreeItem) - .rootTreeItem - .QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindow) - .wrappedJSObject; -} diff --git a/application/basilisk/components/translation/BingTranslator.jsm b/application/basilisk/components/translation/BingTranslator.jsm deleted file mode 100644 index fc1cc942a..000000000 --- a/application/basilisk/components/translation/BingTranslator.jsm +++ /dev/null @@ -1,449 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -this.EXPORTED_SYMBOLS = [ "BingTranslator" ]; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Log.jsm"); -Cu.import("resource://gre/modules/Promise.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://services-common/utils.js"); -Cu.import("resource://gre/modules/Http.jsm"); - -// The maximum amount of net data allowed per request on Bing's API. -const MAX_REQUEST_DATA = 5000; // Documentation says 10000 but anywhere - // close to that is refused by the service. - -// The maximum number of chunks allowed to be translated in a single -// request. -const MAX_REQUEST_CHUNKS = 1000; // Documentation says 2000. - -// Self-imposed limit of 15 requests. This means that a page that would need -// to be broken in more than 15 requests won't be fully translated. -// The maximum amount of data that we will translate for a single page -// is MAX_REQUESTS * MAX_REQUEST_DATA. -const MAX_REQUESTS = 15; - -/** - * Translates a webpage using Bing's Translation API. - * - * @param translationDocument The TranslationDocument object that represents - * the webpage to be translated - * @param sourceLanguage The source language of the document - * @param targetLanguage The target language for the translation - * - * @returns {Promise} A promise that will resolve when the translation - * task is finished. - */ -this.BingTranslator = function(translationDocument, sourceLanguage, targetLanguage) { - this.translationDocument = translationDocument; - this.sourceLanguage = sourceLanguage; - this.targetLanguage = targetLanguage; - this._pendingRequests = 0; - this._partialSuccess = false; - this._serviceUnavailable = false; - this._translatedCharacterCount = 0; -}; - -this.BingTranslator.prototype = { - /** - * Performs the translation, splitting the document into several chunks - * respecting the data limits of the API. - * - * @returns {Promise} A promise that will resolve when the translation - * task is finished. - */ - translate: function() { - return Task.spawn(function *() { - let currentIndex = 0; - this._onFinishedDeferred = Promise.defer(); - - // Let's split the document into various requests to be sent to - // Bing's Translation API. - for (let requestCount = 0; requestCount < MAX_REQUESTS; requestCount++) { - // Generating the text for each request can be expensive, so - // let's take the opportunity of the chunkification process to - // allow for the event loop to attend other pending events - // before we continue. - yield CommonUtils.laterTickResolvingPromise(); - - // Determine the data for the next request. - let request = this._generateNextTranslationRequest(currentIndex); - - // Create a real request to the server, and put it on the - // pending requests list. - let bingRequest = new BingRequest(request.data, - this.sourceLanguage, - this.targetLanguage); - this._pendingRequests++; - bingRequest.fireRequest().then(this._chunkCompleted.bind(this), - this._chunkFailed.bind(this)); - - currentIndex = request.lastIndex; - if (request.finished) { - break; - } - } - - return this._onFinishedDeferred.promise; - }.bind(this)); - }, - - /** - * Resets the expiration time of the current token, in order to - * force the token manager to ask for a new token during the next request. - */ - _resetToken : function() { - // Force the token manager to get update token - BingTokenManager._currentExpiryTime = 0; - }, - - /** - * Function called when a request sent to the server completed successfully. - * This function handles calling the function to parse the result and the - * function to resolve the promise returned by the public `translate()` - * method when there's no pending request left. - * - * @param request The BingRequest sent to the server. - */ - _chunkCompleted: function(bingRequest) { - if (this._parseChunkResult(bingRequest)) { - this._partialSuccess = true; - // Count the number of characters successfully translated. - this._translatedCharacterCount += bingRequest.characterCount; - } - - this._checkIfFinished(); - }, - - /** - * Function called when a request sent to the server has failed. - * This function handles deciding if the error is transient or means the - * service is unavailable (zero balance on the key or request credentials are - * not in an active state) and calling the function to resolve the promise - * returned by the public `translate()` method when there's no pending. - * request left. - * - * @param aError [optional] The XHR object of the request that failed. - */ - _chunkFailed: function(aError) { - if (aError instanceof Ci.nsIXMLHttpRequest && - [400, 401].indexOf(aError.status) != -1) { - let body = aError.responseText; - if (body && body.includes("TranslateApiException") && - (body.includes("balance") || body.includes("active state"))) - this._serviceUnavailable = true; - } - - this._checkIfFinished(); - }, - - /** - * Function called when a request sent to the server has completed. - * This function handles resolving the promise - * returned by the public `translate()` method when all chunks are completed. - */ - _checkIfFinished: function() { - // Check if all pending requests have been - // completed and then resolves the promise. - // If at least one chunk was successful, the - // promise will be resolved positively which will - // display the "Success" state for the infobar. Otherwise, - // the "Error" state will appear. - if (--this._pendingRequests == 0) { - if (this._partialSuccess) { - this._onFinishedDeferred.resolve({ - characterCount: this._translatedCharacterCount - }); - } else { - let error = this._serviceUnavailable ? "unavailable" : "failure"; - this._onFinishedDeferred.reject(error); - } - } - }, - - /** - * This function parses the result returned by Bing's Http.svc API, - * which is a XML file that contains a number of elements. To our - * particular interest, the only part of the response that matters - * are the <TranslatedText> nodes, which contains the resulting - * items that were sent to be translated. - * - * @param request The request sent to the server. - * @returns boolean True if parsing of this chunk was successful. - */ - _parseChunkResult: function(bingRequest) { - let results; - try { - let doc = bingRequest.networkRequest.responseXML; - results = doc.querySelectorAll("TranslatedText"); - } catch (e) { - return false; - } - - let len = results.length; - if (len != bingRequest.translationData.length) { - // This should never happen, but if the service returns a different number - // of items (from the number of items submitted), we can't use this chunk - // because all items would be paired incorrectly. - return false; - } - - let error = false; - for (let i = 0; i < len; i++) { - try { - let result = results[i].firstChild.nodeValue; - let root = bingRequest.translationData[i][0]; - - if (root.isSimpleRoot) { - // Workaround for Bing's service problem in which "&" chars in - // plain-text TranslationItems are double-escaped. - result = result.replace(/&/g, "&"); - } - - root.parseResult(result); - } catch (e) { error = true; } - } - - return !error; - }, - - /** - * This function will determine what is the data to be used for - * the Nth request we are generating, based on the input params. - * - * @param startIndex What is the index, in the roots list, that the - * chunk should start. - */ - _generateNextTranslationRequest: function(startIndex) { - let currentDataSize = 0; - let currentChunks = 0; - let output = []; - let rootsList = this.translationDocument.roots; - - for (let i = startIndex; i < rootsList.length; i++) { - let root = rootsList[i]; - let text = this.translationDocument.generateTextForItem(root); - if (!text) { - continue; - } - - text = escapeXML(text); - let newCurSize = currentDataSize + text.length; - let newChunks = currentChunks + 1; - - if (newCurSize > MAX_REQUEST_DATA || - newChunks > MAX_REQUEST_CHUNKS) { - - // If we've reached the API limits, let's stop accumulating data - // for this request and return. We return information useful for - // the caller to pass back on the next call, so that the function - // can keep working from where it stopped. - return { - data: output, - finished: false, - lastIndex: i - }; - } - - currentDataSize = newCurSize; - currentChunks = newChunks; - output.push([root, text]); - } - - return { - data: output, - finished: true, - lastIndex: 0 - }; - } -}; - -/** - * Represents a request (for 1 chunk) sent off to Bing's service. - * - * @params translationData The data to be used for this translation, - * generated by the generateNextTranslationRequest... - * function. - * @param sourceLanguage The source language of the document. - * @param targetLanguage The target language for the translation. - * - */ -function BingRequest(translationData, sourceLanguage, targetLanguage) { - this.translationData = translationData; - this.sourceLanguage = sourceLanguage; - this.targetLanguage = targetLanguage; - this.characterCount = 0; -} - -BingRequest.prototype = { - /** - * Initiates the request - */ - fireRequest: function() { - return Task.spawn(function *() { - // Prepare authentication. - let token = yield BingTokenManager.getToken(); - let auth = "Bearer " + token; - - // Prepare URL. - let url = getUrlParam("https://api.microsofttranslator.com/v2/Http.svc/TranslateArray", - "browser.translation.bing.translateArrayURL"); - - // Prepare request headers. - let headers = [["Content-type", "text/xml"], ["Authorization", auth]]; - - // Prepare the request body. - let requestString = - '<TranslateArrayRequest>' + - '<AppId/>' + - '<From>' + this.sourceLanguage + '</From>' + - '<Options>' + - '<ContentType xmlns="http://schemas.datacontract.org/2004/07/Microsoft.MT.Web.Service.V2">text/html</ContentType>' + - '<ReservedFlags xmlns="http://schemas.datacontract.org/2004/07/Microsoft.MT.Web.Service.V2" />' + - '</Options>' + - '<Texts xmlns:s="http://schemas.microsoft.com/2003/10/Serialization/Arrays">'; - - for (let [, text] of this.translationData) { - requestString += '<s:string>' + text + '</s:string>'; - this.characterCount += text.length; - } - - requestString += '</Texts>' + - '<To>' + this.targetLanguage + '</To>' + - '</TranslateArrayRequest>'; - - // Set up request options. - let deferred = Promise.defer(); - let options = { - onLoad: (function(responseText, xhr) { - deferred.resolve(this); - }).bind(this), - onError: function(e, responseText, xhr) { - deferred.reject(xhr); - }, - postData: requestString, - headers: headers - }; - - // Fire the request. - let request = httpRequest(url, options); - - // Override the response MIME type. - request.overrideMimeType("text/xml"); - this.networkRequest = request; - return deferred.promise; - }.bind(this)); - } -}; - -/** - * Authentication Token manager for the API - */ -var BingTokenManager = { - _currentToken: null, - _currentExpiryTime: 0, - _pendingRequest: null, - - /** - * Get a valid, non-expired token to be used for the API calls. - * - * @returns {Promise} A promise that resolves with the token - * string once it is obtained. The token returned - * can be the same one used in the past if it is still - * valid. - */ - getToken: function() { - if (this._pendingRequest) { - return this._pendingRequest; - } - - let remainingMs = this._currentExpiryTime - new Date(); - // Our existing token is still good for more than a minute, let's use it. - if (remainingMs > 60 * 1000) { - return Promise.resolve(this._currentToken); - } - - return this._getNewToken(); - }, - - /** - * Generates a new token from the server. - * - * @returns {Promise} A promise that resolves with the token - * string once it is obtained. - */ - _getNewToken: function() { - let url = getUrlParam("https://datamarket.accesscontrol.windows.net/v2/OAuth2-13", - "browser.translation.bing.authURL"); - let params = [ - ["grant_type", "client_credentials"], - ["scope", "http://api.microsofttranslator.com"], - ["client_id", - getUrlParam("%BING_API_CLIENTID%", "browser.translation.bing.clientIdOverride")], - ["client_secret", - getUrlParam("%BING_API_KEY%", "browser.translation.bing.apiKeyOverride")] - ]; - - let deferred = Promise.defer(); - let options = { - onLoad: function(responseText, xhr) { - BingTokenManager._pendingRequest = null; - try { - let json = JSON.parse(responseText); - - if (json.error) { - deferred.reject(json.error); - return; - } - - let token = json.access_token; - let expires_in = json.expires_in; - BingTokenManager._currentToken = token; - BingTokenManager._currentExpiryTime = new Date(Date.now() + expires_in * 1000); - deferred.resolve(token); - } catch (e) { - deferred.reject(e); - } - }, - onError: function(e, responseText, xhr) { - BingTokenManager._pendingRequest = null; - deferred.reject(e); - }, - postData: params - }; - - this._pendingRequest = deferred.promise; - httpRequest(url, options); - - return deferred.promise; - } -}; - -/** - * Escape a string to be valid XML content. - */ -function escapeXML(aStr) { - return aStr.toString() - .replace(/&/g, "&") - .replace(/\"/g, """) - .replace(/\'/g, "'") - .replace(/</g, "<") - .replace(/>/g, ">"); -} - -/** - * Fetch an auth token (clientID or client secret), which may be overridden by - * a pref if it's set. - */ -function getUrlParam(paramValue, prefName) { - if (Services.prefs.getPrefType(prefName)) - paramValue = Services.prefs.getCharPref(prefName); - paramValue = Services.urlFormatter.formatURL(paramValue); - return paramValue; -} diff --git a/application/basilisk/components/translation/Translation.jsm b/application/basilisk/components/translation/Translation.jsm deleted file mode 100644 index 15a847c13..000000000 --- a/application/basilisk/components/translation/Translation.jsm +++ /dev/null @@ -1,446 +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"; - -this.EXPORTED_SYMBOLS = [ - "Translation", - "TranslationTelemetry", -]; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -const TRANSLATION_PREF_SHOWUI = "browser.translation.ui.show"; -const TRANSLATION_PREF_DETECT_LANG = "browser.translation.detectLanguage"; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Promise.jsm"); -Cu.import("resource://gre/modules/Task.jsm", this); - -this.Translation = { - STATE_OFFER: 0, - STATE_TRANSLATING: 1, - STATE_TRANSLATED: 2, - STATE_ERROR: 3, - STATE_UNAVAILABLE: 4, - - serviceUnavailable: false, - - supportedSourceLanguages: ["bg", "cs", "de", "en", "es", "fr", "ja", "ko", "nl", "no", "pl", "pt", "ru", "tr", "vi", "zh"], - supportedTargetLanguages: ["bg", "cs", "de", "en", "es", "fr", "ja", "ko", "nl", "no", "pl", "pt", "ru", "tr", "vi", "zh"], - - _defaultTargetLanguage: "", - get defaultTargetLanguage() { - if (!this._defaultTargetLanguage) { - this._defaultTargetLanguage = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIXULChromeRegistry) - .getSelectedLocale("global") - .split("-")[0]; - } - return this._defaultTargetLanguage; - }, - - documentStateReceived: function(aBrowser, aData) { - if (aData.state == this.STATE_OFFER) { - if (aData.detectedLanguage == this.defaultTargetLanguage) { - // Detected language is the same as the user's locale. - return; - } - - if (this.supportedSourceLanguages.indexOf(aData.detectedLanguage) == -1) { - // Detected language is not part of the supported languages. - TranslationTelemetry.recordMissedTranslationOpportunity(aData.detectedLanguage); - return; - } - - TranslationTelemetry.recordTranslationOpportunity(aData.detectedLanguage); - } - - if (!Services.prefs.getBoolPref(TRANSLATION_PREF_SHOWUI)) - return; - - if (!aBrowser.translationUI) - aBrowser.translationUI = new TranslationUI(aBrowser); - let trUI = aBrowser.translationUI; - - // Set all values before showing a new translation infobar. - trUI._state = Translation.serviceUnavailable ? Translation.STATE_UNAVAILABLE - : aData.state; - trUI.detectedLanguage = aData.detectedLanguage; - trUI.translatedFrom = aData.translatedFrom; - trUI.translatedTo = aData.translatedTo; - trUI.originalShown = aData.originalShown; - - trUI.showURLBarIcon(); - - if (trUI.shouldShowInfoBar(aBrowser.currentURI)) - trUI.showTranslationInfoBar(); - }, - - openProviderAttribution: function() { - let attribution = this.supportedEngines[this.translationEngine]; - Cu.import("resource:///modules/RecentWindow.jsm"); - RecentWindow.getMostRecentBrowserWindow().openUILinkIn(attribution, "tab"); - }, - - /** - * The list of translation engines and their attributions. - */ - supportedEngines: { - "bing" : "http://aka.ms/MicrosoftTranslatorAttribution", - "yandex" : "http://translate.yandex.com/" - }, - - /** - * Fallback engine (currently Bing Translator) if the preferences seem - * confusing. - */ - get defaultEngine() { - return this.supportedEngines.keys[0]; - }, - - /** - * Returns the name of the preferred translation engine. - */ - get translationEngine() { - let engine = Services.prefs.getCharPref("browser.translation.engine"); - return Object.keys(this.supportedEngines).indexOf(engine) == -1 ? this.defaultEngine : engine; - }, -}; - -/* TranslationUI objects keep the information related to translation for - * a specific browser. This object is passed to the translation - * infobar so that it can initialize itself. The properties exposed to - * the infobar are: - * - detectedLanguage, code of the language detected on the web page. - * - state, the state in which the infobar should be displayed - * - translatedFrom, if already translated, source language code. - * - translatedTo, if already translated, target language code. - * - translate, method starting the translation of the current page. - * - showOriginalContent, method showing the original page content. - * - showTranslatedContent, method showing the translation for an - * already translated page whose original content is shown. - * - originalShown, boolean indicating if the original or translated - * version of the page is shown. - */ -function TranslationUI(aBrowser) { - this.browser = aBrowser; -} - -TranslationUI.prototype = { - get browser() { - return this._browser; - }, - set browser(aBrowser) { - if (this._browser) - this._browser.messageManager.removeMessageListener("Translation:Finished", this); - aBrowser.messageManager.addMessageListener("Translation:Finished", this); - this._browser = aBrowser; - }, - translate: function(aFrom, aTo) { - if (aFrom == aTo || - (this.state == Translation.STATE_TRANSLATED && - this.translatedFrom == aFrom && this.translatedTo == aTo)) { - // Nothing to do. - return; - } - - if (this.state == Translation.STATE_OFFER) { - if (this.detectedLanguage != aFrom) - TranslationTelemetry.recordDetectedLanguageChange(true); - } else { - if (this.translatedFrom != aFrom) - TranslationTelemetry.recordDetectedLanguageChange(false); - if (this.translatedTo != aTo) - TranslationTelemetry.recordTargetLanguageChange(); - } - - this.state = Translation.STATE_TRANSLATING; - this.translatedFrom = aFrom; - this.translatedTo = aTo; - - this.browser.messageManager.sendAsyncMessage( - "Translation:TranslateDocument", - { from: aFrom, to: aTo } - ); - }, - - showURLBarIcon: function() { - let chromeWin = this.browser.ownerGlobal; - let PopupNotifications = chromeWin.PopupNotifications; - let removeId = this.originalShown ? "translated" : "translate"; - let notification = - PopupNotifications.getNotification(removeId, this.browser); - if (notification) - PopupNotifications.remove(notification); - - let callback = (aTopic, aNewBrowser) => { - if (aTopic == "swapping") { - let infoBarVisible = - this.notificationBox.getNotificationWithValue("translation"); - aNewBrowser.translationUI = this; - this.browser = aNewBrowser; - if (infoBarVisible) - this.showTranslationInfoBar(); - return true; - } - - if (aTopic != "showing") - return false; - let notification = this.notificationBox.getNotificationWithValue("translation"); - if (notification) - notification.close(); - else - this.showTranslationInfoBar(); - return true; - }; - - let addId = this.originalShown ? "translate" : "translated"; - PopupNotifications.show(this.browser, addId, null, - addId + "-notification-icon", null, null, - {dismissed: true, eventCallback: callback}); - }, - - _state: 0, - get state() { - return this._state; - }, - set state(val) { - let notif = this.notificationBox.getNotificationWithValue("translation"); - if (notif) - notif.state = val; - this._state = val; - }, - - originalShown: true, - showOriginalContent: function() { - this.originalShown = true; - this.showURLBarIcon(); - this.browser.messageManager.sendAsyncMessage("Translation:ShowOriginal"); - TranslationTelemetry.recordShowOriginalContent(); - }, - - showTranslatedContent: function() { - this.originalShown = false; - this.showURLBarIcon(); - this.browser.messageManager.sendAsyncMessage("Translation:ShowTranslation"); - }, - - get notificationBox() { - return this.browser.ownerGlobal.gBrowser.getNotificationBox(this.browser); - }, - - showTranslationInfoBar: function() { - let notificationBox = this.notificationBox; - let notif = notificationBox.appendNotification("", "translation", null, - notificationBox.PRIORITY_INFO_HIGH); - notif.init(this); - return notif; - }, - - shouldShowInfoBar: function(aURI) { - // Never show the infobar automatically while the translation - // service is temporarily unavailable. - if (Translation.serviceUnavailable) - return false; - - // Check if we should never show the infobar for this language. - let neverForLangs = - Services.prefs.getCharPref("browser.translation.neverForLanguages"); - if (neverForLangs.split(",").indexOf(this.detectedLanguage) != -1) { - TranslationTelemetry.recordAutoRejectedTranslationOffer(); - return false; - } - - // or if we should never show the infobar for this domain. - let perms = Services.perms; - if (perms.testExactPermission(aURI, "translate") == perms.DENY_ACTION) { - TranslationTelemetry.recordAutoRejectedTranslationOffer(); - return false; - } - - return true; - }, - - receiveMessage: function(msg) { - switch (msg.name) { - case "Translation:Finished": - if (msg.data.success) { - this.originalShown = false; - this.state = Translation.STATE_TRANSLATED; - this.showURLBarIcon(); - - // Record the number of characters translated. - TranslationTelemetry.recordTranslation(msg.data.from, msg.data.to, - msg.data.characterCount); - } else if (msg.data.unavailable) { - Translation.serviceUnavailable = true; - this.state = Translation.STATE_UNAVAILABLE; - } else { - this.state = Translation.STATE_ERROR; - } - break; - } - }, - - infobarClosed: function() { - if (this.state == Translation.STATE_OFFER) - TranslationTelemetry.recordDeniedTranslationOffer(); - } -}; - -/** - * Uses telemetry histograms for collecting statistics on the usage of the - * translation component. - * - * NOTE: Metrics are only recorded if the user enabled the telemetry option. - */ -this.TranslationTelemetry = { - - init: function () { - // Constructing histograms. - const plain = (id) => Services.telemetry.getHistogramById(id); - const keyed = (id) => Services.telemetry.getKeyedHistogramById(id); - this.HISTOGRAMS = { - OPPORTUNITIES : () => plain("TRANSLATION_OPPORTUNITIES"), - OPPORTUNITIES_BY_LANG : () => keyed("TRANSLATION_OPPORTUNITIES_BY_LANGUAGE"), - PAGES : () => plain("TRANSLATED_PAGES"), - PAGES_BY_LANG : () => keyed("TRANSLATED_PAGES_BY_LANGUAGE"), - CHARACTERS : () => plain("TRANSLATED_CHARACTERS"), - DENIED : () => plain("DENIED_TRANSLATION_OFFERS"), - AUTO_REJECTED : () => plain("AUTO_REJECTED_TRANSLATION_OFFERS"), - SHOW_ORIGINAL : () => plain("REQUESTS_OF_ORIGINAL_CONTENT"), - TARGET_CHANGES : () => plain("CHANGES_OF_TARGET_LANGUAGE"), - DETECTION_CHANGES : () => plain("CHANGES_OF_DETECTED_LANGUAGE"), - SHOW_UI : () => plain("SHOULD_TRANSLATION_UI_APPEAR"), - DETECT_LANG : () => plain("SHOULD_AUTO_DETECT_LANGUAGE"), - }; - - // Capturing the values of flags at the startup. - this.recordPreferences(); - }, - - /** - * Record a translation opportunity in the health report. - * @param language - * The language of the page. - */ - recordTranslationOpportunity: function (language) { - return this._recordOpportunity(language, true); - }, - - /** - * Record a missed translation opportunity in the health report. - * A missed opportunity is when the language detected is not part - * of the supported languages. - * @param language - * The language of the page. - */ - recordMissedTranslationOpportunity: function (language) { - return this._recordOpportunity(language, false); - }, - - /** - * Record an automatically rejected translation offer in the health - * report. A translation offer is automatically rejected when a user - * has previously clicked "Never translate this language" or "Never - * translate this site", which results in the infobar not being shown for - * the translation opportunity. - * - * These translation opportunities should still be recorded in addition to - * recording the automatic rejection of the offer. - */ - recordAutoRejectedTranslationOffer: function () { - if (!this._canRecord) return; - this.HISTOGRAMS.AUTO_REJECTED().add(); - }, - - /** - * Record a translation in the health report. - * @param langFrom - * The language of the page. - * @param langTo - * The language translated to - * @param numCharacters - * The number of characters that were translated - */ - recordTranslation: function (langFrom, langTo, numCharacters) { - if (!this._canRecord) return; - this.HISTOGRAMS.PAGES().add(); - this.HISTOGRAMS.PAGES_BY_LANG().add(langFrom + " -> " + langTo); - this.HISTOGRAMS.CHARACTERS().add(numCharacters); - }, - - /** - * Record a change of the detected language in the health report. This should - * only be called when actually executing a translation, not every time the - * user changes in the language in the UI. - * - * @param beforeFirstTranslation - * A boolean indicating if we are recording a change of detected - * language before translating the page for the first time. If we - * have already translated the page from the detected language and - * the user has manually adjusted the detected language false should - * be passed. - */ - recordDetectedLanguageChange: function (beforeFirstTranslation) { - if (!this._canRecord) return; - this.HISTOGRAMS.DETECTION_CHANGES().add(beforeFirstTranslation); - }, - - /** - * Record a change of the target language in the health report. This should - * only be called when actually executing a translation, not every time the - * user changes in the language in the UI. - */ - recordTargetLanguageChange: function () { - if (!this._canRecord) return; - this.HISTOGRAMS.TARGET_CHANGES().add(); - }, - - /** - * Record a denied translation offer. - */ - recordDeniedTranslationOffer: function () { - if (!this._canRecord) return; - this.HISTOGRAMS.DENIED().add(); - }, - - /** - * Record a "Show Original" command use. - */ - recordShowOriginalContent: function () { - if (!this._canRecord) return; - this.HISTOGRAMS.SHOW_ORIGINAL().add(); - }, - - /** - * Record the state of translation preferences. - */ - recordPreferences: function () { - if (!this._canRecord) return; - if (Services.prefs.getBoolPref(TRANSLATION_PREF_SHOWUI)) { - this.HISTOGRAMS.SHOW_UI().add(1); - } - if (Services.prefs.getBoolPref(TRANSLATION_PREF_DETECT_LANG)) { - this.HISTOGRAMS.DETECT_LANG().add(1); - } - }, - - _recordOpportunity: function(language, success) { - if (!this._canRecord) return; - this.HISTOGRAMS.OPPORTUNITIES().add(success); - this.HISTOGRAMS.OPPORTUNITIES_BY_LANG().add(language, success); - }, - - /** - * A shortcut for reading the telemetry preference. - * - */ - _canRecord: function () { - return Services.prefs.getBoolPref("toolkit.telemetry.enabled"); - } -}; - -this.TranslationTelemetry.init(); diff --git a/application/basilisk/components/translation/TranslationContentHandler.jsm b/application/basilisk/components/translation/TranslationContentHandler.jsm deleted file mode 100644 index 3b0d59ddd..000000000 --- a/application/basilisk/components/translation/TranslationContentHandler.jsm +++ /dev/null @@ -1,181 +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"; - -this.EXPORTED_SYMBOLS = [ "TranslationContentHandler" ]; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "LanguageDetector", - "resource:///modules/translation/LanguageDetector.jsm"); - -const STATE_OFFER = 0; -const STATE_TRANSLATED = 2; -const STATE_ERROR = 3; - -this.TranslationContentHandler = function(global, docShell) { - let webProgress = docShell.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIWebProgress); - webProgress.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT); - - global.addEventListener("pageshow", this); - - global.addMessageListener("Translation:TranslateDocument", this); - global.addMessageListener("Translation:ShowTranslation", this); - global.addMessageListener("Translation:ShowOriginal", this); - this.global = global; -} - -TranslationContentHandler.prototype = { - handleEvent: function(aEvent) { - // We are only listening to pageshow events. - let target = aEvent.target; - - // Only handle top-level frames. - let win = target.defaultView; - if (win.parent !== win) - return; - - let content = this.global.content; - if (!content.detectedLanguage) - return; - - let data = {}; - let trDoc = content.translationDocument; - if (trDoc) { - data.state = trDoc.translationError ? STATE_ERROR : STATE_TRANSLATED; - data.translatedFrom = trDoc.translatedFrom; - data.translatedTo = trDoc.translatedTo; - data.originalShown = trDoc.originalShown; - } else { - data.state = STATE_OFFER; - data.originalShown = true; - } - data.detectedLanguage = content.detectedLanguage; - - this.global.sendAsyncMessage("Translation:DocumentState", data); - }, - - /* nsIWebProgressListener implementation */ - onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) { - if (!aWebProgress.isTopLevel || - !(aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) || - !this.global.content) - return; - - let url = aRequest.name; - if (!url.startsWith("http://") && !url.startsWith("https://")) - return; - - let content = this.global.content; - if (content.detectedLanguage) - return; - - // Grab a 60k sample of text from the page. - let encoder = Cc["@mozilla.org/layout/documentEncoder;1?type=text/plain"] - .createInstance(Ci.nsIDocumentEncoder); - encoder.init(content.document, "text/plain", encoder.SkipInvisibleContent); - let string = encoder.encodeToStringWithMaxLength(60 * 1024); - - // Language detection isn't reliable on very short strings. - if (string.length < 100) - return; - - LanguageDetector.detectLanguage(string).then(result => { - // Bail if we're not confident. - if (!result.confident) { - return; - } - - // The window might be gone by now. - if (Cu.isDeadWrapper(content)) { - return; - } - - content.detectedLanguage = result.language; - - let data = { - state: STATE_OFFER, - originalShown: true, - detectedLanguage: result.language - }; - this.global.sendAsyncMessage("Translation:DocumentState", data); - }); - }, - - // Unused methods. - onProgressChange: function() {}, - onLocationChange: function() {}, - onStatusChange: function() {}, - onSecurityChange: function() {}, - - QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener, - Ci.nsISupportsWeakReference]), - - receiveMessage: function(msg) { - switch (msg.name) { - case "Translation:TranslateDocument": - { - Cu.import("resource:///modules/translation/TranslationDocument.jsm"); - - // If a TranslationDocument already exists for this document, it should - // be used instead of creating a new one so that we can use the original - // content of the page for the new translation instead of the newly - // translated text. - let translationDocument = this.global.content.translationDocument || - new TranslationDocument(this.global.content.document); - - let preferredEngine = Services.prefs.getCharPref("browser.translation.engine"); - let translator = null; - if (preferredEngine == "yandex") { - Cu.import("resource:///modules/translation/YandexTranslator.jsm"); - translator = new YandexTranslator(translationDocument, - msg.data.from, - msg.data.to); - } else { - Cu.import("resource:///modules/translation/BingTranslator.jsm"); - translator = new BingTranslator(translationDocument, - msg.data.from, - msg.data.to); - } - - this.global.content.translationDocument = translationDocument; - translationDocument.translatedFrom = msg.data.from; - translationDocument.translatedTo = msg.data.to; - translationDocument.translationError = false; - - translator.translate().then( - result => { - this.global.sendAsyncMessage("Translation:Finished", { - characterCount: result.characterCount, - from: msg.data.from, - to: msg.data.to, - success: true - }); - translationDocument.showTranslation(); - }, - error => { - translationDocument.translationError = true; - let data = {success: false}; - if (error == "unavailable") - data.unavailable = true; - this.global.sendAsyncMessage("Translation:Finished", data); - } - ); - break; - } - - case "Translation:ShowOriginal": - this.global.content.translationDocument.showOriginal(); - break; - - case "Translation:ShowTranslation": - this.global.content.translationDocument.showTranslation(); - break; - } - } -}; diff --git a/application/basilisk/components/translation/TranslationDocument.jsm b/application/basilisk/components/translation/TranslationDocument.jsm deleted file mode 100644 index 058d07a49..000000000 --- a/application/basilisk/components/translation/TranslationDocument.jsm +++ /dev/null @@ -1,683 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -this.EXPORTED_SYMBOLS = [ "TranslationDocument" ]; - -const SHOW_ELEMENT = Ci.nsIDOMNodeFilter.SHOW_ELEMENT; -const SHOW_TEXT = Ci.nsIDOMNodeFilter.SHOW_TEXT; -const TEXT_NODE = Ci.nsIDOMNode.TEXT_NODE; - -Cu.import("resource://services-common/utils.js"); -Cu.import("resource://gre/modules/Task.jsm"); - -/** - * This class represents a document that is being translated, - * and it is responsible for parsing the document, - * generating the data structures translation (the list of - * translation items and roots), and managing the original - * and translated texts on the translation items. - * - * @param document The document to be translated - */ -this.TranslationDocument = function(document) { - this.itemsMap = new Map(); - this.roots = []; - this._init(document); -}; - -this.TranslationDocument.prototype = { - translatedFrom: "", - translatedTo: "", - translationError: false, - originalShown: true, - - /** - * Initializes the object and populates - * the roots lists. - * - * @param document The document to be translated - */ - _init: function(document) { - let window = document.defaultView; - let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils); - - // Get all the translation nodes in the document's body: - // a translation node is a node from the document which - // contains useful content for translation, and therefore - // must be included in the translation process. - let nodeList = winUtils.getTranslationNodes(document.body); - - let length = nodeList.length; - - for (let i = 0; i < length; i++) { - let node = nodeList.item(i); - let isRoot = nodeList.isTranslationRootAtIndex(i); - - // Create a TranslationItem object for this node. - // This function will also add it to the this.roots array. - this._createItemForNode(node, i, isRoot); - } - - // At first all roots are stored in the roots list, and only after - // the process has finished we're able to determine which roots are - // simple, and which ones are not. - - // A simple root is defined by a root with no children items, which - // basically represents an element from a page with only text content - // inside. - - // This distinction is useful for optimization purposes: we treat a - // simple root as plain-text in the translation process and with that - // we are able to reduce their data payload sent to the translation service. - - for (let root of this.roots) { - if (root.children.length == 0 && - root.nodeRef.childElementCount == 0) { - root.isSimpleRoot = true; - } - } - }, - - /** - * Creates a TranslationItem object, which should be called - * for each node returned by getTranslationNodes. - * - * @param node The DOM node for this item. - * @param id A unique, numeric id for this item. - * @parem isRoot A boolean saying whether this item is a root. - * - * @returns A TranslationItem object. - */ - _createItemForNode: function(node, id, isRoot) { - if (this.itemsMap.has(node)) { - return this.itemsMap.get(node); - } - - let item = new TranslationItem(node, id, isRoot); - - if (isRoot) { - // Root items do not have a parent item. - this.roots.push(item); - } else { - let parentItem = this.itemsMap.get(node.parentNode); - if (parentItem) { - parentItem.children.push(item); - } - } - - this.itemsMap.set(node, item); - return item; - }, - - /** - * Generate the text string that represents a TranslationItem object. - * Besides generating the string, it's also stored in the "original" - * field of the TranslationItem object, which needs to be stored for - * later to be used in the "Show Original" functionality. - * If this function had already been called for the given item (determined - * by the presence of the "original" array in the item), the text will - * be regenerated from the "original" data instead of from the related - * DOM nodes (because the nodes might contain translated data). - * - * @param item A TranslationItem object - * - * @returns A string representation of the TranslationItem. - */ - generateTextForItem: function(item) { - if (item.original) { - return regenerateTextFromOriginalHelper(item); - } - - if (item.isSimpleRoot) { - let text = item.nodeRef.firstChild.nodeValue.trim(); - item.original = [text]; - return text; - } - - let str = ""; - item.original = []; - let wasLastItemPlaceholder = false; - - for (let child of item.nodeRef.childNodes) { - if (child.nodeType == TEXT_NODE) { - let x = child.nodeValue.trim(); - if (x != "") { - item.original.push(x); - str += x; - wasLastItemPlaceholder = false; - } - continue; - } - - let objInMap = this.itemsMap.get(child); - if (objInMap && !objInMap.isRoot) { - // If this childNode is present in the itemsMap, it means - // it's a translation node: it has useful content for translation. - // In this case, we need to stringify this node. - // However, if this item is a root, we should skip it here in this - // object's child list (and just add a placeholder for it), because - // it will be stringfied separately for being a root. - item.original.push(objInMap); - str += this.generateTextForItem(objInMap); - wasLastItemPlaceholder = false; - } else if (!wasLastItemPlaceholder) { - // Otherwise, if this node doesn't contain any useful content, - // or if it is a root itself, we can replace it with a placeholder node. - // We can't simply eliminate this node from our string representation - // because that could change the HTML structure (e.g., it would - // probably merge two separate text nodes). - // It's not necessary to add more than one placeholder in sequence; - // we can optimize them away. - item.original.push(TranslationItem_NodePlaceholder); - str += '<br>'; - wasLastItemPlaceholder = true; - } - } - - return generateTranslationHtmlForItem(item, str); - }, - - /** - * Changes the document to display its translated - * content. - */ - showTranslation: function() { - this.originalShown = false; - this._swapDocumentContent("translation"); - }, - - /** - * Changes the document to display its original - * content. - */ - showOriginal: function() { - this.originalShown = true; - this._swapDocumentContent("original"); - }, - - /** - * Swap the document with the resulting translation, - * or back with the original content. - * - * @param target A string that is either "translation" - * or "original". - */ - _swapDocumentContent: function(target) { - Task.spawn(function *() { - // Let the event loop breath on every 100 nodes - // that are replaced. - const YIELD_INTERVAL = 100; - let count = YIELD_INTERVAL; - - for (let root of this.roots) { - root.swapText(target); - if (count-- == 0) { - count = YIELD_INTERVAL; - yield CommonUtils.laterTickResolvingPromise(); - } - } - }.bind(this)); - } -}; - -/** - * This class represents an item for translation. It's basically our - * wrapper class around a node returned by getTranslationNode, with - * more data and structural information on it. - * - * At the end of the translation process, besides the properties below, - * a TranslationItem will contain two other properties: one called "original" - * and one called "translation". They are twin objects, one which reflect - * the structure of that node in its original state, and the other in its - * translated state. - * - * The "original" array is generated in the generateTextForItem function, - * and the "translation" array is generated when the translation results - * are parsed. - * - * They are both arrays, which contain a mix of strings and references to - * child TranslationItems. The references in both arrays point to the * same * - * TranslationItem object, but they might appear in different orders between the - * "original" and "translation" arrays. - * - * An example: - * - * English: <div id="n1">Welcome to <b id="n2">Mozilla's</b> website</div> - * Portuguese: <div id="n1">Bem vindo a pagina <b id="n2">da Mozilla</b></div> - * - * TranslationItem n1 = { - * id: 1, - * original: ["Welcome to", ptr to n2, "website"] - * translation: ["Bem vindo a pagina", ptr to n2] - * } - * - * TranslationItem n2 = { - * id: 2, - * original: ["Mozilla's"], - * translation: ["da Mozilla"] - * } - */ -function TranslationItem(node, id, isRoot) { - this.nodeRef = node; - this.id = id; - this.isRoot = isRoot; - this.children = []; -} - -TranslationItem.prototype = { - isRoot: false, - isSimpleRoot: false, - - toString: function() { - let rootType = ""; - if (this.isRoot) { - if (this.isSimpleRoot) { - rootType = " (simple root)"; - } - else { - rootType = " (non simple root)"; - } - } - return "[object TranslationItem: <" + this.nodeRef.localName + ">" - + rootType + "]"; - }, - - /** - * This function will parse the result of the translation of one translation - * item. If this item was a simple root, all we sent was a plain-text version - * of it, so the result is also straightforward text. - * - * For non-simple roots, we sent a simplified HTML representation of that - * node, and we'll first parse that into an HTML doc and then call the - * parseResultNode helper function to parse it. - * - * While parsing, the result is stored in the "translation" field of the - * TranslationItem, which will be used to display the final translation when - * all items are finished. It remains stored too to allow back-and-forth - * switching between the "Show Original" and "Show Translation" functions. - * - * @param result A string with the textual result received from the server, - * which can be plain-text or a serialized HTML doc. - */ - parseResult: function(result) { - if (this.isSimpleRoot) { - this.translation = [result]; - return; - } - - let domParser = Cc["@mozilla.org/xmlextras/domparser;1"] - .createInstance(Ci.nsIDOMParser); - - let doc = domParser.parseFromString(result, "text/html"); - parseResultNode(this, doc.body.firstChild); - }, - - /** - * This function finds a child TranslationItem - * with the given id. - * @param id The id to look for, in the format "n#" - * @returns A TranslationItem with the given id, or null if - * it was not found. - */ - getChildById: function(id) { - for (let child of this.children) { - if (("n" + child.id) == id) { - return child; - } - } - return null; - }, - - /** - * Swap the text of this TranslationItem between - * its original and translated states. - * - * @param target A string that is either "translation" - * or "original". - */ - swapText: function(target) { - swapTextForItem(this, target); - } -}; - -/** - * This object represents a placeholder item for translation. It's similar to - * the TranslationItem class, but it represents nodes that have no meaningful - * content for translation. These nodes will be replaced by "<br>" in a - * translation request. It's necessary to keep them to use it as a mark - * for correct positioning and spliting of text nodes. - */ -const TranslationItem_NodePlaceholder = { - toString: function() { - return "[object TranslationItem_NodePlaceholder]"; - } -}; - -/** - * Generate the outer HTML representation for a given item. - * - * @param item A TranslationItem object. - * param content The inner content for this item. - * @returns string The outer HTML needed for translation - * of this item. - */ -function generateTranslationHtmlForItem(item, content) { - let localName = item.isRoot ? "div" : "b"; - return '<' + localName + ' id=n' + item.id + '>' + - content + - "</" + localName + ">"; -} - - /** - * Regenerate the text string that represents a TranslationItem object, - * with data from its "original" array. The array must have already - * been created by TranslationDocument.generateTextForItem(). - * - * @param item A TranslationItem object - * - * @returns A string representation of the TranslationItem. - */ -function regenerateTextFromOriginalHelper(item) { - if (item.isSimpleRoot) { - return item.original[0]; - } - - let str = ""; - for (let child of item.original) { - if (child instanceof TranslationItem) { - str += regenerateTextFromOriginalHelper(child); - } else if (child === TranslationItem_NodePlaceholder) { - str += "<br>"; - } else { - str += child; - } - } - - return generateTranslationHtmlForItem(item, str); -} - -/** - * Helper function to parse a HTML doc result. - * How it works: - * - * An example result string is: - * - * <div id="n1">Hello <b id="n2">World</b> of Mozilla.</div> - * - * For an element node, we look at its id and find the corresponding - * TranslationItem that was associated with this node, and then we - * walk down it repeating the process. - * - * For text nodes we simply add it as a string. - */ -function parseResultNode(item, node) { - item.translation = []; - for (let child of node.childNodes) { - if (child.nodeType == TEXT_NODE) { - item.translation.push(child.nodeValue); - } else if (child.localName == "br") { - item.translation.push(TranslationItem_NodePlaceholder); - } else { - let translationItemChild = item.getChildById(child.id); - - if (translationItemChild) { - item.translation.push(translationItemChild); - parseResultNode(translationItemChild, child); - } - } - } -} - -/** - * Helper function to swap the text of a TranslationItem - * between its original and translated states. - * How it works: - * - * The function iterates through the target array (either the `original` or - * `translation` array from the TranslationItem), while also keeping a pointer - * to a current position in the child nodes from the actual DOM node that we - * are modifying. This pointer is moved forward after each item of the array - * is translated. If, at any given time, the pointer doesn't match the expected - * node that was supposed to be seen, it means that the original and translated - * contents have a different ordering, and thus we need to adjust that. - * - * A full example of the reordering process, swapping from Original to - * Translation: - * - * Original (en): <div>I <em>miss</em> <b>you</b></div> - * - * Translation (fr): <div><b>Tu</b> me <em>manques</em></div> - * - * Step 1: - * pointer points to firstChild of the DOM node, textnode "I " - * first item in item.translation is [object TranslationItem <b>] - * - * pointer does not match the expected element, <b>. So let's move <b> to the - * pointer position. - * - * Current state of the DOM: - * <div><b>you</b>I <em>miss</em> </div> - * - * Step 2: - * pointer moves forward to nextSibling, textnode "I " again. - * second item in item.translation is the string " me " - * - * pointer points to a text node, and we were expecting a text node. Match! - * just replace the text content. - * - * Current state of the DOM: - * <div><b>you</b> me <em>miss</em> </div> - * - * Step 3: - * pointer moves forward to nextSibling, <em>miss</em> - * third item in item.translation is [object TranslationItem <em>] - * - * pointer points to the expected node. Match! Nothing to do. - * - * Step 4: - * all items in this item.translation were transformed. The remaining - * text nodes are cleared to "", and domNode.normalize() removes them. - * - * Current state of the DOM: - * <div><b>you</b> me <em>miss</em></div> - * - * Further steps: - * After that, the function will visit the child items (from the visitStack), - * and the text inside the <b> and <em> nodes will be swapped as well, - * yielding the final result: - * - * <div><b>Tu</b> me <em>manques</em></div> - * - * - * @param item A TranslationItem object - * @param target A string that is either "translation" - * or "original". - */ -function swapTextForItem(item, target) { - // visitStack is the stack of items that we still need to visit. - // Let's start the process by adding the root item. - let visitStack = [ item ]; - - while (visitStack.length > 0) { - let curItem = visitStack.shift(); - - let domNode = curItem.nodeRef; - if (!domNode) { - // Skipping this item due to a missing node. - continue; - } - - if (!curItem[target]) { - // Translation not found for this item. This could be due to - // an error in the server response. For example, if a translation - // was broken in various chunks, and one of the chunks failed, - // the items from that chunk will be missing its "translation" - // field. - continue; - } - - domNode.normalize(); - - // curNode points to the child nodes of the DOM node that we are - // modifying. During most of the process, while the target array is - // being iterated (in the for loop below), it should walk together with - // the array and be pointing to the correct node that needs to modified. - // If it's not pointing to it, that means some sort of node reordering - // will be necessary to produce the correct translation. - // Note that text nodes don't need to be reordered, as we can just replace - // the content of one text node with another. - // - // curNode starts in the firstChild... - let curNode = domNode.firstChild; - - // ... actually, let's make curNode start at the first useful node (either - // a non-blank text node or something else). This is not strictly necessary, - // as the reordering algorithm would correctly handle this case. However, - // this better aligns the resulting translation with the DOM content of the - // page, avoiding cases that would need to be unecessarily reordered. - // - // An example of how this helps: - // - // ---- Original: <div> <b>Hello </b> world.</div> - // ^textnode 1 ^item 1 ^textnode 2 - // - // - Translation: <div><b>Hallo </b> Welt.</div> - // - // Transformation process without this optimization: - // 1 - start pointer at textnode 1 - // 2 - move item 1 to first position inside the <div> - // - // Node now looks like: <div><b>Hello </b>[ ][ world.]</div> - // textnode 1^ ^textnode 2 - // - // 3 - replace textnode 1 with " Welt." - // 4 - clear remaining text nodes (in this case, textnode 2) - // - // Transformation process with this optimization: - // 1 - start pointer at item 1 - // 2 - item 1 is already in position - // 3 - replace textnode 2 with " Welt." - // - // which completely avoids any node reordering, and requires only one - // text change instead of two (while also leaving the page closer to - // its original state). - while (curNode && - curNode.nodeType == TEXT_NODE && - curNode.nodeValue.trim() == "") { - curNode = curNode.nextSibling; - } - - // Now let's walk through all items in the `target` array of the - // TranslationItem. This means either the TranslationItem.original or - // TranslationItem.translation array. - for (let targetItem of curItem[target]) { - - if (targetItem instanceof TranslationItem) { - // If the array element is another TranslationItem object, let's - // add it to the stack to be visited. - visitStack.push(targetItem); - - let targetNode = targetItem.nodeRef; - - // If the node is not in the expected position, let's reorder - // it into position... - if (curNode != targetNode && - // ...unless the page has reparented this node under a totally - // different node (or removed it). In this case, all bets are off - // on being able to do anything correctly, so it's better not to - // bring back the node to this parent. - targetNode.parentNode == domNode) { - - // We don't need to null-check curNode because insertBefore(..., null) - // does what we need in that case: reorder this node to the end - // of child nodes. - domNode.insertBefore(targetNode, curNode); - curNode = targetNode; - } - - // Move pointer forward. Since we do not add empty text nodes to the - // list of translation items, we must skip them here too while - // traversing the DOM in order to get better alignment between the - // text nodes and the translation items. - if (curNode) { - curNode = getNextSiblingSkippingEmptyTextNodes(curNode); - } - - } else if (targetItem === TranslationItem_NodePlaceholder) { - // If the current item is a placeholder node, we need to move - // our pointer "past" it, jumping from one side of a block of - // elements + empty text nodes to the other side. Even if - // non-placeholder elements exists inside the jumped block, - // they will be pulled correctly later in the process when the - // targetItem for those nodes are handled. - - while (curNode && - (curNode.nodeType != TEXT_NODE || - curNode.nodeValue.trim() == "")) { - curNode = curNode.nextSibling; - } - - } else { - // Finally, if it's a text item, we just need to find the next - // text node to use. Text nodes don't need to be reordered, so - // the first one found can be used. - while (curNode && curNode.nodeType != TEXT_NODE) { - curNode = curNode.nextSibling; - } - - // If none was found and we reached the end of the child nodes, - // let's create a new one. - if (!curNode) { - // We don't know if the original content had a space or not, - // so the best bet is to create the text node with " " which - // will add one space at the beginning and one at the end. - curNode = domNode.appendChild(domNode.ownerDocument.createTextNode(" ")); - } - - // A trailing and a leading space must be preserved because - // they are meaningful in HTML. - let preSpace = /^\s/.test(curNode.nodeValue) ? " " : ""; - let endSpace = /\s$/.test(curNode.nodeValue) ? " " : ""; - - curNode.nodeValue = preSpace + targetItem + endSpace; - curNode = getNextSiblingSkippingEmptyTextNodes(curNode); - } - } - - // The translated version of a node might have less text nodes than its - // original version. If that's the case, let's clear the remaining nodes. - if (curNode) { - clearRemainingNonEmptyTextNodesFromElement(curNode); - } - - // And remove any garbage "" nodes left after clearing. - domNode.normalize(); - } -} - -function getNextSiblingSkippingEmptyTextNodes(startSibling) { - let item = startSibling.nextSibling; - while (item && - item.nodeType == TEXT_NODE && - item.nodeValue.trim() == "") { - item = item.nextSibling; - } - return item; -} - -function clearRemainingNonEmptyTextNodesFromElement(startSibling) { - let item = startSibling; - while (item) { - if (item.nodeType == TEXT_NODE && - item.nodeValue != "") { - item.nodeValue = ""; - } - item = item.nextSibling; - } -} diff --git a/application/basilisk/components/translation/YandexTranslator.jsm b/application/basilisk/components/translation/YandexTranslator.jsm deleted file mode 100644 index ab92e0962..000000000 --- a/application/basilisk/components/translation/YandexTranslator.jsm +++ /dev/null @@ -1,343 +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"; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -this.EXPORTED_SYMBOLS = [ "YandexTranslator" ]; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Log.jsm"); -Cu.import("resource://gre/modules/Promise.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://services-common/utils.js"); -Cu.import("resource://gre/modules/Http.jsm"); - -// The maximum amount of net data allowed per request on Bing's API. -const MAX_REQUEST_DATA = 5000; // Documentation says 10000 but anywhere - // close to that is refused by the service. - -// The maximum number of chunks allowed to be translated in a single -// request. -const MAX_REQUEST_CHUNKS = 1000; // Documentation says 2000. - -// Self-imposed limit of 15 requests. This means that a page that would need -// to be broken in more than 15 requests won't be fully translated. -// The maximum amount of data that we will translate for a single page -// is MAX_REQUESTS * MAX_REQUEST_DATA. -const MAX_REQUESTS = 15; - -const YANDEX_RETURN_CODE_OK = 200; - -const YANDEX_ERR_KEY_INVALID = 401; // Invalid API key -const YANDEX_ERR_KEY_BLOCKED = 402; // This API key has been blocked -const YANDEX_ERR_DAILY_REQ_LIMIT_EXCEEDED = 403; // Daily limit for requests reached -const YANDEX_ERR_DAILY_CHAR_LIMIT_EXCEEDED = 404; // Daily limit of chars reached -const YANDEX_ERR_TEXT_TOO_LONG = 413; // The text size exceeds the maximum -const YANDEX_ERR_UNPROCESSABLE_TEXT = 422; // The text could not be translated -const YANDEX_ERR_LANG_NOT_SUPPORTED = 501; // The specified translation direction is not supported - -// Errors that should activate the service unavailable handling -const YANDEX_PERMANENT_ERRORS = [ - YANDEX_ERR_KEY_INVALID, - YANDEX_ERR_KEY_BLOCKED, - YANDEX_ERR_DAILY_REQ_LIMIT_EXCEEDED, - YANDEX_ERR_DAILY_CHAR_LIMIT_EXCEEDED, -]; - -/** - * Translates a webpage using Yandex's Translation API. - * - * @param translationDocument The TranslationDocument object that represents - * the webpage to be translated - * @param sourceLanguage The source language of the document - * @param targetLanguage The target language for the translation - * - * @returns {Promise} A promise that will resolve when the translation - * task is finished. - */ -this.YandexTranslator = function(translationDocument, sourceLanguage, targetLanguage) { - this.translationDocument = translationDocument; - this.sourceLanguage = sourceLanguage; - this.targetLanguage = targetLanguage; - this._pendingRequests = 0; - this._partialSuccess = false; - this._serviceUnavailable = false; - this._translatedCharacterCount = 0; -}; - -this.YandexTranslator.prototype = { - /** - * Performs the translation, splitting the document into several chunks - * respecting the data limits of the API. - * - * @returns {Promise} A promise that will resolve when the translation - * task is finished. - */ - translate: function() { - return Task.spawn(function *() { - let currentIndex = 0; - this._onFinishedDeferred = Promise.defer(); - - // Let's split the document into various requests to be sent to - // Yandex's Translation API. - for (let requestCount = 0; requestCount < MAX_REQUESTS; requestCount++) { - // Generating the text for each request can be expensive, so - // let's take the opportunity of the chunkification process to - // allow for the event loop to attend other pending events - // before we continue. - yield CommonUtils.laterTickResolvingPromise(); - - // Determine the data for the next request. - let request = this._generateNextTranslationRequest(currentIndex); - - // Create a real request to the server, and put it on the - // pending requests list. - let yandexRequest = new YandexRequest(request.data, - this.sourceLanguage, - this.targetLanguage); - this._pendingRequests++; - yandexRequest.fireRequest().then(this._chunkCompleted.bind(this), - this._chunkFailed.bind(this)); - - currentIndex = request.lastIndex; - if (request.finished) { - break; - } - } - - return this._onFinishedDeferred.promise; - }.bind(this)); - }, - - /** - * Function called when a request sent to the server completed successfully. - * This function handles calling the function to parse the result and the - * function to resolve the promise returned by the public `translate()` - * method when there are no pending requests left. - * - * @param request The YandexRequest sent to the server - */ - _chunkCompleted: function(yandexRequest) { - if (this._parseChunkResult(yandexRequest)) { - this._partialSuccess = true; - // Count the number of characters successfully translated. - this._translatedCharacterCount += yandexRequest.characterCount; - } - - this._checkIfFinished(); - }, - - /** - * Function called when a request sent to the server has failed. - * This function handles deciding if the error is transient or means the - * service is unavailable (zero balance on the key or request credentials are - * not in an active state) and calling the function to resolve the promise - * returned by the public `translate()` method when there are no pending - * requests left. - * - * @param aError [optional] The XHR object of the request that failed. - */ - _chunkFailed: function(aError) { - if (aError instanceof Ci.nsIXMLHttpRequest) { - let body = aError.responseText; - let json = { code: 0 }; - try { - json = JSON.parse(body); - } catch (e) {} - - if (json.code && YANDEX_PERMANENT_ERRORS.indexOf(json.code) != -1) - this._serviceUnavailable = true; - } - - this._checkIfFinished(); - }, - - /** - * Function called when a request sent to the server has completed. - * This function handles resolving the promise - * returned by the public `translate()` method when all chunks are completed. - */ - _checkIfFinished: function() { - // Check if all pending requests have been - // completed and then resolves the promise. - // If at least one chunk was successful, the - // promise will be resolved positively which will - // display the "Success" state for the infobar. Otherwise, - // the "Error" state will appear. - if (--this._pendingRequests == 0) { - if (this._partialSuccess) { - this._onFinishedDeferred.resolve({ - characterCount: this._translatedCharacterCount - }); - } else { - let error = this._serviceUnavailable ? "unavailable" : "failure"; - this._onFinishedDeferred.reject(error); - } - } - }, - - /** - * This function parses the result returned by Yandex's Translation API, - * which returns a JSON result that contains a number of elements. The - * API is documented here: - * http://api.yandex.com/translate/doc/dg/reference/translate.xml - * - * @param request The request sent to the server. - * @returns boolean True if parsing of this chunk was successful. - */ - _parseChunkResult: function(yandexRequest) { - let results; - try { - let result = JSON.parse(yandexRequest.networkRequest.responseText); - if (result.code != 200) { - Services.console.logStringMessage("YandexTranslator: Result is " + result.code); - return false; - } - results = result.text - } catch (e) { - return false; - } - - let len = results.length; - if (len != yandexRequest.translationData.length) { - // This should never happen, but if the service returns a different number - // of items (from the number of items submitted), we can't use this chunk - // because all items would be paired incorrectly. - return false; - } - - let error = false; - for (let i = 0; i < len; i++) { - try { - let result = results[i]; - let root = yandexRequest.translationData[i][0]; - root.parseResult(result); - } catch (e) { error = true; } - } - - return !error; - }, - - /** - * This function will determine what is the data to be used for - * the Nth request we are generating, based on the input params. - * - * @param startIndex What is the index, in the roots list, that the - * chunk should start. - */ - _generateNextTranslationRequest: function(startIndex) { - let currentDataSize = 0; - let currentChunks = 0; - let output = []; - let rootsList = this.translationDocument.roots; - - for (let i = startIndex; i < rootsList.length; i++) { - let root = rootsList[i]; - let text = this.translationDocument.generateTextForItem(root); - if (!text) { - continue; - } - - let newCurSize = currentDataSize + text.length; - let newChunks = currentChunks + 1; - - if (newCurSize > MAX_REQUEST_DATA || - newChunks > MAX_REQUEST_CHUNKS) { - - // If we've reached the API limits, let's stop accumulating data - // for this request and return. We return information useful for - // the caller to pass back on the next call, so that the function - // can keep working from where it stopped. - return { - data: output, - finished: false, - lastIndex: i - }; - } - - currentDataSize = newCurSize; - currentChunks = newChunks; - output.push([root, text]); - } - - return { - data: output, - finished: true, - lastIndex: 0 - }; - } -}; - -/** - * Represents a request (for 1 chunk) sent off to Yandex's service. - * - * @params translationData The data to be used for this translation, - * generated by the generateNextTranslationRequest... - * function. - * @param sourceLanguage The source language of the document. - * @param targetLanguage The target language for the translation. - * - */ -function YandexRequest(translationData, sourceLanguage, targetLanguage) { - this.translationData = translationData; - this.sourceLanguage = sourceLanguage; - this.targetLanguage = targetLanguage; - this.characterCount = 0; -} - -YandexRequest.prototype = { - /** - * Initiates the request - */ - fireRequest: function() { - return Task.spawn(function *() { - // Prepare URL. - let url = getUrlParam("https://translate.yandex.net/api/v1.5/tr.json/translate", - "browser.translation.yandex.translateURLOverride"); - - // Prepare the request body. - let apiKey = getUrlParam("%YANDEX_API_KEY%", "browser.translation.yandex.apiKeyOverride"); - let params = [ - ["key", apiKey], - ["format", "html"], - ["lang", this.sourceLanguage + "-" + this.targetLanguage], - ]; - - for (let [, text] of this.translationData) { - params.push(["text", text]); - this.characterCount += text.length; - } - - // Set up request options. - let deferred = Promise.defer(); - let options = { - onLoad: (function(responseText, xhr) { - deferred.resolve(this); - }).bind(this), - onError: function(e, responseText, xhr) { - deferred.reject(xhr); - }, - postData: params - }; - - // Fire the request. - this.networkRequest = httpRequest(url, options); - - return deferred.promise; - }.bind(this)); - } -}; - -/** - * Fetch an auth token (clientID or client secret), which may be overridden by - * a pref if it's set. - */ -function getUrlParam(paramValue, prefName) { - if (Services.prefs.getPrefType(prefName)) - paramValue = Services.prefs.getCharPref(prefName); - paramValue = Services.urlFormatter.formatURL(paramValue); - return paramValue; -} diff --git a/application/basilisk/components/translation/jar.mn b/application/basilisk/components/translation/jar.mn deleted file mode 100644 index be744cb9e..000000000 --- a/application/basilisk/components/translation/jar.mn +++ /dev/null @@ -1,6 +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/. -browser.jar: - content/browser/translation-infobar.xml - content/browser/microsoft-translator-attribution.png diff --git a/application/basilisk/components/translation/microsoft-translator-attribution.png b/application/basilisk/components/translation/microsoft-translator-attribution.png Binary files differdeleted file mode 100644 index d9d277461..000000000 --- a/application/basilisk/components/translation/microsoft-translator-attribution.png +++ /dev/null diff --git a/application/basilisk/components/translation/moz.build b/application/basilisk/components/translation/moz.build index ac0165230..32421e430 100644 --- a/application/basilisk/components/translation/moz.build +++ b/application/basilisk/components/translation/moz.build @@ -3,14 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. EXTRA_JS_MODULES.translation = [ - 'BingTranslator.jsm', 'cld2/cld-worker.js', 'cld2/cld-worker.js.mem', 'LanguageDetector.jsm', - 'Translation.jsm', - 'TranslationContentHandler.jsm', - 'TranslationDocument.jsm', - 'YandexTranslator.jsm' ] - -JAR_MANIFESTS += ['jar.mn'] diff --git a/application/basilisk/components/translation/translation-infobar.xml b/application/basilisk/components/translation/translation-infobar.xml deleted file mode 100644 index db0695c03..000000000 --- a/application/basilisk/components/translation/translation-infobar.xml +++ /dev/null @@ -1,441 +0,0 @@ -<?xml version="1.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/. --> - -<!DOCTYPE bindings [ -<!ENTITY % notificationDTD SYSTEM "chrome://global/locale/notification.dtd"> -%notificationDTD; -<!ENTITY % translationDTD SYSTEM "chrome://browser/locale/translation.dtd" > -%translationDTD; -]> - -<bindings id="translationBindings" - xmlns="http://www.mozilla.org/xbl" - xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" - xmlns:xbl="http://www.mozilla.org/xbl"> - <binding id="translationbar" extends="chrome://global/content/bindings/notification.xml#notification" role="xul:alert"> - <resources> - <stylesheet src="chrome://global/skin/notification.css"/> - </resources> - <content> - <xul:hbox class="notification-inner" flex="1" xbl:inherits="type"> - <xul:hbox anonid="details" align="center" flex="1"> - <xul:image class="translate-infobar-element messageImage" - anonid="messageImage"/> - <xul:panel anonid="welcomePanel" class="translation-welcome-panel" - type="arrow" align="start"> - <xul:image class="translation-welcome-logo"/> - <xul:vbox flex="1" class="translation-welcome-content"> - <xul:description class="translation-welcome-headline" - anonid="welcomeHeadline"/> - <xul:description class="translation-welcome-body" anonid="welcomeBody"/> - <xul:hbox align="center"> - <xul:label anonid="learnMore" class="plain text-link" - onclick="openUILinkIn('https://support.mozilla.org/kb/automatic-translation', 'tab'); this.parentNode.parentNode.parentNode.hidePopup();"/> - <xul:spacer flex="1"/> - <xul:button class="translate-infobar-element" anonid="thanksButton" - onclick="this.parentNode.parentNode.parentNode.hidePopup();"/> - </xul:hbox> - </xul:vbox> - </xul:panel> - <xul:deck anonid="translationStates" selectedIndex="0"> - - <!-- offer to translate --> - <xul:hbox class="translate-offer-box" align="center"> - <xul:label class="translate-infobar-element" value="&translation.thisPageIsIn.label;"/> - <xul:menulist class="translate-infobar-element" anonid="detectedLanguage"> - <xul:menupopup/> - </xul:menulist> - <xul:label class="translate-infobar-element" value="&translation.translateThisPage.label;"/> - <xul:button class="translate-infobar-element" - label="&translation.translate.button;" - anonid="translate" - oncommand="document.getBindingParent(this).translate();"/> - <xul:button class="translate-infobar-element" - label="&translation.notNow.button;" anonid="notNow" - oncommand="document.getBindingParent(this).closeCommand();"/> - </xul:hbox> - - <!-- translating --> - <xul:vbox class="translating-box" pack="center"> - <xul:label class="translate-infobar-element" - value="&translation.translatingContent.label;"/> - </xul:vbox> - - <!-- translated --> - <xul:hbox class="translated-box" align="center"> - <xul:label class="translate-infobar-element" - value="&translation.translatedFrom.label;"/> - <xul:menulist class="translate-infobar-element" - anonid="fromLanguage" - oncommand="document.getBindingParent(this).translate()"> - <xul:menupopup/> - </xul:menulist> - <xul:label class="translate-infobar-element" - value="&translation.translatedTo.label;"/> - <xul:menulist class="translate-infobar-element" - anonid="toLanguage" - oncommand="document.getBindingParent(this).translate()"> - <xul:menupopup/> - </xul:menulist> - <xul:label class="translate-infobar-element" - value="&translation.translatedToSuffix.label;"/> - <xul:button anonid="showOriginal" - class="translate-infobar-element" - label="&translation.showOriginal.button;" - oncommand="document.getBindingParent(this).showOriginal();"/> - <xul:button anonid="showTranslation" - class="translate-infobar-element" - label="&translation.showTranslation.button;" - oncommand="document.getBindingParent(this).showTranslation();"/> - </xul:hbox> - - <!-- error --> - <xul:hbox class="translation-error" align="center"> - <xul:label class="translate-infobar-element" - value="&translation.errorTranslating.label;"/> - <xul:button class="translate-infobar-element" - label="&translation.tryAgain.button;" - anonid="tryAgain" - oncommand="document.getBindingParent(this).translate();"/> - </xul:hbox> - - <!-- unavailable --> - <xul:vbox class="translation-unavailable" pack="center"> - <xul:label class="translate-infobar-element" - value="&translation.serviceUnavailable.label;"/> - </xul:vbox> - - </xul:deck> - <xul:spacer flex="1"/> - - <xul:button type="menu" - class="translate-infobar-element options-menu-button" - anonid="options" - label="&translation.options.menu;"> - <xul:menupopup class="translation-menupopup cui-widget-panel cui-widget-panelview - cui-widget-panelWithFooter PanelUI-subView" - onpopupshowing="document.getBindingParent(this).optionsShowing();"> - <xul:menuitem anonid="neverForLanguage" - oncommand="document.getBindingParent(this).neverForLanguage();"/> - <xul:menuitem anonid="neverForSite" - oncommand="document.getBindingParent(this).neverForSite();" - label="&translation.options.neverForSite.label;" - accesskey="&translation.options.neverForSite.accesskey;"/> - <xul:menuseparator/> - <xul:menuitem oncommand="openPreferences('paneContent');" - label="&translation.options.preferences.label;" - accesskey="&translation.options.preferences.accesskey;"/> - <xul:menuitem class="subviewbutton panel-subview-footer" - oncommand="document.getBindingParent(this).openProviderAttribution();"> - <xul:deck anonid="translationEngine" selectedIndex="0"> - <xul:hbox class="translation-attribution"> - <xul:label>&translation.options.attribution.beforeLogo;</xul:label> - <xul:image src="chrome://browser/content/microsoft-translator-attribution.png" - aria-label="Microsoft Translator"/> - <xul:label>&translation.options.attribution.afterLogo;</xul:label> - </xul:hbox> - <xul:label class="translation-attribution">&translation.options.attribution.yandexTranslate;</xul:label> - </xul:deck> - </xul:menuitem> - </xul:menupopup> - </xul:button> - - </xul:hbox> - <xul:toolbarbutton ondblclick="event.stopPropagation();" - anonid="closeButton" - class="messageCloseButton close-icon tabbable" - xbl:inherits="hidden=hideclose" - tooltiptext="&closeNotification.tooltip;" - oncommand="document.getBindingParent(this).closeCommand();"/> - </xul:hbox> - </content> - <implementation> - <property name="state" - onget="return this._getAnonElt('translationStates').selectedIndex;"> - <setter> - <![CDATA[ - let deck = this._getAnonElt('translationStates'); - - let activeElt = document.activeElement; - if (activeElt && deck.contains(activeElt)) - activeElt.blur(); - - let stateName; - for (let name of ["OFFER", "TRANSLATING", "TRANSLATED", "ERROR"]) { - if (Translation["STATE_" + name] == val) { - stateName = name.toLowerCase(); - break; - } - } - this.setAttribute("state", stateName); - - if (val == Translation.STATE_TRANSLATED) - this._handleButtonHiding(); - - deck.selectedIndex = val; - ]]> - </setter> - </property> - - <method name="init"> - <parameter name="aTranslation"/> - <body> - <![CDATA[ - this.translation = aTranslation; - let bundle = Cc["@mozilla.org/intl/stringbundle;1"] - .getService(Ci.nsIStringBundleService) - .createBundle("chrome://global/locale/languageNames.properties"); - let sortByLocalizedName = function(aList) { - return aList.map(code => [code, bundle.GetStringFromName(code)]) - .sort((a, b) => a[1].localeCompare(b[1])); - }; - - // Fill the lists of supported source languages. - let detectedLanguage = this._getAnonElt("detectedLanguage"); - let fromLanguage = this._getAnonElt("fromLanguage"); - let sourceLanguages = - sortByLocalizedName(Translation.supportedSourceLanguages); - for (let [code, name] of sourceLanguages) { - detectedLanguage.appendItem(name, code); - fromLanguage.appendItem(name, code); - } - detectedLanguage.value = this.translation.detectedLanguage; - - // translatedFrom is only set if we have already translated this page. - if (aTranslation.translatedFrom) - fromLanguage.value = aTranslation.translatedFrom; - - // Fill the list of supported target languages. - let toLanguage = this._getAnonElt("toLanguage"); - let targetLanguages = - sortByLocalizedName(Translation.supportedTargetLanguages); - for (let [code, name] of targetLanguages) - toLanguage.appendItem(name, code); - - if (aTranslation.translatedTo) - toLanguage.value = aTranslation.translatedTo; - - if (aTranslation.state) - this.state = aTranslation.state; - - // Show attribution for the preferred translator. - let engineIndex = Object.keys(Translation.supportedEngines) - .indexOf(Translation.translationEngine); - if (engineIndex != -1) { - this._getAnonElt('translationEngine').selectedIndex = engineIndex; - } - - const kWelcomePref = "browser.translation.ui.welcomeMessageShown"; - if (Services.prefs.prefHasUserValue(kWelcomePref) || - this.translation.browser != gBrowser.selectedBrowser) - return; - - this.addEventListener("transitionend", function onShown() { - this.removeEventListener("transitionend", onShown); - - // These strings are hardcoded because they need to reach beta - // without riding the trains. - let localizedStrings = { - en: ["Hey look! It's something new!", - "Now the Web is even more accessible with our new in-page translation feature. Click the translate button to try it!", - "Learn more.", - "Thanks"], - "es-AR": ["\xA1Mir\xE1! \xA1Hay algo nuevo!", - "Ahora la web es a\xFAn m\xE1s accesible con nuestra nueva funcionalidad de traducci\xF3n integrada. \xA1Hac\xE9 clic en el bot\xF3n traducir para probarla!", - "Conoc\xE9 m\xE1s.", - "Gracias"], - "es-ES": ["\xA1Mira! \xA1Hay algo nuevo!", - "Con la nueva funcionalidad de traducci\xF3n integrada, ahora la Web es a\xFAn m\xE1s accesible. \xA1Pulsa el bot\xF3n Traducir y pru\xE9bala!", - "M\xE1s informaci\xF3n.", - "Gracias"], - pl: ["Sp\xF3jrz tutaj! To co\u015B nowego!", - "Sie\u0107 sta\u0142a si\u0119 w\u0142a\u015Bnie jeszcze bardziej dost\u0119pna dzi\u0119ki opcji bezpo\u015Bredniego t\u0142umaczenia stron. Kliknij przycisk t\u0142umaczenia, aby spr\xF3bowa\u0107!", - "Dowiedz si\u0119 wi\u0119cej", - "Dzi\u0119kuj\u0119"], - tr: ["Bak\u0131n, burada yeni bir \u015Fey var!", - "Yeni sayfa i\xE7i \xE7eviri \xF6zelli\u011Fimiz sayesinde Web art\u0131k \xE7ok daha anla\u015F\u0131l\u0131r olacak. Denemek i\xE7in \xC7evir d\xFC\u011Fmesine t\u0131klay\u0131n!", - "Daha fazla bilgi al\u0131n.", - "Te\u015Fekk\xFCrler"], - vi: ["Nh\xECn n\xE0y! \u0110\u1ED3 m\u1EDBi!", - "Gi\u1EDD \u0111\xE2y ch\xFAng ta c\xF3 th\u1EC3 ti\u1EBFp c\u1EADn web d\u1EC5 d\xE0ng h\u01A1n n\u1EEFa v\u1EDBi t\xEDnh n\u0103ng d\u1ECBch ngay trong trang. Hay nh\u1EA5n n\xFAt d\u1ECBch \u0111\u1EC3 th\u1EED!", - "T\xECm hi\u1EC3u th\xEAm.", - "C\u1EA3m \u01A1n"] - }; - - let locale = Cc["@mozilla.org/chrome/chrome-registry;1"] - .getService(Ci.nsIXULChromeRegistry) - .getSelectedLocale("browser"); - if (!(locale in localizedStrings)) - locale = "en"; - let strings = localizedStrings[locale]; - - this._getAnonElt("welcomeHeadline").setAttribute("value", strings[0]); - this._getAnonElt("welcomeBody").textContent = strings[1]; - this._getAnonElt("learnMore").setAttribute("value", strings[2]); - this._getAnonElt("thanksButton").setAttribute("label", strings[3]); - - let panel = this._getAnonElt("welcomePanel"); - panel.openPopup(this._getAnonElt("messageImage"), - "bottomcenter topleft"); - - Services.prefs.setBoolPref(kWelcomePref, true); - }); - ]]> - </body> - </method> - - <method name="_getAnonElt"> - <parameter name="aAnonId"/> - <body> - return document.getAnonymousElementByAttribute(this, "anonid", aAnonId); - </body> - </method> - - <method name="translate"> - <body> - <![CDATA[ - if (this.state == Translation.STATE_OFFER) { - this._getAnonElt("fromLanguage").value = - this._getAnonElt("detectedLanguage").value; - this._getAnonElt("toLanguage").value = - Translation.defaultTargetLanguage; - } - - this.translation.translate(this._getAnonElt("fromLanguage").value, - this._getAnonElt("toLanguage").value); - ]]> - </body> - </method> - - <!-- To be called when the infobar should be closed per user's wish (e.g. - by clicking the notification's close button --> - <method name="closeCommand"> - <body> - <![CDATA[ - this.close(); - this.translation.infobarClosed(); - ]]> - </body> - </method> - <method name="_handleButtonHiding"> - <body> - <![CDATA[ - let originalShown = this.translation.originalShown; - this._getAnonElt("showOriginal").hidden = originalShown; - this._getAnonElt("showTranslation").hidden = !originalShown; - ]]> - </body> - </method> - - <method name="showOriginal"> - <body> - <![CDATA[ - this.translation.showOriginalContent(); - this._handleButtonHiding(); - ]]> - </body> - </method> - - <method name="showTranslation"> - <body> - <![CDATA[ - this.translation.showTranslatedContent(); - this._handleButtonHiding(); - ]]> - </body> - </method> - - <method name="optionsShowing"> - <body> - <![CDATA[ - // Get the source language name. - let lang; - if (this.state == Translation.STATE_OFFER) - lang = this._getAnonElt("detectedLanguage").value; - else { - lang = this._getAnonElt("fromLanguage").value; - - // If we have never attempted to translate the page before the - // service became unavailable, "fromLanguage" isn't set. - if (!lang && this.state == Translation.STATE_UNAVAILABLE) - lang = this.translation.detectedLanguage; - } - - let langBundle = - Cc["@mozilla.org/intl/stringbundle;1"] - .getService(Ci.nsIStringBundleService) - .createBundle("chrome://global/locale/languageNames.properties"); - let langName = langBundle.GetStringFromName(lang); - - // Set the label and accesskey on the menuitem. - let bundle = - Cc["@mozilla.org/intl/stringbundle;1"] - .getService(Ci.nsIStringBundleService) - .createBundle("chrome://browser/locale/translation.properties"); - let item = this._getAnonElt("neverForLanguage"); - const kStrId = "translation.options.neverForLanguage"; - item.setAttribute("label", - bundle.formatStringFromName(kStrId + ".label", - [langName], 1)); - item.setAttribute("accesskey", - bundle.GetStringFromName(kStrId + ".accesskey")); - item.langCode = lang; - - // We may need to disable the menuitems if they have already been used. - // Check if translation is already disabled for this language: - let neverForLangs = - Services.prefs.getCharPref("browser.translation.neverForLanguages"); - item.disabled = neverForLangs.split(",").indexOf(lang) != -1; - - // Check if translation is disabled for the domain: - let uri = this.translation.browser.currentURI; - let perms = Services.perms; - item = this._getAnonElt("neverForSite"); - item.disabled = - perms.testExactPermission(uri, "translate") == perms.DENY_ACTION; - ]]> - </body> - </method> - - <method name="neverForLanguage"> - <body> - <![CDATA[ - const kPrefName = "browser.translation.neverForLanguages"; - - let val = Services.prefs.getCharPref(kPrefName); - if (val) - val += ","; - val += this._getAnonElt("neverForLanguage").langCode; - - Services.prefs.setCharPref(kPrefName, val); - - this.closeCommand(); - ]]> - </body> - </method> - - <method name="neverForSite"> - <body> - <![CDATA[ - let uri = this.translation.browser.currentURI; - let perms = Services.perms; - perms.add(uri, "translate", perms.DENY_ACTION); - - this.closeCommand(); - ]]> - </body> - </method> - - <method name="openProviderAttribution"> - <body> - <![CDATA[ - Translation.openProviderAttribution(); - ]]> - </body> - </method> - - </implementation> - </binding> -</bindings> diff --git a/application/basilisk/components/webextensions/.eslintrc.js b/application/basilisk/components/webextensions/.eslintrc.js deleted file mode 100644 index 81a11c4ac..000000000 --- a/application/basilisk/components/webextensions/.eslintrc.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; - -module.exports = { // eslint-disable-line no-undef - "extends": "../../../toolkit/components/extensions/.eslintrc.js", - - "globals": { - "AllWindowEvents": true, - "browserActionFor": true, - "currentWindow": true, - "EventEmitter": true, - "getCookieStoreIdForTab": true, - "IconDetails": true, - "makeWidgetId": true, - "pageActionFor": true, - "PanelPopup": true, - "TabContext": true, - "ViewPopup": true, - "WindowEventManager": true, - "WindowListManager": true, - "WindowManager": true, - }, -}; diff --git a/application/basilisk/components/webextensions/ext-bookmarks.js b/application/basilisk/components/webextensions/ext-bookmarks.js deleted file mode 100644 index 399f6212d..000000000 --- a/application/basilisk/components/webextensions/ext-bookmarks.js +++ /dev/null @@ -1,374 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); -const { - SingletonEventManager, -} = ExtensionUtils; - -XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter", - "resource://devtools/shared/event-emitter.js"); -XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", - "resource://gre/modules/PlacesUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Task", - "resource://gre/modules/Task.jsm"); - -let listenerCount = 0; - -function getTree(rootGuid, onlyChildren) { - function convert(node, parent) { - let treenode = { - id: node.guid, - title: node.title || "", - index: node.index, - dateAdded: node.dateAdded / 1000, - }; - - if (parent && node.guid != PlacesUtils.bookmarks.rootGuid) { - treenode.parentId = parent.guid; - } - - if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE) { - // This isn't quite correct. Recently Bookmarked ends up here ... - treenode.url = node.uri; - } else { - treenode.dateGroupModified = node.lastModified / 1000; - - if (node.children && !onlyChildren) { - treenode.children = node.children.map(child => convert(child, node)); - } - } - - return treenode; - } - - return PlacesUtils.promiseBookmarksTree(rootGuid, { - excludeItemsCallback: item => { - if (item.type == PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR) { - return true; - } - return item.annos && - item.annos.find(a => a.name == PlacesUtils.EXCLUDE_FROM_BACKUP_ANNO); - }, - }).then(root => { - if (onlyChildren) { - let children = root.children || []; - return children.map(child => convert(child, root)); - } - // It seems like the array always just contains the root node. - return [convert(root, null)]; - }).catch(e => Promise.reject({message: e.message})); -} - -function convert(result) { - let node = { - id: result.guid, - title: result.title || "", - index: result.index, - dateAdded: result.dateAdded.getTime(), - }; - - if (result.guid != PlacesUtils.bookmarks.rootGuid) { - node.parentId = result.parentGuid; - } - - if (result.type == PlacesUtils.bookmarks.TYPE_BOOKMARK) { - node.url = result.url.href; // Output is always URL object. - } else { - node.dateGroupModified = result.lastModified.getTime(); - } - - return node; -} - -let observer = { - skipTags: true, - skipDescendantsOnItemRemoval: true, - - onBeginUpdateBatch() {}, - onEndUpdateBatch() {}, - - onItemAdded(id, parentId, index, itemType, uri, title, dateAdded, guid, parentGuid, source) { - if (itemType == PlacesUtils.bookmarks.TYPE_SEPARATOR) { - return; - } - - let bookmark = { - id: guid, - parentId: parentGuid, - index, - title, - dateAdded: dateAdded / 1000, - }; - - if (itemType == PlacesUtils.bookmarks.TYPE_BOOKMARK) { - bookmark.url = uri.spec; - } else { - bookmark.dateGroupModified = bookmark.dateAdded; - } - - this.emit("created", bookmark); - }, - - onItemVisited() {}, - - onItemMoved(id, oldParentId, oldIndex, newParentId, newIndex, itemType, guid, oldParentGuid, newParentGuid, source) { - if (itemType == PlacesUtils.bookmarks.TYPE_SEPARATOR) { - return; - } - - let info = { - parentId: newParentGuid, - index: newIndex, - oldParentId: oldParentGuid, - oldIndex, - }; - this.emit("moved", {guid, info}); - }, - - onItemRemoved(id, parentId, index, itemType, uri, guid, parentGuid, source) { - if (itemType == PlacesUtils.bookmarks.TYPE_SEPARATOR) { - return; - } - - let node = { - id: guid, - parentId: parentGuid, - index, - }; - - if (itemType == PlacesUtils.bookmarks.TYPE_BOOKMARK) { - node.url = uri.spec; - } - - this.emit("removed", {guid, info: {parentId: parentGuid, index, node}}); - }, - - onItemChanged(id, prop, isAnno, val, lastMod, itemType, parentId, guid, parentGuid, oldVal, source) { - if (itemType == PlacesUtils.bookmarks.TYPE_SEPARATOR) { - return; - } - - let info = {}; - if (prop == "title") { - info.title = val; - } else if (prop == "uri") { - info.url = val; - } else { - // Not defined yet. - return; - } - - this.emit("changed", {guid, info}); - }, -}; -EventEmitter.decorate(observer); - -function decrementListeners() { - listenerCount -= 1; - if (!listenerCount) { - PlacesUtils.bookmarks.removeObserver(observer); - } -} - -function incrementListeners() { - listenerCount++; - if (listenerCount == 1) { - PlacesUtils.bookmarks.addObserver(observer, false); - } -} - -extensions.registerSchemaAPI("bookmarks", "addon_parent", context => { - return { - bookmarks: { - get: function(idOrIdList) { - let list = Array.isArray(idOrIdList) ? idOrIdList : [idOrIdList]; - - return Task.spawn(function* () { - let bookmarks = []; - for (let id of list) { - let bookmark = yield PlacesUtils.bookmarks.fetch({guid: id}); - if (!bookmark) { - throw new Error("Bookmark not found"); - } - bookmarks.push(convert(bookmark)); - } - return bookmarks; - }).catch(error => Promise.reject({message: error.message})); - }, - - getChildren: function(id) { - // TODO: We should optimize this. - return getTree(id, true); - }, - - getTree: function() { - return getTree(PlacesUtils.bookmarks.rootGuid, false); - }, - - getSubTree: function(id) { - return getTree(id, false); - }, - - search: function(query) { - return PlacesUtils.bookmarks.search(query).then(result => result.map(convert)); - }, - - getRecent: function(numberOfItems) { - return PlacesUtils.bookmarks.getRecent(numberOfItems).then(result => result.map(convert)); - }, - - create: function(bookmark) { - let info = { - title: bookmark.title || "", - }; - - // If url is NULL or missing, it will be a folder. - if (bookmark.url !== null) { - info.type = PlacesUtils.bookmarks.TYPE_BOOKMARK; - info.url = bookmark.url || ""; - } else { - info.type = PlacesUtils.bookmarks.TYPE_FOLDER; - } - - if (bookmark.index !== null) { - info.index = bookmark.index; - } - - if (bookmark.parentId !== null) { - info.parentGuid = bookmark.parentId; - } else { - info.parentGuid = PlacesUtils.bookmarks.unfiledGuid; - } - - try { - return PlacesUtils.bookmarks.insert(info).then(convert) - .catch(error => Promise.reject({message: error.message})); - } catch (e) { - return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`}); - } - }, - - move: function(id, destination) { - let info = { - guid: id, - }; - - if (destination.parentId !== null) { - info.parentGuid = destination.parentId; - } - info.index = (destination.index === null) ? - PlacesUtils.bookmarks.DEFAULT_INDEX : destination.index; - - try { - return PlacesUtils.bookmarks.update(info).then(convert) - .catch(error => Promise.reject({message: error.message})); - } catch (e) { - return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`}); - } - }, - - update: function(id, changes) { - let info = { - guid: id, - }; - - if (changes.title !== null) { - info.title = changes.title; - } - if (changes.url !== null) { - info.url = changes.url; - } - - try { - return PlacesUtils.bookmarks.update(info).then(convert) - .catch(error => Promise.reject({message: error.message})); - } catch (e) { - return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`}); - } - }, - - remove: function(id) { - let info = { - guid: id, - }; - - // The API doesn't give you the old bookmark at the moment - try { - return PlacesUtils.bookmarks.remove(info, {preventRemovalOfNonEmptyFolders: true}).then(result => {}) - .catch(error => Promise.reject({message: error.message})); - } catch (e) { - return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`}); - } - }, - - removeTree: function(id) { - let info = { - guid: id, - }; - - try { - return PlacesUtils.bookmarks.remove(info).then(result => {}) - .catch(error => Promise.reject({message: error.message})); - } catch (e) { - return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`}); - } - }, - - onCreated: new SingletonEventManager(context, "bookmarks.onCreated", fire => { - let listener = (event, bookmark) => { - context.runSafe(fire, bookmark.id, bookmark); - }; - - observer.on("created", listener); - incrementListeners(); - return () => { - observer.off("created", listener); - decrementListeners(); - }; - }).api(), - - onRemoved: new SingletonEventManager(context, "bookmarks.onRemoved", fire => { - let listener = (event, data) => { - context.runSafe(fire, data.guid, data.info); - }; - - observer.on("removed", listener); - incrementListeners(); - return () => { - observer.off("removed", listener); - decrementListeners(); - }; - }).api(), - - onChanged: new SingletonEventManager(context, "bookmarks.onChanged", fire => { - let listener = (event, data) => { - context.runSafe(fire, data.guid, data.info); - }; - - observer.on("changed", listener); - incrementListeners(); - return () => { - observer.off("changed", listener); - decrementListeners(); - }; - }).api(), - - onMoved: new SingletonEventManager(context, "bookmarks.onMoved", fire => { - let listener = (event, data) => { - context.runSafe(fire, data.guid, data.info); - }; - - observer.on("moved", listener); - incrementListeners(); - return () => { - observer.off("moved", listener); - decrementListeners(); - }; - }).api(), - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-browserAction.js b/application/basilisk/components/webextensions/ext-browserAction.js deleted file mode 100644 index 2c82ac701..000000000 --- a/application/basilisk/components/webextensions/ext-browserAction.js +++ /dev/null @@ -1,531 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI", - "resource:///modules/CustomizableUI.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout", - "resource://gre/modules/Timer.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "setTimeout", - "resource://gre/modules/Timer.jsm"); - -XPCOMUtils.defineLazyServiceGetter(this, "DOMUtils", - "@mozilla.org/inspector/dom-utils;1", - "inIDOMUtils"); - -Cu.import("resource://devtools/shared/event-emitter.js"); -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); - -var { - EventManager, - IconDetails, -} = ExtensionUtils; - -const POPUP_PRELOAD_TIMEOUT_MS = 200; - -const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; - -function isAncestorOrSelf(target, node) { - for (; node; node = node.parentNode) { - if (node === target) { - return true; - } - } - return false; -} - -// WeakMap[Extension -> BrowserAction] -var browserActionMap = new WeakMap(); - -// Responsible for the browser_action section of the manifest as well -// as the associated popup. -function BrowserAction(options, extension) { - this.extension = extension; - - let widgetId = makeWidgetId(extension.id); - this.id = `${widgetId}-browser-action`; - this.viewId = `PanelUI-webext-${widgetId}-browser-action-view`; - this.widget = null; - - this.pendingPopup = null; - this.pendingPopupTimeout = null; - - this.tabManager = TabManager.for(extension); - - this.defaults = { - enabled: true, - title: options.default_title || extension.name, - badgeText: "", - badgeBackgroundColor: null, - icon: IconDetails.normalize({path: options.default_icon}, extension), - popup: options.default_popup || "", - }; - - this.browserStyle = options.browser_style || false; - if (options.browser_style === null) { - this.extension.logger.warn("Please specify whether you want browser_style " + - "or not in your browser_action options."); - } - - this.tabContext = new TabContext(tab => Object.create(this.defaults), - extension); - - EventEmitter.decorate(this); -} - -BrowserAction.prototype = { - build() { - let widget = CustomizableUI.createWidget({ - id: this.id, - viewId: this.viewId, - type: "view", - removable: true, - label: this.defaults.title || this.extension.name, - tooltiptext: this.defaults.title || "", - defaultArea: CustomizableUI.AREA_NAVBAR, - - onBeforeCreated: document => { - let view = document.createElementNS(XUL_NS, "panelview"); - view.id = this.viewId; - view.setAttribute("flex", "1"); - - document.getElementById("PanelUI-multiView").appendChild(view); - }, - - onDestroyed: document => { - let view = document.getElementById(this.viewId); - if (view) { - this.clearPopup(); - CustomizableUI.hidePanelForNode(view); - view.remove(); - } - }, - - onCreated: node => { - node.classList.add("badged-button"); - node.classList.add("webextension-browser-action"); - node.setAttribute("constrain-size", "true"); - - node.onmousedown = event => this.handleEvent(event); - - this.updateButton(node, this.defaults); - }, - - onViewShowing: event => { - let document = event.target.ownerDocument; - let tabbrowser = document.defaultView.gBrowser; - - let tab = tabbrowser.selectedTab; - let popupURL = this.getProperty(tab, "popup"); - this.tabManager.addActiveTabPermission(tab); - - // Popups are shown only if a popup URL is defined; otherwise - // a "click" event is dispatched. This is done for compatibility with the - // Google Chrome onClicked extension API. - if (popupURL) { - try { - let popup = this.getPopup(document.defaultView, popupURL); - event.detail.addBlocker(popup.attach(event.target)); - } catch (e) { - Cu.reportError(e); - event.preventDefault(); - } - } else { - // This isn't not a hack, but it seems to provide the correct behavior - // with the fewest complications. - event.preventDefault(); - this.emit("click"); - } - }, - }); - - this.tabContext.on("tab-select", // eslint-disable-line mozilla/balanced-listeners - (evt, tab) => { this.updateWindow(tab.ownerGlobal); }); - - this.widget = widget; - }, - - /** - * Triggers this browser action for the given window, with the same effects as - * if it were clicked by a user. - * - * This has no effect if the browser action is disabled for, or not - * present in, the given window. - */ - triggerAction: Task.async(function* (window) { - let popup = ViewPopup.for(this.extension, window); - if (popup) { - popup.closePopup(); - return; - } - - let widget = this.widget.forWindow(window); - let tab = window.gBrowser.selectedTab; - - if (!widget || !this.getProperty(tab, "enabled")) { - return; - } - - // Popups are shown only if a popup URL is defined; otherwise - // a "click" event is dispatched. This is done for compatibility with the - // Google Chrome onClicked extension API. - if (this.getProperty(tab, "popup")) { - if (this.widget.areaType == CustomizableUI.TYPE_MENU_PANEL) { - yield window.PanelUI.show(); - } - - let event = new window.CustomEvent("command", {bubbles: true, cancelable: true}); - widget.node.dispatchEvent(event); - } else { - this.emit("click"); - } - }), - - handleEvent(event) { - let button = event.target; - let window = button.ownerDocument.defaultView; - - switch (event.type) { - case "mousedown": - if (event.button == 0) { - // Begin pre-loading the browser for the popup, so it's more likely to - // be ready by the time we get a complete click. - let tab = window.gBrowser.selectedTab; - let popupURL = this.getProperty(tab, "popup"); - let enabled = this.getProperty(tab, "enabled"); - - if (popupURL && enabled) { - // Add permission for the active tab so it will exist for the popup. - // Store the tab to revoke the permission during clearPopup. - if (!this.pendingPopup && !this.tabManager.hasActiveTabPermission(tab)) { - this.tabManager.addActiveTabPermission(tab); - this.tabToRevokeDuringClearPopup = tab; - } - - this.pendingPopup = this.getPopup(window, popupURL); - window.addEventListener("mouseup", this, true); - } else { - this.clearPopup(); - } - } - break; - - case "mouseup": - if (event.button == 0) { - this.clearPopupTimeout(); - // If we have a pending pre-loaded popup, cancel it after we've waited - // long enough that we can be relatively certain it won't be opening. - if (this.pendingPopup) { - let {node} = this.widget.forWindow(window); - if (isAncestorOrSelf(node, event.originalTarget)) { - this.pendingPopupTimeout = setTimeout(() => this.clearPopup(), - POPUP_PRELOAD_TIMEOUT_MS); - } else { - this.clearPopup(); - } - } - } - break; - } - }, - - /** - * Returns a potentially pre-loaded popup for the given URL in the given - * window. If a matching pre-load popup already exists, returns that. - * Otherwise, initializes a new one. - * - * If a pre-load popup exists which does not match, it is destroyed before a - * new one is created. - * - * @param {Window} window - * The browser window in which to create the popup. - * @param {string} popupURL - * The URL to load into the popup. - * @returns {ViewPopup} - */ - getPopup(window, popupURL) { - this.clearPopupTimeout(); - let {pendingPopup} = this; - this.pendingPopup = null; - - if (pendingPopup) { - if (pendingPopup.window === window && pendingPopup.popupURL === popupURL) { - return pendingPopup; - } - pendingPopup.destroy(); - } - - let fixedWidth = this.widget.areaType == CustomizableUI.TYPE_MENU_PANEL; - return new ViewPopup(this.extension, window, popupURL, this.browserStyle, fixedWidth); - }, - - /** - * Clears any pending pre-loaded popup and related timeouts. - */ - clearPopup() { - this.clearPopupTimeout(); - if (this.pendingPopup) { - if (this.tabToRevokeDuringClearPopup) { - this.tabManager.revokeActiveTabPermission(this.tabToRevokeDuringClearPopup); - this.tabToRevokeDuringClearPopup = null; - } - this.pendingPopup.destroy(); - this.pendingPopup = null; - } - }, - - /** - * Clears any pending timeouts to clear stale, pre-loaded popups. - */ - clearPopupTimeout() { - if (this.pendingPopup) { - this.pendingPopup.window.removeEventListener("mouseup", this, true); - } - - if (this.pendingPopupTimeout) { - clearTimeout(this.pendingPopupTimeout); - this.pendingPopupTimeout = null; - } - }, - - // Update the toolbar button |node| with the tab context data - // in |tabData|. - updateButton(node, tabData) { - let title = tabData.title || this.extension.name; - node.setAttribute("tooltiptext", title); - node.setAttribute("label", title); - - if (tabData.badgeText) { - node.setAttribute("badge", tabData.badgeText); - } else { - node.removeAttribute("badge"); - } - - if (tabData.enabled) { - node.removeAttribute("disabled"); - } else { - node.setAttribute("disabled", "true"); - } - - let badgeNode = node.ownerDocument.getAnonymousElementByAttribute(node, - "class", "toolbarbutton-badge"); - if (badgeNode) { - let color = tabData.badgeBackgroundColor; - if (color) { - color = `rgba(${color[0]}, ${color[1]}, ${color[2]}, ${color[3] / 255})`; - } - badgeNode.style.backgroundColor = color || ""; - } - - const LEGACY_CLASS = "toolbarbutton-legacy-addon"; - node.classList.remove(LEGACY_CLASS); - - let baseSize = 16; - let {icon, size} = IconDetails.getPreferredIcon(tabData.icon, this.extension, baseSize); - - // If the best available icon size is not divisible by 16, check if we have - // an 18px icon to fall back to, and trim off the padding instead. - if (size % 16 && !icon.endsWith(".svg")) { - let result = IconDetails.getPreferredIcon(tabData.icon, this.extension, 18); - - if (result.size % 18 == 0) { - baseSize = 18; - icon = result.icon; - node.classList.add(LEGACY_CLASS); - } - } - - // These URLs should already be properly escaped, but make doubly sure CSS - // string escape characters are escaped here, since they could lead to a - // sandbox break. - let escape = str => str.replace(/[\\\s"]/g, encodeURIComponent); - - let getIcon = size => escape(IconDetails.getPreferredIcon(tabData.icon, this.extension, size).icon); - - node.setAttribute("style", ` - --webextension-menupanel-image: url("${getIcon(32)}"); - --webextension-menupanel-image-2x: url("${getIcon(64)}"); - --webextension-toolbar-image: url("${escape(icon)}"); - --webextension-toolbar-image-2x: url("${getIcon(baseSize * 2)}"); - `); - }, - - // Update the toolbar button for a given window. - updateWindow(window) { - let widget = this.widget.forWindow(window); - if (widget) { - let tab = window.gBrowser.selectedTab; - this.updateButton(widget.node, this.tabContext.get(tab)); - } - }, - - // Update the toolbar button when the extension changes the icon, - // title, badge, etc. If it only changes a parameter for a single - // tab, |tab| will be that tab. Otherwise it will be null. - updateOnChange(tab) { - if (tab) { - if (tab.selected) { - this.updateWindow(tab.ownerGlobal); - } - } else { - for (let window of WindowListManager.browserWindows()) { - this.updateWindow(window); - } - } - }, - - // tab is allowed to be null. - // prop should be one of "icon", "title", "badgeText", "popup", or "badgeBackgroundColor". - setProperty(tab, prop, value) { - if (tab == null) { - this.defaults[prop] = value; - } else if (value != null) { - this.tabContext.get(tab)[prop] = value; - } else { - delete this.tabContext.get(tab)[prop]; - } - - this.updateOnChange(tab); - }, - - // tab is allowed to be null. - // prop should be one of "title", "badgeText", "popup", or "badgeBackgroundColor". - getProperty(tab, prop) { - if (tab == null) { - return this.defaults[prop]; - } - return this.tabContext.get(tab)[prop]; - }, - - shutdown() { - this.tabContext.shutdown(); - CustomizableUI.destroyWidget(this.id); - }, -}; - -BrowserAction.for = (extension) => { - return browserActionMap.get(extension); -}; - -global.browserActionFor = BrowserAction.for; - -/* eslint-disable mozilla/balanced-listeners */ -extensions.on("manifest_browser_action", (type, directive, extension, manifest) => { - let browserAction = new BrowserAction(manifest.browser_action, extension); - browserAction.build(); - browserActionMap.set(extension, browserAction); -}); - -extensions.on("shutdown", (type, extension) => { - if (browserActionMap.has(extension)) { - browserActionMap.get(extension).shutdown(); - browserActionMap.delete(extension); - } -}); -/* eslint-enable mozilla/balanced-listeners */ - -extensions.registerSchemaAPI("browserAction", "addon_parent", context => { - let {extension} = context; - return { - browserAction: { - onClicked: new EventManager(context, "browserAction.onClicked", fire => { - let listener = () => { - let tab = TabManager.activeTab; - fire(TabManager.convert(extension, tab)); - }; - BrowserAction.for(extension).on("click", listener); - return () => { - BrowserAction.for(extension).off("click", listener); - }; - }).api(), - - enable: function(tabId) { - let tab = tabId !== null ? TabManager.getTab(tabId, context) : null; - BrowserAction.for(extension).setProperty(tab, "enabled", true); - }, - - disable: function(tabId) { - let tab = tabId !== null ? TabManager.getTab(tabId, context) : null; - BrowserAction.for(extension).setProperty(tab, "enabled", false); - }, - - setTitle: function(details) { - let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null; - - let title = details.title; - // Clear the tab-specific title when given a null string. - if (tab && title == "") { - title = null; - } - BrowserAction.for(extension).setProperty(tab, "title", title); - }, - - getTitle: function(details) { - let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null; - - let title = BrowserAction.for(extension).getProperty(tab, "title"); - return Promise.resolve(title); - }, - - setIcon: function(details) { - let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null; - - let icon = IconDetails.normalize(details, extension, context); - BrowserAction.for(extension).setProperty(tab, "icon", icon); - }, - - setBadgeText: function(details) { - let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null; - - BrowserAction.for(extension).setProperty(tab, "badgeText", details.text); - }, - - getBadgeText: function(details) { - let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null; - - let text = BrowserAction.for(extension).getProperty(tab, "badgeText"); - return Promise.resolve(text); - }, - - setPopup: function(details) { - let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null; - - // Note: Chrome resolves arguments to setIcon relative to the calling - // context, but resolves arguments to setPopup relative to the extension - // root. - // For internal consistency, we currently resolve both relative to the - // calling context. - let url = details.popup && context.uri.resolve(details.popup); - if (url && !context.checkLoadURL(url)) { - return Promise.reject({message: `Access denied for URL ${url}`}); - } - BrowserAction.for(extension).setProperty(tab, "popup", url); - }, - - getPopup: function(details) { - let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null; - - let popup = BrowserAction.for(extension).getProperty(tab, "popup"); - return Promise.resolve(popup); - }, - - setBadgeBackgroundColor: function(details) { - let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null; - let color = details.color; - if (!Array.isArray(color)) { - let col = DOMUtils.colorToRGBA(color); - color = col && [col.r, col.g, col.b, Math.round(col.a * 255)]; - } - BrowserAction.for(extension).setProperty(tab, "badgeBackgroundColor", color); - }, - - getBadgeBackgroundColor: function(details, callback) { - let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null; - - let color = BrowserAction.for(extension).getProperty(tab, "badgeBackgroundColor"); - return Promise.resolve(color || [0xd9, 0, 0, 255]); - }, - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-c-contextMenus.js b/application/basilisk/components/webextensions/ext-c-contextMenus.js deleted file mode 100644 index 9fde90808..000000000 --- a/application/basilisk/components/webextensions/ext-c-contextMenus.js +++ /dev/null @@ -1,158 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -// If id is not specified for an item we use an integer. -// This ID need only be unique within a single addon. Since all addon code that -// can use this API runs in the same process, this local variable suffices. -var gNextMenuItemID = 0; - -// Map[Extension -> Map[string or id, ContextMenusClickPropHandler]] -var gPropHandlers = new Map(); - -// The contextMenus API supports an "onclick" attribute in the create/update -// methods to register a callback. This class manages these onclick properties. -class ContextMenusClickPropHandler { - constructor(context) { - this.context = context; - // Map[string or integer -> callback] - this.onclickMap = new Map(); - this.dispatchEvent = this.dispatchEvent.bind(this); - } - - // A listener on contextMenus.onClicked that forwards the event to the only - // listener, if any. - dispatchEvent(info, tab) { - let onclick = this.onclickMap.get(info.menuItemId); - if (onclick) { - // No need for runSafe or anything because we are already being run inside - // an event handler -- the event is just being forwarded to the actual - // handler. - onclick(info, tab); - } - } - - // Sets the `onclick` handler for the given menu item. - // The `onclick` function MUST be owned by `this.context`. - setListener(id, onclick) { - if (this.onclickMap.size === 0) { - this.context.childManager.getParentEvent("contextMenus.onClicked").addListener(this.dispatchEvent); - this.context.callOnClose(this); - } - this.onclickMap.set(id, onclick); - - let propHandlerMap = gPropHandlers.get(this.context.extension); - if (!propHandlerMap) { - propHandlerMap = new Map(); - } else { - // If the current callback was created in a different context, remove it - // from the other context. - let propHandler = propHandlerMap.get(id); - if (propHandler && propHandler !== this) { - propHandler.unsetListener(id); - } - } - propHandlerMap.set(id, this); - gPropHandlers.set(this.context.extension, propHandlerMap); - } - - // Deletes the `onclick` handler for the given menu item. - // The `onclick` function MUST be owned by `this.context`. - unsetListener(id) { - if (!this.onclickMap.delete(id)) { - return; - } - if (this.onclickMap.size === 0) { - this.context.childManager.getParentEvent("contextMenus.onClicked").removeListener(this.dispatchEvent); - this.context.forgetOnClose(this); - } - let propHandlerMap = gPropHandlers.get(this.context.extension); - propHandlerMap.delete(id); - if (propHandlerMap.size === 0) { - gPropHandlers.delete(this.context.extension); - } - } - - // Deletes the `onclick` handler for the given menu item, if any, regardless - // of the context where it was created. - unsetListenerFromAnyContext(id) { - let propHandlerMap = gPropHandlers.get(this.context.extension); - let propHandler = propHandlerMap && propHandlerMap.get(id); - if (propHandler) { - propHandler.unsetListener(id); - } - } - - // Remove all `onclick` handlers of the extension. - deleteAllListenersFromExtension() { - let propHandlerMap = gPropHandlers.get(this.context.extension); - if (propHandlerMap) { - for (let [id, propHandler] of propHandlerMap) { - propHandler.unsetListener(id); - } - } - } - - // Removes all `onclick` handlers from this context. - close() { - for (let id of this.onclickMap.keys()) { - this.unsetListener(id); - } - } -} - -extensions.registerSchemaAPI("contextMenus", "addon_child", context => { - let onClickedProp = new ContextMenusClickPropHandler(context); - - return { - contextMenus: { - create(createProperties, callback) { - if (createProperties.id === null) { - createProperties.id = ++gNextMenuItemID; - } - let {onclick} = createProperties; - delete createProperties.onclick; - context.childManager.callParentAsyncFunction("contextMenus.createInternal", [ - createProperties, - ]).then(() => { - if (onclick) { - onClickedProp.setListener(createProperties.id, onclick); - } - if (callback) { - callback(); - } - }); - return createProperties.id; - }, - - update(id, updateProperties) { - let {onclick} = updateProperties; - delete updateProperties.onclick; - return context.childManager.callParentAsyncFunction("contextMenus.update", [ - id, - updateProperties, - ]).then(() => { - if (onclick) { - onClickedProp.setListener(id, onclick); - } else if (onclick === null) { - onClickedProp.unsetListenerFromAnyContext(id); - } - // else onclick is not set so it should not be changed. - }); - }, - - remove(id) { - onClickedProp.unsetListenerFromAnyContext(id); - return context.childManager.callParentAsyncFunction("contextMenus.remove", [ - id, - ]); - }, - - removeAll() { - onClickedProp.deleteAllListenersFromExtension(); - - return context.childManager.callParentAsyncFunction("contextMenus.removeAll", []); - }, - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-c-omnibox.js b/application/basilisk/components/webextensions/ext-c-omnibox.js deleted file mode 100644 index 3b9b6e2f7..000000000 --- a/application/basilisk/components/webextensions/ext-c-omnibox.js +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); - -var { - runSafeSyncWithoutClone, - SingletonEventManager, -} = ExtensionUtils; - -extensions.registerSchemaAPI("omnibox", "addon_child", context => { - return { - omnibox: { - onInputChanged: new SingletonEventManager(context, "omnibox.onInputChanged", fire => { - let listener = (text, id) => { - runSafeSyncWithoutClone(fire, text, suggestions => { - // TODO: Switch to using callParentFunctionNoReturn once bug 1314903 is fixed. - context.childManager.callParentAsyncFunction("omnibox_internal.addSuggestions", [ - id, - suggestions, - ]); - }); - }; - context.childManager.getParentEvent("omnibox_internal.onInputChanged").addListener(listener); - return () => { - context.childManager.getParentEvent("omnibox_internal.onInputChanged").removeListener(listener); - }; - }).api(), - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-c-tabs.js b/application/basilisk/components/webextensions/ext-c-tabs.js deleted file mode 100644 index d5ce9fbf9..000000000 --- a/application/basilisk/components/webextensions/ext-c-tabs.js +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -extensions.registerSchemaAPI("tabs", "addon_child", context => { - return { - tabs: { - connect: function(tabId, connectInfo) { - let name = ""; - if (connectInfo && connectInfo.name !== null) { - name = connectInfo.name; - } - let recipient = { - extensionId: context.extension.id, - tabId, - }; - if (connectInfo && connectInfo.frameId !== null) { - recipient.frameId = connectInfo.frameId; - } - return context.messenger.connect(context.messageManager, name, recipient); - }, - - sendMessage: function(tabId, message, options, responseCallback) { - let recipient = { - extensionId: context.extension.id, - tabId: tabId, - }; - if (options && options.frameId !== null) { - recipient.frameId = options.frameId; - } - return context.messenger.sendMessage(context.messageManager, message, recipient, responseCallback); - }, - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-commands.js b/application/basilisk/components/webextensions/ext-commands.js deleted file mode 100644 index b6e7ab3d1..000000000 --- a/application/basilisk/components/webextensions/ext-commands.js +++ /dev/null @@ -1,264 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -Cu.import("resource://devtools/shared/event-emitter.js"); -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); - -var { - EventManager, - PlatformInfo, -} = ExtensionUtils; - -const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; - -// WeakMap[Extension -> CommandList] -var commandsMap = new WeakMap(); - -function CommandList(manifest, extension) { - this.extension = extension; - this.id = makeWidgetId(extension.id); - this.windowOpenListener = null; - - // Map[{String} commandName -> {Object} commandProperties] - this.commands = this.loadCommandsFromManifest(manifest); - - // WeakMap[Window -> <xul:keyset>] - this.keysetsMap = new WeakMap(); - - this.register(); - EventEmitter.decorate(this); -} - -CommandList.prototype = { - /** - * Registers the commands to all open windows and to any which - * are later created. - */ - register() { - for (let window of WindowListManager.browserWindows()) { - this.registerKeysToDocument(window); - } - - this.windowOpenListener = (window) => { - if (!this.keysetsMap.has(window)) { - this.registerKeysToDocument(window); - } - }; - - WindowListManager.addOpenListener(this.windowOpenListener); - }, - - /** - * Unregisters the commands from all open windows and stops commands - * from being registered to windows which are later created. - */ - unregister() { - for (let window of WindowListManager.browserWindows()) { - if (this.keysetsMap.has(window)) { - this.keysetsMap.get(window).remove(); - } - } - - WindowListManager.removeOpenListener(this.windowOpenListener); - }, - - /** - * Creates a Map from commands for each command in the manifest.commands object. - * - * @param {Object} manifest The manifest JSON object. - * @returns {Map<string, object>} - */ - loadCommandsFromManifest(manifest) { - let commands = new Map(); - // For Windows, chrome.runtime expects 'win' while chrome.commands - // expects 'windows'. We can special case this for now. - let os = PlatformInfo.os == "win" ? "windows" : PlatformInfo.os; - for (let [name, command] of Object.entries(manifest.commands)) { - let suggested_key = command.suggested_key || {}; - let shortcut = suggested_key[os] || suggested_key.default; - shortcut = shortcut ? shortcut.replace(/\s+/g, "") : null; - commands.set(name, { - description: command.description, - shortcut, - }); - } - return commands; - }, - - /** - * Registers the commands to a document. - * @param {ChromeWindow} window The XUL window to insert the Keyset. - */ - registerKeysToDocument(window) { - let doc = window.document; - let keyset = doc.createElementNS(XUL_NS, "keyset"); - keyset.id = `ext-keyset-id-${this.id}`; - this.commands.forEach((command, name) => { - if (command.shortcut) { - let keyElement = this.buildKey(doc, name, command.shortcut); - keyset.appendChild(keyElement); - } - }); - doc.documentElement.appendChild(keyset); - this.keysetsMap.set(window, keyset); - }, - - /** - * Builds a XUL Key element and attaches an onCommand listener which - * emits a command event with the provided name when fired. - * - * @param {Document} doc The XUL document. - * @param {string} name The name of the command. - * @param {string} shortcut The shortcut provided in the manifest. - * @see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/key - * - * @returns {Document} The newly created Key element. - */ - buildKey(doc, name, shortcut) { - let keyElement = this.buildKeyFromShortcut(doc, shortcut); - - // We need to have the attribute "oncommand" for the "command" listener to fire, - // and it is currently ignored when set to the empty string. - keyElement.setAttribute("oncommand", "//"); - - /* eslint-disable mozilla/balanced-listeners */ - // We remove all references to the key elements when the extension is shutdown, - // therefore the listeners for these elements will be garbage collected. - keyElement.addEventListener("command", (event) => { - if (name == "_execute_page_action") { - let win = event.target.ownerDocument.defaultView; - pageActionFor(this.extension).triggerAction(win); - } else if (name == "_execute_browser_action") { - let win = event.target.ownerDocument.defaultView; - browserActionFor(this.extension).triggerAction(win); - } else { - TabManager.for(this.extension) - .addActiveTabPermission(TabManager.activeTab); - this.emit("command", name); - } - }); - /* eslint-enable mozilla/balanced-listeners */ - - return keyElement; - }, - - /** - * Builds a XUL Key element from the provided shortcut. - * - * @param {Document} doc The XUL document. - * @param {string} shortcut The shortcut provided in the manifest. - * - * @see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/key - * @returns {Document} The newly created Key element. - */ - buildKeyFromShortcut(doc, shortcut) { - let keyElement = doc.createElementNS(XUL_NS, "key"); - - let parts = shortcut.split("+"); - - // The key is always the last element. - let chromeKey = parts.pop(); - - // The modifiers are the remaining elements. - keyElement.setAttribute("modifiers", this.getModifiersAttribute(parts)); - - if (/^[A-Z]$/.test(chromeKey)) { - // We use the key attribute for all single digits and characters. - keyElement.setAttribute("key", chromeKey); - } else { - keyElement.setAttribute("keycode", this.getKeycodeAttribute(chromeKey)); - keyElement.setAttribute("event", "keydown"); - } - - return keyElement; - }, - - /** - * Determines the corresponding XUL keycode from the given chrome key. - * - * For example: - * - * input | output - * --------------------------------------- - * "PageUP" | "VK_PAGE_UP" - * "Delete" | "VK_DELETE" - * - * @param {string} chromeKey The chrome key (e.g. "PageUp", "Space", ...) - * @returns {string} The constructed value for the Key's 'keycode' attribute. - */ - getKeycodeAttribute(chromeKey) { - if (/[0-9]/.test(chromeKey)) { - return `VK_${chromeKey}`; - } - return `VK${chromeKey.replace(/([A-Z])/g, "_$&").toUpperCase()}`; - }, - - /** - * Determines the corresponding XUL modifiers from the chrome modifiers. - * - * For example: - * - * input | output - * --------------------------------------- - * ["Ctrl", "Shift"] | "accel shift" - * ["MacCtrl"] | "control" - * - * @param {Array} chromeModifiers The array of chrome modifiers. - * @returns {string} The constructed value for the Key's 'modifiers' attribute. - */ - getModifiersAttribute(chromeModifiers) { - let modifiersMap = { - "Alt": "alt", - "Command": "accel", - "Ctrl": "accel", - "MacCtrl": "control", - "Shift": "shift", - }; - return Array.from(chromeModifiers, modifier => { - return modifiersMap[modifier]; - }).join(" "); - }, -}; - - -/* eslint-disable mozilla/balanced-listeners */ -extensions.on("manifest_commands", (type, directive, extension, manifest) => { - commandsMap.set(extension, new CommandList(manifest, extension)); -}); - -extensions.on("shutdown", (type, extension) => { - let commandsList = commandsMap.get(extension); - if (commandsList) { - commandsList.unregister(); - commandsMap.delete(extension); - } -}); -/* eslint-enable mozilla/balanced-listeners */ - -extensions.registerSchemaAPI("commands", "addon_parent", context => { - let {extension} = context; - return { - commands: { - getAll() { - let commands = commandsMap.get(extension).commands; - return Promise.resolve(Array.from(commands, ([name, command]) => { - return ({ - name, - description: command.description, - shortcut: command.shortcut, - }); - })); - }, - onCommand: new EventManager(context, "commands.onCommand", fire => { - let listener = (eventName, commandName) => { - fire(commandName); - }; - commandsMap.get(extension).on("command", listener); - return () => { - commandsMap.get(extension).off("command", listener); - }; - }).api(), - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-contextMenus.js b/application/basilisk/components/webextensions/ext-contextMenus.js deleted file mode 100644 index b3bf8aa53..000000000 --- a/application/basilisk/components/webextensions/ext-contextMenus.js +++ /dev/null @@ -1,537 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); -Cu.import("resource://gre/modules/MatchPattern.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); - -var { - EventManager, - ExtensionError, - IconDetails, -} = ExtensionUtils; - -// Map[Extension -> Map[ID -> MenuItem]] -// Note: we want to enumerate all the menu items so -// this cannot be a weak map. -var gContextMenuMap = new Map(); - -// Map[Extension -> MenuItem] -var gRootItems = new Map(); - -// If id is not specified for an item we use an integer. -var gNextMenuItemID = 0; - -// Used to assign unique names to radio groups. -var gNextRadioGroupID = 0; - -// The max length of a menu item's label. -var gMaxLabelLength = 64; - -// When a new contextMenu is opened, this function is called and -// we populate the |xulMenu| with all the items from extensions -// to be displayed. We always clear all the items again when -// popuphidden fires. -var gMenuBuilder = { - build: function(contextData) { - let xulMenu = contextData.menu; - xulMenu.addEventListener("popuphidden", this); - this.xulMenu = xulMenu; - for (let [, root] of gRootItems) { - let rootElement = this.buildElementWithChildren(root, contextData); - if (!rootElement.firstChild || !rootElement.firstChild.childNodes.length) { - // If the root has no visible children, there is no reason to show - // the root menu item itself either. - continue; - } - rootElement.setAttribute("ext-type", "top-level-menu"); - rootElement = this.removeTopLevelMenuIfNeeded(rootElement); - - // Display the extension icon on the root element. - if (root.extension.manifest.icons) { - let parentWindow = contextData.menu.ownerGlobal; - let extension = root.extension; - - let {icon} = IconDetails.getPreferredIcon(extension.manifest.icons, extension, - 16 * parentWindow.devicePixelRatio); - - // The extension icons in the manifest are not pre-resolved, since - // they're sometimes used by the add-on manager when the extension is - // not enabled, and its URLs are not resolvable. - let resolvedURL = root.extension.baseURI.resolve(icon); - - if (rootElement.localName == "menu") { - rootElement.setAttribute("class", "menu-iconic"); - } else if (rootElement.localName == "menuitem") { - rootElement.setAttribute("class", "menuitem-iconic"); - } - rootElement.setAttribute("image", resolvedURL); - } - - xulMenu.appendChild(rootElement); - this.itemsToCleanUp.add(rootElement); - } - }, - - buildElementWithChildren(item, contextData) { - let element = this.buildSingleElement(item, contextData); - let groupName; - for (let child of item.children) { - if (child.type == "radio" && !child.groupName) { - if (!groupName) { - groupName = `webext-radio-group-${gNextRadioGroupID++}`; - } - child.groupName = groupName; - } else { - groupName = null; - } - - if (child.enabledForContext(contextData)) { - let childElement = this.buildElementWithChildren(child, contextData); - // Here element must be a menu element and its first child - // is a menupopup, we have to append its children to this - // menupopup. - element.firstChild.appendChild(childElement); - } - } - - return element; - }, - - removeTopLevelMenuIfNeeded(element) { - // If there is only one visible top level element we don't need the - // root menu element for the extension. - let menuPopup = element.firstChild; - if (menuPopup && menuPopup.childNodes.length == 1) { - let onlyChild = menuPopup.firstChild; - onlyChild.remove(); - return onlyChild; - } - - return element; - }, - - buildSingleElement(item, contextData) { - let doc = contextData.menu.ownerDocument; - let element; - if (item.children.length > 0) { - element = this.createMenuElement(doc, item); - } else if (item.type == "separator") { - element = doc.createElement("menuseparator"); - } else { - element = doc.createElement("menuitem"); - } - - return this.customizeElement(element, item, contextData); - }, - - createMenuElement(doc, item) { - let element = doc.createElement("menu"); - // Menu elements need to have a menupopup child for its menu items. - let menupopup = doc.createElement("menupopup"); - element.appendChild(menupopup); - return element; - }, - - customizeElement(element, item, contextData) { - let label = item.title; - if (label) { - if (contextData.isTextSelected && label.indexOf("%s") > -1) { - let selection = contextData.selectionText; - // The rendering engine will truncate the title if it's longer than 64 characters. - // But if it makes sense let's try truncate selection text only, to handle cases like - // 'look up "%s" in MyDictionary' more elegantly. - let maxSelectionLength = gMaxLabelLength - label.length + 2; - if (maxSelectionLength > 4) { - selection = selection.substring(0, maxSelectionLength - 3) + "..."; - } - label = label.replace(/%s/g, selection); - } - - element.setAttribute("label", label); - } - - if (item.type == "checkbox") { - element.setAttribute("type", "checkbox"); - if (item.checked) { - element.setAttribute("checked", "true"); - } - } else if (item.type == "radio") { - element.setAttribute("type", "radio"); - element.setAttribute("name", item.groupName); - if (item.checked) { - element.setAttribute("checked", "true"); - } - } - - if (!item.enabled) { - element.setAttribute("disabled", "true"); - } - - element.addEventListener("command", event => { // eslint-disable-line mozilla/balanced-listeners - if (event.target !== event.currentTarget) { - return; - } - const wasChecked = item.checked; - if (item.type == "checkbox") { - item.checked = !item.checked; - } else if (item.type == "radio") { - // Deselect all radio items in the current radio group. - for (let child of item.parent.children) { - if (child.type == "radio" && child.groupName == item.groupName) { - child.checked = false; - } - } - // Select the clicked radio item. - item.checked = true; - } - - item.tabManager.addActiveTabPermission(); - - let tab = item.tabManager.convert(contextData.tab); - let info = item.getClickInfo(contextData, wasChecked); - item.extension.emit("webext-contextmenu-menuitem-click", info, tab); - }); - - return element; - }, - - handleEvent: function(event) { - if (this.xulMenu != event.target || event.type != "popuphidden") { - return; - } - - delete this.xulMenu; - let target = event.target; - target.removeEventListener("popuphidden", this); - for (let item of this.itemsToCleanUp) { - item.remove(); - } - this.itemsToCleanUp.clear(); - }, - - itemsToCleanUp: new Set(), -}; - -function contextMenuObserver(subject, topic, data) { - subject = subject.wrappedJSObject; - gMenuBuilder.build(subject); -} - -function getContexts(contextData) { - let contexts = new Set(["all"]); - - if (contextData.inFrame) { - contexts.add("frame"); - } - - if (contextData.isTextSelected) { - contexts.add("selection"); - } - - if (contextData.onLink) { - contexts.add("link"); - } - - if (contextData.onEditableArea) { - contexts.add("editable"); - } - - if (contextData.onImage) { - contexts.add("image"); - } - - if (contextData.onVideo) { - contexts.add("video"); - } - - if (contextData.onAudio) { - contexts.add("audio"); - } - - if (contexts.size == 1) { - contexts.add("page"); - } - - return contexts; -} - -function MenuItem(extension, createProperties, isRoot = false) { - this.extension = extension; - this.children = []; - this.parent = null; - this.tabManager = TabManager.for(extension); - - this.setDefaults(); - this.setProps(createProperties); - if (!this.hasOwnProperty("_id")) { - this.id = gNextMenuItemID++; - } - // If the item is not the root and has no parent - // it must be a child of the root. - if (!isRoot && !this.parent) { - this.root.addChild(this); - } -} - -MenuItem.prototype = { - setProps(createProperties) { - for (let propName in createProperties) { - if (createProperties[propName] === null) { - // Omitted optional argument. - continue; - } - this[propName] = createProperties[propName]; - } - - if (createProperties.documentUrlPatterns != null) { - this.documentUrlMatchPattern = new MatchPattern(this.documentUrlPatterns); - } - - if (createProperties.targetUrlPatterns != null) { - this.targetUrlMatchPattern = new MatchPattern(this.targetUrlPatterns); - } - }, - - setDefaults() { - this.setProps({ - type: "normal", - checked: false, - contexts: ["all"], - enabled: true, - }); - }, - - set id(id) { - if (this.hasOwnProperty("_id")) { - throw new Error("Id of a MenuItem cannot be changed"); - } - let isIdUsed = gContextMenuMap.get(this.extension).has(id); - if (isIdUsed) { - throw new Error("Id already exists"); - } - this._id = id; - }, - - get id() { - return this._id; - }, - - ensureValidParentId(parentId) { - if (parentId === undefined) { - return; - } - let menuMap = gContextMenuMap.get(this.extension); - if (!menuMap.has(parentId)) { - throw new Error("Could not find any MenuItem with id: " + parentId); - } - for (let item = menuMap.get(parentId); item; item = item.parent) { - if (item === this) { - throw new ExtensionError("MenuItem cannot be an ancestor (or self) of its new parent."); - } - } - }, - - set parentId(parentId) { - this.ensureValidParentId(parentId); - - if (this.parent) { - this.parent.detachChild(this); - } - - if (parentId === undefined) { - this.root.addChild(this); - } else { - let menuMap = gContextMenuMap.get(this.extension); - menuMap.get(parentId).addChild(this); - } - }, - - get parentId() { - return this.parent ? this.parent.id : undefined; - }, - - addChild(child) { - if (child.parent) { - throw new Error("Child MenuItem already has a parent."); - } - this.children.push(child); - child.parent = this; - }, - - detachChild(child) { - let idx = this.children.indexOf(child); - if (idx < 0) { - throw new Error("Child MenuItem not found, it cannot be removed."); - } - this.children.splice(idx, 1); - child.parent = null; - }, - - get root() { - let extension = this.extension; - if (!gRootItems.has(extension)) { - let root = new MenuItem(extension, - {title: extension.name}, - /* isRoot = */ true); - gRootItems.set(extension, root); - } - - return gRootItems.get(extension); - }, - - remove() { - if (this.parent) { - this.parent.detachChild(this); - } - let children = this.children.slice(0); - for (let child of children) { - child.remove(); - } - - let menuMap = gContextMenuMap.get(this.extension); - menuMap.delete(this.id); - if (this.root == this) { - gRootItems.delete(this.extension); - } - }, - - getClickInfo(contextData, wasChecked) { - let mediaType; - if (contextData.onVideo) { - mediaType = "video"; - } - if (contextData.onAudio) { - mediaType = "audio"; - } - if (contextData.onImage) { - mediaType = "image"; - } - - let info = { - menuItemId: this.id, - editable: contextData.onEditableArea, - }; - - function setIfDefined(argName, value) { - if (value !== undefined) { - info[argName] = value; - } - } - - setIfDefined("parentMenuItemId", this.parentId); - setIfDefined("mediaType", mediaType); - setIfDefined("linkUrl", contextData.linkUrl); - setIfDefined("srcUrl", contextData.srcUrl); - setIfDefined("pageUrl", contextData.pageUrl); - setIfDefined("frameUrl", contextData.frameUrl); - setIfDefined("selectionText", contextData.selectionText); - - if ((this.type === "checkbox") || (this.type === "radio")) { - info.checked = this.checked; - info.wasChecked = wasChecked; - } - - return info; - }, - - enabledForContext(contextData) { - let contexts = getContexts(contextData); - if (!this.contexts.some(n => contexts.has(n))) { - return false; - } - - let docPattern = this.documentUrlMatchPattern; - let pageURI = Services.io.newURI(contextData.pageUrl, null, null); - if (docPattern && !docPattern.matches(pageURI)) { - return false; - } - - let targetPattern = this.targetUrlMatchPattern; - if (targetPattern) { - let targetUrls = []; - if (contextData.onImage || contextData.onAudio || contextData.onVideo) { - // TODO: double check if srcUrl is always set when we need it - targetUrls.push(contextData.srcUrl); - } - if (contextData.onLink) { - targetUrls.push(contextData.linkUrl); - } - if (!targetUrls.some(targetUrl => targetPattern.matches(NetUtil.newURI(targetUrl)))) { - return false; - } - } - - return true; - }, -}; - -var gExtensionCount = 0; -/* eslint-disable mozilla/balanced-listeners */ -extensions.on("startup", (type, extension) => { - gContextMenuMap.set(extension, new Map()); - if (++gExtensionCount == 1) { - Services.obs.addObserver(contextMenuObserver, - "on-build-contextmenu", - false); - } -}); - -extensions.on("shutdown", (type, extension) => { - gContextMenuMap.delete(extension); - gRootItems.delete(extension); - if (--gExtensionCount == 0) { - Services.obs.removeObserver(contextMenuObserver, - "on-build-contextmenu"); - } -}); -/* eslint-enable mozilla/balanced-listeners */ - -extensions.registerSchemaAPI("contextMenus", "addon_parent", context => { - let {extension} = context; - return { - contextMenus: { - createInternal: function(createProperties) { - // Note that the id is required by the schema. If the addon did not set - // it, the implementation of contextMenus.create in the child should - // have added it. - let menuItem = new MenuItem(extension, createProperties); - gContextMenuMap.get(extension).set(menuItem.id, menuItem); - }, - - update: function(id, updateProperties) { - let menuItem = gContextMenuMap.get(extension).get(id); - if (menuItem) { - menuItem.setProps(updateProperties); - } - }, - - remove: function(id) { - let menuItem = gContextMenuMap.get(extension).get(id); - if (menuItem) { - menuItem.remove(); - } - }, - - removeAll: function() { - let root = gRootItems.get(extension); - if (root) { - root.remove(); - } - }, - - onClicked: new EventManager(context, "contextMenus.onClicked", fire => { - let listener = (event, info, tab) => { - fire(info, tab); - }; - - extension.on("webext-contextmenu-menuitem-click", listener); - return () => { - extension.off("webext-contextmenu-menuitem-click", listener); - }; - }).api(), - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-desktop-runtime.js b/application/basilisk/components/webextensions/ext-desktop-runtime.js deleted file mode 100644 index 0fdb45562..000000000 --- a/application/basilisk/components/webextensions/ext-desktop-runtime.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; - -/* eslint-disable mozilla/balanced-listeners */ -extensions.on("uninstall", (msg, extension) => { - if (extension.uninstallURL) { - let browser = WindowManager.topWindow.gBrowser; - browser.addTab(extension.uninstallURL, {relatedToCurrent: true}); - } -}); - -global.openOptionsPage = (extension) => { - let window = WindowManager.topWindow; - if (!window) { - return Promise.reject({message: "No browser window available"}); - } - - if (extension.manifest.options_ui.open_in_tab) { - window.switchToTabHavingURI(extension.manifest.options_ui.page, true); - return Promise.resolve(); - } - - let viewId = `addons://detail/${encodeURIComponent(extension.id)}/preferences`; - - return window.BrowserOpenAddonsMgr(viewId); -}; - diff --git a/application/basilisk/components/webextensions/ext-history.js b/application/basilisk/components/webextensions/ext-history.js deleted file mode 100644 index a47df1621..000000000 --- a/application/basilisk/components/webextensions/ext-history.js +++ /dev/null @@ -1,246 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; - -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter", - "resource://devtools/shared/event-emitter.js"); -XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", - "resource://gre/modules/NetUtil.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", - "resource://gre/modules/PlacesUtils.jsm"); - -const { - normalizeTime, - SingletonEventManager, -} = ExtensionUtils; - -let nsINavHistoryService = Ci.nsINavHistoryService; -const TRANSITION_TO_TRANSITION_TYPES_MAP = new Map([ - ["link", nsINavHistoryService.TRANSITION_LINK], - ["typed", nsINavHistoryService.TRANSITION_TYPED], - ["auto_bookmark", nsINavHistoryService.TRANSITION_BOOKMARK], - ["auto_subframe", nsINavHistoryService.TRANSITION_EMBED], - ["manual_subframe", nsINavHistoryService.TRANSITION_FRAMED_LINK], -]); - -let TRANSITION_TYPE_TO_TRANSITIONS_MAP = new Map(); -for (let [transition, transitionType] of TRANSITION_TO_TRANSITION_TYPES_MAP) { - TRANSITION_TYPE_TO_TRANSITIONS_MAP.set(transitionType, transition); -} - -function getTransitionType(transition) { - // cannot set a default value for the transition argument as the framework sets it to null - transition = transition || "link"; - let transitionType = TRANSITION_TO_TRANSITION_TYPES_MAP.get(transition); - if (!transitionType) { - throw new Error(`|${transition}| is not a supported transition for history`); - } - return transitionType; -} - -function getTransition(transitionType) { - return TRANSITION_TYPE_TO_TRANSITIONS_MAP.get(transitionType) || "link"; -} - -/* - * Converts a nsINavHistoryResultNode into a HistoryItem - * - * https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsINavHistoryResultNode - */ -function convertNodeToHistoryItem(node) { - return { - id: node.pageGuid, - url: node.uri, - title: node.title, - lastVisitTime: PlacesUtils.toDate(node.time).getTime(), - visitCount: node.accessCount, - }; -} - -/* - * Converts a nsINavHistoryResultNode into a VisitItem - * - * https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsINavHistoryResultNode - */ -function convertNodeToVisitItem(node) { - return { - id: node.pageGuid, - visitId: node.visitId, - visitTime: PlacesUtils.toDate(node.time).getTime(), - referringVisitId: node.fromVisitId, - transition: getTransition(node.visitType), - }; -} - -/* - * Converts a nsINavHistoryContainerResultNode into an array of objects - * - * https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsINavHistoryContainerResultNode - */ -function convertNavHistoryContainerResultNode(container, converter) { - let results = []; - container.containerOpen = true; - for (let i = 0; i < container.childCount; i++) { - let node = container.getChild(i); - results.push(converter(node)); - } - container.containerOpen = false; - return results; -} - -var _observer; - -function getObserver() { - if (!_observer) { - _observer = { - onDeleteURI: function(uri, guid, reason) { - this.emit("visitRemoved", {allHistory: false, urls: [uri.spec]}); - }, - onVisit: function(uri, visitId, time, sessionId, referringId, transitionType, guid, hidden, visitCount, typed) { - let data = { - id: guid, - url: uri.spec, - title: "", - lastVisitTime: time / 1000, // time from Places is microseconds, - visitCount, - typedCount: typed, - }; - this.emit("visited", data); - }, - onBeginUpdateBatch: function() {}, - onEndUpdateBatch: function() {}, - onTitleChanged: function() {}, - onClearHistory: function() { - this.emit("visitRemoved", {allHistory: true, urls: []}); - }, - onPageChanged: function() {}, - onFrecencyChanged: function() {}, - onManyFrecenciesChanged: function() {}, - onDeleteVisits: function(uri, time, guid, reason) { - this.emit("visitRemoved", {allHistory: false, urls: [uri.spec]}); - }, - }; - EventEmitter.decorate(_observer); - PlacesUtils.history.addObserver(_observer, false); - } - return _observer; -} - -extensions.registerSchemaAPI("history", "addon_parent", context => { - return { - history: { - addUrl: function(details) { - let transition, date; - try { - transition = getTransitionType(details.transition); - } catch (error) { - return Promise.reject({message: error.message}); - } - if (details.visitTime) { - date = normalizeTime(details.visitTime); - } - let pageInfo = { - title: details.title, - url: details.url, - visits: [ - { - transition, - date, - }, - ], - }; - try { - return PlacesUtils.history.insert(pageInfo).then(() => undefined); - } catch (error) { - return Promise.reject({message: error.message}); - } - }, - - deleteAll: function() { - return PlacesUtils.history.clear(); - }, - - deleteRange: function(filter) { - let newFilter = { - beginDate: normalizeTime(filter.startTime), - endDate: normalizeTime(filter.endTime), - }; - // History.removeVisitsByFilter returns a boolean, but our API should return nothing - return PlacesUtils.history.removeVisitsByFilter(newFilter).then(() => undefined); - }, - - deleteUrl: function(details) { - let url = details.url; - // History.remove returns a boolean, but our API should return nothing - return PlacesUtils.history.remove(url).then(() => undefined); - }, - - search: function(query) { - let beginTime = (query.startTime == null) ? - PlacesUtils.toPRTime(Date.now() - 24 * 60 * 60 * 1000) : - PlacesUtils.toPRTime(normalizeTime(query.startTime)); - let endTime = (query.endTime == null) ? - Number.MAX_VALUE : - PlacesUtils.toPRTime(normalizeTime(query.endTime)); - if (beginTime > endTime) { - return Promise.reject({message: "The startTime cannot be after the endTime"}); - } - - let options = PlacesUtils.history.getNewQueryOptions(); - options.sortingMode = options.SORT_BY_DATE_DESCENDING; - options.maxResults = query.maxResults || 100; - - let historyQuery = PlacesUtils.history.getNewQuery(); - historyQuery.searchTerms = query.text; - historyQuery.beginTime = beginTime; - historyQuery.endTime = endTime; - let queryResult = PlacesUtils.history.executeQuery(historyQuery, options).root; - let results = convertNavHistoryContainerResultNode(queryResult, convertNodeToHistoryItem); - return Promise.resolve(results); - }, - - getVisits: function(details) { - let url = details.url; - if (!url) { - return Promise.reject({message: "A URL must be provided for getVisits"}); - } - - let options = PlacesUtils.history.getNewQueryOptions(); - options.sortingMode = options.SORT_BY_DATE_DESCENDING; - options.resultType = options.RESULTS_AS_VISIT; - - let historyQuery = PlacesUtils.history.getNewQuery(); - historyQuery.uri = NetUtil.newURI(url); - let queryResult = PlacesUtils.history.executeQuery(historyQuery, options).root; - let results = convertNavHistoryContainerResultNode(queryResult, convertNodeToVisitItem); - return Promise.resolve(results); - }, - - onVisited: new SingletonEventManager(context, "history.onVisited", fire => { - let listener = (event, data) => { - context.runSafe(fire, data); - }; - - getObserver().on("visited", listener); - return () => { - getObserver().off("visited", listener); - }; - }).api(), - - onVisitRemoved: new SingletonEventManager(context, "history.onVisitRemoved", fire => { - let listener = (event, data) => { - context.runSafe(fire, data); - }; - - getObserver().on("visitRemoved", listener); - return () => { - getObserver().off("visitRemoved", listener); - }; - }).api(), - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-omnibox.js b/application/basilisk/components/webextensions/ext-omnibox.js deleted file mode 100644 index 9b2f60ca4..000000000 --- a/application/basilisk/components/webextensions/ext-omnibox.js +++ /dev/null @@ -1,104 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "ExtensionSearchHandler", - "resource://gre/modules/ExtensionSearchHandler.jsm"); -var { - SingletonEventManager, -} = ExtensionUtils; - -// WeakMap[extension -> keyword] -let gKeywordMap = new WeakMap(); - -/* eslint-disable mozilla/balanced-listeners */ -extensions.on("manifest_omnibox", (type, directive, extension, manifest) => { - let keyword = manifest.omnibox.keyword; - try { - // This will throw if the keyword is already registered. - ExtensionSearchHandler.registerKeyword(keyword, extension); - gKeywordMap.set(extension, keyword); - } catch (e) { - extension.manifestError(e.message); - } -}); - -extensions.on("shutdown", (type, extension) => { - let keyword = gKeywordMap.get(extension); - if (keyword) { - ExtensionSearchHandler.unregisterKeyword(keyword); - gKeywordMap.delete(extension); - } -}); -/* eslint-enable mozilla/balanced-listeners */ - -extensions.registerSchemaAPI("omnibox", "addon_parent", context => { - let {extension} = context; - return { - omnibox: { - setDefaultSuggestion(suggestion) { - let keyword = gKeywordMap.get(extension); - try { - // This will throw if the keyword failed to register. - ExtensionSearchHandler.setDefaultSuggestion(keyword, suggestion); - } catch (e) { - return Promise.reject(e.message); - } - }, - - onInputStarted: new SingletonEventManager(context, "omnibox.onInputStarted", fire => { - let listener = (eventName) => { - fire(); - }; - extension.on(ExtensionSearchHandler.MSG_INPUT_STARTED, listener); - return () => { - extension.off(ExtensionSearchHandler.MSG_INPUT_STARTED, listener); - }; - }).api(), - - onInputCancelled: new SingletonEventManager(context, "omnibox.onInputCancelled", fire => { - let listener = (eventName) => { - fire(); - }; - extension.on(ExtensionSearchHandler.MSG_INPUT_CANCELLED, listener); - return () => { - extension.off(ExtensionSearchHandler.MSG_INPUT_CANCELLED, listener); - }; - }).api(), - - onInputEntered: new SingletonEventManager(context, "omnibox.onInputEntered", fire => { - let listener = (eventName, text, disposition) => { - fire(text, disposition); - }; - extension.on(ExtensionSearchHandler.MSG_INPUT_ENTERED, listener); - return () => { - extension.off(ExtensionSearchHandler.MSG_INPUT_ENTERED, listener); - }; - }).api(), - }, - - omnibox_internal: { - addSuggestions(id, suggestions) { - let keyword = gKeywordMap.get(extension); - try { - ExtensionSearchHandler.addSuggestions(keyword, id, suggestions); - } catch (e) { - // Silently fail because the extension developer can not know for sure if the user - // has already invalidated the callback when asynchronously providing suggestions. - } - }, - - onInputChanged: new SingletonEventManager(context, "omnibox_internal.onInputChanged", fire => { - let listener = (eventName, text, id) => { - fire(text, id); - }; - extension.on(ExtensionSearchHandler.MSG_INPUT_CHANGED, listener); - return () => { - extension.off(ExtensionSearchHandler.MSG_INPUT_CHANGED, listener); - }; - }).api(), - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-pageAction.js b/application/basilisk/components/webextensions/ext-pageAction.js deleted file mode 100644 index 5bf3a9c70..000000000 --- a/application/basilisk/components/webextensions/ext-pageAction.js +++ /dev/null @@ -1,290 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); -var { - EventManager, - IconDetails, -} = ExtensionUtils; - -// WeakMap[Extension -> PageAction] -var pageActionMap = new WeakMap(); - -// Handles URL bar icons, including the |page_action| manifest entry -// and associated API. -function PageAction(options, extension) { - this.extension = extension; - this.id = makeWidgetId(extension.id) + "-page-action"; - - this.tabManager = TabManager.for(extension); - - this.defaults = { - show: false, - title: options.default_title || extension.name, - icon: IconDetails.normalize({path: options.default_icon}, extension), - popup: options.default_popup || "", - }; - - this.browserStyle = options.browser_style || false; - if (options.browser_style === null) { - this.extension.logger.warn("Please specify whether you want browser_style " + - "or not in your page_action options."); - } - - this.tabContext = new TabContext(tab => Object.create(this.defaults), - extension); - - this.tabContext.on("location-change", this.handleLocationChange.bind(this)); // eslint-disable-line mozilla/balanced-listeners - - // WeakMap[ChromeWindow -> <xul:image>] - this.buttons = new WeakMap(); - - EventEmitter.decorate(this); -} - -PageAction.prototype = { - // Returns the value of the property |prop| for the given tab, where - // |prop| is one of "show", "title", "icon", "popup". - getProperty(tab, prop) { - return this.tabContext.get(tab)[prop]; - }, - - // Sets the value of the property |prop| for the given tab to the - // given value, symmetrically to |getProperty|. - // - // If |tab| is currently selected, updates the page action button to - // reflect the new value. - setProperty(tab, prop, value) { - if (value != null) { - this.tabContext.get(tab)[prop] = value; - } else { - delete this.tabContext.get(tab)[prop]; - } - - if (tab.selected) { - this.updateButton(tab.ownerGlobal); - } - }, - - // Updates the page action button in the given window to reflect the - // properties of the currently selected tab: - // - // Updates "tooltiptext" and "aria-label" to match "title" property. - // Updates "image" to match the "icon" property. - // Shows or hides the icon, based on the "show" property. - updateButton(window) { - let tabData = this.tabContext.get(window.gBrowser.selectedTab); - - if (!(tabData.show || this.buttons.has(window))) { - // Don't bother creating a button for a window until it actually - // needs to be shown. - return; - } - - let button = this.getButton(window); - - if (tabData.show) { - // Update the title and icon only if the button is visible. - - let title = tabData.title || this.extension.name; - button.setAttribute("tooltiptext", title); - button.setAttribute("aria-label", title); - - // These URLs should already be properly escaped, but make doubly sure CSS - // string escape characters are escaped here, since they could lead to a - // sandbox break. - let escape = str => str.replace(/[\\\s"]/g, encodeURIComponent); - - let getIcon = size => escape(IconDetails.getPreferredIcon(tabData.icon, this.extension, size).icon); - - button.setAttribute("style", ` - --webextension-urlbar-image: url("${getIcon(16)}"); - --webextension-urlbar-image-2x: url("${getIcon(32)}"); - `); - - button.classList.add("webextension-page-action"); - } - - button.hidden = !tabData.show; - }, - - // Create an |image| node and add it to the |urlbar-icons| - // container in the given window. - addButton(window) { - let document = window.document; - - let button = document.createElement("image"); - button.id = this.id; - button.setAttribute("class", "urlbar-icon"); - - button.addEventListener("click", event => { // eslint-disable-line mozilla/balanced-listeners - if (event.button == 0) { - this.handleClick(window); - } - }); - - document.getElementById("urlbar-icons").appendChild(button); - - return button; - }, - - // Returns the page action button for the given window, creating it if - // it doesn't already exist. - getButton(window) { - if (!this.buttons.has(window)) { - let button = this.addButton(window); - this.buttons.set(window, button); - } - - return this.buttons.get(window); - }, - - /** - * Triggers this page action for the given window, with the same effects as - * if it were clicked by a user. - * - * This has no effect if the page action is hidden for the selected tab. - * - * @param {Window} window - */ - triggerAction(window) { - let pageAction = pageActionMap.get(this.extension); - if (pageAction.getProperty(window.gBrowser.selectedTab, "show")) { - pageAction.handleClick(window); - } - }, - - // Handles a click event on the page action button for the given - // window. - // If the page action has a |popup| property, a panel is opened to - // that URL. Otherwise, a "click" event is emitted, and dispatched to - // the any click listeners in the add-on. - handleClick(window) { - let tab = window.gBrowser.selectedTab; - let popupURL = this.tabContext.get(tab).popup; - - this.tabManager.addActiveTabPermission(tab); - - // If the widget has a popup URL defined, we open a popup, but do not - // dispatch a click event to the extension. - // If it has no popup URL defined, we dispatch a click event, but do not - // open a popup. - if (popupURL) { - new PanelPopup(this.extension, this.getButton(window), popupURL, - this.browserStyle); - } else { - this.emit("click", tab); - } - }, - - handleLocationChange(eventType, tab, fromBrowse) { - if (fromBrowse) { - this.tabContext.clear(tab); - } - this.updateButton(tab.ownerGlobal); - }, - - shutdown() { - this.tabContext.shutdown(); - - for (let window of WindowListManager.browserWindows()) { - if (this.buttons.has(window)) { - this.buttons.get(window).remove(); - } - } - }, -}; - -/* eslint-disable mozilla/balanced-listeners */ -extensions.on("manifest_page_action", (type, directive, extension, manifest) => { - let pageAction = new PageAction(manifest.page_action, extension); - pageActionMap.set(extension, pageAction); -}); - -extensions.on("shutdown", (type, extension) => { - if (pageActionMap.has(extension)) { - pageActionMap.get(extension).shutdown(); - pageActionMap.delete(extension); - } -}); -/* eslint-enable mozilla/balanced-listeners */ - -PageAction.for = extension => { - return pageActionMap.get(extension); -}; - -global.pageActionFor = PageAction.for; - -extensions.registerSchemaAPI("pageAction", "addon_parent", context => { - let {extension} = context; - return { - pageAction: { - onClicked: new EventManager(context, "pageAction.onClicked", fire => { - let listener = (evt, tab) => { - fire(TabManager.convert(extension, tab)); - }; - let pageAction = PageAction.for(extension); - - pageAction.on("click", listener); - return () => { - pageAction.off("click", listener); - }; - }).api(), - - show(tabId) { - let tab = TabManager.getTab(tabId, context); - PageAction.for(extension).setProperty(tab, "show", true); - }, - - hide(tabId) { - let tab = TabManager.getTab(tabId, context); - PageAction.for(extension).setProperty(tab, "show", false); - }, - - setTitle(details) { - let tab = TabManager.getTab(details.tabId, context); - - // Clear the tab-specific title when given a null string. - PageAction.for(extension).setProperty(tab, "title", details.title || null); - }, - - getTitle(details) { - let tab = TabManager.getTab(details.tabId, context); - - let title = PageAction.for(extension).getProperty(tab, "title"); - return Promise.resolve(title); - }, - - setIcon(details) { - let tab = TabManager.getTab(details.tabId, context); - - let icon = IconDetails.normalize(details, extension, context); - PageAction.for(extension).setProperty(tab, "icon", icon); - }, - - setPopup(details) { - let tab = TabManager.getTab(details.tabId, context); - - // Note: Chrome resolves arguments to setIcon relative to the calling - // context, but resolves arguments to setPopup relative to the extension - // root. - // For internal consistency, we currently resolve both relative to the - // calling context. - let url = details.popup && context.uri.resolve(details.popup); - if (url && !context.checkLoadURL(url)) { - return Promise.reject({message: `Access denied for URL ${url}`}); - } - PageAction.for(extension).setProperty(tab, "popup", url); - }, - - getPopup(details) { - let tab = TabManager.getTab(details.tabId, context); - - let popup = PageAction.for(extension).getProperty(tab, "popup"); - return Promise.resolve(popup); - }, - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-sessions.js b/application/basilisk/components/webextensions/ext-sessions.js deleted file mode 100644 index 4c13a1ac3..000000000 --- a/application/basilisk/components/webextensions/ext-sessions.js +++ /dev/null @@ -1,92 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); -var { - promiseObserved, -} = ExtensionUtils; - -XPCOMUtils.defineLazyModuleGetter(this, "SessionStore", - "resource:///modules/sessionstore/SessionStore.jsm"); - -function getRecentlyClosed(maxResults, extension) { - let recentlyClosed = []; - - // Get closed windows - let closedWindowData = SessionStore.getClosedWindowData(false); - for (let window of closedWindowData) { - recentlyClosed.push({ - lastModified: window.closedAt, - window: WindowManager.convertFromSessionStoreClosedData(window, extension)}); - } - - // Get closed tabs - for (let window of WindowListManager.browserWindows()) { - let closedTabData = SessionStore.getClosedTabData(window, false); - for (let tab of closedTabData) { - recentlyClosed.push({ - lastModified: tab.closedAt, - tab: TabManager.for(extension).convertFromSessionStoreClosedData(tab, window)}); - } - } - - // Sort windows and tabs - recentlyClosed.sort((a, b) => b.lastModified - a.lastModified); - return recentlyClosed.slice(0, maxResults); -} - -function createSession(restored, extension, sessionId) { - if (!restored) { - return Promise.reject({message: `Could not restore object using sessionId ${sessionId}.`}); - } - let sessionObj = {lastModified: Date.now()}; - if (restored instanceof Ci.nsIDOMChromeWindow) { - return promiseObserved("sessionstore-single-window-restored", subject => subject == restored).then(() => { - sessionObj.window = WindowManager.convert(extension, restored, {populate: true}); - return Promise.resolve([sessionObj]); - }); - } - sessionObj.tab = TabManager.for(extension).convert(restored); - return Promise.resolve([sessionObj]); -} - -extensions.registerSchemaAPI("sessions", "addon_parent", context => { - let {extension} = context; - return { - sessions: { - getRecentlyClosed: function(filter) { - let maxResults = filter.maxResults == undefined ? this.MAX_SESSION_RESULTS : filter.maxResults; - return Promise.resolve(getRecentlyClosed(maxResults, extension)); - }, - restore: function(sessionId) { - let session, closedId; - if (sessionId) { - closedId = sessionId; - session = SessionStore.undoCloseById(closedId); - } else if (SessionStore.lastClosedObjectType == "window") { - // If the most recently closed object is a window, just undo closing the most recent window. - session = SessionStore.undoCloseWindow(0); - } else { - // It is a tab, and we cannot call SessionStore.undoCloseTab without a window, - // so we must find the tab in which case we can just use its closedId. - let recentlyClosedTabs = []; - for (let window of WindowListManager.browserWindows()) { - let closedTabData = SessionStore.getClosedTabData(window, false); - for (let tab of closedTabData) { - recentlyClosedTabs.push(tab); - } - } - - // Sort the tabs. - recentlyClosedTabs.sort((a, b) => b.closedAt - a.closedAt); - - // Use the closedId of the most recently closed tab to restore it. - closedId = recentlyClosedTabs[0].closedId; - session = SessionStore.undoCloseById(closedId); - } - return createSession(session, extension, closedId); - }, - }, - }; -}); diff --git a/application/basilisk/components/webextensions/ext-tabs.js b/application/basilisk/components/webextensions/ext-tabs.js deleted file mode 100644 index bb575aaab..000000000 --- a/application/basilisk/components/webextensions/ext-tabs.js +++ /dev/null @@ -1,1093 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService", - "@mozilla.org/browser/aboutnewtab-service;1", - "nsIAboutNewTabService"); - -XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern", - "resource://gre/modules/MatchPattern.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", - "resource://gre/modules/PrivateBrowsingUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils", - "resource://gre/modules/PromiseUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Services", - "resource://gre/modules/Services.jsm"); - -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); - -var { - EventManager, - ignoreEvent, -} = ExtensionUtils; - -// This function is pretty tightly tied to Extension.jsm. -// Its job is to fill in the |tab| property of the sender. -function getSender(extension, target, sender) { - if ("tabId" in sender) { - // The message came from an ExtensionContext. In that case, it should - // include a tabId property (which is filled in by the page-open - // listener below). - let tab = TabManager.getTab(sender.tabId, null, null); - delete sender.tabId; - if (tab) { - sender.tab = TabManager.convert(extension, tab); - return; - } - } - if (target instanceof Ci.nsIDOMXULElement) { - // If the message was sent from a content script to a <browser> element, - // then we can just get the `tab` from `target`. - let tabbrowser = target.ownerGlobal.gBrowser; - if (tabbrowser) { - let tab = tabbrowser.getTabForBrowser(target); - - // `tab` can be `undefined`, e.g. for extension popups. This condition is - // reached if `getSender` is called for a popup without a valid `tabId`. - if (tab) { - sender.tab = TabManager.convert(extension, tab); - } - } - } -} - -// Used by Extension.jsm -global.tabGetSender = getSender; - -/* eslint-disable mozilla/balanced-listeners */ - -extensions.on("page-shutdown", (type, context) => { - if (context.viewType == "tab") { - if (context.extension.id !== context.xulBrowser.contentPrincipal.addonId) { - // Only close extension tabs. - // This check prevents about:addons from closing when it contains a - // WebExtension as an embedded inline options page. - return; - } - let {gBrowser} = context.xulBrowser.ownerGlobal; - if (gBrowser) { - let tab = gBrowser.getTabForBrowser(context.xulBrowser); - if (tab) { - gBrowser.removeTab(tab); - } - } - } -}); - -extensions.on("fill-browser-data", (type, browser, data) => { - data.tabId = browser ? TabManager.getBrowserId(browser) : -1; -}); -/* eslint-enable mozilla/balanced-listeners */ - -global.currentWindow = function(context) { - let {xulWindow} = context; - if (xulWindow && context.viewType != "background") { - return xulWindow; - } - return WindowManager.topWindow; -}; - -let tabListener = { - init() { - if (this.initialized) { - return; - } - - this.adoptedTabs = new WeakMap(); - - this.handleWindowOpen = this.handleWindowOpen.bind(this); - this.handleWindowClose = this.handleWindowClose.bind(this); - - AllWindowEvents.addListener("TabClose", this); - AllWindowEvents.addListener("TabOpen", this); - WindowListManager.addOpenListener(this.handleWindowOpen); - WindowListManager.addCloseListener(this.handleWindowClose); - - EventEmitter.decorate(this); - - this.initialized = true; - }, - - handleEvent(event) { - switch (event.type) { - case "TabOpen": - if (event.detail.adoptedTab) { - this.adoptedTabs.set(event.detail.adoptedTab, event.target); - } - - // We need to delay sending this event until the next tick, since the - // tab does not have its final index when the TabOpen event is dispatched. - Promise.resolve().then(() => { - if (event.detail.adoptedTab) { - this.emitAttached(event.originalTarget); - } else { - this.emitCreated(event.originalTarget); - } - }); - break; - - case "TabClose": - let tab = event.originalTarget; - - if (event.detail.adoptedBy) { - this.emitDetached(tab, event.detail.adoptedBy); - } else { - this.emitRemoved(tab, false); - } - break; - } - }, - - handleWindowOpen(window) { - if (window.arguments[0] instanceof window.XULElement) { - // If the first window argument is a XUL element, it means the - // window is about to adopt a tab from another window to replace its - // initial tab. - // - // Note that this event handler depends on running before the - // delayed startup code in browser.js, which is currently triggered - // by the first MozAfterPaint event. That code handles finally - // adopting the tab, and clears it from the arguments list in the - // process, so if we run later than it, we're too late. - let tab = window.arguments[0]; - this.adoptedTabs.set(tab, window.gBrowser.tabs[0]); - - // We need to be sure to fire this event after the onDetached event - // for the original tab. - let listener = (event, details) => { - if (details.tab == tab) { - this.off("tab-detached", listener); - - Promise.resolve().then(() => { - this.emitAttached(details.adoptedBy); - }); - } - }; - - this.on("tab-detached", listener); - } else { - for (let tab of window.gBrowser.tabs) { - this.emitCreated(tab); - } - } - }, - - handleWindowClose(window) { - for (let tab of window.gBrowser.tabs) { - if (this.adoptedTabs.has(tab)) { - this.emitDetached(tab, this.adoptedTabs.get(tab)); - } else { - this.emitRemoved(tab, true); - } - } - }, - - emitAttached(tab) { - let newWindowId = WindowManager.getId(tab.ownerGlobal); - let tabId = TabManager.getId(tab); - - this.emit("tab-attached", {tab, tabId, newWindowId, newPosition: tab._tPos}); - }, - - emitDetached(tab, adoptedBy) { - let oldWindowId = WindowManager.getId(tab.ownerGlobal); - let tabId = TabManager.getId(tab); - - this.emit("tab-detached", {tab, adoptedBy, tabId, oldWindowId, oldPosition: tab._tPos}); - }, - - emitCreated(tab) { - this.emit("tab-created", {tab}); - }, - - emitRemoved(tab, isWindowClosing) { - let windowId = WindowManager.getId(tab.ownerGlobal); - let tabId = TabManager.getId(tab); - - // When addons run in-process, `window.close()` is synchronous. Most other - // addon-invoked calls are asynchronous since they go through a proxy - // context via the message manager. This includes event registrations such - // as `tabs.onRemoved.addListener`. - // So, even if `window.close()` were to be called (in-process) after calling - // `tabs.onRemoved.addListener`, then the tab would be closed before the - // event listener is registered. To make sure that the event listener is - // notified, we dispatch `tabs.onRemoved` asynchronously. - Services.tm.mainThread.dispatch(() => { - this.emit("tab-removed", {tab, tabId, windowId, isWindowClosing}); - }, Ci.nsIThread.DISPATCH_NORMAL); - }, - - tabReadyInitialized: false, - tabReadyPromises: new WeakMap(), - initializingTabs: new WeakSet(), - - initTabReady() { - if (!this.tabReadyInitialized) { - AllWindowEvents.addListener("progress", this); - - this.tabReadyInitialized = true; - } - }, - - onLocationChange(browser, webProgress, request, locationURI, flags) { - if (webProgress.isTopLevel) { - let gBrowser = browser.ownerGlobal.gBrowser; - let tab = gBrowser.getTabForBrowser(browser); - - // Now we are certain that the first page in the tab was loaded. - this.initializingTabs.delete(tab); - - // browser.innerWindowID is now set, resolve the promises if any. - let deferred = this.tabReadyPromises.get(tab); - if (deferred) { - deferred.resolve(tab); - this.tabReadyPromises.delete(tab); - } - } - }, - - /** - * Returns a promise that resolves when the tab is ready. - * Tabs created via the `tabs.create` method are "ready" once the location - * changes to the requested URL. Other tabs are assumed to be ready once their - * inner window ID is known. - * - * @param {XULElement} tab The <tab> element. - * @returns {Promise} Resolves with the given tab once ready. - */ - awaitTabReady(tab) { - let deferred = this.tabReadyPromises.get(tab); - if (!deferred) { - deferred = PromiseUtils.defer(); - if (!this.initializingTabs.has(tab) && tab.linkedBrowser.innerWindowID) { - deferred.resolve(tab); - } else { - this.initTabReady(); - this.tabReadyPromises.set(tab, deferred); - } - } - return deferred.promise; - }, -}; - -/* eslint-disable mozilla/balanced-listeners */ -extensions.on("startup", () => { - tabListener.init(); -}); -/* eslint-enable mozilla/balanced-listeners */ - -extensions.registerSchemaAPI("tabs", "addon_parent", context => { - let {extension} = context; - let self = { - tabs: { - onActivated: new WindowEventManager(context, "tabs.onActivated", "TabSelect", (fire, event) => { - let tab = event.originalTarget; - let tabId = TabManager.getId(tab); - let windowId = WindowManager.getId(tab.ownerGlobal); - fire({tabId, windowId}); - }).api(), - - onCreated: new EventManager(context, "tabs.onCreated", fire => { - let listener = (eventName, event) => { - fire(TabManager.convert(extension, event.tab)); - }; - - tabListener.on("tab-created", listener); - return () => { - tabListener.off("tab-created", listener); - }; - }).api(), - - /** - * Since multiple tabs currently can't be highlighted, onHighlighted - * essentially acts an alias for self.tabs.onActivated but returns - * the tabId in an array to match the API. - * @see https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/Tabs/onHighlighted - */ - onHighlighted: new WindowEventManager(context, "tabs.onHighlighted", "TabSelect", (fire, event) => { - let tab = event.originalTarget; - let tabIds = [TabManager.getId(tab)]; - let windowId = WindowManager.getId(tab.ownerGlobal); - fire({tabIds, windowId}); - }).api(), - - onAttached: new EventManager(context, "tabs.onAttached", fire => { - let listener = (eventName, event) => { - fire(event.tabId, {newWindowId: event.newWindowId, newPosition: event.newPosition}); - }; - - tabListener.on("tab-attached", listener); - return () => { - tabListener.off("tab-attached", listener); - }; - }).api(), - - onDetached: new EventManager(context, "tabs.onDetached", fire => { - let listener = (eventName, event) => { - fire(event.tabId, {oldWindowId: event.oldWindowId, oldPosition: event.oldPosition}); - }; - - tabListener.on("tab-detached", listener); - return () => { - tabListener.off("tab-detached", listener); - }; - }).api(), - - onRemoved: new EventManager(context, "tabs.onRemoved", fire => { - let listener = (eventName, event) => { - fire(event.tabId, {windowId: event.windowId, isWindowClosing: event.isWindowClosing}); - }; - - tabListener.on("tab-removed", listener); - return () => { - tabListener.off("tab-removed", listener); - }; - }).api(), - - onReplaced: ignoreEvent(context, "tabs.onReplaced"), - - onMoved: new EventManager(context, "tabs.onMoved", fire => { - // There are certain circumstances where we need to ignore a move event. - // - // Namely, the first time the tab is moved after it's created, we need - // to report the final position as the initial position in the tab's - // onAttached or onCreated event. This is because most tabs are inserted - // in a temporary location and then moved after the TabOpen event fires, - // which generates a TabOpen event followed by a TabMove event, which - // does not match the contract of our API. - let ignoreNextMove = new WeakSet(); - - let openListener = event => { - ignoreNextMove.add(event.target); - // Remove the tab from the set on the next tick, since it will already - // have been moved by then. - Promise.resolve().then(() => { - ignoreNextMove.delete(event.target); - }); - }; - - let moveListener = event => { - let tab = event.originalTarget; - - if (ignoreNextMove.has(tab)) { - ignoreNextMove.delete(tab); - return; - } - - fire(TabManager.getId(tab), { - windowId: WindowManager.getId(tab.ownerGlobal), - fromIndex: event.detail, - toIndex: tab._tPos, - }); - }; - - AllWindowEvents.addListener("TabMove", moveListener); - AllWindowEvents.addListener("TabOpen", openListener); - return () => { - AllWindowEvents.removeListener("TabMove", moveListener); - AllWindowEvents.removeListener("TabOpen", openListener); - }; - }).api(), - - onUpdated: new EventManager(context, "tabs.onUpdated", fire => { - function sanitize(extension, changeInfo) { - let result = {}; - let nonempty = false; - for (let prop in changeInfo) { - if ((prop != "favIconUrl" && prop != "url") || extension.hasPermission("tabs")) { - nonempty = true; - result[prop] = changeInfo[prop]; - } - } - return [nonempty, result]; - } - - let fireForBrowser = (browser, changed) => { - let [needed, changeInfo] = sanitize(extension, changed); - if (needed) { - let gBrowser = browser.ownerGlobal.gBrowser; - let tabElem = gBrowser.getTabForBrowser(browser); - - let tab = TabManager.convert(extension, tabElem); - fire(tab.id, changeInfo, tab); - } - }; - - let listener = event => { - let needed = []; - if (event.type == "TabAttrModified") { - let changed = event.detail.changed; - if (changed.includes("image")) { - needed.push("favIconUrl"); - } - if (changed.includes("muted")) { - needed.push("mutedInfo"); - } - if (changed.includes("soundplaying")) { - needed.push("audible"); - } - } else if (event.type == "TabPinned") { - needed.push("pinned"); - } else if (event.type == "TabUnpinned") { - needed.push("pinned"); - } - - if (needed.length && !extension.hasPermission("tabs")) { - needed = needed.filter(attr => attr != "url" && attr != "favIconUrl"); - } - - if (needed.length) { - let tab = TabManager.convert(extension, event.originalTarget); - - let changeInfo = {}; - for (let prop of needed) { - changeInfo[prop] = tab[prop]; - } - fire(tab.id, changeInfo, tab); - } - }; - let progressListener = { - onStateChange(browser, webProgress, request, stateFlags, statusCode) { - if (!webProgress.isTopLevel) { - return; - } - - let status; - if (stateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) { - if (stateFlags & Ci.nsIWebProgressListener.STATE_START) { - status = "loading"; - } else if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP) { - status = "complete"; - } - } else if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP && - statusCode == Cr.NS_BINDING_ABORTED) { - status = "complete"; - } - - fireForBrowser(browser, {status}); - }, - - onLocationChange(browser, webProgress, request, locationURI, flags) { - if (!webProgress.isTopLevel) { - return; - } - - fireForBrowser(browser, { - status: webProgress.isLoadingDocument ? "loading" : "complete", - url: locationURI.spec, - }); - }, - }; - - AllWindowEvents.addListener("progress", progressListener); - AllWindowEvents.addListener("TabAttrModified", listener); - AllWindowEvents.addListener("TabPinned", listener); - AllWindowEvents.addListener("TabUnpinned", listener); - - return () => { - AllWindowEvents.removeListener("progress", progressListener); - AllWindowEvents.removeListener("TabAttrModified", listener); - AllWindowEvents.removeListener("TabPinned", listener); - AllWindowEvents.removeListener("TabUnpinned", listener); - }; - }).api(), - - create: function(createProperties) { - return new Promise((resolve, reject) => { - let window = createProperties.windowId !== null ? - WindowManager.getWindow(createProperties.windowId, context) : - WindowManager.topWindow; - if (!window.gBrowser) { - let obs = (finishedWindow, topic, data) => { - if (finishedWindow != window) { - return; - } - Services.obs.removeObserver(obs, "browser-delayed-startup-finished"); - resolve(window); - }; - Services.obs.addObserver(obs, "browser-delayed-startup-finished", false); - } else { - resolve(window); - } - }).then(window => { - let url; - - if (createProperties.url !== null) { - url = context.uri.resolve(createProperties.url); - - if (!context.checkLoadURL(url, {dontReportErrors: true})) { - return Promise.reject({message: `Illegal URL: ${url}`}); - } - } - - if (createProperties.cookieStoreId && !extension.hasPermission("cookies")) { - return Promise.reject({message: `No permission for cookieStoreId: ${createProperties.cookieStoreId}`}); - } - - let options = {}; - if (createProperties.cookieStoreId) { - if (!global.isValidCookieStoreId(createProperties.cookieStoreId)) { - return Promise.reject({message: `Illegal cookieStoreId: ${createProperties.cookieStoreId}`}); - } - - let privateWindow = PrivateBrowsingUtils.isBrowserPrivate(window.gBrowser); - if (privateWindow && !global.isPrivateCookieStoreId(createProperties.cookieStoreId)) { - return Promise.reject({message: `Illegal to set non-private cookieStorageId in a private window`}); - } - - if (!privateWindow && global.isPrivateCookieStoreId(createProperties.cookieStoreId)) { - return Promise.reject({message: `Illegal to set private cookieStorageId in a non-private window`}); - } - - if (global.isContainerCookieStoreId(createProperties.cookieStoreId)) { - let containerId = global.getContainerForCookieStoreId(createProperties.cookieStoreId); - if (!containerId) { - return Promise.reject({message: `No cookie store exists with ID ${createProperties.cookieStoreId}`}); - } - - options.userContextId = containerId; - } - } - - tabListener.initTabReady(); - let tab = window.gBrowser.addTab(url || window.BROWSER_NEW_TAB_URL, options); - - let active = true; - if (createProperties.active !== null) { - active = createProperties.active; - } - if (active) { - window.gBrowser.selectedTab = tab; - } - - if (createProperties.index !== null) { - window.gBrowser.moveTabTo(tab, createProperties.index); - } - - if (createProperties.pinned) { - window.gBrowser.pinTab(tab); - } - - if (createProperties.url && !createProperties.url.startsWith("about:")) { - // We can't wait for a location change event for about:newtab, - // since it may be pre-rendered, in which case its initial - // location change event has already fired. - - // Mark the tab as initializing, so that operations like - // `executeScript` wait until the requested URL is loaded in - // the tab before dispatching messages to the inner window - // that contains the URL we're attempting to load. - tabListener.initializingTabs.add(tab); - } - - return TabManager.convert(extension, tab); - }); - }, - - remove: function(tabs) { - if (!Array.isArray(tabs)) { - tabs = [tabs]; - } - - for (let tabId of tabs) { - let tab = TabManager.getTab(tabId, context); - tab.ownerGlobal.gBrowser.removeTab(tab); - } - - return Promise.resolve(); - }, - - update: function(tabId, updateProperties) { - let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab; - - let tabbrowser = tab.ownerGlobal.gBrowser; - - if (updateProperties.url !== null) { - let url = context.uri.resolve(updateProperties.url); - - if (!context.checkLoadURL(url, {dontReportErrors: true})) { - return Promise.reject({message: `Illegal URL: ${url}`}); - } - - tab.linkedBrowser.loadURI(url); - } - - if (updateProperties.active !== null) { - if (updateProperties.active) { - tabbrowser.selectedTab = tab; - } else { - // Not sure what to do here? Which tab should we select? - } - } - if (updateProperties.muted !== null) { - if (tab.muted != updateProperties.muted) { - tab.toggleMuteAudio(extension.uuid); - } - } - if (updateProperties.pinned !== null) { - if (updateProperties.pinned) { - tabbrowser.pinTab(tab); - } else { - tabbrowser.unpinTab(tab); - } - } - // FIXME: highlighted/selected, openerTabId - - return Promise.resolve(TabManager.convert(extension, tab)); - }, - - reload: function(tabId, reloadProperties) { - let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab; - - let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE; - if (reloadProperties && reloadProperties.bypassCache) { - flags |= Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE; - } - tab.linkedBrowser.reloadWithFlags(flags); - - return Promise.resolve(); - }, - - get: function(tabId) { - let tab = TabManager.getTab(tabId, context); - - return Promise.resolve(TabManager.convert(extension, tab)); - }, - - getCurrent() { - let tab; - if (context.tabId) { - tab = TabManager.convert(extension, TabManager.getTab(context.tabId, context)); - } - return Promise.resolve(tab); - }, - - query: function(queryInfo) { - let pattern = null; - if (queryInfo.url !== null) { - if (!extension.hasPermission("tabs")) { - return Promise.reject({message: 'The "tabs" permission is required to use the query API with the "url" parameter'}); - } - - pattern = new MatchPattern(queryInfo.url); - } - - function matches(tab) { - let props = ["active", "pinned", "highlighted", "status", "title", "index"]; - for (let prop of props) { - if (queryInfo[prop] !== null && queryInfo[prop] != tab[prop]) { - return false; - } - } - - if (queryInfo.audible !== null) { - if (queryInfo.audible != tab.audible) { - return false; - } - } - - if (queryInfo.muted !== null) { - if (queryInfo.muted != tab.mutedInfo.muted) { - return false; - } - } - - if (queryInfo.cookieStoreId !== null && - tab.cookieStoreId != queryInfo.cookieStoreId) { - return false; - } - - if (pattern && !pattern.matches(Services.io.newURI(tab.url, null, null))) { - return false; - } - - return true; - } - - let result = []; - for (let window of WindowListManager.browserWindows()) { - let lastFocused = window === WindowManager.topWindow; - if (queryInfo.lastFocusedWindow !== null && queryInfo.lastFocusedWindow !== lastFocused) { - continue; - } - - let windowType = WindowManager.windowType(window); - if (queryInfo.windowType !== null && queryInfo.windowType !== windowType) { - continue; - } - - if (queryInfo.windowId !== null) { - if (queryInfo.windowId === WindowManager.WINDOW_ID_CURRENT) { - if (currentWindow(context) !== window) { - continue; - } - } else if (queryInfo.windowId !== WindowManager.getId(window)) { - continue; - } - } - - if (queryInfo.currentWindow !== null) { - let eq = window === currentWindow(context); - if (queryInfo.currentWindow != eq) { - continue; - } - } - - let tabs = TabManager.for(extension).getTabs(window); - for (let tab of tabs) { - if (matches(tab)) { - result.push(tab); - } - } - } - return Promise.resolve(result); - }, - - captureVisibleTab: function(windowId, options) { - if (!extension.hasPermission("<all_urls>")) { - return Promise.reject({message: "The <all_urls> permission is required to use the captureVisibleTab API"}); - } - - let window = windowId == null ? - WindowManager.topWindow : - WindowManager.getWindow(windowId, context); - - let tab = window.gBrowser.selectedTab; - return tabListener.awaitTabReady(tab).then(() => { - let browser = tab.linkedBrowser; - let recipient = { - innerWindowID: browser.innerWindowID, - }; - - if (!options) { - options = {}; - } - if (options.format == null) { - options.format = "png"; - } - if (options.quality == null) { - options.quality = 92; - } - - let message = { - options, - width: browser.clientWidth, - height: browser.clientHeight, - }; - - return context.sendMessage(browser.messageManager, "Extension:Capture", - message, {recipient}); - }); - }, - - detectLanguage: function(tabId) { - let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab; - - return tabListener.awaitTabReady(tab).then(() => { - let browser = tab.linkedBrowser; - let recipient = {innerWindowID: browser.innerWindowID}; - - return context.sendMessage(browser.messageManager, "Extension:DetectLanguage", - {}, {recipient}); - }); - }, - - // Used to executeScript, insertCSS and removeCSS. - _execute: function(tabId, details, kind, method) { - let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab; - - let options = { - js: [], - css: [], - remove_css: method == "removeCSS", - }; - - // We require a `code` or a `file` property, but we can't accept both. - if ((details.code === null) == (details.file === null)) { - return Promise.reject({message: `${method} requires either a 'code' or a 'file' property, but not both`}); - } - - if (details.frameId !== null && details.allFrames) { - return Promise.reject({message: `'frameId' and 'allFrames' are mutually exclusive`}); - } - - if (TabManager.for(extension).hasActiveTabPermission(tab)) { - // If we have the "activeTab" permission for this tab, ignore - // the host whitelist. - options.matchesHost = ["<all_urls>"]; - } else { - options.matchesHost = extension.whiteListedHosts.serialize(); - } - - if (details.code !== null) { - options[kind + "Code"] = details.code; - } - if (details.file !== null) { - let url = context.uri.resolve(details.file); - if (!extension.isExtensionURL(url)) { - return Promise.reject({message: "Files to be injected must be within the extension"}); - } - options[kind].push(url); - } - if (details.allFrames) { - options.all_frames = details.allFrames; - } - if (details.frameId !== null) { - options.frame_id = details.frameId; - } - if (details.matchAboutBlank) { - options.match_about_blank = details.matchAboutBlank; - } - if (details.runAt !== null) { - options.run_at = details.runAt; - } else { - options.run_at = "document_idle"; - } - - return tabListener.awaitTabReady(tab).then(() => { - let browser = tab.linkedBrowser; - let recipient = { - innerWindowID: browser.innerWindowID, - }; - - return context.sendMessage(browser.messageManager, "Extension:Execute", {options}, {recipient}); - }); - }, - - executeScript: function(tabId, details) { - return self.tabs._execute(tabId, details, "js", "executeScript"); - }, - - insertCSS: function(tabId, details) { - return self.tabs._execute(tabId, details, "css", "insertCSS").then(() => {}); - }, - - removeCSS: function(tabId, details) { - return self.tabs._execute(tabId, details, "css", "removeCSS").then(() => {}); - }, - - move: function(tabIds, moveProperties) { - let index = moveProperties.index; - let tabsMoved = []; - if (!Array.isArray(tabIds)) { - tabIds = [tabIds]; - } - - let destinationWindow = null; - if (moveProperties.windowId !== null) { - destinationWindow = WindowManager.getWindow(moveProperties.windowId, context); - // Fail on an invalid window. - if (!destinationWindow) { - return Promise.reject({message: `Invalid window ID: ${moveProperties.windowId}`}); - } - } - - /* - Indexes are maintained on a per window basis so that a call to - move([tabA, tabB], {index: 0}) - -> tabA to 0, tabB to 1 if tabA and tabB are in the same window - move([tabA, tabB], {index: 0}) - -> tabA to 0, tabB to 0 if tabA and tabB are in different windows - */ - let indexMap = new Map(); - - let tabs = tabIds.map(tabId => TabManager.getTab(tabId, context)); - for (let tab of tabs) { - // If the window is not specified, use the window from the tab. - let window = destinationWindow || tab.ownerGlobal; - let gBrowser = window.gBrowser; - - let insertionPoint = indexMap.get(window) || index; - // If the index is -1 it should go to the end of the tabs. - if (insertionPoint == -1) { - insertionPoint = gBrowser.tabs.length; - } - - // We can only move pinned tabs to a point within, or just after, - // the current set of pinned tabs. Unpinned tabs, likewise, can only - // be moved to a position after the current set of pinned tabs. - // Attempts to move a tab to an illegal position are ignored. - let numPinned = gBrowser._numPinnedTabs; - let ok = tab.pinned ? insertionPoint <= numPinned : insertionPoint >= numPinned; - if (!ok) { - continue; - } - - indexMap.set(window, insertionPoint + 1); - - if (tab.ownerGlobal != window) { - // If the window we are moving the tab in is different, then move the tab - // to the new window. - tab = gBrowser.adoptTab(tab, insertionPoint, false); - } else { - // If the window we are moving is the same, just move the tab. - gBrowser.moveTabTo(tab, insertionPoint); - } - tabsMoved.push(tab); - } - - return Promise.resolve(tabsMoved.map(tab => TabManager.convert(extension, tab))); - }, - - duplicate: function(tabId) { - let tab = TabManager.getTab(tabId, context); - - let gBrowser = tab.ownerGlobal.gBrowser; - let newTab = gBrowser.duplicateTab(tab); - - return new Promise(resolve => { - // We need to use SSTabRestoring because any attributes set before - // are ignored. SSTabRestored is too late and results in a jump in - // the UI. See http://bit.ly/session-store-api for more information. - newTab.addEventListener("SSTabRestoring", function listener() { - // As the tab is restoring, move it to the correct position. - newTab.removeEventListener("SSTabRestoring", listener); - // Pinned tabs that are duplicated are inserted - // after the existing pinned tab and pinned. - if (tab.pinned) { - gBrowser.pinTab(newTab); - } - gBrowser.moveTabTo(newTab, tab._tPos + 1); - }); - - newTab.addEventListener("SSTabRestored", function listener() { - // Once it has been restored, select it and return the promise. - newTab.removeEventListener("SSTabRestored", listener); - gBrowser.selectedTab = newTab; - return resolve(TabManager.convert(extension, newTab)); - }); - }); - }, - - getZoom(tabId) { - let tab = tabId ? TabManager.getTab(tabId, context) : TabManager.activeTab; - - let {ZoomManager} = tab.ownerGlobal; - let zoom = ZoomManager.getZoomForBrowser(tab.linkedBrowser); - - return Promise.resolve(zoom); - }, - - setZoom(tabId, zoom) { - let tab = tabId ? TabManager.getTab(tabId, context) : TabManager.activeTab; - - let {FullZoom, ZoomManager} = tab.ownerGlobal; - - if (zoom === 0) { - // A value of zero means use the default zoom factor. - return FullZoom.reset(tab.linkedBrowser); - } else if (zoom >= ZoomManager.MIN && zoom <= ZoomManager.MAX) { - FullZoom.setZoom(zoom, tab.linkedBrowser); - } else { - return Promise.reject({ - message: `Zoom value ${zoom} out of range (must be between ${ZoomManager.MIN} and ${ZoomManager.MAX})`, - }); - } - - return Promise.resolve(); - }, - - _getZoomSettings(tabId) { - let tab = tabId ? TabManager.getTab(tabId, context) : TabManager.activeTab; - - let {FullZoom} = tab.ownerGlobal; - - return { - mode: "automatic", - scope: FullZoom.siteSpecific ? "per-origin" : "per-tab", - defaultZoomFactor: 1, - }; - }, - - getZoomSettings(tabId) { - return Promise.resolve(this._getZoomSettings(tabId)); - }, - - setZoomSettings(tabId, settings) { - let tab = tabId ? TabManager.getTab(tabId, context) : TabManager.activeTab; - - let currentSettings = this._getZoomSettings(tab.id); - - if (!Object.keys(settings).every(key => settings[key] === currentSettings[key])) { - return Promise.reject(`Unsupported zoom settings: ${JSON.stringify(settings)}`); - } - return Promise.resolve(); - }, - - onZoomChange: new EventManager(context, "tabs.onZoomChange", fire => { - let getZoomLevel = browser => { - let {ZoomManager} = browser.ownerGlobal; - - return ZoomManager.getZoomForBrowser(browser); - }; - - // Stores the last known zoom level for each tab's browser. - // WeakMap[<browser> -> number] - let zoomLevels = new WeakMap(); - - // Store the zoom level for all existing tabs. - for (let window of WindowListManager.browserWindows()) { - for (let tab of window.gBrowser.tabs) { - let browser = tab.linkedBrowser; - zoomLevels.set(browser, getZoomLevel(browser)); - } - } - - let tabCreated = (eventName, event) => { - let browser = event.tab.linkedBrowser; - zoomLevels.set(browser, getZoomLevel(browser)); - }; - - - let zoomListener = event => { - let browser = event.originalTarget; - - // For non-remote browsers, this event is dispatched on the document - // rather than on the <browser>. - if (browser instanceof Ci.nsIDOMDocument) { - browser = browser.defaultView.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDocShell) - .chromeEventHandler; - } - - let {gBrowser} = browser.ownerGlobal; - let tab = gBrowser.getTabForBrowser(browser); - if (!tab) { - // We only care about zoom events in the top-level browser of a tab. - return; - } - - let oldZoomFactor = zoomLevels.get(browser); - let newZoomFactor = getZoomLevel(browser); - - if (oldZoomFactor != newZoomFactor) { - zoomLevels.set(browser, newZoomFactor); - - let tabId = TabManager.getId(tab); - fire({ - tabId, - oldZoomFactor, - newZoomFactor, - zoomSettings: self.tabs._getZoomSettings(tabId), - }); - } - }; - - tabListener.on("tab-attached", tabCreated); - tabListener.on("tab-created", tabCreated); - - AllWindowEvents.addListener("FullZoomChange", zoomListener); - AllWindowEvents.addListener("TextZoomChange", zoomListener); - return () => { - tabListener.off("tab-attached", tabCreated); - tabListener.off("tab-created", tabCreated); - - AllWindowEvents.removeListener("FullZoomChange", zoomListener); - AllWindowEvents.removeListener("TextZoomChange", zoomListener); - }; - }).api(), - }, - }; - return self; -}); diff --git a/application/basilisk/components/webextensions/ext-utils.js b/application/basilisk/components/webextensions/ext-utils.js deleted file mode 100644 index 75b2f4bd4..000000000 --- a/application/basilisk/components/webextensions/ext-utils.js +++ /dev/null @@ -1,1239 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI", - "resource:///modules/CustomizableUI.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", - "resource://gre/modules/NetUtil.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", - "resource://gre/modules/PrivateBrowsingUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "Task", - "resource://gre/modules/Task.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "setTimeout", - "resource://gre/modules/Timer.jsm"); - -XPCOMUtils.defineLazyServiceGetter(this, "styleSheetService", - "@mozilla.org/content/style-sheet-service;1", - "nsIStyleSheetService"); - -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); -Cu.import("resource://gre/modules/AppConstants.jsm"); - -const POPUP_LOAD_TIMEOUT_MS = 200; - -const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; - -var { - DefaultWeakMap, - EventManager, - promiseEvent, -} = ExtensionUtils; - -// This file provides some useful code for the |tabs| and |windows| -// modules. All of the code is installed on |global|, which is a scope -// shared among the different ext-*.js scripts. - -global.makeWidgetId = id => { - id = id.toLowerCase(); - // FIXME: This allows for collisions. - return id.replace(/[^a-z0-9_-]/g, "_"); -}; - -function promisePopupShown(popup) { - return new Promise(resolve => { - if (popup.state == "open") { - resolve(); - } else { - popup.addEventListener("popupshown", function onPopupShown(event) { - popup.removeEventListener("popupshown", onPopupShown); - resolve(); - }); - } - }); -} - -XPCOMUtils.defineLazyGetter(this, "popupStylesheets", () => { - let stylesheets = ["chrome://browser/content/extension.css"]; - - if (AppConstants.platform === "macosx") { - stylesheets.push("chrome://browser/content/extension-mac.css"); - } - return stylesheets; -}); - -XPCOMUtils.defineLazyGetter(this, "standaloneStylesheets", () => { - let stylesheets = []; - - if (AppConstants.platform === "macosx") { - stylesheets.push("chrome://browser/content/extension-mac-panel.css"); - } - if (AppConstants.platform === "win") { - stylesheets.push("chrome://browser/content/extension-win-panel.css"); - } - return stylesheets; -}); - -class BasePopup { - constructor(extension, viewNode, popupURL, browserStyle, fixedWidth = false) { - this.extension = extension; - this.popupURL = popupURL; - this.viewNode = viewNode; - this.browserStyle = browserStyle; - this.window = viewNode.ownerGlobal; - this.destroyed = false; - this.fixedWidth = fixedWidth; - - extension.callOnClose(this); - - this.contentReady = new Promise(resolve => { - this._resolveContentReady = resolve; - }); - - this.viewNode.addEventListener(this.DESTROY_EVENT, this); - - let doc = viewNode.ownerDocument; - let arrowContent = doc.getAnonymousElementByAttribute(this.panel, "class", "panel-arrowcontent"); - this.borderColor = doc.defaultView.getComputedStyle(arrowContent).borderTopColor; - - this.browser = null; - this.browserLoaded = new Promise((resolve, reject) => { - this.browserLoadedDeferred = {resolve, reject}; - }); - this.browserReady = this.createBrowser(viewNode, popupURL); - - BasePopup.instances.get(this.window).set(extension, this); - } - - static for(extension, window) { - return BasePopup.instances.get(window).get(extension); - } - - close() { - this.closePopup(); - } - - destroy() { - this.extension.forgetOnClose(this); - - this.destroyed = true; - this.browserLoadedDeferred.reject(new Error("Popup destroyed")); - return this.browserReady.then(() => { - this.destroyBrowser(this.browser); - this.browser.remove(); - - this.viewNode.removeEventListener(this.DESTROY_EVENT, this); - this.viewNode.style.maxHeight = ""; - - if (this.panel) { - this.panel.style.removeProperty("--arrowpanel-background"); - this.panel.style.removeProperty("--panel-arrow-image-vertical"); - } - - BasePopup.instances.get(this.window).delete(this.extension); - - this.browser = null; - this.viewNode = null; - }); - } - - destroyBrowser(browser) { - let mm = browser.messageManager; - // If the browser has already been removed from the document, because the - // popup was closed externally, there will be no message manager here. - if (mm) { - mm.removeMessageListener("DOMTitleChanged", this); - mm.removeMessageListener("Extension:BrowserBackgroundChanged", this); - mm.removeMessageListener("Extension:BrowserContentLoaded", this); - mm.removeMessageListener("Extension:BrowserResized", this); - mm.removeMessageListener("Extension:DOMWindowClose", this); - } - } - - // Returns the name of the event fired on `viewNode` when the popup is being - // destroyed. This must be implemented by every subclass. - get DESTROY_EVENT() { - throw new Error("Not implemented"); - } - - get STYLESHEETS() { - let sheets = []; - - if (this.browserStyle) { - sheets.push(...popupStylesheets); - } - if (!this.fixedWidth) { - sheets.push(...standaloneStylesheets); - } - - return sheets; - } - - get panel() { - let panel = this.viewNode; - while (panel && panel.localName != "panel") { - panel = panel.parentNode; - } - return panel; - } - - receiveMessage({name, data}) { - switch (name) { - case "DOMTitleChanged": - this.viewNode.setAttribute("aria-label", this.browser.contentTitle); - break; - - case "Extension:BrowserBackgroundChanged": - this.setBackground(data.background); - break; - - case "Extension:BrowserContentLoaded": - this.browserLoadedDeferred.resolve(); - break; - - case "Extension:BrowserResized": - this._resolveContentReady(); - if (this.ignoreResizes) { - this.dimensions = data; - } else { - this.resizeBrowser(data); - } - break; - - case "Extension:DOMWindowClose": - this.closePopup(); - break; - } - } - - handleEvent(event) { - switch (event.type) { - case this.DESTROY_EVENT: - this.destroy(); - break; - } - } - - createBrowser(viewNode, popupURL = null) { - let document = viewNode.ownerDocument; - this.browser = document.createElementNS(XUL_NS, "browser"); - this.browser.setAttribute("type", "content"); - this.browser.setAttribute("disableglobalhistory", "true"); - this.browser.setAttribute("transparent", "true"); - this.browser.setAttribute("class", "webextension-popup-browser"); - this.browser.setAttribute("tooltip", "aHTMLTooltip"); - - // We only need flex sizing for the sake of the slide-in sub-views of the - // main menu panel, so that the browser occupies the full width of the view, - // and also takes up any extra height that's available to it. - this.browser.setAttribute("flex", "1"); - - // Note: When using noautohide panels, the popup manager will add width and - // height attributes to the panel, breaking our resize code, if the browser - // starts out smaller than 30px by 10px. This isn't an issue now, but it - // will be if and when we popup debugging. - - viewNode.appendChild(this.browser); - - extensions.emit("extension-browser-inserted", this.browser); - let windowId = WindowManager.getId(this.browser.ownerGlobal); - this.browser.messageManager.sendAsyncMessage("Extension:InitExtensionView", { - viewType: "popup", - windowId, - }); - // TODO(robwu): Rework this to use the Extension:ExtensionViewLoaded message - // to detect loads and so on. And definitely move this content logic inside - // a file in the child process. - - let initBrowser = browser => { - let mm = browser.messageManager; - mm.addMessageListener("DOMTitleChanged", this); - mm.addMessageListener("Extension:BrowserBackgroundChanged", this); - mm.addMessageListener("Extension:BrowserContentLoaded", this); - mm.addMessageListener("Extension:BrowserResized", this); - mm.addMessageListener("Extension:DOMWindowClose", this, true); - }; - - if (!popupURL) { - initBrowser(this.browser); - return this.browser; - } - - return promiseEvent(this.browser, "load").then(() => { - initBrowser(this.browser); - - let mm = this.browser.messageManager; - - mm.loadFrameScript( - "chrome://extensions/content/ext-browser-content.js", false); - - mm.sendAsyncMessage("Extension:InitBrowser", { - allowScriptsToClose: true, - fixedWidth: this.fixedWidth, - maxWidth: 800, - maxHeight: 600, - stylesheets: this.STYLESHEETS, - }); - - this.browser.setAttribute("src", popupURL); - }); - } - - resizeBrowser({width, height, detail}) { - if (this.fixedWidth) { - // Figure out how much extra space we have on the side of the panel - // opposite the arrow. - let side = this.panel.getAttribute("side") == "top" ? "bottom" : "top"; - let maxHeight = this.viewHeight + this.extraHeight[side]; - - height = Math.min(height, maxHeight); - this.browser.style.height = `${height}px`; - - // Set a maximum height on the <panelview> element to our preferred - // maximum height, so that the PanelUI resizing code can make an accurate - // calculation. If we don't do this, the flex sizing logic will prevent us - // from ever reporting a preferred size smaller than the height currently - // available to us in the panel. - height = Math.max(height, this.viewHeight); - this.viewNode.style.maxHeight = `${height}px`; - } else { - this.browser.style.width = `${width}px`; - this.browser.style.height = `${height}px`; - } - - let event = new this.window.CustomEvent("WebExtPopupResized", {detail}); - this.browser.dispatchEvent(event); - } - - setBackground(background) { - let panelBackground = ""; - let panelArrow = ""; - - if (background) { - let borderColor = this.borderColor || background; - - panelBackground = background; - panelArrow = `url("data:image/svg+xml,${encodeURIComponent(`<?xml version="1.0" encoding="UTF-8"?> - <svg xmlns="http://www.w3.org/2000/svg" width="20" height="10"> - <path d="M 0,10 L 10,0 20,10 z" fill="${borderColor}"/> - <path d="M 1,10 L 10,1 19,10 z" fill="${background}"/> - </svg> - `)}")`; - } - - this.panel.style.setProperty("--arrowpanel-background", panelBackground); - this.panel.style.setProperty("--panel-arrow-image-vertical", panelArrow); - this.background = background; - } -} - -/** - * A map of active popups for a given browser window. - * - * WeakMap[window -> WeakMap[Extension -> BasePopup]] - */ -BasePopup.instances = new DefaultWeakMap(() => new WeakMap()); - -class PanelPopup extends BasePopup { - constructor(extension, imageNode, popupURL, browserStyle) { - let document = imageNode.ownerDocument; - - let panel = document.createElement("panel"); - panel.setAttribute("id", makeWidgetId(extension.id) + "-panel"); - panel.setAttribute("class", "browser-extension-panel"); - panel.setAttribute("tabspecific", "true"); - panel.setAttribute("type", "arrow"); - panel.setAttribute("role", "group"); - - document.getElementById("mainPopupSet").appendChild(panel); - - super(extension, panel, popupURL, browserStyle); - - this.contentReady.then(() => { - panel.openPopup(imageNode, "bottomcenter topright", 0, 0, false, false); - - let event = new this.window.CustomEvent("WebExtPopupLoaded", { - bubbles: true, - detail: {extension}, - }); - this.browser.dispatchEvent(event); - }); - } - - get DESTROY_EVENT() { - return "popuphidden"; - } - - destroy() { - super.destroy(); - this.viewNode.remove(); - } - - closePopup() { - promisePopupShown(this.viewNode).then(() => { - // Make sure we're not already destroyed. - if (this.viewNode) { - this.viewNode.hidePopup(); - } - }); - } -} - -class ViewPopup extends BasePopup { - constructor(extension, window, popupURL, browserStyle, fixedWidth) { - let document = window.document; - - // Create a temporary panel to hold the browser while it pre-loads its - // content. This panel will never be shown, but the browser's docShell will - // be swapped with the browser in the real panel when it's ready. - let panel = document.createElement("panel"); - panel.setAttribute("type", "arrow"); - document.getElementById("mainPopupSet").appendChild(panel); - - super(extension, panel, popupURL, browserStyle, fixedWidth); - - this.ignoreResizes = true; - - this.attached = false; - this.tempPanel = panel; - - this.browser.classList.add("webextension-preload-browser"); - } - - /** - * Attaches the pre-loaded browser to the given view node, and reserves a - * promise which resolves when the browser is ready. - * - * @param {Element} viewNode - * The node to attach the browser to. - * @returns {Promise<boolean>} - * Resolves when the browser is ready. Resolves to `false` if the - * browser was destroyed before it was fully loaded, and the popup - * should be closed, or `true` otherwise. - */ - attach(viewNode) { - return Task.spawn(function* () { - this.viewNode = viewNode; - this.viewNode.addEventListener(this.DESTROY_EVENT, this); - - // Wait until the browser element is fully initialized, and give it at least - // a short grace period to finish loading its initial content, if necessary. - // - // In practice, the browser that was created by the mousdown handler should - // nearly always be ready by this point. - yield Promise.all([ - this.browserReady, - Promise.race([ - // This promise may be rejected if the popup calls window.close() - // before it has fully loaded. - this.browserLoaded.catch(() => {}), - new Promise(resolve => setTimeout(resolve, POPUP_LOAD_TIMEOUT_MS)), - ]), - ]); - - if (!this.destroyed && !this.panel) { - this.destroy(); - } - - if (this.destroyed) { - return false; - } - - this.attached = true; - - // Store the initial height of the view, so that we never resize menu panel - // sub-views smaller than the initial height of the menu. - this.viewHeight = this.viewNode.boxObject.height; - - // Calculate the extra height available on the screen above and below the - // menu panel. Use that to calculate the how much the sub-view may grow. - let popupRect = this.panel.getBoundingClientRect(); - - this.setBackground(this.background); - - let win = this.window; - let popupBottom = win.mozInnerScreenY + popupRect.bottom; - let popupTop = win.mozInnerScreenY + popupRect.top; - - let screenBottom = win.screen.availTop + win.screen.availHeight; - this.extraHeight = { - bottom: Math.max(0, screenBottom - popupBottom), - top: Math.max(0, popupTop - win.screen.availTop), - }; - - // Create a new browser in the real popup. - let browser = this.browser; - this.createBrowser(this.viewNode); - - this.browser.swapDocShells(browser); - this.destroyBrowser(browser); - - this.ignoreResizes = false; - if (this.dimensions) { - this.resizeBrowser(this.dimensions); - } - - this.tempPanel.remove(); - this.tempPanel = null; - - let event = new this.window.CustomEvent("WebExtPopupLoaded", { - bubbles: true, - detail: {extension: this.extension}, - }); - this.browser.dispatchEvent(event); - - return true; - }.bind(this)); - } - - destroy() { - return super.destroy().then(() => { - if (this.tempPanel) { - this.tempPanel.remove(); - this.tempPanel = null; - } - }); - } - - get DESTROY_EVENT() { - return "ViewHiding"; - } - - closePopup() { - if (this.attached) { - CustomizableUI.hidePanelForNode(this.viewNode); - } else { - this.destroy(); - } - } -} - -Object.assign(global, {PanelPopup, ViewPopup}); - -// Manages tab-specific context data, and dispatching tab select events -// across all windows. -global.TabContext = function TabContext(getDefaults, extension) { - this.extension = extension; - this.getDefaults = getDefaults; - - this.tabData = new WeakMap(); - this.lastLocation = new WeakMap(); - - AllWindowEvents.addListener("progress", this); - AllWindowEvents.addListener("TabSelect", this); - - EventEmitter.decorate(this); -}; - -TabContext.prototype = { - get(tab) { - if (!this.tabData.has(tab)) { - this.tabData.set(tab, this.getDefaults(tab)); - } - - return this.tabData.get(tab); - }, - - clear(tab) { - this.tabData.delete(tab); - }, - - handleEvent(event) { - if (event.type == "TabSelect") { - let tab = event.target; - this.emit("tab-select", tab); - this.emit("location-change", tab); - } - }, - - onStateChange(browser, webProgress, request, stateFlags, statusCode) { - let flags = Ci.nsIWebProgressListener; - - if (!(~stateFlags & (flags.STATE_IS_WINDOW | flags.STATE_START) || - this.lastLocation.has(browser))) { - this.lastLocation.set(browser, request.URI); - } - }, - - onLocationChange(browser, webProgress, request, locationURI, flags) { - let gBrowser = browser.ownerGlobal.gBrowser; - let lastLocation = this.lastLocation.get(browser); - if (browser === gBrowser.selectedBrowser && - !(lastLocation && lastLocation.equalsExceptRef(browser.currentURI))) { - let tab = gBrowser.getTabForBrowser(browser); - this.emit("location-change", tab, true); - } - this.lastLocation.set(browser, browser.currentURI); - }, - - shutdown() { - AllWindowEvents.removeListener("progress", this); - AllWindowEvents.removeListener("TabSelect", this); - }, -}; - -// Manages tab mappings and permissions for a specific extension. -function ExtensionTabManager(extension) { - this.extension = extension; - - // A mapping of tab objects to the inner window ID the extension currently has - // the active tab permission for. The active permission for a given tab is - // valid only for the inner window that was active when the permission was - // granted. If the tab navigates, the inner window ID changes, and the - // permission automatically becomes stale. - // - // WeakMap[tab => inner-window-id<int>] - this.hasTabPermissionFor = new WeakMap(); -} - -ExtensionTabManager.prototype = { - addActiveTabPermission(tab = TabManager.activeTab) { - if (this.extension.hasPermission("activeTab")) { - // Note that, unlike Chrome, we don't currently clear this permission with - // the tab navigates. If the inner window is revived from BFCache before - // we've granted this permission to a new inner window, the extension - // maintains its permissions for it. - this.hasTabPermissionFor.set(tab, tab.linkedBrowser.innerWindowID); - } - }, - - revokeActiveTabPermission(tab = TabManager.activeTab) { - this.hasTabPermissionFor.delete(tab); - }, - - // Returns true if the extension has the "activeTab" permission for this tab. - // This is somewhat more permissive than the generic "tabs" permission, as - // checked by |hasTabPermission|, in that it also allows programmatic script - // injection without an explicit host permission. - hasActiveTabPermission(tab) { - // This check is redundant with addTabPermission, but cheap. - if (this.extension.hasPermission("activeTab")) { - return (this.hasTabPermissionFor.has(tab) && - this.hasTabPermissionFor.get(tab) === tab.linkedBrowser.innerWindowID); - } - return false; - }, - - hasTabPermission(tab) { - return this.extension.hasPermission("tabs") || this.hasActiveTabPermission(tab); - }, - - convert(tab) { - let window = tab.ownerGlobal; - let browser = tab.linkedBrowser; - - let mutedInfo = {muted: tab.muted}; - if (tab.muteReason === null) { - mutedInfo.reason = "user"; - } else if (tab.muteReason) { - mutedInfo.reason = "extension"; - mutedInfo.extensionId = tab.muteReason; - } - - let result = { - id: TabManager.getId(tab), - index: tab._tPos, - windowId: WindowManager.getId(window), - selected: tab.selected, - highlighted: tab.selected, - active: tab.selected, - pinned: tab.pinned, - status: TabManager.getStatus(tab), - incognito: WindowManager.isBrowserPrivate(browser), - width: browser.frameLoader.lazyWidth || browser.clientWidth, - height: browser.frameLoader.lazyHeight || browser.clientHeight, - audible: tab.soundPlaying, - mutedInfo, - }; - if (this.extension.hasPermission("cookies")) { - result.cookieStoreId = getCookieStoreIdForTab(result, tab); - } - - if (this.hasTabPermission(tab)) { - result.url = browser.currentURI.spec; - let title = browser.contentTitle || tab.label; - if (title) { - result.title = title; - } - let icon = window.gBrowser.getIcon(tab); - if (icon) { - result.favIconUrl = icon; - } - } - - return result; - }, - - // Converts tabs returned from SessionStore.getClosedTabData and - // SessionStore.getClosedWindowData into API tab objects - convertFromSessionStoreClosedData(tab, window) { - let result = { - sessionId: String(tab.closedId), - index: tab.pos ? tab.pos : 0, - windowId: WindowManager.getId(window), - selected: false, - highlighted: false, - active: false, - pinned: false, - incognito: Boolean(tab.state && tab.state.isPrivate), - }; - - if (this.hasTabPermission(tab)) { - let entries = tab.state ? tab.state.entries : tab.entries; - result.url = entries[0].url; - result.title = entries[0].title; - if (tab.image) { - result.favIconUrl = tab.image; - } - } - - return result; - }, - - getTabs(window) { - return Array.from(window.gBrowser.tabs) - .filter(tab => !tab.closing) - .map(tab => this.convert(tab)); - }, -}; - -// Sends the tab and windowId upon request. This is primarily used to support -// the synchronous `browser.extension.getViews` API. -let onGetTabAndWindowId = { - receiveMessage({name, target, sync}) { - let {gBrowser} = target.ownerGlobal; - let tab = gBrowser && gBrowser.getTabForBrowser(target); - if (tab) { - let reply = { - tabId: TabManager.getId(tab), - windowId: WindowManager.getId(tab.ownerGlobal), - }; - if (sync) { - return reply; - } - target.messageManager.sendAsyncMessage("Extension:SetTabAndWindowId", reply); - } - }, -}; -/* eslint-disable mozilla/balanced-listeners */ -Services.mm.addMessageListener("Extension:GetTabAndWindowId", onGetTabAndWindowId); -/* eslint-enable mozilla/balanced-listeners */ - - -// Manages global mappings between XUL tabs and extension tab IDs. -global.TabManager = { - _tabs: new WeakMap(), - _nextId: 1, - _initialized: false, - - // We begin listening for TabOpen and TabClose events once we've started - // assigning IDs to tabs, so that we can remap the IDs of tabs which are moved - // between windows. - initListener() { - if (this._initialized) { - return; - } - - AllWindowEvents.addListener("TabOpen", this); - AllWindowEvents.addListener("TabClose", this); - WindowListManager.addOpenListener(this.handleWindowOpen.bind(this)); - - this._initialized = true; - }, - - handleEvent(event) { - if (event.type == "TabOpen") { - let {adoptedTab} = event.detail; - if (adoptedTab) { - // This tab is being created to adopt a tab from a different window. - // Copy the ID from the old tab to the new. - let tab = event.target; - this._tabs.set(tab, this.getId(adoptedTab)); - - tab.linkedBrowser.messageManager.sendAsyncMessage("Extension:SetTabAndWindowId", { - windowId: WindowManager.getId(tab.ownerGlobal), - }); - } - } else if (event.type == "TabClose") { - let {adoptedBy} = event.detail; - if (adoptedBy) { - // This tab is being closed because it was adopted by a new window. - // Copy its ID to the new tab, in case it was created as the first tab - // of a new window, and did not have an `adoptedTab` detail when it was - // opened. - this._tabs.set(adoptedBy, this.getId(event.target)); - - adoptedBy.linkedBrowser.messageManager.sendAsyncMessage("Extension:SetTabAndWindowId", { - windowId: WindowManager.getId(adoptedBy), - }); - } - } - }, - - handleWindowOpen(window) { - if (window.arguments && window.arguments[0] instanceof window.XULElement) { - // If the first window argument is a XUL element, it means the - // window is about to adopt a tab from another window to replace its - // initial tab. - let adoptedTab = window.arguments[0]; - - this._tabs.set(window.gBrowser.tabs[0], this.getId(adoptedTab)); - } - }, - - getId(tab) { - if (this._tabs.has(tab)) { - return this._tabs.get(tab); - } - this.initListener(); - - let id = this._nextId++; - this._tabs.set(tab, id); - return id; - }, - - getBrowserId(browser) { - let gBrowser = browser.ownerGlobal.gBrowser; - // Some non-browser windows have gBrowser but not - // getTabForBrowser! - if (gBrowser && gBrowser.getTabForBrowser) { - let tab = gBrowser.getTabForBrowser(browser); - if (tab) { - return this.getId(tab); - } - } - return -1; - }, - - /** - * Returns the XUL <tab> element associated with the given tab ID. If no tab - * with the given ID exists, and no default value is provided, an error is - * raised, belonging to the scope of the given context. - * - * @param {integer} tabId - * The ID of the tab to retrieve. - * @param {ExtensionContext} context - * The context of the caller. - * This value may be omitted if `default_` is not `undefined`. - * @param {*} default_ - * The value to return if no tab exists with the given ID. - * @returns {Element<tab>} - * A XUL <tab> element. - */ - getTab(tabId, context, default_ = undefined) { - // FIXME: Speed this up without leaking memory somehow. - for (let window of WindowListManager.browserWindows()) { - if (!window.gBrowser) { - continue; - } - for (let tab of window.gBrowser.tabs) { - if (this.getId(tab) == tabId) { - return tab; - } - } - } - if (default_ !== undefined) { - return default_; - } - throw new context.cloneScope.Error(`Invalid tab ID: ${tabId}`); - }, - - get activeTab() { - let window = WindowManager.topWindow; - if (window && window.gBrowser) { - return window.gBrowser.selectedTab; - } - return null; - }, - - getStatus(tab) { - return tab.getAttribute("busy") == "true" ? "loading" : "complete"; - }, - - convert(extension, tab) { - return TabManager.for(extension).convert(tab); - }, -}; - -// WeakMap[Extension -> ExtensionTabManager] -let tabManagers = new WeakMap(); - -// Returns the extension-specific tab manager for the given extension, or -// creates one if it doesn't already exist. -TabManager.for = function(extension) { - if (!tabManagers.has(extension)) { - tabManagers.set(extension, new ExtensionTabManager(extension)); - } - return tabManagers.get(extension); -}; - -/* eslint-disable mozilla/balanced-listeners */ -extensions.on("shutdown", (type, extension) => { - tabManagers.delete(extension); -}); -/* eslint-enable mozilla/balanced-listeners */ - -function memoize(fn) { - let weakMap = new DefaultWeakMap(fn); - return weakMap.get.bind(weakMap); -} - -// Manages mapping between XUL windows and extension window IDs. -global.WindowManager = { - _windows: new WeakMap(), - _nextId: 0, - - // Note: These must match the values in windows.json. - WINDOW_ID_NONE: -1, - WINDOW_ID_CURRENT: -2, - - get topWindow() { - return Services.wm.getMostRecentWindow("navigator:browser"); - }, - - windowType(window) { - // TODO: Make this work. - - let {chromeFlags} = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDocShell) - .treeOwner.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIXULWindow); - - if (chromeFlags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG) { - return "popup"; - } - - return "normal"; - }, - - updateGeometry(window, options) { - if (options.left !== null || options.top !== null) { - let left = options.left !== null ? options.left : window.screenX; - let top = options.top !== null ? options.top : window.screenY; - window.moveTo(left, top); - } - - if (options.width !== null || options.height !== null) { - let width = options.width !== null ? options.width : window.outerWidth; - let height = options.height !== null ? options.height : window.outerHeight; - window.resizeTo(width, height); - } - }, - - isBrowserPrivate: memoize(browser => { - return PrivateBrowsingUtils.isBrowserPrivate(browser); - }), - - getId(window) { - if (this._windows.has(window)) { - return this._windows.get(window); - } - let id = this._nextId++; - this._windows.set(window, id); - return id; - }, - - getWindow(id, context) { - if (id == this.WINDOW_ID_CURRENT) { - return currentWindow(context); - } - - for (let window of WindowListManager.browserWindows(true)) { - if (this.getId(window) == id) { - return window; - } - } - return null; - }, - - getState(window) { - const STATES = { - [window.STATE_MAXIMIZED]: "maximized", - [window.STATE_MINIMIZED]: "minimized", - [window.STATE_NORMAL]: "normal", - }; - let state = STATES[window.windowState]; - if (window.fullScreen) { - state = "fullscreen"; - } - return state; - }, - - setState(window, state) { - if (state != "fullscreen" && window.fullScreen) { - window.fullScreen = false; - } - - switch (state) { - case "maximized": - window.maximize(); - break; - - case "minimized": - case "docked": - window.minimize(); - break; - - case "normal": - // Restore sometimes returns the window to its previous state, rather - // than to the "normal" state, so it may need to be called anywhere from - // zero to two times. - window.restore(); - if (window.windowState != window.STATE_NORMAL) { - window.restore(); - } - if (window.windowState != window.STATE_NORMAL) { - // And on OS-X, where normal vs. maximized is basically a heuristic, - // we need to cheat. - window.sizeToContent(); - } - break; - - case "fullscreen": - window.fullScreen = true; - break; - - default: - throw new Error(`Unexpected window state: ${state}`); - } - }, - - convert(extension, window, getInfo) { - let xulWindow = window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDocShell) - .treeOwner.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIXULWindow); - - let result = { - id: this.getId(window), - focused: window.document.hasFocus(), - top: window.screenY, - left: window.screenX, - width: window.outerWidth, - height: window.outerHeight, - incognito: PrivateBrowsingUtils.isWindowPrivate(window), - type: this.windowType(window), - state: this.getState(window), - alwaysOnTop: xulWindow.zLevel >= Ci.nsIXULWindow.raisedZ, - }; - - if (getInfo && getInfo.populate) { - result.tabs = TabManager.for(extension).getTabs(window); - } - - return result; - }, - - // Converts windows returned from SessionStore.getClosedWindowData - // into API window objects - convertFromSessionStoreClosedData(window, extension) { - let result = { - sessionId: String(window.closedId), - focused: false, - incognito: false, - type: "normal", // this is always "normal" for a closed window - state: this.getState(window), - alwaysOnTop: false, - }; - - if (window.tabs.length) { - result.tabs = []; - window.tabs.forEach((tab, index) => { - result.tabs.push(TabManager.for(extension).convertFromSessionStoreClosedData(tab, window, index)); - }); - } - - return result; - }, -}; - -// Manages listeners for window opening and closing. A window is -// considered open when the "load" event fires on it. A window is -// closed when a "domwindowclosed" notification fires for it. -global.WindowListManager = { - _openListeners: new Set(), - _closeListeners: new Set(), - - // Returns an iterator for all browser windows. Unless |includeIncomplete| is - // true, only fully-loaded windows are returned. - * browserWindows(includeIncomplete = false) { - // The window type parameter is only available once the window's document - // element has been created. This means that, when looking for incomplete - // browser windows, we need to ignore the type entirely for windows which - // haven't finished loading, since we would otherwise skip browser windows - // in their early loading stages. - // This is particularly important given that the "domwindowcreated" event - // fires for browser windows when they're in that in-between state, and just - // before we register our own "domwindowcreated" listener. - - let e = Services.wm.getEnumerator(""); - while (e.hasMoreElements()) { - let window = e.getNext(); - - let ok = includeIncomplete; - if (window.document.readyState == "complete") { - ok = window.document.documentElement.getAttribute("windowtype") == "navigator:browser"; - } - - if (ok) { - yield window; - } - } - }, - - addOpenListener(listener) { - if (this._openListeners.size == 0 && this._closeListeners.size == 0) { - Services.ww.registerNotification(this); - } - this._openListeners.add(listener); - - for (let window of this.browserWindows(true)) { - if (window.document.readyState != "complete") { - window.addEventListener("load", this); - } - } - }, - - removeOpenListener(listener) { - this._openListeners.delete(listener); - if (this._openListeners.size == 0 && this._closeListeners.size == 0) { - Services.ww.unregisterNotification(this); - } - }, - - addCloseListener(listener) { - if (this._openListeners.size == 0 && this._closeListeners.size == 0) { - Services.ww.registerNotification(this); - } - this._closeListeners.add(listener); - }, - - removeCloseListener(listener) { - this._closeListeners.delete(listener); - if (this._openListeners.size == 0 && this._closeListeners.size == 0) { - Services.ww.unregisterNotification(this); - } - }, - - handleEvent(event) { - event.currentTarget.removeEventListener(event.type, this); - let window = event.target.defaultView; - if (window.document.documentElement.getAttribute("windowtype") != "navigator:browser") { - return; - } - - for (let listener of this._openListeners) { - listener(window); - } - }, - - observe(window, topic, data) { - if (topic == "domwindowclosed") { - if (window.document.documentElement.getAttribute("windowtype") != "navigator:browser") { - return; - } - - window.removeEventListener("load", this); - for (let listener of this._closeListeners) { - listener(window); - } - } else { - window.addEventListener("load", this); - } - }, -}; - -// Provides a facility to listen for DOM events across all XUL windows. -global.AllWindowEvents = { - _listeners: new Map(), - - // If |type| is a normal event type, invoke |listener| each time - // that event fires in any open window. If |type| is "progress", add - // a web progress listener that covers all open windows. - addListener(type, listener) { - if (type == "domwindowopened") { - return WindowListManager.addOpenListener(listener); - } else if (type == "domwindowclosed") { - return WindowListManager.addCloseListener(listener); - } - - if (this._listeners.size == 0) { - WindowListManager.addOpenListener(this.openListener); - } - - if (!this._listeners.has(type)) { - this._listeners.set(type, new Set()); - } - let list = this._listeners.get(type); - list.add(listener); - - // Register listener on all existing windows. - for (let window of WindowListManager.browserWindows()) { - this.addWindowListener(window, type, listener); - } - }, - - removeListener(eventType, listener) { - if (eventType == "domwindowopened") { - return WindowListManager.removeOpenListener(listener); - } else if (eventType == "domwindowclosed") { - return WindowListManager.removeCloseListener(listener); - } - - let listeners = this._listeners.get(eventType); - listeners.delete(listener); - if (listeners.size == 0) { - this._listeners.delete(eventType); - if (this._listeners.size == 0) { - WindowListManager.removeOpenListener(this.openListener); - } - } - - // Unregister listener from all existing windows. - let useCapture = eventType === "focus" || eventType === "blur"; - for (let window of WindowListManager.browserWindows()) { - if (eventType == "progress") { - window.gBrowser.removeTabsProgressListener(listener); - } else { - window.removeEventListener(eventType, listener, useCapture); - } - } - }, - - /* eslint-disable mozilla/balanced-listeners */ - addWindowListener(window, eventType, listener) { - let useCapture = eventType === "focus" || eventType === "blur"; - - if (eventType == "progress") { - window.gBrowser.addTabsProgressListener(listener); - } else { - window.addEventListener(eventType, listener, useCapture); - } - }, - /* eslint-enable mozilla/balanced-listeners */ - - // Runs whenever the "load" event fires for a new window. - openListener(window) { - for (let [eventType, listeners] of AllWindowEvents._listeners) { - for (let listener of listeners) { - this.addWindowListener(window, eventType, listener); - } - } - }, -}; - -AllWindowEvents.openListener = AllWindowEvents.openListener.bind(AllWindowEvents); - -// Subclass of EventManager where we just need to call -// add/removeEventListener on each XUL window. -global.WindowEventManager = function(context, name, event, listener) { - EventManager.call(this, context, name, fire => { - let listener2 = (...args) => listener(fire, ...args); - AllWindowEvents.addListener(event, listener2); - return () => { - AllWindowEvents.removeListener(event, listener2); - }; - }); -}; - -WindowEventManager.prototype = Object.create(EventManager.prototype); diff --git a/application/basilisk/components/webextensions/ext-windows.js b/application/basilisk/components/webextensions/ext-windows.js deleted file mode 100644 index 5956ae15b..000000000 --- a/application/basilisk/components/webextensions/ext-windows.js +++ /dev/null @@ -1,231 +0,0 @@ -/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */ -/* vim: set sts=2 sw=2 et tw=80: */ -"use strict"; - -XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService", - "@mozilla.org/browser/aboutnewtab-service;1", - "nsIAboutNewTabService"); -XPCOMUtils.defineLazyModuleGetter(this, "AppConstants", - "resource://gre/modules/AppConstants.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", - "resource://gre/modules/PrivateBrowsingUtils.jsm"); - -Cu.import("resource://gre/modules/ExtensionUtils.jsm"); -var { - EventManager, - promiseObserved, -} = ExtensionUtils; - -function onXULFrameLoaderCreated({target}) { - target.messageManager.sendAsyncMessage("AllowScriptsToClose", {}); -} - -extensions.registerSchemaAPI("windows", "addon_parent", context => { - let {extension} = context; - return { - windows: { - onCreated: - new WindowEventManager(context, "windows.onCreated", "domwindowopened", (fire, window) => { - fire(WindowManager.convert(extension, window)); - }).api(), - - onRemoved: - new WindowEventManager(context, "windows.onRemoved", "domwindowclosed", (fire, window) => { - fire(WindowManager.getId(window)); - }).api(), - - onFocusChanged: new EventManager(context, "windows.onFocusChanged", fire => { - // Keep track of the last windowId used to fire an onFocusChanged event - let lastOnFocusChangedWindowId; - - let listener = event => { - // Wait a tick to avoid firing a superfluous WINDOW_ID_NONE - // event when switching focus between two Firefox windows. - Promise.resolve().then(() => { - let window = Services.focus.activeWindow; - let windowId = window ? WindowManager.getId(window) : WindowManager.WINDOW_ID_NONE; - if (windowId !== lastOnFocusChangedWindowId) { - fire(windowId); - lastOnFocusChangedWindowId = windowId; - } - }); - }; - AllWindowEvents.addListener("focus", listener); - AllWindowEvents.addListener("blur", listener); - return () => { - AllWindowEvents.removeListener("focus", listener); - AllWindowEvents.removeListener("blur", listener); - }; - }).api(), - - get: function(windowId, getInfo) { - let window = WindowManager.getWindow(windowId, context); - return Promise.resolve(WindowManager.convert(extension, window, getInfo)); - }, - - getCurrent: function(getInfo) { - let window = currentWindow(context); - return Promise.resolve(WindowManager.convert(extension, window, getInfo)); - }, - - getLastFocused: function(getInfo) { - let window = WindowManager.topWindow; - return Promise.resolve(WindowManager.convert(extension, window, getInfo)); - }, - - getAll: function(getInfo) { - let windows = Array.from(WindowListManager.browserWindows(), - window => WindowManager.convert(extension, window, getInfo)); - return Promise.resolve(windows); - }, - - create: function(createData) { - let needResize = (createData.left !== null || createData.top !== null || - createData.width !== null || createData.height !== null); - - if (needResize) { - if (createData.state !== null && createData.state != "normal") { - return Promise.reject({message: `"state": "${createData.state}" may not be combined with "left", "top", "width", or "height"`}); - } - createData.state = "normal"; - } - - function mkstr(s) { - let result = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString); - result.data = s; - return result; - } - - let args = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); - - if (createData.tabId !== null) { - if (createData.url !== null) { - return Promise.reject({message: "`tabId` may not be used in conjunction with `url`"}); - } - - if (createData.allowScriptsToClose) { - return Promise.reject({message: "`tabId` may not be used in conjunction with `allowScriptsToClose`"}); - } - - let tab = TabManager.getTab(createData.tabId, context); - - // Private browsing tabs can only be moved to private browsing - // windows. - let incognito = PrivateBrowsingUtils.isBrowserPrivate(tab.linkedBrowser); - if (createData.incognito !== null && createData.incognito != incognito) { - return Promise.reject({message: "`incognito` property must match the incognito state of tab"}); - } - createData.incognito = incognito; - - args.appendElement(tab, /* weak = */ false); - } else if (createData.url !== null) { - if (Array.isArray(createData.url)) { - let array = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray); - for (let url of createData.url) { - array.appendElement(mkstr(url), /* weak = */ false); - } - args.appendElement(array, /* weak = */ false); - } else { - args.appendElement(mkstr(createData.url), /* weak = */ false); - } - } else { - args.appendElement(mkstr(aboutNewTabService.newTabURL), /* weak = */ false); - } - - let features = ["chrome"]; - - if (createData.type === null || createData.type == "normal") { - features.push("dialog=no", "all"); - } else { - // All other types create "popup"-type windows by default. - features.push("dialog", "resizable", "minimizable", "centerscreen", "titlebar", "close"); - } - - if (createData.incognito !== null) { - if (createData.incognito) { - features.push("private"); - } else { - features.push("non-private"); - } - } - - let {allowScriptsToClose, url} = createData; - if (allowScriptsToClose === null) { - allowScriptsToClose = typeof url === "string" && url.startsWith("moz-extension://"); - } - - let window = Services.ww.openWindow(null, "chrome://browser/content/browser.xul", "_blank", - features.join(","), args); - - WindowManager.updateGeometry(window, createData); - - // TODO: focused, type - - return new Promise(resolve => { - window.addEventListener("load", function listener() { - window.removeEventListener("load", listener); - if (["maximized", "normal"].includes(createData.state)) { - window.document.documentElement.setAttribute("sizemode", createData.state); - } - resolve(promiseObserved("browser-delayed-startup-finished", win => win == window)); - }); - }).then(() => { - // Some states only work after delayed-startup-finished - if (["minimized", "fullscreen", "docked"].includes(createData.state)) { - WindowManager.setState(window, createData.state); - } - if (allowScriptsToClose) { - for (let {linkedBrowser} of window.gBrowser.tabs) { - onXULFrameLoaderCreated({target: linkedBrowser}); - linkedBrowser.addEventListener( // eslint-disable-line mozilla/balanced-listeners - "XULFrameLoaderCreated", onXULFrameLoaderCreated); - } - } - return WindowManager.convert(extension, window, {populate: true}); - }); - }, - - update: function(windowId, updateInfo) { - if (updateInfo.state !== null && updateInfo.state != "normal") { - if (updateInfo.left !== null || updateInfo.top !== null || - updateInfo.width !== null || updateInfo.height !== null) { - return Promise.reject({message: `"state": "${updateInfo.state}" may not be combined with "left", "top", "width", or "height"`}); - } - } - - let window = WindowManager.getWindow(windowId, context); - if (updateInfo.focused) { - Services.focus.activeWindow = window; - } - - if (updateInfo.state !== null) { - WindowManager.setState(window, updateInfo.state); - } - - if (updateInfo.drawAttention) { - // Bug 1257497 - Firefox can't cancel attention actions. - window.getAttention(); - } - - WindowManager.updateGeometry(window, updateInfo); - - // TODO: All the other properties, focused=false... - - return Promise.resolve(WindowManager.convert(extension, window)); - }, - - remove: function(windowId) { - let window = WindowManager.getWindow(windowId, context); - window.close(); - - return new Promise(resolve => { - let listener = () => { - AllWindowEvents.removeListener("domwindowclosed", listener); - resolve(); - }; - AllWindowEvents.addListener("domwindowclosed", listener); - }); - }, - }, - }; -}); diff --git a/application/basilisk/components/webextensions/extension-mac-panel.css b/application/basilisk/components/webextensions/extension-mac-panel.css deleted file mode 100644 index 2e9ed6bdb..000000000 --- a/application/basilisk/components/webextensions/extension-mac-panel.css +++ /dev/null @@ -1,3 +0,0 @@ -body { - border-radius: 3.5px; -} diff --git a/application/basilisk/components/webextensions/extension-mac.css b/application/basilisk/components/webextensions/extension-mac.css deleted file mode 100644 index 49cd3b359..000000000 --- a/application/basilisk/components/webextensions/extension-mac.css +++ /dev/null @@ -1,11 +0,0 @@ -button, -select, -input[type="checkbox"] + label::before { - border-radius: 4px; -} - -.panel-section-footer { - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - overflow: hidden; -} diff --git a/application/basilisk/components/webextensions/extension-win-panel.css b/application/basilisk/components/webextensions/extension-win-panel.css deleted file mode 100644 index 9da6da14c..000000000 --- a/application/basilisk/components/webextensions/extension-win-panel.css +++ /dev/null @@ -1,5 +0,0 @@ -@media (-moz-os-version: windows-win7) { - body { - border-radius: 4px; - } -} diff --git a/application/basilisk/components/webextensions/extension.css b/application/basilisk/components/webextensions/extension.css deleted file mode 100644 index 6b59033e3..000000000 --- a/application/basilisk/components/webextensions/extension.css +++ /dev/null @@ -1,572 +0,0 @@ -/* stylelint-disable property-no-vendor-prefix */ -/* stylelint-disable property-no-vendor-prefix */ -/* Base */ -button, -select, -option, -input { - -moz-appearance: none; -} - -/* Variables */ -html, -body { - background: transparent; - box-sizing: border-box; - color: #222426; - cursor: default; - display: flex; - flex-direction: column; - font: caption; - margin: 0; - padding: 0; - -moz-user-select: none; -} - -body * { - box-sizing: border-box; - text-align: start; -} - -/* stylelint-disable property-no-vendor-prefix */ -/* Buttons */ -button, -select { - background-color: #fbfbfb; - border: 1px solid #b1b1b1; - box-shadow: 0 0 0 0 transparent; - font: caption; - height: 24px; - outline: 0 !important; - padding: 0 8px 0; - transition-duration: 250ms; - transition-property: box-shadow, border; -} - -select { - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNOCwxMkwzLDcsNCw2bDQsNCw0LTQsMSwxWiIgZmlsbD0iIzZBNkE2QSIgLz4KPC9zdmc+Cg==); - background-position: calc(100% - 4px) center; - background-repeat: no-repeat; - padding-inline-end: 24px; - text-overflow: ellipsis; -} - -label { - font: caption; -} - -button::-moz-focus-inner { - border: 0; - outline: 0; -} - -/* Dropdowns */ -select { - background-color: #fbfbfb; - border: 1px solid #b1b1b1; - box-shadow: 0 0 0 0 transparent; - font: caption; - height: 24px; - outline: 0 !important; - padding: 0 8px 0; - transition-duration: 250ms; - transition-property: box-shadow, border; -} - -select { - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNOCwxMkwzLDcsNCw2bDQsNCw0LTQsMSwxWiIgZmlsbD0iIzZBNkE2QSIgLz4KPC9zdmc+Cg==); - background-position: calc(100% - 4px) center; - background-repeat: no-repeat; - padding-inline-end: 24px; - text-overflow: ellipsis; -} - -select:-moz-focusring { - color: transparent; - text-shadow: 0 0 0 #000; -} - -select:-moz-focusring * { - color: #000; - text-shadow: none; -} - -button.hover, -select.hover { - background-color: #ebebeb; - border: 1px solid #b1b1b1; -} - -button.pressed, -select.pressed { - background-color: #d4d4d4; - border: 1px solid #858585; -} - -button.disabled, -select.disabled { - color: #999; - opacity: .5; -} - -button.focused, -select.focused { - border-color: #fff; - box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75); -} - -button.default { - background-color: #0996f8; - border-color: #0670cc; - color: #fff; -} - -button.default.hover { - background-color: #0670cc; - border-color: #005bab; -} - -button.default.pressed { - background-color: #005bab; - border-color: #004480; -} - -button.default.focused { - border-color: #fff; -} - -/* Radio Buttons */ -.radioItem { - margin-bottom: 6px; - text-align: left; -} - -input[type="radio"] { - display: none; -} - -input[type="radio"] + label { - -moz-user-select: none; -} - -input[type="radio"] + label::before { - background-color: #fff; - background-position: center; - border: 1px solid #b1b1b1; - border-radius: 50%; - content: ""; - display: inline-block; - height: 16px; - margin-right: 6px; - vertical-align: text-top; - width: 16px; -} - -input[type="radio"]:hover + label::before, -.radioItem.hover input[type="radio"]:not(active) + label::before { - background-color: #fbfbfb; - border-color: #b1b1b1; -} - -input[type="radio"]:hover:active + label::before, -.radioItem.pressed input[type="radio"]:not(active) + label::before { - background-color: #ebebeb; - border-color: #858585; -} - -input[type="radio"]:checked + label::before { - background-color: #0996f8; - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNCIgZmlsbD0iI2ZmZiIgLz4KPC9zdmc+Cg==); - border-color: #0670cc; -} - -input[type="radio"]:checked:hover + label::before, -.radioItem.hover input[type="radio"]:checked:not(active) + label::before { - background-color: #0670cc; - border-color: #005bab; -} - -input[type="radio"]:checked:hover:active + label::before, -.radioItem.pressed input[type="radio"]:checked:not(active) + label::before { - background-color: #005bab; - border-color: #004480; -} - -.radioItem.disabled input[type="radio"] + label, -.radioItem.disabled input[type="radio"]:hover + label, -.radioItem.disabled input[type="radio"]:hover:active + label { - color: #999; - opacity: .5; -} - -.radioItem.focused input[type="radio"] + label::before { - border-color: #0996f8; - box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75); -} - -.radioItem.focused input[type="radio"]:checked + label::before { - border-color: #fff; -} - -/* Checkboxes */ -.checkboxItem { - margin-bottom: 6px; - text-align: left; -} - -input[type="checkbox"] { - display: none; -} - -input[type="checkbox"] + label { - -moz-user-select: none; -} - -input[type="checkbox"] + label::before { - background-color: #fff; - background-position: center; - border: 1px solid #b1b1b1; - content: ""; - display: inline-block; - height: 16px; - margin-right: 6px; - vertical-align: text-top; - width: 16px; -} - -input[type="checkbox"]:hover + label::before, -.checkboxItem.hover input[type="checkbox"]:not(active) + label::before { - background-color: #fbfbfb; - border-color: #b1b1b1; -} - -input[type="checkbox"]:hover:active + label::before, -.checkboxItem.pressed input[type="checkbox"]:not(active) + label::before { - background-color: #ebebeb; - border-color: #858585; -} - -input[type="checkbox"]:checked + label::before { - background-color: #0996f8; - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNNy43LDEyLjkgQzcuNCwxMy4zIDYuOCwxMy40IDYuNCwxMyBMMy4yLDkuOCBDMi44LDkuNCAyLjgsOC42IDMuMiw4LjIgQzMuNiw3LjggNC40LDcuOCA0LjgsOC4yIEw2LjksMTAuMyBMMTEuMSw0LjQgQzExLjUsMy45IDEyLjIsMy44IDEyLjcsNC4xIEMxMy4yLDQuNSAxMy4zLDUuMiAxMyw1LjcgTDcuNywxMi45IEw3LjcsMTIuOSBaIiBmaWxsPSIjZmZmIiAvPgo8L3N2Zz4K); - border-color: #0670cc; -} - -input[type="checkbox"]:checked:hover + label::before, -.checkboxItem.hover input[type="checkbox"]:checked:not(active) + label::before { - background-color: #0670cc; - border-color: #005bab; -} - -input[type="checkbox"]:checked:hover:active + label::before, -.checkboxItem.pressed input[type="checkbox"]:checked:not(active) + label::before { - background-color: #005bab; - border-color: #004480; -} - -.checkboxItem.disabled input[type="checkbox"] + label, -.checkboxItem.disabled input[type="checkbox"]:hover + label, -.checkboxItem.disabled input[type="checkbox"]:hover:active + label { - color: #999; - opacity: .5; -} - -.checkboxItem.focused input[type="checkbox"] + label::before { - border-color: #0996f8; - box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75); -} - -.checkboxItem.focused input[type="checkbox"]:checked + label::before { - border-color: #fff; -} - -/* Expander Button */ -button.expander { - background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNOCwxMkwzLDcsNCw2bDQsNCw0LTQsMSwxWiIgZmlsbD0iIzZBNkE2QSIgLz4KPC9zdmc+Cg==); - background-position: center; - background-repeat: no-repeat; - height: 24px; - padding: 0; - width: 24px; -} - -/* Interactive States */ -button:hover:not(.pressed):not(.disabled):not(.focused), -select:hover:not(.pressed):not(.disabled):not(.focused) { - background-color: #ebebeb; - border: 1px solid #b1b1b1; -} - -button:hover:active:not(.hover):not(.disabled):not(.focused), -select:hover:active:not(.hover):not(.disabled):not(.focused) { - background-color: #d4d4d4; - border: 1px solid #858585; -} - -button.default:hover:not(.pressed):not(.disabled):not(.focused) { - background-color: #0670cc; - border-color: #005bab; -} - -button.default:hover:active:not(.hover):not(.disabled):not(.focused) { - background-color: #005bab; - border-color: #004480; -} - -button:focus:not(.disabled) { - border-color: #fff !important; - box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75); -} - -/* Fields */ -input[type="text"], -textarea { - background-color: #fff; - border: 1px solid #b1b1b1; - box-shadow: 0 0 0 0 rgba(97, 181, 255, 0); - font: caption; - padding: 0 6px 0; - transition-duration: 250ms; - transition-property: box-shadow; -} - -input[type="text"] { - height: 24px; -} - -input[type="text"].hover, -textarea.hover { - border: 1px solid #858585; -} - -input[type="text"].disabled, -textarea.disabled { - color: #999; - opacity: .5; -} - -input[type="text"].focused, -textarea.focused { - border-color: #0996f8; - box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75); -} - -/* Interactive States */ -input[type="text"]:not(disabled):hover, -textarea:not(disabled):hover { - border: 1px solid #858585; -} - -input[type="text"]:focus, -input[type="text"]:focus:hover, -textarea:focus, -textarea:focus:hover { - border-color: #0996f8; - box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75); -} - -/* stylelint-disable property-no-vendor-prefix */ -.panel-section { - display: flex; - flex-direction: row; -} - -.panel-section-separator { - background-color: rgba(0, 0, 0, 0.15); - min-height: 1px; -} - -/* Panel Section - Header */ -.panel-section-header { - border-bottom: 1px solid rgba(0, 0, 0, 0.15); - padding: 16px; -} - -.panel-section-header > .icon-section-header { - background-position: center center; - background-repeat: no-repeat; - height: 32px; - margin-right: 16px; - position: relative; - width: 32px; -} - -.panel-section-header > .text-section-header { - align-self: center; - font-size: 1.385em; - font-weight: lighter; -} - -/* Panel Section - List */ -.panel-section-list { - flex-direction: column; - padding: 4px 0; -} - -.panel-list-item { - align-items: center; - display: flex; - flex-direction: row; - height: 24px; - padding: 0 16px; -} - -.panel-list-item:not(.disabled):hover { - background-color: rgba(0, 0, 0, 0.06); - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - border-top: 1px solid rgba(0, 0, 0, 0.1); -} - -.panel-list-item:not(.disabled):hover:active { - background-color: rgba(0, 0, 0, 0.1); -} - -.panel-list-item.disabled { - color: #999; -} - -.panel-list-item > .icon { - flex-grow: 0; - flex-shrink: 0; -} - -.panel-list-item > .text { - flex-grow: 10; -} - -.panel-list-item > .text-shortcut { - color: #808080; - font-family: "Lucida Grande", caption; - font-size: .847em; - justify-content: flex-end; -} - -.panel-section-list .panel-section-separator { - margin: 4px 0; -} - -/* Panel Section - Form Elements */ -.panel-section-formElements { - display: flex; - flex-direction: column; - padding: 16px; -} - -.panel-formElements-item { - align-items: center; - display: flex; - flex-direction: row; - margin-bottom: 12px; -} - -.panel-formElements-item:last-child { - margin-bottom: 0; -} - -.panel-formElements-item label { - flex-shrink: 0; - margin-right: 6px; - text-align: right; -} - -.panel-formElements-item input[type="text"], -.panel-formElements-item select { - flex-grow: 1; -} - -/* Panel Section - Footer */ -.panel-section-footer { - background-color: rgba(0, 0, 0, 0.06); - border-top: 1px solid rgba(0, 0, 0, 0.15); - color: #1a1a1a; - display: flex; - flex-direction: row; - height: 41px; - margin-top: -1px; - padding: 0; -} - -.panel-section-footer-button { - flex: 1 1 auto; - height: 100%; - margin: 0 -1px; - padding: 12px; - text-align: center; -} - -.panel-section-footer-button > .text-shortcut { - color: #808080; - font-family: "Lucida Grande", caption; - font-size: .847em; -} - -.panel-section-footer-button:hover { - background-color: rgba(0, 0, 0, 0.06); -} - -.panel-section-footer-button:hover:active { - background-color: rgba(0, 0, 0, 0.1); -} - -.panel-section-footer-button.default { - background-color: #0996f8; - box-shadow: 0 1px 0 #0670cc inset; - color: #fff; -} - -.panel-section-footer-button.default:hover { - background-color: #0670cc; - box-shadow: 0 1px 0 #005bab inset; -} - -.panel-section-footer-button.default:hover:active { - background-color: #005bab; - box-shadow: 0 1px 0 #004480 inset; -} - -.panel-section-footer-separator { - background-color: rgba(0, 0, 0, 0.1); - width: 1px; - z-index: 99; -} - -/* Panel Section - Tabs */ -.panel-section-tabs { - color: #1a1a1a; - display: flex; - flex-direction: row; - height: 41px; - margin-bottom: -1px; - padding: 0; -} - -.panel-section-tabs-button { - flex: 1 1 auto; - height: 100%; - margin: 0 -1px; - padding: 12px; - text-align: center; -} - -.panel-section-tabs-button:hover { - background-color: rgba(0, 0, 0, 0.06); -} - -.panel-section-tabs-button:hover:active { - background-color: rgba(0, 0, 0, 0.1); -} - -.panel-section-tabs-button.selected { - box-shadow: 0 -1px 0 #0670cc inset, 0 -4px 0 #0996f8 inset; - color: #0996f8; -} - -.panel-section-tabs-button.selected:hover { - color: #0670cc; -} - -.panel-section-tabs-separator { - background-color: rgba(0, 0, 0, 0.1); - width: 1px; - z-index: 99; -} diff --git a/application/basilisk/components/webextensions/extension.svg b/application/basilisk/components/webextensions/extension.svg deleted file mode 100644 index a16455253..000000000 --- a/application/basilisk/components/webextensions/extension.svg +++ /dev/null @@ -1,19 +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/. --> -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" - width="64" height="64" viewBox="0 0 64 64"> - <defs> - <style> - .style-puzzle-piece { - fill: url('#gradient-linear-puzzle-piece'); - } - </style> - <linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%"> - <stop offset="0%" stop-color="#66cc52" stop-opacity="1"/> - <stop offset="100%" stop-color="#60bf4c" stop-opacity="1"/> - </linearGradient> - </defs> - <path class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/> -</svg> diff --git a/application/basilisk/components/webextensions/extensions-browser.manifest b/application/basilisk/components/webextensions/extensions-browser.manifest deleted file mode 100644 index ed5cca813..000000000 --- a/application/basilisk/components/webextensions/extensions-browser.manifest +++ /dev/null @@ -1,31 +0,0 @@ -# scripts -category webextension-scripts bookmarks chrome://browser/content/ext-bookmarks.js -category webextension-scripts browserAction chrome://browser/content/ext-browserAction.js -category webextension-scripts commands chrome://browser/content/ext-commands.js -category webextension-scripts contextMenus chrome://browser/content/ext-contextMenus.js -category webextension-scripts desktop-runtime chrome://browser/content/ext-desktop-runtime.js -category webextension-scripts history chrome://browser/content/ext-history.js -category webextension-scripts omnibox chrome://browser/content/ext-omnibox.js -category webextension-scripts pageAction chrome://browser/content/ext-pageAction.js -category webextension-scripts sessions chrome://browser/content/ext-sessions.js -category webextension-scripts tabs chrome://browser/content/ext-tabs.js -category webextension-scripts utils chrome://browser/content/ext-utils.js -category webextension-scripts windows chrome://browser/content/ext-windows.js - -# scripts that must run in the same process as addon code. -category webextension-scripts-addon contextMenus chrome://browser/content/ext-c-contextMenus.js -category webextension-scripts-addon omnibox chrome://browser/content/ext-c-omnibox.js -category webextension-scripts-addon tabs chrome://browser/content/ext-c-tabs.js - -# schemas -category webextension-schemas bookmarks chrome://browser/content/schemas/bookmarks.json -category webextension-schemas browser_action chrome://browser/content/schemas/browser_action.json -category webextension-schemas commands chrome://browser/content/schemas/commands.json -category webextension-schemas context_menus chrome://browser/content/schemas/context_menus.json -category webextension-schemas context_menus_internal chrome://browser/content/schemas/context_menus_internal.json -category webextension-schemas history chrome://browser/content/schemas/history.json -category webextension-schemas omnibox chrome://browser/content/schemas/omnibox.json -category webextension-schemas page_action chrome://browser/content/schemas/page_action.json -category webextension-schemas sessions chrome://browser/content/schemas/sessions.json -category webextension-schemas tabs chrome://browser/content/schemas/tabs.json -category webextension-schemas windows chrome://browser/content/schemas/windows.json diff --git a/application/basilisk/components/webextensions/jar.mn b/application/basilisk/components/webextensions/jar.mn deleted file mode 100644 index a7b506ec4..000000000 --- a/application/basilisk/components/webextensions/jar.mn +++ /dev/null @@ -1,29 +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/. - -browser.jar: - content/browser/extension.css -#ifdef XP_MACOSX - content/browser/extension-mac.css - content/browser/extension-mac-panel.css -#endif -#ifdef XP_WIN - content/browser/extension-win-panel.css -#endif - content/browser/extension.svg - content/browser/ext-bookmarks.js - content/browser/ext-browserAction.js - content/browser/ext-commands.js - content/browser/ext-contextMenus.js - content/browser/ext-desktop-runtime.js - content/browser/ext-history.js - content/browser/ext-omnibox.js - content/browser/ext-pageAction.js - content/browser/ext-sessions.js - content/browser/ext-tabs.js - content/browser/ext-utils.js - content/browser/ext-windows.js - content/browser/ext-c-contextMenus.js - content/browser/ext-c-omnibox.js - content/browser/ext-c-tabs.js diff --git a/application/basilisk/components/webextensions/schemas/LICENSE b/application/basilisk/components/webextensions/schemas/LICENSE deleted file mode 100644 index 9314092fd..000000000 --- a/application/basilisk/components/webextensions/schemas/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/application/basilisk/components/webextensions/schemas/bookmarks.json b/application/basilisk/components/webextensions/schemas/bookmarks.json deleted file mode 100644 index fb74c633e..000000000 --- a/application/basilisk/components/webextensions/schemas/bookmarks.json +++ /dev/null @@ -1,568 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "manifest", - "types": [ - { - "$extend": "Permission", - "choices": [{ - "type": "string", - "enum": [ - "bookmarks" - ] - }] - } - ] - }, - { - "namespace": "bookmarks", - "description": "Use the <code>browser.bookmarks</code> API to create, organize, and otherwise manipulate bookmarks. Also see $(topic:override)[Override Pages], which you can use to create a custom Bookmark Manager page.", - "permissions": ["bookmarks"], - "types": [ - { - "id": "BookmarkTreeNodeUnmodifiable", - "type": "string", - "enum": ["managed"], - "description": "Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default)." - }, - { - "id": "BookmarkTreeNode", - "type": "object", - "description": "A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder.", - "properties": { - "id": { - "type": "string", - "description": "The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted." - }, - "parentId": { - "type": "string", - "optional": true, - "description": "The <code>id</code> of the parent folder. Omitted for the root node." - }, - "index": { - "type": "integer", - "optional": true, - "description": "The 0-based position of this node within its parent folder." - }, - "url": { - "type": "string", - "optional": true, - "description": "The URL navigated to when a user clicks the bookmark. Omitted for folders." - }, - "title": { - "type": "string", - "description": "The text displayed for the node." - }, - "dateAdded": { - "type": "number", - "optional": true, - "description": "When this node was created, in milliseconds since the epoch (<code>new Date(dateAdded)</code>)." - }, - "dateGroupModified": { - "type": "number", - "optional": true, - "description": "When the contents of this folder last changed, in milliseconds since the epoch." - }, - "unmodifiable": { - "$ref": "BookmarkTreeNodeUnmodifiable", - "optional": true, - "description": "Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default)." - }, - "children": { - "type": "array", - "optional": true, - "items": { "$ref": "BookmarkTreeNode" }, - "description": "An ordered list of children of this node." - } - } - }, - { - "id": "CreateDetails", - "description": "Object passed to the create() function.", - "type": "object", - "properties": { - "parentId": { - "type": "string", - "optional": true, - "description": "Defaults to the Other Bookmarks folder." - }, - "index": { - "type": "integer", - "minimum": 0, - "optional": true - }, - "title": { - "type": "string", - "optional": true - }, - "url": { - "type": "string", - "optional": true - } - } - } - ], - "functions": [ - { - "name": "get", - "type": "function", - "description": "Retrieves the specified BookmarkTreeNode(s).", - "async": "callback", - "parameters": [ - { - "name": "idOrIdList", - "description": "A single string-valued id, or an array of string-valued ids", - "choices": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - } - ] - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "results", - "type": "array", - "items": { "$ref": "BookmarkTreeNode" } - } - ] - } - ] - }, - { - "name": "getChildren", - "type": "function", - "description": "Retrieves the children of the specified BookmarkTreeNode id.", - "async": "callback", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "results", - "type": "array", - "items": { "$ref": "BookmarkTreeNode"} - } - ] - } - ] - }, - { - "name": "getRecent", - "type": "function", - "description": "Retrieves the recently added bookmarks.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "minimum": 1, - "name": "numberOfItems", - "description": "The maximum number of items to return." - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "results", - "type": "array", - "items": { "$ref": "BookmarkTreeNode" } - } - ] - } - ] - }, - { - "name": "getTree", - "type": "function", - "description": "Retrieves the entire Bookmarks hierarchy.", - "async": "callback", - "parameters": [ - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "results", - "type": "array", - "items": { "$ref": "BookmarkTreeNode" } - } - ] - } - ] - }, - { - "name": "getSubTree", - "type": "function", - "description": "Retrieves part of the Bookmarks hierarchy, starting at the specified node.", - "async": "callback", - "parameters": [ - { - "type": "string", - "name": "id", - "description": "The ID of the root of the subtree to retrieve." - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "results", - "type": "array", - "items": { "$ref": "BookmarkTreeNode" } - } - ] - } - ] - }, - { - "name": "search", - "type": "function", - "description": "Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.", - "async": "callback", - "parameters": [ - { - "name": "query", - "description": "Either a string of words and quoted phrases that are matched against bookmark URLs and titles, or an object. If an object, the properties <code>query</code>, <code>url</code>, and <code>title</code> may be specified and bookmarks matching all specified properties will be produced.", - "choices": [ - { - "type": "string", - "description": "A string of words and quoted phrases that are matched against bookmark URLs and titles." - }, - { - "type": "object", - "description": "An object specifying properties and values to match when searching. Produces bookmarks matching all properties.", - "properties": { - "query": { - "type": "string", - "optional": true, - "description": "A string of words and quoted phrases that are matched against bookmark URLs and titles." - }, - "url": { - "type": "string", - "format": "url", - "optional": true, - "description": "The URL of the bookmark; matches verbatim. Note that folders have no URL." - }, - "title": { - "type": "string", - "optional": true, - "description": "The title of the bookmark; matches verbatim." - } - } - } - ] - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "results", - "type": "array", - "items": { "$ref": "BookmarkTreeNode" } - } - ] - } - ] - }, - { - "name": "create", - "type": "function", - "description": "Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.", - "async": "callback", - "parameters": [ - { - "$ref": "CreateDetails", - "name": "bookmark" - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "result", - "$ref": "BookmarkTreeNode" - } - ] - } - ] - }, - { - "name": "move", - "type": "function", - "description": "Moves the specified BookmarkTreeNode to the provided location.", - "async": "callback", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "type": "object", - "name": "destination", - "properties": { - "parentId": { - "type": "string", - "optional": true - }, - "index": { - "type": "integer", - "minimum": 0, - "optional": true - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "result", - "$ref": "BookmarkTreeNode" - } - ] - } - ] - }, - { - "name": "update", - "type": "function", - "description": "Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. <b>Note:</b> Currently, only 'title' and 'url' are supported.", - "async": "callback", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "type": "object", - "name": "changes", - "properties": { - "title": { - "type": "string", - "optional": true - }, - "url": { - "type": "string", - "optional": true - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "result", - "$ref": "BookmarkTreeNode" - } - ] - } - ] - }, - { - "name": "remove", - "type": "function", - "description": "Removes a bookmark or an empty bookmark folder.", - "async": "callback", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "removeTree", - "type": "function", - "description": "Recursively removes a bookmark folder.", - "async": "callback", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "import", - "unsupported": true, - "type": "function", - "description": "Imports bookmarks from an html bookmark file", - "async": "callback", - "parameters": [ - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "export", - "unsupported": true, - "type": "function", - "description": "Exports bookmarks to an html bookmark file", - "async": "callback", - "parameters": [ - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - } - ], - "events": [ - { - "name": "onCreated", - "type": "function", - "description": "Fired when a bookmark or folder is created.", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "$ref": "BookmarkTreeNode", - "name": "bookmark" - } - ] - }, - { - "name": "onRemoved", - "type": "function", - "description": "Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents.", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "type": "object", - "name": "removeInfo", - "properties": { - "parentId": { "type": "string" }, - "index": { "type": "integer" }, - "node": { "$ref": "BookmarkTreeNode" } - } - } - ] - }, - { - "name": "onChanged", - "type": "function", - "description": "Fired when a bookmark or folder changes. <b>Note:</b> Currently, only title and url changes trigger this.", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "type": "object", - "name": "changeInfo", - "properties": { - "title": { "type": "string" }, - "url": { - "type": "string", - "optional": true - } - } - } - ] - }, - { - "name": "onMoved", - "type": "function", - "description": "Fired when a bookmark or folder is moved to a different parent folder.", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "type": "object", - "name": "moveInfo", - "properties": { - "parentId": { "type": "string" }, - "index": { "type": "integer" }, - "oldParentId": { "type": "string" }, - "oldIndex": { "type": "integer" } - } - } - ] - }, - { - "name": "onChildrenReordered", - "unsupported": true, - "type": "function", - "description": "Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move().", - "parameters": [ - { - "type": "string", - "name": "id" - }, - { - "type": "object", - "name": "reorderInfo", - "properties": { - "childIds": { - "type": "array", - "items": { "type": "string" } - } - } - } - ] - }, - { - "name": "onImportBegan", - "unsupported": true, - "type": "function", - "description": "Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately.", - "parameters": [] - }, - { - "name": "onImportEnded", - "unsupported": true, - "type": "function", - "description": "Fired when a bookmark import session is ended.", - "parameters": [] - } - ] - } -] diff --git a/application/basilisk/components/webextensions/schemas/browser_action.json b/application/basilisk/components/webextensions/schemas/browser_action.json deleted file mode 100644 index 1a7da956a..000000000 --- a/application/basilisk/components/webextensions/schemas/browser_action.json +++ /dev/null @@ -1,430 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "manifest", - "types": [ - { - "$extend": "WebExtensionManifest", - "properties": { - "browser_action": { - "type": "object", - "additionalProperties": { "$ref": "UnrecognizedProperty" }, - "properties": { - "default_title": { - "type": "string", - "optional": true, - "preprocess": "localize" - }, - "default_icon": { - "$ref": "IconPath", - "optional": true - }, - "default_popup": { - "type": "string", - "format": "relativeUrl", - "optional": true, - "preprocess": "localize" - }, - "browser_style": { - "type": "boolean", - "optional": true - } - }, - "optional": true - } - } - } - ] - }, - { - "namespace": "browserAction", - "description": "Use browser actions to put icons in the main browser toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup.", - "permissions": ["manifest:browser_action"], - "types": [ - { - "id": "ColorArray", - "type": "array", - "items": { - "type": "integer", - "minimum": 0, - "maximum": 255 - }, - "minItems": 4, - "maxItems": 4 - }, - { - "id": "ImageDataType", - "type": "object", - "isInstanceOf": "ImageData", - "additionalProperties": { "type": "any" }, - "postprocess": "convertImageDataToURL", - "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)." - } - ], - "functions": [ - { - "name": "setTitle", - "type": "function", - "description": "Sets the title of the browser action. This shows up in the tooltip.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "title": { - "type": "string", - "description": "The string the browser action should display when moused over." - }, - "tabId": { - "type": "integer", - "optional": true, - "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "getTitle", - "type": "function", - "description": "Gets the title of the browser action.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": { - "type": "integer", - "optional": true, - "description": "Specify the tab to get the title from. If no tab is specified, the non-tab-specific title is returned." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "result", - "type": "string" - } - ] - } - ] - }, - { - "name": "setIcon", - "type": "function", - "description": "Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "imageData": { - "choices": [ - { "$ref": "ImageDataType" }, - { - "type": "object", - "additionalProperties": {"$ref": "ImageDataType"} - } - ], - "optional": true, - "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'" - }, - "path": { - "choices": [ - { "type": "string" }, - { - "type": "object", - "additionalProperties": {"type": "string"} - } - ], - "optional": true, - "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'" - }, - "tabId": { - "type": "integer", - "optional": true, - "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "setPopup", - "type": "function", - "description": "Sets the html document to be opened as a popup when the user clicks on the browser action's icon.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": { - "type": "integer", - "optional": true, - "minimum": 0, - "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed." - }, - "popup": { - "type": "string", - "description": "The html file to show in a popup. If set to the empty string (''), no popup is shown." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "getPopup", - "type": "function", - "description": "Gets the html document set as the popup for this browser action.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": { - "type": "integer", - "optional": true, - "description": "Specify the tab to get the popup from. If no tab is specified, the non-tab-specific popup is returned." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "result", - "type": "string" - } - ] - } - ] - }, - { - "name": "setBadgeText", - "type": "function", - "description": "Sets the badge text for the browser action. The badge is displayed on top of the icon.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "Any number of characters can be passed, but only about four can fit in the space." - }, - "tabId": { - "type": "integer", - "optional": true, - "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "getBadgeText", - "type": "function", - "description": "Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": { - "type": "integer", - "optional": true, - "description": "Specify the tab to get the badge text from. If no tab is specified, the non-tab-specific badge text is returned." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "result", - "type": "string" - } - ] - } - ] - }, - { - "name": "setBadgeBackgroundColor", - "type": "function", - "description": "Sets the background color for the badge.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "color": { - "description": "An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <code>[255, 0, 0, 255]</code>. Can also be a string with a CSS value, with opaque red being <code>#FF0000</code> or <code>#F00</code>.", - "choices": [ - {"type": "string"}, - {"$ref": "ColorArray"} - ] - }, - "tabId": { - "type": "integer", - "optional": true, - "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "getBadgeBackgroundColor", - "type": "function", - "description": "Gets the background color of the browser action.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": { - "type": "integer", - "optional": true, - "description": "Specify the tab to get the badge background color from. If no tab is specified, the non-tab-specific badge background color is returned." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "result", - "$ref": "ColorArray" - } - ] - } - ] - }, - { - "name": "enable", - "type": "function", - "description": "Enables the browser action for a tab. By default, browser actions are enabled.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "optional": true, - "name": "tabId", - "minimum": 0, - "description": "The id of the tab for which you want to modify the browser action." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "disable", - "type": "function", - "description": "Disables the browser action for a tab.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "optional": true, - "name": "tabId", - "minimum": 0, - "description": "The id of the tab for which you want to modify the browser action." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "openPopup", - "type": "function", - "description": "Opens the extension popup window in the active window but does not grant tab permissions.", - "unsupported": true, - "async": "callback", - "parameters": [ - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "popupView", - "type": "object", - "optional": true, - "description": "JavaScript 'window' object for the popup window if it was succesfully opened.", - "additionalProperties": { "type": "any" } - } - ] - } - ] - } - ], - "events": [ - { - "name": "onClicked", - "type": "function", - "description": "Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.", - "parameters": [ - { - "name": "tab", - "$ref": "tabs.Tab" - } - ] - } - ] - } -] diff --git a/application/basilisk/components/webextensions/schemas/commands.json b/application/basilisk/components/webextensions/schemas/commands.json deleted file mode 100644 index a1632088e..000000000 --- a/application/basilisk/components/webextensions/schemas/commands.json +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "manifest", - "types": [ - { - "id": "KeyName", - "choices": [ - { - "type": "string", - "pattern": "^\\s*(Alt|Ctrl|Command|MacCtrl)\\s*\\+\\s*(Shift\\s*\\+\\s*)?([A-Z0-9]|Comma|Period|Home|End|PageUp|PageDown|Space|Insert|Delete|Up|Down|Left|Right)\\s*$" - }, - { - "type": "string", - "pattern": "^(MediaNextTrack|MediaPlayPause|MediaPrevTrack|MediaStop)$" - } - ] - }, - { - "$extend": "WebExtensionManifest", - "properties": { - "commands": { - "type": "object", - "optional": true, - "additionalProperties": { - "type": "object", - "additionalProperties": { "$ref": "UnrecognizedProperty" }, - "properties": { - "suggested_key": { - "type": "object", - "optional": true, - "properties": { - "default": { - "$ref": "KeyName", - "optional": true - }, - "mac": { - "$ref": "KeyName", - "optional": true - }, - "linux": { - "$ref": "KeyName", - "optional": true - }, - "windows": { - "$ref": "KeyName", - "optional": true - }, - "chromeos": { - "type": "string", - "optional": true - }, - "android": { - "type": "string", - "optional": true - }, - "ios": { - "type": "string", - "optional": true - }, - "additionalProperties": { - "type": "string", - "deprecated": "Unknown platform name", - "optional": true - } - } - }, - "description": { - "type": "string", - "optional": true - } - } - } - } - } - } - ] - }, - { - "namespace": "commands", - "description": "Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the xtension.", - "permissions": ["manifest:commands"], - "types": [ - { - "id": "Command", - "type": "object", - "properties": { - "name": { - "type": "string", - "optional": true, - "description": "The name of the Extension Command" - }, - "description": { - "type": "string", - "optional": true, - "description": "The Extension Command description" - }, - "shortcut": { - "type": "string", - "optional": true, - "description": "The shortcut active for this command, or blank if not active." - } - } - } - ], - "events": [ - { - "name": "onCommand", - "description": "Fired when a registered command is activated using a keyboard shortcut.", - "type": "function", - "parameters": [ - { - "name": "command", - "type": "string" - } - ] - } - ], - "functions": [ - { - "name": "getAll", - "type": "function", - "async": "callback", - "description": "Returns all the registered extension commands for this extension and their shortcut (if active).", - "parameters": [ - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "commands", - "type": "array", - "items": { - "$ref": "Command" - } - } - ], - "description": "Called to return the registered commands." - } - ] - } - ] - } -] diff --git a/application/basilisk/components/webextensions/schemas/context_menus.json b/application/basilisk/components/webextensions/schemas/context_menus.json deleted file mode 100644 index b31af51f3..000000000 --- a/application/basilisk/components/webextensions/schemas/context_menus.json +++ /dev/null @@ -1,424 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "manifest", - "types": [ - { - "$extend": "Permission", - "choices": [{ - "type": "string", - "enum": [ - "contextMenus" - ] - }] - } - ] - }, - { - "namespace": "contextMenus", - "description": "Use the <code>browser.contextMenus</code> API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.", - "permissions": ["contextMenus"], - "properties": { - "ACTION_MENU_TOP_LEVEL_LIMIT": { - "value": 6, - "description": "The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored." - } - }, - "types": [ - { - "id": "ContextType", - "type": "string", - "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher", "browser_action", "page_action"], - "description": "The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is only supported by apps and is used to add menu items to the context menu that appears when clicking on the app icon in the launcher/taskbar/dock/etc. Different platforms might put limitations on what is actually supported in a launcher context menu." - }, - { - "id": "ItemType", - "type": "string", - "enum": ["normal", "checkbox", "radio", "separator"], - "description": "The type of menu item." - }, - { - "id": "OnClickData", - "type": "object", - "description": "Information sent when a context menu item is clicked.", - "properties": { - "menuItemId": { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "description": "The ID of the menu item that was clicked." - }, - "parentMenuItemId": { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "optional": true, - "description": "The parent ID, if any, for the item clicked." - }, - "mediaType": { - "type": "string", - "optional": true, - "description": "One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements." - }, - "linkUrl": { - "type": "string", - "optional": true, - "description": "If the element is a link, the URL it points to." - }, - "srcUrl": { - "type": "string", - "optional": true, - "description": "Will be present for elements with a 'src' URL." - }, - "pageUrl": { - "type": "string", - "optional": true, - "description": "The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu." - }, - "frameUrl": { - "type": "string", - "optional": true, - "description": " The URL of the frame of the element where the context menu was clicked, if it was in a frame." - }, - "selectionText": { - "type": "string", - "optional": true, - "description": "The text for the context selection, if any." - }, - "editable": { - "type": "boolean", - "description": "A flag indicating whether the element is editable (text input, textarea, etc.)." - }, - "wasChecked": { - "type": "boolean", - "optional": true, - "description": "A flag indicating the state of a checkbox or radio item before it was clicked." - }, - "checked": { - "type": "boolean", - "optional": true, - "description": "A flag indicating the state of a checkbox or radio item after it is clicked." - } - } - } - ], - "functions": [ - { - "name": "create", - "type": "function", - "description": "Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in $(ref:runtime.lastError)).", - "returns": { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "description": "The ID of the newly created item." - }, - "parameters": [ - { - "type": "object", - "name": "createProperties", - "properties": { - "type": { - "$ref": "ItemType", - "optional": true, - "description": "The type of menu item. Defaults to 'normal' if not specified." - }, - "id": { - "type": "string", - "optional": true, - "description": "The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension." - }, - "title": { - "type": "string", - "optional": true, - "description": "The text to be displayed in the item; this is <em>required</em> unless <code>type</code> is 'separator'. When the context is 'selection', you can use <code>%s</code> within the string to show the selected text. For example, if this parameter's value is \"Translate '%s' to Pig Latin\" and the user selects the word \"cool\", the context menu item for the selection is \"Translate 'cool' to Pig Latin\"." - }, - "checked": { - "type": "boolean", - "optional": true, - "description": "The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items." - }, - "contexts": { - "type": "array", - "items": { - "$ref": "ContextType" - }, - "minItems": 1, - "optional": true, - "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified." - }, - "onclick": { - "type": "function", - "optional": true, - "description": "A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for $(ref:contextMenus.onClicked).", - "parameters": [ - { - "name": "info", - "$ref": "contextMenusInternal.OnClickData", - "description": "Information about the item clicked and the context where the click happened." - }, - { - "name": "tab", - "$ref": "tabs.Tab", - "description": "The details of the tab where the click took place. Note: this parameter only present for extensions." - } - ] - }, - "parentId": { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "optional": true, - "description": "The ID of a parent menu item; this makes the item a child of a previously added item." - }, - "documentUrlPatterns": { - "type": "array", - "items": {"type": "string"}, - "optional": true, - "description": "Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see $(topic:match_patterns)[Match Patterns]." - }, - "targetUrlPatterns": { - "type": "array", - "items": {"type": "string"}, - "optional": true, - "description": "Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags." - }, - "enabled": { - "type": "boolean", - "optional": true, - "description": "Whether this context menu item is enabled or disabled. Defaults to true." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "description": "Called when the item has been created in the browser. If there were any problems creating the item, details will be available in $(ref:runtime.lastError).", - "parameters": [] - } - ] - }, - { - "name": "createInternal", - "type": "function", - "allowedContexts": ["addon_parent_only"], - "async": "callback", - "description": "Identical to contextMenus.create, except: the 'id' field is required and allows an integer, 'onclick' is not allowed, and the method is async (and the return value is not a menu item ID).", - "parameters": [ - { - "type": "object", - "name": "createProperties", - "properties": { - "type": { - "$ref": "ItemType", - "optional": true - }, - "id": { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ] - }, - "title": { - "type": "string", - "optional": true - }, - "checked": { - "type": "boolean", - "optional": true - }, - "contexts": { - "type": "array", - "items": { - "$ref": "ContextType" - }, - "minItems": 1, - "optional": true - }, - "parentId": { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "optional": true - }, - "documentUrlPatterns": { - "type": "array", - "items": {"type": "string"}, - "optional": true - }, - "targetUrlPatterns": { - "type": "array", - "items": {"type": "string"}, - "optional": true - }, - "enabled": { - "type": "boolean", - "optional": true - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "update", - "type": "function", - "description": "Updates a previously created context menu item.", - "async": "callback", - "parameters": [ - { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "name": "id", - "description": "The ID of the item to update." - }, - { - "type": "object", - "name": "updateProperties", - "description": "The properties to update. Accepts the same values as the create function.", - "properties": { - "type": { - "$ref": "ItemType", - "optional": true - }, - "title": { - "type": "string", - "optional": true - }, - "checked": { - "type": "boolean", - "optional": true - }, - "contexts": { - "type": "array", - "items": { - "$ref": "ContextType" - }, - "minItems": 1, - "optional": true - }, - "onclick": { - "type": "function", - "optional": "omit-key-if-missing", - "parameters": [ - { - "name": "info", - "$ref": "contextMenusInternal.OnClickData" - }, - { - "name": "tab", - "$ref": "tabs.Tab", - "description": "The details of the tab where the click took place. Note: this parameter only present for extensions." - } - ] - }, - "parentId": { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "optional": true, - "description": "Note: You cannot change an item to be a child of one of its own descendants." - }, - "documentUrlPatterns": { - "type": "array", - "items": {"type": "string"}, - "optional": true - }, - "targetUrlPatterns": { - "type": "array", - "items": {"type": "string"}, - "optional": true - }, - "enabled": { - "type": "boolean", - "optional": true - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [], - "description": "Called when the context menu has been updated." - } - ] - }, - { - "name": "remove", - "type": "function", - "description": "Removes a context menu item.", - "async": "callback", - "parameters": [ - { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "name": "menuItemId", - "description": "The ID of the context menu item to remove." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [], - "description": "Called when the context menu has been removed." - } - ] - }, - { - "name": "removeAll", - "type": "function", - "description": "Removes all context menu items added by this extension.", - "async": "callback", - "parameters": [ - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [], - "description": "Called when removal is complete." - } - ] - } - ], - "events": [ - { - "name": "onClicked", - "type": "function", - "description": "Fired when a context menu item is clicked.", - "parameters": [ - { - "name": "info", - "$ref": "OnClickData", - "description": "Information about the item clicked and the context where the click happened." - }, - { - "name": "tab", - "$ref": "tabs.Tab", - "description": "The details of the tab where the click took place. If the click did not take place in a tab, this parameter will be missing.", - "optional": true - } - ] - } - ] - } -] diff --git a/application/basilisk/components/webextensions/schemas/context_menus_internal.json b/application/basilisk/components/webextensions/schemas/context_menus_internal.json deleted file mode 100644 index c3cb7aff0..000000000 --- a/application/basilisk/components/webextensions/schemas/context_menus_internal.json +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "contextMenusInternal", - "description": "Use the <code>browser.contextMenus</code> API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.", - "types": [ - { - "id": "OnClickData", - "type": "object", - "description": "Information sent when a context menu item is clicked.", - "properties": { - "menuItemId": { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "description": "The ID of the menu item that was clicked." - }, - "parentMenuItemId": { - "choices": [ - { "type": "integer" }, - { "type": "string" } - ], - "optional": true, - "description": "The parent ID, if any, for the item clicked." - }, - "mediaType": { - "type": "string", - "optional": true, - "description": "One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements." - }, - "linkUrl": { - "type": "string", - "optional": true, - "description": "If the element is a link, the URL it points to." - }, - "srcUrl": { - "type": "string", - "optional": true, - "description": "Will be present for elements with a 'src' URL." - }, - "pageUrl": { - "type": "string", - "optional": true, - "description": "The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu." - }, - "frameUrl": { - "type": "string", - "optional": true, - "description": " The URL of the frame of the element where the context menu was clicked, if it was in a frame." - }, - "selectionText": { - "type": "string", - "optional": true, - "description": "The text for the context selection, if any." - }, - "editable": { - "type": "boolean", - "description": "A flag indicating whether the element is editable (text input, textarea, etc.)." - }, - "wasChecked": { - "type": "boolean", - "optional": true, - "description": "A flag indicating the state of a checkbox or radio item before it was clicked." - }, - "checked": { - "type": "boolean", - "optional": true, - "description": "A flag indicating the state of a checkbox or radio item after it is clicked." - } - } - } - ] - } -] diff --git a/application/basilisk/components/webextensions/schemas/history.json b/application/basilisk/components/webextensions/schemas/history.json deleted file mode 100644 index e05569e38..000000000 --- a/application/basilisk/components/webextensions/schemas/history.json +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "manifest", - "types": [ - { - "$extend": "Permission", - "choices": [{ - "type": "string", - "enum": [ - "history" - ] - }] - } - ] - }, - { - "namespace": "history", - "description": "Use the <code>browser.history</code> API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see $(topic:override)[Override Pages].", - "permissions": ["history"], - "types": [ - { - "id": "TransitionType", - "type": "string", - "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "auto_toplevel", "form_submit", "reload", "keyword", "keyword_generated"], - "description": "The $(topic:transition-types)[transition type] for this visit from its referrer." - }, - { - "id": "HistoryItem", - "type": "object", - "description": "An object encapsulating one result of a history query.", - "properties": { - "id": { - "type": "string", - "description": "The unique identifier for the item." - }, - "url": { - "type": "string", - "optional": true, - "description": "The URL navigated to by a user." - }, - "title": { - "type": "string", - "optional": true, - "description": "The title of the page when it was last loaded." - }, - "lastVisitTime": { - "type": "number", - "optional": true, - "description": "When this page was last loaded, represented in milliseconds since the epoch." - }, - "visitCount": { - "type": "integer", - "optional": true, - "description": "The number of times the user has navigated to this page." - }, - "typedCount": { - "type": "integer", - "optional": true, - "description": "The number of times the user has navigated to this page by typing in the address." - } - } - }, - { - "id": "VisitItem", - "type": "object", - "description": "An object encapsulating one visit to a URL.", - "properties": { - "id": { - "type": "string", - "description": "The unique identifier for the item." - }, - "visitId": { - "type": "string", - "description": "The unique identifier for this visit." - }, - "visitTime": { - "type": "number", - "optional": true, - "description": "When this visit occurred, represented in milliseconds since the epoch." - }, - "referringVisitId": { - "type": "string", - "description": "The visit ID of the referrer." - }, - "transition": { - "$ref": "TransitionType", - "description": "The $(topic:transition-types)[transition type] for this visit from its referrer." - } - } - } - ], - "functions": [ - { - "name": "search", - "type": "function", - "description": "Searches the history for the last visit time of each page matching the query.", - "async": "callback", - "parameters": [ - { - "name": "query", - "type": "object", - "properties": { - "text": { - "type": "string", - "description": "A free-text query to the history service. Leave empty to retrieve all pages." - }, - "startTime": { - "$ref": "extensionTypes.Date", - "optional": true, - "description": "Limit results to those visited after this date. If not specified, this defaults to 24 hours in the past." - }, - "endTime": { - "$ref": "extensionTypes.Date", - "optional": true, - "description": "Limit results to those visited before this date." - }, - "maxResults": { - "type": "integer", - "optional": true, - "minimum": 1, - "description": "The maximum number of results to retrieve. Defaults to 100." - } - } - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "results", - "type": "array", - "items": { - "$ref": "HistoryItem" - } - } - ] - } - ] - }, - { - "name": "getVisits", - "type": "function", - "description": "Retrieves information about visits to a URL.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The URL for which to retrieve visit information. It must be in the format as returned from a call to history.search." - } - } - }, - { - "name": "callback", - "type": "function", - "parameters": [ - { - "name": "results", - "type": "array", - "items": { - "$ref": "VisitItem" - } - } - ] - } - ] - }, - { - "name": "addUrl", - "type": "function", - "description": "Adds a URL to the history with a default visitTime of the current time and a default $(topic:transition-types)[transition type] of \"link\".", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The URL to add. Must be a valid URL that can be added to history." - }, - "title": { - "type": "string", - "optional": true, - "description": "The title of the page." - }, - "transition": { - "$ref": "TransitionType", - "optional": true, - "description": "The $(topic:transition-types)[transition type] for this visit from its referrer." - }, - "visitTime": { - "$ref": "extensionTypes.Date", - "optional": true, - "description": "The date when this visit occurred." - } - } - }, - { - "name": "callback", - "type": "function", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "deleteUrl", - "type": "function", - "description": "Removes all occurrences of the given URL from the history.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The URL to remove." - } - } - }, - { - "name": "callback", - "type": "function", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "deleteRange", - "type": "function", - "description": "Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.", - "async": "callback", - "parameters": [ - { - "name": "range", - "type": "object", - "properties": { - "startTime": { - "$ref": "extensionTypes.Date", - "description": "Items added to history after this date." - }, - "endTime": { - "$ref": "extensionTypes.Date", - "description": "Items added to history before this date." - } - } - }, - { - "name": "callback", - "type": "function", - "parameters": [] - } - ] - }, - { - "name": "deleteAll", - "type": "function", - "description": "Deletes all items from the history.", - "async": "callback", - "parameters": [ - { - "name": "callback", - "type": "function", - "parameters": [] - } - ] - } - ], - "events": [ - { - "name": "onVisited", - "type": "function", - "description": "Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded.", - "parameters": [ - { - "name": "result", - "$ref": "HistoryItem" - } - ] - }, - { - "name": "onVisitRemoved", - "type": "function", - "description": "Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history.", - "parameters": [ - { - "name": "removed", - "type": "object", - "properties": { - "allHistory": { - "type": "boolean", - "description": "True if all history was removed. If true, then urls will be empty." - }, - "urls": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - ] - } - ] - } -] diff --git a/application/basilisk/components/webextensions/schemas/jar.mn b/application/basilisk/components/webextensions/schemas/jar.mn deleted file mode 100644 index c9fc9a808..000000000 --- a/application/basilisk/components/webextensions/schemas/jar.mn +++ /dev/null @@ -1,16 +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/. - -browser.jar: - content/browser/schemas/bookmarks.json - content/browser/schemas/browser_action.json - content/browser/schemas/commands.json - content/browser/schemas/context_menus.json - content/browser/schemas/context_menus_internal.json - content/browser/schemas/history.json - content/browser/schemas/omnibox.json - content/browser/schemas/page_action.json - content/browser/schemas/sessions.json - content/browser/schemas/tabs.json - content/browser/schemas/windows.json diff --git a/application/basilisk/components/webextensions/schemas/omnibox.json b/application/basilisk/components/webextensions/schemas/omnibox.json deleted file mode 100644 index 34428fab7..000000000 --- a/application/basilisk/components/webextensions/schemas/omnibox.json +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -[ - { - "namespace": "manifest", - "types": [ - { - "$extend": "WebExtensionManifest", - "properties": { - "omnibox": { - "type": "object", - "additionalProperties": { "$ref": "UnrecognizedProperty" }, - "properties": { - "keyword": { - "type": "string", - "pattern": "^[^?\\s:]([^\\s:]*[^/\\s:])?$" - } - }, - "optional": true - } - } - } - ] - }, - { - "namespace": "omnibox", - "description": "The omnibox API allows you to register a keyword with Firefox's address bar.", - "permissions": ["manifest:omnibox"], - "types": [ - { - "id": "DescriptionStyleType", - "type": "string", - "description": "The style type.", - "enum": ["url", "match", "dim"] - }, - { - "id": "OnInputEnteredDisposition", - "type": "string", - "enum": ["currentTab", "newForegroundTab", "newBackgroundTab"], - "description": "The window disposition for the omnibox query. This is the recommended context to display results. For example, if the omnibox command is to navigate to a certain URL, a disposition of 'newForegroundTab' means the navigation should take place in a new selected tab." - }, - { - "id": "SuggestResult", - "type": "object", - "description": "A suggest result.", - "properties": { - "content": { - "type": "string", - "minLength": 1, - "description": "The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry." - }, - "description": { - "type": "string", - "minLength": 1, - "description": "The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. <dim><match>dimmed match</match></dim>. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 " - }, - "descriptionStyles": { - "optional": true, - "unsupported": true, - "type": "array", - "description": "An array of style ranges for the description, as provided by the extension.", - "items": { - "type": "object", - "description": "The style ranges for the description, as provided by the extension.", - "properties": { - "offset": { "type": "integer" }, - "type": { "description": "The style type", "$ref": "DescriptionStyleType"}, - "length": { "type": "integer", "optional": true } - } - } - }, - "descriptionStylesRaw": { - "optional": true, - "unsupported": true, - "type": "array", - "description": "An array of style ranges for the description, as provided by ToValue().", - "items": { - "type": "object", - "description": "The style ranges for the description, as provided by ToValue().", - "properties": { - "offset": { "type": "integer" }, - "type": { "type": "integer" } - } - } - } - } - }, - { - "id": "DefaultSuggestResult", - "type": "object", - "description": "A suggest result.", - "properties": { - "description": { - "type": "string", - "minLength": 1, - "description": "The text that is displayed in the URL dropdown." - }, - "descriptionStyles": { - "optional": true, - "unsupported": true, - "type": "array", - "description": "An array of style ranges for the description, as provided by the extension.", - "items": { - "type": "object", - "description": "The style ranges for the description, as provided by the extension.", - "properties": { - "offset": { "type": "integer" }, - "type": { "description": "The style type", "$ref": "DescriptionStyleType"}, - "length": { "type": "integer", "optional": true } - } - } - }, - "descriptionStylesRaw": { - "optional": true, - "unsupported": true, - "type": "array", - "description": "An array of style ranges for the description, as provided by ToValue().", - "items": { - "type": "object", - "description": "The style ranges for the description, as provided by ToValue().", - "properties": { - "offset": { "type": "integer" }, - "type": { "type": "integer" } - } - } - } - } - } - ], - "functions": [ - { - "name": "setDefaultSuggestion", - "type": "function", - "description": "Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.", - "parameters": [ - { - "name": "suggestion", - "$ref": "DefaultSuggestResult", - "description": "A partial SuggestResult object, without the 'content' parameter." - } - ] - } - ], - "events": [ - { - "name": "onInputStarted", - "type": "function", - "description": "User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events.", - "parameters": [] - }, - { - "name": "onInputChanged", - "type": "function", - "description": "User has changed what is typed into the omnibox.", - "parameters": [ - { - "type": "string", - "name": "text" - }, - { - "name": "suggest", - "type": "function", - "description": "A callback passed to the onInputChanged event used for sending suggestions back to the browser.", - "parameters": [ - { - "name": "suggestResults", - "type": "array", - "description": "Array of suggest results", - "items": { - "$ref": "SuggestResult" - } - } - ] - } - ] - }, - { - "name": "onInputEntered", - "type": "function", - "description": "User has accepted what is typed into the omnibox.", - "parameters": [ - { - "type": "string", - "name": "text" - }, - { - "name": "disposition", - "$ref": "OnInputEnteredDisposition" - } - ] - }, - { - "name": "onInputCancelled", - "type": "function", - "description": "User has ended the keyword input session without accepting the input.", - "parameters": [] - } - ] - }, - { - "namespace": "omnibox_internal", - "description": "The internal namespace used by the omnibox API.", - "defaultContexts": ["addon_parent_only"], - "functions": [ - { - "name": "addSuggestions", - "type": "function", - "async": "callback", - "description": "Internal function used by omnibox.onInputChanged for adding search suggestions", - "parameters": [ - { - "name": "id", - "type": "integer", - "description": "The ID of the callback received by onInputChangedInternal" - }, - { - "name": "suggestResults", - "type": "array", - "description": "Array of suggest results", - "items": { - "$ref": "omnibox.SuggestResult" - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - } - ], - "events": [ - { - "name": "onInputChanged", - "type": "function", - "description": "Identical to omnibox.onInputChanged except no 'suggest' callback is provided.", - "parameters": [ - { - "type": "string", - "name": "text" - } - ] - } - ] - } -]
\ No newline at end of file diff --git a/application/basilisk/components/webextensions/schemas/page_action.json b/application/basilisk/components/webextensions/schemas/page_action.json deleted file mode 100644 index 126378ca5..000000000 --- a/application/basilisk/components/webextensions/schemas/page_action.json +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "manifest", - "types": [ - { - "$extend": "WebExtensionManifest", - "properties": { - "page_action": { - "type": "object", - "additionalProperties": { "$ref": "UnrecognizedProperty" }, - "properties": { - "default_title": { - "type": "string", - "optional": true, - "preprocess": "localize" - }, - "default_icon": { - "$ref": "IconPath", - "optional": true - }, - "default_popup": { - "type": "string", - "format": "relativeUrl", - "optional": true, - "preprocess": "localize" - }, - "browser_style": { - "type": "boolean", - "optional": true - } - }, - "optional": true - } - } - } - ] - }, - { - "namespace": "pageAction", - "description": "Use the <code>browser.pageAction</code> API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.", - "permissions": ["manifest:page_action"], - "types": [ - { - "id": "ImageDataType", - "type": "object", - "isInstanceOf": "ImageData", - "additionalProperties": { "type": "any" }, - "postprocess": "convertImageDataToURL", - "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)." - } - ], - "functions": [ - { - "name": "show", - "type": "function", - "async": "callback", - "description": "Shows the page action. The page action is shown whenever the tab is selected.", - "parameters": [ - {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "hide", - "type": "function", - "async": "callback", - "description": "Hides the page action.", - "parameters": [ - {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "setTitle", - "type": "function", - "description": "Sets the title of the page action. This is displayed in a tooltip over the page action.", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}, - "title": {"type": "string", "description": "The tooltip string."} - } - } - ] - }, - { - "name": "getTitle", - "type": "function", - "description": "Gets the title of the page action.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": { - "type": "integer", - "description": "Specify the tab to get the title from." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "result", - "type": "string" - } - ] - } - ] - }, - { - "name": "setIcon", - "type": "function", - "description": "Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}, - "imageData": { - "choices": [ - { "$ref": "ImageDataType" }, - { - "type": "object", - "additionalProperties": {"$ref": "ImageDataType"} - } - ], - "optional": true, - "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'" - }, - "path": { - "choices": [ - { "type": "string" }, - { - "type": "object", - "additionalProperties": {"type": "string"} - } - ], - "optional": true, - "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'" - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "setPopup", - "type": "function", - "async": true, - "description": "Sets the html document to be opened as a popup when the user clicks on the page action's icon.", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."}, - "popup": { - "type": "string", - "description": "The html file to show in a popup. If set to the empty string (''), no popup is shown." - } - } - } - ] - }, - { - "name": "getPopup", - "type": "function", - "description": "Gets the html document set as the popup for this page action.", - "async": "callback", - "parameters": [ - { - "name": "details", - "type": "object", - "properties": { - "tabId": { - "type": "integer", - "description": "Specify the tab to get the popup from." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "result", - "type": "string" - } - ] - } - ] - } - ], - "events": [ - { - "name": "onClicked", - "type": "function", - "description": "Fired when a page action icon is clicked. This event will not fire if the page action has a popup.", - "parameters": [ - { - "name": "tab", - "$ref": "tabs.Tab" - } - ] - } - ] - } -] diff --git a/application/basilisk/components/webextensions/schemas/sessions.json b/application/basilisk/components/webextensions/schemas/sessions.json deleted file mode 100644 index 690bb8ebc..000000000 --- a/application/basilisk/components/webextensions/schemas/sessions.json +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "manifest", - "types": [ - { - "$extend": "Permission", - "choices": [{ - "type": "string", - "enum": [ - "sessions" - ] - }] - } - ] - }, - { - "namespace": "sessions", - "description": "Use the <code>chrome.sessions</code> API to query and restore tabs and windows from a browsing session.", - "permissions": ["sessions"], - "types": [ - { - "id": "Filter", - "type": "object", - "properties": { - "maxResults": { - "type": "integer", - "minimum": 0, - "maximum": 25, - "optional": true, - "description": "The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ($(ref:sessions.MAX_SESSION_RESULTS))." - } - } - }, - { - "id": "Session", - "type": "object", - "properties": { - "lastModified": {"type": "integer", "description": "The time when the window or tab was closed or modified, represented in milliseconds since the epoch."}, - "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $(ref:tabs.Tab), if this entry describes a tab. Either this or $(ref:sessions.Session.window) will be set."}, - "window": {"$ref": "windows.Window", "optional": true, "description": "The $(ref:windows.Window), if this entry describes a window. Either this or $(ref:sessions.Session.tab) will be set."} - } - }, - { - "id": "Device", - "type": "object", - "properties": { - "info": {"type": "string"}, - "deviceName": {"type": "string", "description": "The name of the foreign device."}, - "sessions": {"type": "array", "items": {"$ref": "Session"}, "description": "A list of open window sessions for the foreign device, sorted from most recently to least recently modified session."} - } - } - ], - "functions": [ - { - "name": "getRecentlyClosed", - "type": "function", - "description": "Gets the list of recently closed tabs and/or windows.", - "async": "callback", - "parameters": [ - { - "$ref": "Filter", - "name": "filter", - "optional": true, - "default": {} - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "sessions", "type": "array", "items": { "$ref": "Session" }, "description": "The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index <code>0</code>). The entries may contain either tabs or windows." - } - ] - } - ] - }, - { - "name": "getDevices", - "unsupported": true, - "type": "function", - "description": "Retrieves all devices with synced sessions.", - "async": "callback", - "parameters": [ - { - "$ref": "Filter", - "name": "filter", - "optional": true - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "devices", "type": "array", "items": { "$ref": "Device" }, "description": "The list of $(ref:sessions.Device) objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. $(ref:tabs.Tab) objects are sorted by recency in the $(ref:windows.Window) of the $(ref:sessions.Session) objects." - } - ] - } - ] - }, - { - "name": "restore", - "type": "function", - "description": "Reopens a $(ref:windows.Window) or $(ref:tabs.Tab), with an optional callback to run when the entry has been restored.", - "async": "callback", - "parameters": [ - { - "type": "string", - "name": "sessionId", - "optional": true, - "description": "The $(ref:windows.Window.sessionId), or $(ref:tabs.Tab.sessionId) to restore. If this parameter is not specified, the most recently closed session is restored." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "$ref": "Session", - "name": "restoredSession", - "description": "A $(ref:sessions.Session) containing the restored $(ref:windows.Window) or $(ref:tabs.Tab) object." - } - ] - } - ] - } - ], - "events": [ - { - "name": "onChanged", - "unsupported": true, - "description": "Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes.", - "type": "function" - } - ], - "properties": { - "MAX_SESSION_RESULTS": { - "value": 25, - "description": "The maximum number of $(ref:sessions.Session) that will be included in a requested list." - } - } - } -] diff --git a/application/basilisk/components/webextensions/schemas/tabs.json b/application/basilisk/components/webextensions/schemas/tabs.json deleted file mode 100644 index 23ce33a4b..000000000 --- a/application/basilisk/components/webextensions/schemas/tabs.json +++ /dev/null @@ -1,1295 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "manifest", - "types": [ - { - "$extend": "Permission", - "choices": [{ - "type": "string", - "enum": [ - "activeTab", - "tabs" - ] - }] - } - ] - }, - { - "namespace": "tabs", - "description": "Use the <code>browser.tabs</code> API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.", - "types": [ - { "id": "MutedInfoReason", - "type": "string", - "description": "An event that caused a muted state change.", - "enum": [ - {"name": "user", "description": "A user input action has set/overridden the muted state."}, - {"name": "capture", "description": "Tab capture started, forcing a muted state change."}, - {"name": "extension", "description": "An extension, identified by the extensionId field, set the muted state."} - ] - }, - { - "id": "MutedInfo", - "type": "object", - "description": "Tab muted state and the reason for the last state change.", - "properties": { - "muted": { - "type": "boolean", - "description": "Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing." - }, - "reason": { - "$ref": "MutedInfoReason", - "optional": true, - "description": "The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed." - }, - "extensionId": { - "type": "string", - "optional": true, - "description": "The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed." - } - } - }, - { - "id": "Tab", - "type": "object", - "properties": { - "id": {"type": "integer", "minimum": -1, "optional": true, "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present. Tab ID can also be set to $(ref:tabs.TAB_ID_NONE) for apps and devtools windows."}, - "index": {"type": "integer", "minimum": -1, "description": "The zero-based index of the tab within its window."}, - "windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window the tab is contained within."}, - "openerTabId": {"unsupported": true, "type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."}, - "selected": {"type": "boolean", "description": "Whether the tab is selected.", "deprecated": "Please use $(ref:tabs.Tab.highlighted).", "unsupported": true}, - "highlighted": {"type": "boolean", "description": "Whether the tab is highlighted."}, - "active": {"type": "boolean", "description": "Whether the tab is active in its window. (Does not necessarily mean the window is focused.)"}, - "pinned": {"type": "boolean", "description": "Whether the tab is pinned."}, - "audible": {"type": "boolean", "optional": true, "description": "Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the speaker audio indicator is showing."}, - "mutedInfo": {"$ref": "MutedInfo", "optional": true, "description": "Current tab muted state and the reason for the last state change."}, - "url": {"type": "string", "optional": true, "permissions": ["tabs"], "description": "The URL the tab is displaying. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission."}, - "title": {"type": "string", "optional": true, "permissions": ["tabs"], "description": "The title of the tab. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission."}, - "favIconUrl": {"type": "string", "optional": true, "permissions": ["tabs"], "description": "The URL of the tab's favicon. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission. It may also be an empty string if the tab is loading."}, - "status": {"type": "string", "optional": true, "description": "Either <em>loading</em> or <em>complete</em>."}, - "incognito": {"type": "boolean", "description": "Whether the tab is in an incognito window."}, - "width": {"type": "integer", "optional": true, "description": "The width of the tab in pixels."}, - "height": {"type": "integer", "optional": true, "description": "The height of the tab in pixels."}, - "sessionId": {"unsupported": true, "type": "string", "optional": true, "description": "The session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API."}, - "cookieStoreId": {"type": "string", "description": "The CookieStoreId used for the tab."} - } - }, - { - "id": "ZoomSettingsMode", - "type": "string", - "description": "Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to <code>automatic</code>.", - "enum": [ - { - "name": "automatic", - "description": "Zoom changes are handled automatically by the browser." - }, - { - "name": "manual", - "description": "Overrides the automatic handling of zoom changes. The <code>onZoomChange</code> event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support <code>per-origin</code> zooming, and will thus ignore the <code>scope</code> zoom setting and assume <code>per-tab</code>." - }, - { - "name": "disabled", - "description": "Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored." - } - ] - }, - { - "id": "ZoomSettingsScope", - "type": "string", - "description": "Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to <code>per-origin</code> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.", - "enum": [ - { - "name": "per-origin", - "description": "Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, <code>per-origin</code> zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The <code>per-origin</code> scope is only available in the <code>automatic</code> mode." - }, - { - "name": "per-tab", - "description": "Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, <code>per-tab</code> zoom changes are reset on navigation; navigating a tab will always load pages with their <code>per-origin</code> zoom factors." - } - ] - }, - { - "id": "ZoomSettings", - "type": "object", - "description": "Defines how zoom changes in a tab are handled and at what scope.", - "properties": { - "mode": { - "$ref": "ZoomSettingsMode", - "description": "Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to <code>automatic</code>.", - "optional": true - }, - "scope": { - "$ref": "ZoomSettingsScope", - "description": "Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to <code>per-origin</code> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.", - "optional": true - }, - "defaultZoomFactor": { - "type": "number", - "optional": true, - "description": "Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings." - } - } - }, - { - "id": "TabStatus", - "type": "string", - "enum": ["loading", "complete"], - "description": "Whether the tabs have completed loading." - }, - { - "id": "WindowType", - "type": "string", - "enum": ["normal", "popup", "panel", "app", "devtools"], - "description": "The type of window." - } - ], - "properties": { - "TAB_ID_NONE": { - "value": -1, - "description": "An ID which represents the absence of a browser tab." - } - }, - "functions": [ - { - "name": "get", - "type": "function", - "description": "Retrieves details about the specified tab.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0 - }, - { - "type": "function", - "name": "callback", - "parameters": [ - {"name": "tab", "$ref": "Tab"} - ] - } - ] - }, - { - "name": "getCurrent", - "type": "function", - "description": "Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view).", - "async": "callback", - "parameters": [ - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "tab", - "$ref": "Tab", - "optional": true - } - ] - } - ] - }, - { - "name": "connect", - "type": "function", - "description": "Connects to the content script(s) in the specified tab. The $(ref:runtime.onConnect) event is fired in each content script running in the specified tab for the current extension. For more details, see $(topic:messaging)[Content Script Messaging].", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0 - }, - { - "type": "object", - "name": "connectInfo", - "properties": { - "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for content scripts that are listening for the connection event." }, - "frameId": { - "type": "integer", - "optional": true, - "minimum": 0, - "description": "Open a port to a specific $(topic:frame_ids)[frame] identified by <code>frameId</code> instead of all frames in the tab." - } - }, - "optional": true - } - ], - "returns": { - "$ref": "runtime.Port", - "description": "A port that can be used to communicate with the content scripts running in the specified tab. The port's $(ref:runtime.Port) event is fired if the tab closes or does not exist. " - } - }, - { - "name": "sendRequest", - "deprecated": "Please use $(ref:runtime.sendMessage).", - "unsupported": true, - "type": "function", - "description": "Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The $(ref:extension.onRequest) event is fired in each content script running in the specified tab for the current extension.", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0 - }, - { - "type": "any", - "name": "request" - }, - { - "type": "function", - "name": "responseCallback", - "optional": true, - "parameters": [ - { - "name": "response", - "type": "any", - "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message." - } - ] - } - ] - }, - { - "name": "sendMessage", - "type": "function", - "description": "Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The $(ref:runtime.onMessage) event is fired in each content script running in the specified tab for the current extension.", - "async": "responseCallback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0 - }, - { - "type": "any", - "name": "message" - }, - { - "type": "object", - "name": "options", - "properties": { - "frameId": { - "type": "integer", - "optional": true, - "minimum": 0, - "description": "Send a message to a specific $(topic:frame_ids)[frame] identified by <code>frameId</code> instead of all frames in the tab." - } - }, - "optional": true - }, - { - "type": "function", - "name": "responseCallback", - "optional": true, - "parameters": [ - { - "name": "response", - "type": "any", - "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message." - } - ] - } - ] - }, - { - "name": "getSelected", - "deprecated": "Please use $(ref:tabs.query) <code>{active: true}</code>.", - "unsupported": true, - "type": "function", - "description": "Gets the tab that is selected in the specified window.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "windowId", - "minimum": -2, - "optional": true, - "description": "Defaults to the $(topic:current-window)[current window]." - }, - { - "type": "function", - "name": "callback", - "parameters": [ - {"name": "tab", "$ref": "Tab"} - ] - } - ] - }, - { - "name": "getAllInWindow", - "deprecated": "Please use $(ref:tabs.query) <code>{windowId: windowId}</code>.", - "unsupported": true, - "type": "function", - "description": "Gets details about all tabs in the specified window.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "windowId", - "minimum": -2, - "optional": true, - "description": "Defaults to the $(topic:current-window)[current window]." - }, - { - "type": "function", - "name": "callback", - "parameters": [ - {"name": "tabs", "type": "array", "items": { "$ref": "Tab" } } - ] - } - ] - }, - { - "name": "create", - "type": "function", - "description": "Creates a new tab.", - "async": "callback", - "parameters": [ - { - "type": "object", - "name": "createProperties", - "properties": { - "windowId": { - "type": "integer", - "minimum": -2, - "optional": true, - "description": "The window to create the new tab in. Defaults to the $(topic:current-window)[current window]." - }, - "index": { - "type": "integer", - "minimum": 0, - "optional": true, - "description": "The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window." - }, - "url": { - "type": "string", - "optional": true, - "description": "The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page." - }, - "active": { - "type": "boolean", - "optional": true, - "description": "Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $(ref:windows.update)). Defaults to <var>true</var>." - }, - "selected": { - "deprecated": "Please use <em>active</em>.", - "unsupported": true, - "type": "boolean", - "optional": true, - "description": "Whether the tab should become the selected tab in the window. Defaults to <var>true</var>" - }, - "pinned": { - "type": "boolean", - "optional": true, - "description": "Whether the tab should be pinned. Defaults to <var>false</var>" - }, - "openerTabId": { - "unsupported": true, - "type": "integer", - "minimum": 0, - "optional": true, - "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab." - }, - "cookieStoreId": { - "type": "string", - "optional": true, - "description": "The CookieStoreId for the tab that opened this tab." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "tab", - "$ref": "Tab", - "description": "Details about the created tab. Will contain the ID of the new tab." - } - ] - } - ] - }, - { - "name": "duplicate", - "type": "function", - "description": "Duplicates a tab.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "description": "The ID of the tab which is to be duplicated." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "tab", - "optional": true, - "description": "Details about the duplicated tab. The $(ref:tabs.Tab) object doesn't contain <code>url</code>, <code>title</code> and <code>favIconUrl</code> if the <code>\"tabs\"</code> permission has not been requested.", - "$ref": "Tab" - } - ] - } - ] - }, - { - "name": "query", - "type": "function", - "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.", - "async": "callback", - "parameters": [ - { - "type": "object", - "name": "queryInfo", - "properties": { - "active": { - "type": "boolean", - "optional": true, - "description": "Whether the tabs are active in their windows." - }, - "pinned": { - "type": "boolean", - "optional": true, - "description": "Whether the tabs are pinned." - }, - "audible": { - "type": "boolean", - "optional": true, - "description": "Whether the tabs are audible." - }, - "muted": { - "type": "boolean", - "optional": true, - "description": "Whether the tabs are muted." - }, - "highlighted": { - "type": "boolean", - "optional": true, - "description": "Whether the tabs are highlighted." - }, - "currentWindow": { - "type": "boolean", - "optional": true, - "description": "Whether the tabs are in the $(topic:current-window)[current window]." - }, - "lastFocusedWindow": { - "type": "boolean", - "optional": true, - "description": "Whether the tabs are in the last focused window." - }, - "status": { - "$ref": "TabStatus", - "optional": true, - "description": "Whether the tabs have completed loading." - }, - "title": { - "type": "string", - "optional": true, - "description": "Match page titles against a pattern." - }, - "url": { - "choices": [ - {"type": "string"}, - {"type": "array", "items": {"type": "string"}} - ], - "optional": true, - "description": "Match tabs against one or more $(topic:match_patterns)[URL patterns]. Note that fragment identifiers are not matched." - }, - "windowId": { - "type": "integer", - "optional": true, - "minimum": -2, - "description": "The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the $(topic:current-window)[current window]." - }, - "windowType": { - "$ref": "WindowType", - "optional": true, - "description": "The type of window the tabs are in." - }, - "index": { - "type": "integer", - "optional": true, - "minimum": 0, - "description": "The position of the tabs within their windows." - }, - "cookieStoreId": { - "type": "string", - "optional": true, - "description": "The CookieStoreId used for the tab." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "result", - "type": "array", - "items": { - "$ref": "Tab" - } - } - ] - } - ] - }, - { - "name": "highlight", - "type": "function", - "description": "Highlights the given tabs.", - "async": "callback", - "parameters": [ - { - "type": "object", - "name": "highlightInfo", - "properties": { - "windowId": { - "type": "integer", - "optional": true, - "description": "The window that contains the tabs.", - "minimum": -2 - }, - "tabs": { - "description": "One or more tab indices to highlight.", - "choices": [ - {"type": "array", "items": {"type": "integer", "minimum": 0}}, - {"type": "integer"} - ] - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "window", - "$ref": "windows.Window", - "description": "Contains details about the window whose tabs were highlighted." - } - ] - } - ] - }, - { - "name": "update", - "type": "function", - "description": "Modifies the properties of a tab. Properties that are not specified in <var>updateProperties</var> are not modified.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "optional": true, - "description": "Defaults to the selected tab of the $(topic:current-window)[current window]." - }, - { - "type": "object", - "name": "updateProperties", - "properties": { - "url": { - "type": "string", - "optional": true, - "description": "A URL to navigate the tab to." - }, - "active": { - "type": "boolean", - "optional": true, - "description": "Whether the tab should be active. Does not affect whether the window is focused (see $(ref:windows.update))." - }, - "highlighted": { - "unsupported": true, - "type": "boolean", - "optional": true, - "description": "Adds or removes the tab from the current selection." - }, - "selected": { - "unsupported": true, - "deprecated": "Please use <em>highlighted</em>.", - "type": "boolean", - "optional": true, - "description": "Whether the tab should be selected." - }, - "pinned": { - "type": "boolean", - "optional": true, - "description": "Whether the tab should be pinned." - }, - "muted": { - "type": "boolean", - "optional": true, - "description": "Whether the tab should be muted." - }, - "openerTabId": { - "unsupported": true, - "type": "integer", - "minimum": 0, - "optional": true, - "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "tab", - "$ref": "Tab", - "optional": true, - "description": "Details about the updated tab. The $(ref:tabs.Tab) object doesn't contain <code>url</code>, <code>title</code> and <code>favIconUrl</code> if the <code>\"tabs\"</code> permission has not been requested." - } - ] - } - ] - }, - { - "name": "move", - "type": "function", - "description": "Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === \"normal\") windows.", - "async": "callback", - "parameters": [ - { - "name": "tabIds", - "description": "The tab or list of tabs to move.", - "choices": [ - {"type": "integer", "minimum": 0}, - {"type": "array", "items": {"type": "integer", "minimum": 0}} - ] - }, - { - "type": "object", - "name": "moveProperties", - "properties": { - "windowId": { - "type": "integer", - "minimum": -2, - "optional": true, - "description": "Defaults to the window the tab is currently in." - }, - "index": { - "type": "integer", - "minimum": -1, - "description": "The position to move the window to. -1 will place the tab at the end of the window." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "tabs", - "description": "Details about the moved tabs.", - "choices": [ - {"$ref": "Tab"}, - {"type": "array", "items": {"$ref": "Tab"}} - ] - } - ] - } - ] - }, - { - "name": "reload", - "type": "function", - "description": "Reload a tab.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "optional": true, - "description": "The ID of the tab to reload; defaults to the selected tab of the current window." - }, - { - "type": "object", - "name": "reloadProperties", - "optional": true, - "properties": { - "bypassCache": { - "type": "boolean", - "optional": true, - "description": "Whether using any local cache. Default is false." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "remove", - "type": "function", - "description": "Closes one or more tabs.", - "async": "callback", - "parameters": [ - { - "name": "tabIds", - "description": "The tab or list of tabs to close.", - "choices": [ - {"type": "integer", "minimum": 0}, - {"type": "array", "items": {"type": "integer", "minimum": 0}} - ] - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - }, - { - "name": "detectLanguage", - "type": "function", - "description": "Detects the primary language of the content in a tab.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "optional": true, - "description": "Defaults to the active tab of the $(topic:current-window)[current window]." - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "type": "string", - "name": "language", - "description": "An ISO language code such as <code>en</code> or <code>fr</code>. For a complete list of languages supported by this method, see <a href='http://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc'>kLanguageInfoTable</a>. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, <code>und</code> will be returned." - } - ] - } - ] - }, - { - "name": "captureVisibleTab", - "type": "function", - "description": "Captures the visible area of the currently active tab in the specified window. You must have $(topic:declare_permissions)[<all_urls>] permission to use this method.", - "permissions": ["<all_urls>"], - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "windowId", - "minimum": -2, - "optional": true, - "description": "The target window. Defaults to the $(topic:current-window)[current window]." - }, - { - "$ref": "extensionTypes.ImageDetails", - "name": "options", - "optional": true - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "type": "string", - "name": "dataUrl", - "description": "A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display." - } - ] - } - ] - }, - { - "name": "executeScript", - "type": "function", - "description": "Injects JavaScript code into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "optional": true, - "description": "The ID of the tab in which to run the script; defaults to the active tab of the current window." - }, - { - "$ref": "extensionTypes.InjectDetails", - "name": "details", - "description": "Details of the script to run." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "description": "Called after all the JavaScript has been executed.", - "parameters": [ - { - "name": "result", - "optional": true, - "type": "array", - "items": {"type": "any"}, - "description": "The result of the script in every injected frame." - } - ] - } - ] - }, - { - "name": "insertCSS", - "type": "function", - "description": "Injects CSS into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "optional": true, - "description": "The ID of the tab in which to insert the CSS; defaults to the active tab of the current window." - }, - { - "$ref": "extensionTypes.InjectDetails", - "name": "details", - "description": "Details of the CSS text to insert." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "description": "Called when all the CSS has been inserted.", - "parameters": [] - } - ] - }, - { - "name": "removeCSS", - "type": "function", - "description": "Removes injected CSS from a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "optional": true, - "description": "The ID of the tab from which to remove the injected CSS; defaults to the active tab of the current window." - }, - { - "$ref": "extensionTypes.InjectDetails", - "name": "details", - "description": "Details of the CSS text to remove." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "description": "Called when all the CSS has been removed.", - "parameters": [] - } - ] - }, - { - "name": "setZoom", - "type": "function", - "description": "Zooms a specified tab.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "optional": true, - "description": "The ID of the tab to zoom; defaults to the active tab of the current window." - }, - { - "type": "number", - "name": "zoomFactor", - "description": "The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "description": "Called after the zoom factor has been changed.", - "parameters": [] - } - ] - }, - { - "name": "getZoom", - "type": "function", - "description": "Gets the current zoom factor of a specified tab.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "optional": true, - "description": "The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window." - }, - { - "type": "function", - "name": "callback", - "description": "Called with the tab's current zoom factor after it has been fetched.", - "parameters": [ - { - "type": "number", - "name": "zoomFactor", - "description": "The tab's current zoom factor." - } - ] - } - ] - }, - { - "name": "setZoomSettings", - "type": "function", - "description": "Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "optional": true, - "minimum": 0, - "description": "The ID of the tab to change the zoom settings for; defaults to the active tab of the current window." - }, - { - "$ref": "ZoomSettings", - "name": "zoomSettings", - "description": "Defines how zoom changes are handled and at what scope." - }, - { - "type": "function", - "name": "callback", - "optional": true, - "description": "Called after the zoom settings have been changed.", - "parameters": [] - } - ] - }, - { - "name": "getZoomSettings", - "type": "function", - "description": "Gets the current zoom settings of a specified tab.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "optional": true, - "minimum": 0, - "description": "The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window." - }, - { - "type": "function", - "name": "callback", - "description": "Called with the tab's current zoom settings.", - "parameters": [ - { - "$ref": "ZoomSettings", - "name": "zoomSettings", - "description": "The tab's current zoom settings." - } - ] - } - ] - } - ], - "events": [ - { - "name": "onCreated", - "type": "function", - "description": "Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.", - "parameters": [ - { - "$ref": "Tab", - "name": "tab", - "description": "Details of the tab that was created." - } - ] - }, - { - "name": "onUpdated", - "type": "function", - "description": "Fired when a tab is updated.", - "parameters": [ - {"type": "integer", "name": "tabId", "minimum": 0}, - { - "type": "object", - "name": "changeInfo", - "description": "Lists the changes to the state of the tab that was updated.", - "properties": { - "status": { - "type": "string", - "optional": true, - "description": "The status of the tab. Can be either <em>loading</em> or <em>complete</em>." - }, - "url": { - "type": "string", - "optional": true, - "description": "The tab's URL if it has changed." - }, - "pinned": { - "type": "boolean", - "optional": true, - "description": "The tab's new pinned state." - }, - "audible": { - "type": "boolean", - "optional": true, - "description": "The tab's new audible state." - }, - "mutedInfo": { - "$ref": "MutedInfo", - "optional": true, - "description": "The tab's new muted state and the reason for the change." - }, - "favIconUrl": { - "type": "string", - "optional": true, - "description": "The tab's new favicon URL." - } - } - }, - { - "$ref": "Tab", - "name": "tab", - "description": "Gives the state of the tab that was updated." - } - ] - }, - { - "name": "onMoved", - "type": "function", - "description": "Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see $(ref:tabs.onDetached).", - "parameters": [ - {"type": "integer", "name": "tabId", "minimum": 0}, - { - "type": "object", - "name": "moveInfo", - "properties": { - "windowId": {"type": "integer", "minimum": 0}, - "fromIndex": {"type": "integer", "minimum": 0}, - "toIndex": {"type": "integer", "minimum": 0} - } - } - ] - }, - { - "name": "onSelectionChanged", - "deprecated": "Please use $(ref:tabs.onActivated).", - "unsupported": true, - "type": "function", - "description": "Fires when the selected tab in a window changes.", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "description": "The ID of the tab that has become active." - }, - { - "type": "object", - "name": "selectInfo", - "properties": { - "windowId": { - "type": "integer", - "minimum": 0, - "description": "The ID of the window the selected tab changed inside of." - } - } - } - ] - }, - { - "name": "onActiveChanged", - "deprecated": "Please use $(ref:tabs.onActivated).", - "unsupported": true, - "type": "function", - "description": "Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to $(ref:tabs.onUpdated) events to be notified when a URL is set.", - "parameters": [ - { - "type": "integer", - "name": "tabId", - "minimum": 0, - "description": "The ID of the tab that has become active." - }, - { - "type": "object", - "name": "selectInfo", - "properties": { - "windowId": { - "type": "integer", - "minimum": 0, - "description": "The ID of the window the selected tab changed inside of." - } - } - } - ] - }, - { - "name": "onActivated", - "type": "function", - "description": "Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.", - "parameters": [ - { - "type": "object", - "name": "activeInfo", - "properties": { - "tabId": { - "type": "integer", - "minimum": 0, - "description": "The ID of the tab that has become active." - }, - "windowId": { - "type": "integer", - "minimum": 0, - "description": "The ID of the window the active tab changed inside of." - } - } - } - ] - }, - { - "name": "onHighlightChanged", - "deprecated": "Please use $(ref:tabs.onHighlighted).", - "unsupported": true, - "type": "function", - "description": "Fired when the highlighted or selected tabs in a window changes.", - "parameters": [ - { - "type": "object", - "name": "selectInfo", - "properties": { - "windowId": { - "type": "integer", - "minimum": 0, - "description": "The window whose tabs changed." - }, - "tabIds": { - "type": "array", - "items": {"type": "integer", "minimum": 0}, - "description": "All highlighted tabs in the window." - } - } - } - ] - }, - { - "name": "onHighlighted", - "type": "function", - "description": "Fired when the highlighted or selected tabs in a window changes.", - "parameters": [ - { - "type": "object", - "name": "highlightInfo", - "properties": { - "windowId": { - "type": "integer", - "minimum": 0, - "description": "The window whose tabs changed." - }, - "tabIds": { - "type": "array", - "items": {"type": "integer", "minimum": 0}, - "description": "All highlighted tabs in the window." - } - } - } - ] - }, - { - "name": "onDetached", - "type": "function", - "description": "Fired when a tab is detached from a window, for example because it is being moved between windows.", - "parameters": [ - {"type": "integer", "name": "tabId", "minimum": 0}, - { - "type": "object", - "name": "detachInfo", - "properties": { - "oldWindowId": {"type": "integer", "minimum": 0}, - "oldPosition": {"type": "integer", "minimum": 0} - } - } - ] - }, - { - "name": "onAttached", - "type": "function", - "description": "Fired when a tab is attached to a window, for example because it was moved between windows.", - "parameters": [ - {"type": "integer", "name": "tabId", "minimum": 0}, - { - "type": "object", - "name": "attachInfo", - "properties": { - "newWindowId": {"type": "integer", "minimum": 0}, - "newPosition": {"type": "integer", "minimum": 0} - } - } - ] - }, - { - "name": "onRemoved", - "type": "function", - "description": "Fired when a tab is closed.", - "parameters": [ - {"type": "integer", "name": "tabId", "minimum": 0}, - { - "type": "object", - "name": "removeInfo", - "properties": { - "windowId": {"type": "integer", "minimum": 0, "description": "The window whose tab is closed." }, - "isWindowClosing": {"type": "boolean", "description": "True when the tab is being closed because its window is being closed." } - } - } - ] - }, - { - "name": "onReplaced", - "type": "function", - "description": "Fired when a tab is replaced with another tab due to prerendering or instant.", - "parameters": [ - {"type": "integer", "name": "addedTabId", "minimum": 0}, - {"type": "integer", "name": "removedTabId", "minimum": 0} - ] - }, - { - "name": "onZoomChange", - "type": "function", - "description": "Fired when a tab is zoomed.", - "parameters": [{ - "type": "object", - "name": "ZoomChangeInfo", - "properties": { - "tabId": {"type": "integer", "minimum": 0}, - "oldZoomFactor": {"type": "number"}, - "newZoomFactor": {"type": "number"}, - "zoomSettings": {"$ref": "ZoomSettings"} - } - }] - } - ] - } -] diff --git a/application/basilisk/components/webextensions/schemas/windows.json b/application/basilisk/components/webextensions/schemas/windows.json deleted file mode 100644 index 8453358b5..000000000 --- a/application/basilisk/components/webextensions/schemas/windows.json +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -[ - { - "namespace": "windows", - "description": "Use the <code>browser.windows</code> API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser.", - "types": [ - { - "id": "WindowType", - "type": "string", - "description": "The type of browser window this is. Under some circumstances a Window may not be assigned type property, for example when querying closed windows from the $(ref:sessions) API.", - "enum": ["normal", "popup", "panel", "app", "devtools"] - }, - { - "id": "WindowState", - "type": "string", - "description": "The state of this browser window. Under some circumstances a Window may not be assigned state property, for example when querying closed windows from the $(ref:sessions) API.", - "enum": ["normal", "minimized", "maximized", "fullscreen", "docked"] - }, - { - "id": "Window", - "type": "object", - "properties": { - "id": { - "type": "integer", - "optional": true, - "minimum": 0, - "description": "The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the $(ref:sessions) API, in which case a session ID may be present." - }, - "focused": { - "type": "boolean", - "description": "Whether the window is currently the focused window." - }, - "top": { - "type": "integer", - "optional": true, - "description": "The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the $(ref:sessions) API." - }, - "left": { - "type": "integer", - "optional": true, - "description": "The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the $(ref:sessions) API." - }, - "width": { - "type": "integer", - "optional": true, - "description": "The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the $(ref:sessions) API." - }, - "height": { - "type": "integer", - "optional": true, - "description": "The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the $(ref:sessions) API." - }, - "tabs": { - "type": "array", - "items": { "$ref": "tabs.Tab" }, - "optional": true, - "description": "Array of $(ref:tabs.Tab) objects representing the current tabs in the window." - }, - "incognito": { - "type": "boolean", - "description": "Whether the window is incognito." - }, - "type": { - "$ref": "WindowType", - "optional": true, - "description": "The type of browser window this is." - }, - "state": { - "$ref": "WindowState", - "optional": true, - "description": "The state of this browser window." - }, - "alwaysOnTop": { - "type": "boolean", - "description": "Whether the window is set to be always on top." - }, - "sessionId": { - "type": "string", - "optional": true, - "description": "The session ID used to uniquely identify a Window obtained from the $(ref:sessions) API." - } - } - }, - { - "id": "CreateType", - "type": "string", - "description": "Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set.", - "enum": ["normal", "popup", "panel", "detached_panel"] - } - ], - "properties": { - "WINDOW_ID_NONE": { - "value": -1, - "description": "The windowId value that represents the absence of a browser window." - }, - "WINDOW_ID_CURRENT": { - "value": -2, - "description": "The windowId value that represents the $(topic:current-window)[current window]." - } - }, - "functions": [ - { - "name": "get", - "type": "function", - "description": "Gets details about a window.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "windowId", - "minimum": -2 - }, - { - "type": "object", - "name": "getInfo", - "optional": true, - "description": "", - "properties": { - "populate": { - "type": "boolean", - "optional": true, - "description": "If true, the $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission." - }, - "windowTypes": { - "type": "array", - "items": { - "$ref": "WindowType" - }, - "optional": true, - "description": "If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "window", - "$ref": "Window" - } - ] - } - ] - }, - { - "name": "getCurrent", - "type": "function", - "description": "Gets the $(topic:current-window)[current window].", - "async": "callback", - "parameters": [ - { - "type": "object", - "name": "getInfo", - "optional": true, - "description": "", - "properties": { - "populate": { - "type": "boolean", - "optional": true, - "description": "If true, the $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission." - }, - "windowTypes": { - "type": "array", - "items": { "$ref": "WindowType" }, - "optional": true, - "description": "If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "window", - "$ref": "Window" - } - ] - } - ] - }, - { - "name": "getLastFocused", - "type": "function", - "description": "Gets the window that was most recently focused — typically the window 'on top'.", - "async": "callback", - "parameters": [ - { - "type": "object", - "name": "getInfo", - "optional": true, - "description": "", - "properties": { - "populate": { - "type": "boolean", - "optional": true, - "description": "If true, the $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission." - }, - "windowTypes": { - "type": "array", - "items": { "$ref": "WindowType" }, - "optional": true, - "description": "If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "window", - "$ref": "Window" - } - ] - } - ] - }, - { - "name": "getAll", - "type": "function", - "description": "Gets all windows.", - "async": "callback", - "parameters": [ - { - "type": "object", - "name": "getInfo", - "optional": true, - "description": "", - "properties": { - "populate": { - "type": "boolean", - "optional": true, - "description": "If true, each $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects for that window. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission." - }, - "windowTypes": { - "type": "array", - "items": { "$ref": "WindowType" }, - "optional": true, - "description": "If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows." - } - } - }, - { - "type": "function", - "name": "callback", - "parameters": [ - { - "name": "windows", - "type": "array", - "items": { "$ref": "Window" } - } - ] - } - ] - }, - { - "name": "create", - "type": "function", - "description": "Creates (opens) a new browser with any optional sizing, position or default URL provided.", - "async": "callback", - "parameters": [ - { - "type": "object", - "name": "createData", - "optional": true, - "default": {}, - "properties": { - "url": { - "description": "A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.", - "optional": true, - "choices": [ - { "type": "string", "format": "relativeUrl" }, - { - "type": "array", - "items": { "type": "string", "format": "relativeUrl" } - } - ] - }, - "tabId": { - "type": "integer", - "minimum": 0, - "optional": true, - "description": "The id of the tab for which you want to adopt to the new window." - }, - "left": { - "type": "integer", - "optional": true, - "description": "The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels." - }, - "top": { - "type": "integer", - "optional": true, - "description": "The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels." - }, - "width": { - "type": "integer", - "minimum": 0, - "optional": true, - "description": "The width in pixels of the new window, including the frame. If not specified defaults to a natural width." - }, - "height": { - "type": "integer", - "minimum": 0, - "optional": true, - "description": "The height in pixels of the new window, including the frame. If not specified defaults to a natural height." - }, - "focused": { - "unsupported": true, - "type": "boolean", - "optional": true, - "description": "If true, opens an active window. If false, opens an inactive window." - }, - "incognito": { - "type": "boolean", - "optional": true, - "description": "Whether the new window should be an incognito window." - }, - "type": { - "$ref": "CreateType", - "optional": true, - "description": "Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set." - }, - "state": { - "$ref": "WindowState", - "optional": true, - "description": "The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'." - }, - "allowScriptsToClose": { - "type": "boolean", - "optional": true, - "description": "Allow scripts to close the window." - } - }, - "optional": true - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "window", - "$ref": "Window", - "description": "Contains details about the created window.", - "optional": true - } - ] - } - ] - }, - { - "name": "update", - "type": "function", - "description": "Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "windowId", - "minimum": -2 - }, - { - "type": "object", - "name": "updateInfo", - "properties": { - "left": { - "type": "integer", - "optional": true, - "description": "The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels." - }, - "top": { - "type": "integer", - "optional": true, - "description": "The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels." - }, - "width": { - "type": "integer", - "minimum": 0, - "optional": true, - "description": "The width to resize the window to in pixels. This value is ignored for panels." - }, - "height": { - "type": "integer", - "minimum": 0, - "optional": true, - "description": "The height to resize the window to in pixels. This value is ignored for panels." - }, - "focused": { - "type": "boolean", - "optional": true, - "description": "If true, brings the window to the front. If false, brings the next window in the z-order to the front." - }, - "drawAttention": { - "type": "boolean", - "optional": true, - "description": "If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request." - }, - "state": { - "$ref": "WindowState", - "optional": true, - "description": "The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'." - } - } - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [ - { - "name": "window", - "$ref": "Window" - } - ] - } - ] - }, - { - "name": "remove", - "type": "function", - "description": "Removes (closes) a window, and all the tabs inside it.", - "async": "callback", - "parameters": [ - { - "type": "integer", - "name": "windowId", - "minimum": 0 - }, - { - "type": "function", - "name": "callback", - "optional": true, - "parameters": [] - } - ] - } - ], - "events": [ - { - "name": "onCreated", - "type": "function", - "description": "Fired when a window is created.", - "filters": [ - { - "name": "windowTypes", - "type": "array", - "items": { "$ref": "WindowType" }, - "description": "Conditions that the window's type being created must satisfy. By default it will satisfy <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows." - } - ], - "parameters": [ - { - "$ref": "Window", - "name": "window", - "description": "Details of the window that was created." - } - ] - }, - { - "name": "onRemoved", - "type": "function", - "description": "Fired when a window is removed (closed).", - "filters": [ - { - "name": "windowTypes", - "type": "array", - "items": { "$ref": "WindowType" }, - "description": "Conditions that the window's type being removed must satisfy. By default it will satisfy <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows." - } - ], - "parameters": [ - { - "type": "integer", - "name": "windowId", - "minimum": 0, - "description": "ID of the removed window." - } - ] - }, - { - "name": "onFocusChanged", - "type": "function", - "description": "Fired when the currently focused window changes. Will be $(ref:windows.WINDOW_ID_NONE) if all browser windows have lost focus. Note: On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one browser window to another.", - "filters": [ - { - "name": "windowTypes", - "type": "array", - "items": { "$ref": "WindowType" }, - "description": "Conditions that the window's type being removed must satisfy. By default it will satisfy <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows." - } - ], - "parameters": [ - { - "type": "integer", - "name": "windowId", - "minimum": -1, - "description": "ID of the newly focused window." - } - ] - } - ] - } -] diff --git a/application/basilisk/configure.in b/application/basilisk/configure.in index 8527d218c..13f2ad54d 100644 --- a/application/basilisk/configure.in +++ b/application/basilisk/configure.in @@ -17,15 +17,9 @@ AC_SUBST(MC_BASILISK) dnl Optional parts of the build. dnl ======================================================== -dnl = Disable WebExtensions +dnl = Disable Sync dnl ======================================================== -MOZ_ARG_DISABLE_BOOL(webextensions, -[ --disable-webextensions Disable WebExtensions], - MOZ_WEBEXTENSIONS=, - MOZ_WEBEXTENSIONS=1) - -if test -n "$MOZ_WEBEXTENSIONS"; then - AC_DEFINE(MOZ_WEBEXTENSIONS) -fi - -AC_SUBST(MOZ_WEBEXTENSIONS)
\ No newline at end of file +MOZ_ARG_DISABLE_BOOL(sync, +[ --disable-sync Disable Sync], + MOZ_SERVICES_SYNC=, + MOZ_SERVICES_SYNC=1)
\ No newline at end of file diff --git a/application/basilisk/confvars.sh b/application/basilisk/confvars.sh index 48985f16a..2df7e826a 100644 --- a/application/basilisk/confvars.sh +++ b/application/basilisk/confvars.sh @@ -8,17 +8,13 @@ MOZ_APP_VENDOR=Moonchild MOZ_PHOENIX=1 MOZ_AUSTRALIS=1 MC_BASILISK=1 -MOZ_UPDATER=1 +MOZ_UPDATER= if test "$OS_ARCH" = "WINNT" -o \ "$OS_ARCH" = "Linux"; then MOZ_BUNDLED_FONTS=1 fi -if test "$OS_ARCH" = "WINNT"; then - MOZ_MAINTENANCE_SERVICE= -fi - # For Basilisk we want to use 52.9.YYYY.MM.DD as MOZ_APP_VERSION in release # builds so add-on developers have something to target while maintaining # Firefox compatiblity. @@ -45,9 +41,9 @@ MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384} # This should usually be the same as the value MAR_CHANNEL_ID. # If more than one ID is needed, then you should use a comma separated list # of values. -ACCEPTED_MAR_CHANNEL_IDS=basilisk-release +ACCEPTED_MAR_CHANNEL_IDS=unofficial,unstable,release # The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t " -MAR_CHANNEL_ID=basilisk-release +MAR_CHANNEL_ID=unofficial # Features MOZ_PROFILE_MIGRATOR=1 @@ -55,13 +51,12 @@ MOZ_APP_STATIC_INI=1 MOZ_WEBGL_CONFORMANT=1 MOZ_JSDOWNLOADS=1 MOZ_WEBRTC=1 -MOZ_WEBEXTENSIONS=1 MOZ_DEVTOOLS=1 MOZ_SERVICES_COMMON=1 MOZ_SERVICES_SYNC=1 MOZ_SERVICES_HEALTHREPORT= MOZ_SAFE_BROWSING= - +MOZ_GAMEPAD=1 # Disable checking that add-ons are signed by the trusted root MOZ_ADDON_SIGNING=0 MOZ_REQUIRE_SIGNING=0 diff --git a/application/basilisk/extensions/pdfjs/content/PdfJs.jsm b/application/basilisk/extensions/pdfjs/content/PdfJs.jsm index b3d85436e..7dc01c398 100644 --- a/application/basilisk/extensions/pdfjs/content/PdfJs.jsm +++ b/application/basilisk/extensions/pdfjs/content/PdfJs.jsm @@ -52,23 +52,6 @@ XPCOMUtils.defineLazyModuleGetter(this, 'PdfjsChromeUtils', 'resource://pdf.js/PdfjsChromeUtils.jsm'); XPCOMUtils.defineLazyModuleGetter(this, 'PdfjsContentUtils', 'resource://pdf.js/PdfjsContentUtils.jsm'); - -function getBoolPref(aPref, aDefaultValue) { - try { - return Services.prefs.getBoolPref(aPref); - } catch (ex) { - return aDefaultValue; - } -} - -function getIntPref(aPref, aDefaultValue) { - try { - return Services.prefs.getIntPref(aPref); - } catch (ex) { - return aDefaultValue; - } -} - function isDefaultHandler() { if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) { return PdfjsContentUtils.isDefaultHandlerApp(); @@ -172,7 +155,7 @@ var PdfJs = { } this._initialized = true; - if (!getBoolPref(PREF_DISABLED, true)) { + if (!Services.prefs.getBoolPref(PREF_DISABLED, true)) { this._migrate(); } @@ -209,7 +192,7 @@ var PdfJs = { _migrate: function migrate() { const VERSION = 2; - var currentVersion = getIntPref(PREF_MIGRATION_VERSION, 0); + var currentVersion = Services.prefs.getIntPref(PREF_MIGRATION_VERSION, 0); if (currentVersion >= VERSION) { return; } @@ -284,7 +267,7 @@ var PdfJs = { * @return {boolean} Whether or not it's enabled. */ get enabled() { - var disabled = getBoolPref(PREF_DISABLED, true); + var disabled = Services.prefs.getBoolPref(PREF_DISABLED, true); if (disabled) { return false; } diff --git a/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm b/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm index 5e337bbc5..b5b21f214 100644 --- a/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm +++ b/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm @@ -78,22 +78,6 @@ function getFindBar(domWindow) { } } -function getBoolPref(pref, def) { - try { - return Services.prefs.getBoolPref(pref); - } catch (ex) { - return def; - } -} - -function getIntPref(pref, def) { - try { - return Services.prefs.getIntPref(pref); - } catch (ex) { - return def; - } -} - function getStringPref(pref, def) { try { return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data; @@ -103,7 +87,7 @@ function getStringPref(pref, def) { } function log(aMsg) { - if (!getBoolPref(PREF_PREFIX + '.pdfBugEnabled', false)) { + if (!Services.prefs.getBoolPref(PREF_PREFIX + '.pdfBugEnabled', false)) { return; } var msg = 'PdfStreamConverter.js: ' + (aMsg.join ? aMsg.join('') : aMsg); @@ -359,17 +343,17 @@ ChromeActions.prototype = { return !!findBar && ('updateControlState' in findBar); }, supportsDocumentFonts: function() { - var prefBrowser = getIntPref('browser.display.use_document_fonts', 1); - var prefGfx = getBoolPref('gfx.downloadable_fonts.enabled', true); + var prefBrowser = Services.prefs.getIntPref('browser.display.use_document_fonts', 1); + var prefGfx = Services.prefs.getBoolPref('gfx.downloadable_fonts.enabled', true); return (!!prefBrowser && prefGfx); }, supportsDocumentColors: function() { - return getIntPref('browser.display.document_color_use', 0) !== 2; + return Services.prefs.getIntPref('browser.display.document_color_use', 0) !== 2; }, supportedMouseWheelZoomModifierKeys: function() { return { - ctrlKey: getIntPref('mousewheel.with_control.action', 3) === 3, - metaKey: getIntPref('mousewheel.with_meta.action', 1) === 3, + ctrlKey: Services.prefs.getIntPref('mousewheel.with_control.action', 3) === 3, + metaKey: Services.prefs.getIntPref('mousewheel.with_meta.action', 1) === 3, }; }, reportTelemetry: function (data) { @@ -531,10 +515,10 @@ ChromeActions.prototype = { prefName = (PREF_PREFIX + '.' + key); switch (typeof prefValue) { case 'boolean': - currentPrefs[key] = getBoolPref(prefName, prefValue); + currentPrefs[key] = Services.prefs.getBoolPref(prefName, prefValue); break; case 'number': - currentPrefs[key] = getIntPref(prefName, prefValue); + currentPrefs[key] = Services.prefs.getIntPref(prefName, prefValue); break; case 'string': currentPrefs[key] = getStringPref(prefName, prefValue); @@ -921,16 +905,16 @@ PdfStreamConverter.prototype = { } catch (e) {} var hash = aRequest.URI.ref; - var isPDFBugEnabled = getBoolPref(PREF_PREFIX + '.pdfBugEnabled', false); + var isPDFBugEnabled = Services.prefs.getBoolPref(PREF_PREFIX + '.pdfBugEnabled', false); rangeRequest = contentEncoding === 'identity' && acceptRanges === 'bytes' && aRequest.contentLength >= 0 && - !getBoolPref(PREF_PREFIX + '.disableRange', false) && + !Services.prefs.getBoolPref(PREF_PREFIX + '.disableRange', false) && (!isPDFBugEnabled || hash.toLowerCase().indexOf('disablerange=true') < 0); streamRequest = contentEncoding === 'identity' && aRequest.contentLength >= 0 && - !getBoolPref(PREF_PREFIX + '.disableStream', false) && + !Services.prefs.getBoolPref(PREF_PREFIX + '.disableStream', false) && (!isPDFBugEnabled || hash.toLowerCase().indexOf('disablestream=true') < 0); } diff --git a/application/basilisk/fonts/TwemojiMozilla.ttf b/application/basilisk/fonts/TwemojiMozilla.ttf Binary files differindex 1933891d9..c47cbbf11 100644 --- a/application/basilisk/fonts/TwemojiMozilla.ttf +++ b/application/basilisk/fonts/TwemojiMozilla.ttf diff --git a/application/basilisk/installer/Makefile.in b/application/basilisk/installer/Makefile.in index 4de368db7..1ca3b8ee0 100644 --- a/application/basilisk/installer/Makefile.in +++ b/application/basilisk/installer/Makefile.in @@ -99,19 +99,19 @@ include $(topsrcdir)/toolkit/mozapps/installer/packager.mk ifeq (bundle, $(MOZ_FS_LAYOUT)) BINPATH = $(_BINPATH) -DEFINES += -DAPPNAME=$(_APPNAME) +DEFINES += -DAPPNAME='$(_APPNAME)' else # Every other platform just winds up in dist/bin BINPATH = bin endif -DEFINES += -DBINPATH=$(BINPATH) +DEFINES += -DBINPATH='$(BINPATH)' ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) RESPATH = $(_APPNAME)/Contents/Resources else RESPATH = $(BINPATH) endif -DEFINES += -DRESPATH=$(RESPATH) +DEFINES += -DRESPATH='$(RESPATH)' LPROJ_ROOT = $(firstword $(subst -, ,$(AB_CD))) ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) @@ -164,7 +164,7 @@ FINDPATH=bin endif package-compare:: - cd $(DIST); find $(PKGCOMP_FIND_OPTS) $(FINDPATH) -type f | sort > bin-list.txt + cd $(DIST); find $(PKGCOMP_FIND_OPTS) '$(FINDPATH)' -type f | sort > bin-list.txt $(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $(MOZ_PKG_MANIFEST)) | grep '^$(BINPATH)' | sed -e 's/^\///' | sort > $(DIST)/pack-list.txt -diff -u $(DIST)/pack-list.txt $(DIST)/bin-list.txt rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt diff --git a/application/basilisk/installer/allowed-dupes.mn b/application/basilisk/installer/allowed-dupes.mn index 7baa6ebed..a3780bf5a 100644 --- a/application/basilisk/installer/allowed-dupes.mn +++ b/application/basilisk/installer/allowed-dupes.mn @@ -211,13 +211,11 @@ chrome/toolkit/skin/classic/mozapps/update/buttons.png chrome/toolkit/skin/classic/mozapps/update/downloadButtons.png chrome/toolkit/skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png -components/FxAccountsPush.js crashreporter.app/Contents/Resources/English.lproj/MainMenu.nib/classes.nib crashreporter.app/Contents/Resources/English.lproj/MainMenuRTL.nib/classes.nib # firefox/firefox-bin is bug 658850 @MOZ_APP_NAME@ @MOZ_APP_NAME@-bin -modules/FxAccountsPush.js modules/commonjs/index.js modules/commonjs/sdk/ui/button/view/events.js modules/commonjs/sdk/ui/state/events.js diff --git a/application/basilisk/installer/package-manifest.in b/application/basilisk/installer/package-manifest.in index c446d3687..d8f65bcfb 100644 --- a/application/basilisk/installer/package-manifest.in +++ b/application/basilisk/installer/package-manifest.in @@ -35,7 +35,9 @@ #ifdef XP_MACOSX ; Mac bundle stuff @APPNAME@/Contents/Info.plist +#ifdef MOZ_UPDATER @APPNAME@/Contents/Library/LaunchServices +#endif @APPNAME@/Contents/PkgInfo @RESPATH@/firefox.icns @RESPATH@/document.icns @@ -56,8 +58,8 @@ #ifdef HAVE_MAKENSISU @BINPATH@/uninstall/helper.exe #endif -#ifdef MOZ_UPDATER @RESPATH@/update.locale +#ifdef MOZ_UPDATER @RESPATH@/updater.ini #endif @@ -114,7 +116,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 @@ -138,13 +140,6 @@ @RESPATH@/run-mozilla.sh #endif #endif -#ifdef XP_WIN -#ifdef _AMD64_ -@BINPATH@/@DLL_PREFIX@qipcap64@DLL_SUFFIX@ -#else -@BINPATH@/@DLL_PREFIX@qipcap@DLL_SUFFIX@ -#endif -#endif ; [Components] #ifdef MOZ_ARTIFACT_BUILDS @@ -188,6 +183,7 @@ @RESPATH@/components/dom.xpt @RESPATH@/components/dom_apps.xpt @RESPATH@/components/dom_base.xpt +@RESPATH@/components/dom_bindings.xpt @RESPATH@/components/dom_system.xpt @RESPATH@/components/dom_canvas.xpt @RESPATH@/components/dom_core.xpt @@ -359,8 +355,6 @@ @RESPATH@/browser/components/nsSetDefaultBrowser.js @RESPATH@/browser/components/devtools-startup.manifest @RESPATH@/browser/components/devtools-startup.js -@RESPATH@/browser/components/webideCli.js -@RESPATH@/browser/components/webideComponents.manifest @RESPATH@/browser/components/browser-newtab.xpt @RESPATH@/browser/components/aboutNewTabService.js @RESPATH@/browser/components/NewTabComponents.manifest @@ -402,15 +396,9 @@ @RESPATH@/components/addonManager.js @RESPATH@/components/amContentHandler.js @RESPATH@/components/amInstallTrigger.js -#ifdef MOZ_WEBEXTENSIONS -@RESPATH@/components/amWebAPI.js -#endif @RESPATH@/components/amWebInstallListener.js @RESPATH@/components/nsBlocklistService.js @RESPATH@/components/blocklist.manifest -#ifdef MOZ_WEBEXTENSIONS -@RESPATH@/components/nsBlocklistServiceContent.js -#endif #ifdef MOZ_UPDATER @RESPATH@/components/nsUpdateService.manifest @RESPATH@/components/nsUpdateService.js @@ -488,10 +476,10 @@ @RESPATH@/browser/components/SelfSupportService.manifest @RESPATH@/browser/components/SelfSupportService.js #endif +#ifdef MOZ_SERVICES_SYNC @RESPATH@/components/SyncComponents.manifest @RESPATH@/components/Weave.js -@RESPATH@/components/FxAccountsComponents.manifest -@RESPATH@/components/FxAccountsPush.js +#endif @RESPATH@/components/CaptivePortalDetectComponents.manifest @RESPATH@/components/captivedetect.js @RESPATH@/components/servicesComponents.manifest @@ -559,12 +547,6 @@ @RESPATH@/components/TestInterfaceJSMaplike.js #endif -#ifdef MOZ_WEBEXTENSIONS -; [Extensions] -@RESPATH@/components/extensions-toolkit.manifest -@RESPATH@/browser/components/extensions-browser.manifest -#endif - ; Modules @RESPATH@/browser/modules/* @RESPATH@/modules/* @@ -612,11 +594,6 @@ @RESPATH@/browser/chrome/icons/default/default48.png #endif -; [Webide Files] -@RESPATH@/browser/chrome/webide@JAREXT@ -@RESPATH@/browser/chrome/webide.manifest -@RESPATH@/browser/@PREF_DIR@/webide-prefs.js - ; DevTools @RESPATH@/browser/chrome/devtools@JAREXT@ @RESPATH@/browser/chrome/devtools.manifest @@ -648,7 +625,9 @@ @RESPATH@/defaults/pref/channel-prefs.js ; Services (gre) prefs +#ifdef MOZ_SERVICES_SYNC @RESPATH@/defaults/pref/services-sync.js +#endif ; [Layout Engine Resources] ; Style Sheets, Graphics and other Resources used by the layout engine. @@ -706,6 +685,13 @@ #ifndef MOZ_SYSTEM_NSS #if defined(XP_LINUX) && !defined(ANDROID) @BINPATH@/@DLL_PREFIX@freeblpriv3@DLL_SUFFIX@ +#elif defined(XP_SOLARIS) && defined(SPARC64) +@BINPATH@/@DLL_PREFIX@freebl_64fpu_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl_64int_3@DLL_SUFFIX@ +#elif defined(XP_SOLARIS) && defined(SPARC) +@BINPATH@/@DLL_PREFIX@freebl_32fpu_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl_32int64_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl3@DLL_SUFFIX@ #else @BINPATH@/@DLL_PREFIX@freebl3@DLL_SUFFIX@ #endif @@ -726,13 +712,6 @@ @RESPATH@/components/pipnss.xpt @RESPATH@/components/pippki.xpt -; for Solaris SPARC -#ifdef SOLARIS -bin/libfreebl_32fpu_3.so -bin/libfreebl_32int_3.so -bin/libfreebl_32int64_3.so -#endif - ; [Updater] ; #ifdef MOZ_UPDATER @@ -743,13 +722,6 @@ bin/libfreebl_32int64_3.so #endif #endif -; [MaintenanceService] -; -#ifdef MOZ_MAINTENANCE_SERVICE -@BINPATH@/maintenanceservice.exe -@BINPATH@/maintenanceservice_installer.exe -#endif - @RESPATH@/components/dom_audiochannel.xpt ; Shutdown Terminator diff --git a/application/basilisk/installer/windows/Makefile.in b/application/basilisk/installer/windows/Makefile.in index d5580b53d..5326ab897 100644 --- a/application/basilisk/installer/windows/Makefile.in +++ b/application/basilisk/installer/windows/Makefile.in @@ -14,12 +14,6 @@ INSTALLER_FILES = \ nsis/shared.nsh \ $(NULL) -ifdef MOZ_MAINTENANCE_SERVICE -INSTALLER_FILES += \ - nsis/maintenanceservice_installer.nsi \ - $(NULL) -endif - BRANDING_FILES = \ branding.nsi \ appname.bmp \ @@ -79,10 +73,6 @@ $(CONFIG_DIR)/setup.exe:: $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \ --preprocess-locale $(topsrcdir) \ $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR) - $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \ - --preprocess-single-file $(topsrcdir) \ - $(PPL_LOCALE_ARGS) $(CONFIG_DIR) \ - nsisstrings.properties nsisstrings.nlf GARBARGE_DIRS += instgen diff --git a/application/basilisk/installer/windows/nsis/defines.nsi.in b/application/basilisk/installer/windows/nsis/defines.nsi.in index 5ad9b7966..8981bbde8 100644 --- a/application/basilisk/installer/windows/nsis/defines.nsi.in +++ b/application/basilisk/installer/windows/nsis/defines.nsi.in @@ -3,23 +3,6 @@ # 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/. -# Defining FunnelcakeVersion will append the value of StubURLVersionAppend to -# StubURLVersion, append the value of URLManualDownloadAppend to -# URLManualDownload, and append the value of URLStubDownloadAppend to -# URLStubDownload. The value of FunnelcakeVersion should not be defined when it -# is not used and when it is defined its value should never be empty. -# !define FunnelcakeVersion "999" - -!ifdef FunnelcakeVersion -!define URLManualDownloadAppend "&f=${FunnelcakeVersion}" -!define URLStubDownloadAppend "-f${FunnelcakeVersion}" -!define StubURLVersionAppend "-${FunnelcakeVersion}" -!else -!define URLManualDownloadAppend "" -!define URLStubDownloadAppend "" -!define StubURLVersionAppend "" -!endif - # These defines should match application.ini settings !define AppName "Basilisk" !define AppVersion "@APP_VERSION@" @@ -68,10 +51,6 @@ !define MinSupportedCPU "SSE2" -#ifdef MOZ_MAINTENANCE_SERVICE -!define MOZ_MAINTENANCE_SERVICE -#endif - # File details shared by both the installer and uninstaller VIProductVersion "1.0.0.0" VIAddVersionKey "ProductName" "${BrandShortName}" @@ -84,13 +63,3 @@ VIAddVersionKey "FileVersion" "${AppVersion}" VIAddVersionKey "ProductVersion" "${AppVersion}" # Comments is not used but left below commented out for future reference # VIAddVersionKey "Comments" "Comments" - -# Control positions in Dialog Units so they are placed correctly with -# non-default DPI settings -!define OPTIONS_ITEM_EDGE_DU 90u -!define OPTIONS_ITEM_WIDTH_DU 356u -!define OPTIONS_SUBITEM_EDGE_DU 119u -!define OPTIONS_SUBITEM_WIDTH_DU 327u -!define INSTALL_BLURB_TOP_DU 78u -!define APPNAME_BMP_EDGE_DU 19u -!define APPNAME_BMP_TOP_DU 12u diff --git a/application/basilisk/installer/windows/nsis/installer.nsi b/application/basilisk/installer/windows/nsis/installer.nsi index 994c09279..6b4b5ab9a 100644 --- a/application/basilisk/installer/windows/nsis/installer.nsi +++ b/application/basilisk/installer/windows/nsis/installer.nsi @@ -165,11 +165,6 @@ Page custom preOptions leaveOptions !define MUI_DIRECTORYPAGE_VERIFYONLEAVE !insertmacro MUI_PAGE_DIRECTORY -; Custom Components Page -!ifdef MOZ_MAINTENANCE_SERVICE -Page custom preComponents leaveComponents -!endif - ; Custom Shortcuts Page Page custom preShortcuts leaveShortcuts @@ -427,41 +422,6 @@ Section "-Application" APP_IDX ${EndIf} ${EndIf} -!ifdef MOZ_MAINTENANCE_SERVICE - ; If the maintenance service page was displayed then a value was already - ; explicitly selected for installing the maintenance service and - ; and so InstallMaintenanceService will already be 0 or 1. - ; If the maintenance service page was not displayed then - ; InstallMaintenanceService will be equal to "". - ${If} $InstallMaintenanceService == "" - Call IsUserAdmin - Pop $R0 - ${If} $R0 == "true" - ; Only proceed if we have HKLM write access - ${AndIf} $TmpVal == "HKLM" - ; On Windows < XP SP3 we do not install the maintenance service. - ${If} ${IsWinXP} - ${AndIf} ${AtMostServicePack} 2 - StrCpy $InstallMaintenanceService "0" - ${Else} - ; The user is an admin, so we should default to installing the service. - StrCpy $InstallMaintenanceService "1" - ${EndIf} - ${Else} - ; The user is not admin, so we can't install the service. - StrCpy $InstallMaintenanceService "0" - ${EndIf} - ${EndIf} - - ${If} $InstallMaintenanceService == "1" - ; The user wants to install the maintenance service, so execute - ; the pre-packaged maintenance service installer. - ; This option can only be turned on if the user is an admin so there - ; is no need to use ExecShell w/ verb runas to enforce elevated. - nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\"" - ${EndIf} -!endif - ; These need special handling on uninstall since they may be overwritten by ; an install into a different location. StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}" @@ -578,13 +538,6 @@ Section "-Application" APP_IDX ${EndIf} ${EndUnless} ${EndIf} - -!ifdef MOZ_MAINTENANCE_SERVICE - ${If} $TmpVal == "HKLM" - ; Add the registry keys for allowed certificates. - ${AddMaintCertKeys} - ${EndIf} -!endif SectionEnd ; Cleanup operations to perform at the end of the installation. @@ -948,59 +901,6 @@ Function leaveShortcuts ${EndIf} FunctionEnd -!ifdef MOZ_MAINTENANCE_SERVICE -Function preComponents - ; If the service already exists, don't show this page - ServicesHelper::IsInstalled "MozillaMaintenance" - Pop $R9 - ${If} $R9 == 1 - ; The service already exists so don't show this page. - Abort - ${EndIf} - - ; On Windows < XP SP3 we do not install the maintenance service. - ${If} ${IsWinXP} - ${AndIf} ${AtMostServicePack} 2 - Abort - ${EndIf} - - ; Don't show the custom components page if the - ; user is not an admin - Call IsUserAdmin - Pop $R9 - ${If} $R9 != "true" - Abort - ${EndIf} - - ; Only show the maintenance service page if we have write access to HKLM - ClearErrors - WriteRegStr HKLM "Software\Mozilla" \ - "${BrandShortName}InstallerTest" "Write Test" - ${If} ${Errors} - ClearErrors - Abort - ${Else} - DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" - ${EndIf} - - StrCpy $PageName "Components" - ${CheckCustomCommon} - !insertmacro MUI_HEADER_TEXT "$(COMPONENTS_PAGE_TITLE)" "$(COMPONENTS_PAGE_SUBTITLE)" - !insertmacro MUI_INSTALLOPTIONS_DISPLAY "components.ini" -FunctionEnd - -Function leaveComponents - ${MUI_INSTALLOPTIONS_READ} $0 "components.ini" "Settings" "State" - ${If} $0 != 0 - Abort - ${EndIf} - ${MUI_INSTALLOPTIONS_READ} $InstallMaintenanceService "components.ini" "Field 2" "State" - ${If} $InstallType == ${INSTALLTYPE_CUSTOM} - Call CheckExistingInstall - ${EndIf} -FunctionEnd -!endif - Function preSummary StrCpy $PageName "Summary" ; Setup the summary.ini file for the Custom Summary Page @@ -1180,7 +1080,6 @@ Function .onInit !insertmacro InitInstallOptionsFile "options.ini" !insertmacro InitInstallOptionsFile "shortcuts.ini" - !insertmacro InitInstallOptionsFile "components.ini" !insertmacro InitInstallOptionsFile "summary.ini" WriteINIStr "$PLUGINSDIR\options.ini" "Settings" NumFields "5" @@ -1255,36 +1154,6 @@ Function .onInit WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" Bottom "50" WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" State "1" - ; Don't offer to install the quick launch shortcut on Windows 7 - ${Unless} ${AtLeastWin7} - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Type "checkbox" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Text "$(ICONS_QUICKLAUNCH)" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Left "0" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Right "-1" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Top "60" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Bottom "70" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" State "1" - ${EndUnless} - - ; Setup the components.ini file for the Components Page - WriteINIStr "$PLUGINSDIR\components.ini" "Settings" NumFields "2" - - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Type "label" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Text "$(OPTIONAL_COMPONENTS_DESC)" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Left "0" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Right "-1" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Top "5" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Bottom "25" - - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Type "checkbox" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Text "$(MAINTENANCE_SERVICE_CHECKBOX_DESC)" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Left "0" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Right "-1" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Top "27" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Bottom "37" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" State "1" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Flags "GROUP" - ; There must always be a core directory. ${GetSize} "$EXEDIR\core\" "/S=0K" $R5 $R7 $R8 SectionSetSize ${APP_IDX} $R5 diff --git a/application/basilisk/installer/windows/nsis/maintenanceservice_installer.nsi b/application/basilisk/installer/windows/nsis/maintenanceservice_installer.nsi deleted file mode 100644 index 1f73bac6a..000000000 --- a/application/basilisk/installer/windows/nsis/maintenanceservice_installer.nsi +++ /dev/null @@ -1,332 +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/. - -; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs -!verbose 3 - -; 7-Zip provides better compression than the lzma from NSIS so we add the files -; uncompressed and use 7-Zip to create a SFX archive of it -SetDatablockOptimize on -SetCompress off -CRCCheck on - -RequestExecutionLevel admin - -; The commands inside this ifdef require NSIS 3.0a2 or greater so the ifdef can -; be removed after we require NSIS 3.0a2 or greater. -!ifdef NSIS_PACKEDVERSION - Unicode true - ManifestSupportedOS all - ManifestDPIAware true -!endif - -!addplugindir ./ - -; Variables -Var TempMaintServiceName -Var BrandFullNameDA -Var BrandFullName - -; Other included files may depend upon these includes! -; The following includes are provided by NSIS. -!include FileFunc.nsh -!include LogicLib.nsh -!include MUI.nsh -!include WinMessages.nsh -!include WinVer.nsh -!include WordFunc.nsh - -!insertmacro GetOptions -!insertmacro GetParameters -!insertmacro GetSize - -; The test slaves use this fallback key to run tests. -; And anyone that wants to run tests themselves should already have -; this installed. -!define FallbackKey \ - "SOFTWARE\Mozilla\MaintenanceService\3932ecacee736d366d6436db0f55bce4" - -!define CompanyName "Mozilla Corporation" -!define BrandFullNameInternal "" - -; The following includes are custom. -!include defines.nsi -; We keep defines.nsi defined so that we get other things like -; the version number, but we redefine BrandFullName -!define MaintFullName "Mozilla Maintenance Service" -!undef BrandFullName -!define BrandFullName "${MaintFullName}" - -!include common.nsh -!include locales.nsi - -VIAddVersionKey "FileDescription" "${MaintFullName} Installer" -VIAddVersionKey "OriginalFilename" "maintenanceservice_installer.exe" - -Name "${MaintFullName}" -OutFile "maintenanceservice_installer.exe" - -; Get installation folder from registry if available -InstallDirRegKey HKLM "Software\Mozilla\MaintenanceService" "" - -SetOverwrite on - -; serviceinstall.cpp also uses this key, in case the path is changed, update -; there too. -!define MaintUninstallKey \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService" - -; Always install into the 32-bit location even if we have a 64-bit build. -; This is because we use only 1 service for all Basilisk channels. -; Allow either x86 and x64 builds to exist at this location, depending on -; what is the latest build. -InstallDir "$PROGRAMFILES32\${MaintFullName}\" -ShowUnInstDetails nevershow - -################################################################################ -# Modern User Interface - MUI - -!define MUI_ICON setup.ico -!define MUI_UNICON setup.ico -!define MUI_WELCOMEPAGE_TITLE_3LINES -!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp - -;Interface Settings -!define MUI_ABORTWARNING - -; Uninstaller Pages -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES - -################################################################################ -# Language - -!insertmacro MOZ_MUI_LANGUAGE 'baseLocale' -!verbose push -!verbose 3 -!include "overrideLocale.nsh" -!include "customLocale.nsh" -!verbose pop - -; Set this after the locale files to override it if it is in the locale -; using " " for BrandingText will hide the "Nullsoft Install System..." branding -BrandingText " " - -Function .onInit - ; Remove the current exe directory from the search order. - ; This only effects LoadLibrary calls and not implicitly loaded DLLs. - System::Call 'kernel32::SetDllDirectoryW(w "")' - - SetSilent silent - - ${Unless} ${AtLeastWin7} - Abort - ${EndUnless} -FunctionEnd - -Function un.onInit - ; Remove the current exe directory from the search order. - ; This only effects LoadLibrary calls and not implicitly loaded DLLs. - System::Call 'kernel32::SetDllDirectoryW(w "")' - -; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be -; removed after we require NSIS 3.0a2 or greater. -!ifndef NSIS_PACKEDVERSION - ${If} ${AtLeastWinVista} - System::Call 'user32::SetProcessDPIAware()' - ${EndIf} -!endif - - StrCpy $BrandFullNameDA "${MaintFullName}" - StrCpy $BrandFullName "${MaintFullName}" -FunctionEnd - -Section "MaintenanceService" - AllowSkipFiles off - - CreateDirectory $INSTDIR - SetOutPath $INSTDIR - - ; If the service already exists, then it will be stopped when upgrading it - ; via the maintenanceservice_tmp.exe command executed below. - ; The maintenanceservice_tmp.exe command will rename the file to - ; maintenanceservice.exe if maintenanceservice_tmp.exe is newer. - ; If the service does not exist yet, we install it and drop the file on - ; disk as maintenanceservice.exe directly. - StrCpy $TempMaintServiceName "maintenanceservice.exe" - IfFileExists "$INSTDIR\maintenanceservice.exe" 0 skipAlreadyExists - StrCpy $TempMaintServiceName "maintenanceservice_tmp.exe" - skipAlreadyExists: - - ; We always write out a copy and then decide whether to install it or - ; not via calling its 'install' cmdline which works by version comparison. - CopyFiles "$EXEDIR\maintenanceservice.exe" "$INSTDIR\$TempMaintServiceName" - - ; The updater.ini file is only used when performing an install or upgrade, - ; and only if that install or upgrade is successful. If an old updater.ini - ; happened to be copied into the maintenance service installation directory - ; but the service was not newer, the updater.ini file would be unused. - ; It is used to fill the description of the service on success. - CopyFiles "$EXEDIR\updater.ini" "$INSTDIR\updater.ini" - - ; Install the application maintenance service. - ; If a service already exists, the command line parameter will stop the - ; service and only install itself if it is newer than the already installed - ; service. If successful it will remove the old maintenanceservice.exe - ; and replace it with maintenanceservice_tmp.exe. - ClearErrors - ${GetParameters} $0 - ${GetOptions} "$0" "/Upgrade" $0 - ${If} ${Errors} - ExecWait '"$INSTDIR\$TempMaintServiceName" install' - ${Else} - ; The upgrade cmdline is the same as install except - ; It will fail if the service isn't already installed. - ExecWait '"$INSTDIR\$TempMaintServiceName" upgrade' - ${EndIf} - - WriteUninstaller "$INSTDIR\Uninstall.exe" - WriteRegStr HKLM "${MaintUninstallKey}" "DisplayName" "${MaintFullName}" - WriteRegStr HKLM "${MaintUninstallKey}" "UninstallString" \ - '"$INSTDIR\uninstall.exe"' - WriteRegStr HKLM "${MaintUninstallKey}" "DisplayIcon" \ - "$INSTDIR\Uninstall.exe,0" - WriteRegStr HKLM "${MaintUninstallKey}" "DisplayVersion" "${AppVersion}" - WriteRegStr HKLM "${MaintUninstallKey}" "Publisher" "Mozilla" - WriteRegStr HKLM "${MaintUninstallKey}" "Comments" "${BrandFullName}" - WriteRegDWORD HKLM "${MaintUninstallKey}" "NoModify" 1 - ${GetSize} "$INSTDIR" "/S=0K" $R2 $R3 $R4 - WriteRegDWORD HKLM "${MaintUninstallKey}" "EstimatedSize" $R2 - - ; Write out that a maintenance service was attempted. - ; We do this because on upgrades we will check this value and we only - ; want to install once on the first upgrade to maintenance service. - ; Also write out that we are currently installed, preferences will check - ; this value to determine if we should show the service update pref. - ; Since the Maintenance service can be installed either x86 or x64, - ; always use the 64-bit registry for checking if an attempt was made. - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1 - WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1 - DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled" - - ; Included here for debug purposes only. - ; These keys are used to bypass the installation dir is a valid installation - ; check from the service so that tests can be run. - ; WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation" - ; WriteRegStr HKLM "${FallbackKey}\0" "issuer" "DigiCert SHA2 Assured ID Code Signing CA" - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} -SectionEnd - -; By renaming before deleting we improve things slightly in case -; there is a file in use error. In this case a new install can happen. -Function un.RenameDelete - Pop $9 - ; If the .moz-delete file already exists previously, delete it - ; If it doesn't exist, the call is ignored. - ; We don't need to pass /REBOOTOK here since it was already marked that way - ; if it exists. - Delete "$9.moz-delete" - Rename "$9" "$9.moz-delete" - ${If} ${Errors} - Delete /REBOOTOK "$9" - ${Else} - Delete /REBOOTOK "$9.moz-delete" - ${EndIf} - ClearErrors -FunctionEnd - -Section "Uninstall" - ; Delete the service so that no updates will be attempted - ExecWait '"$INSTDIR\maintenanceservice.exe" uninstall' - - Push "$INSTDIR\updater.ini" - Call un.RenameDelete - Push "$INSTDIR\maintenanceservice.exe" - Call un.RenameDelete - Push "$INSTDIR\maintenanceservice_tmp.exe" - Call un.RenameDelete - Push "$INSTDIR\maintenanceservice.old" - Call un.RenameDelete - Push "$INSTDIR\Uninstall.exe" - Call un.RenameDelete - Push "$INSTDIR\update\updater.ini" - Call un.RenameDelete - Push "$INSTDIR\update\updater.exe" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-1.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-2.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-3.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-4.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-5.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-6.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-7.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-8.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-9.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-10.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-install.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-uninstall.log" - Call un.RenameDelete - SetShellVarContext all - Push "$APPDATA\Mozilla\logs\maintenanceservice.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-1.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-2.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-3.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-4.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-5.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-6.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-7.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-8.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-9.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-10.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-install.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-uninstall.log" - Call un.RenameDelete - RMDir /REBOOTOK "$APPDATA\Mozilla\logs" - RMDir /REBOOTOK "$APPDATA\Mozilla" - RMDir /REBOOTOK "$INSTDIR\logs" - RMDir /REBOOTOK "$INSTDIR\update" - RMDir /REBOOTOK "$INSTDIR" - - DeleteRegKey HKLM "${MaintUninstallKey}" - - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "Installed" - DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled" - DeleteRegKey HKLM "${FallbackKey}\" - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} -SectionEnd diff --git a/application/basilisk/installer/windows/nsis/shared.nsh b/application/basilisk/installer/windows/nsis/shared.nsh index fb2239d24..f5bbef389 100644 --- a/application/basilisk/installer/windows/nsis/shared.nsh +++ b/application/basilisk/installer/windows/nsis/shared.nsh @@ -124,51 +124,6 @@ ${FixDistributionsINI} RmDir /r /REBOOTOK "$INSTDIR\${TO_BE_DELETED}" - -!ifdef MOZ_MAINTENANCE_SERVICE - Call IsUserAdmin - Pop $R0 - ${If} $R0 == "true" - ; Only proceed if we have HKLM write access - ${AndIf} $TmpVal == "HKLM" - ; On Windows 2000 we do not install the maintenance service. - ${AndIf} ${AtLeastWinXP} - ; We check to see if the maintenance service install was already attempted. - ; Since the Maintenance service can be installed either x86 or x64, - ; always use the 64-bit registry for checking if an attempt was made. - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - ReadRegDWORD $5 HKLM "Software\Mozilla\MaintenanceService" "Attempted" - ClearErrors - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} - - ; Add the registry keys for allowed certificates. - ${AddMaintCertKeys} - - ; If the maintenance service is already installed, do nothing. - ; The maintenance service will launch: - ; maintenanceservice_installer.exe /Upgrade to upgrade the maintenance - ; service if necessary. If the update was done from updater.exe without - ; the service (i.e. service is failing), updater.exe will do the update of - ; the service. The reasons we do not do it here is because we don't want - ; to have to prompt for limited user accounts when the service isn't used - ; and we currently call the PostUpdate twice, once for the user and once - ; for the SYSTEM account. Also, this would stop the maintenance service - ; and we need a return result back to the service when run that way. - ${If} $5 == "" - ; An install of maintenance service was never attempted. - ; We know we are an Admin and that we have write access into HKLM - ; based on the above checks, so attempt to just run the EXE. - ; In the worst case, in case there is some edge case with the - ; IsAdmin check and the permissions check, the maintenance service - ; will just fail to be attempted to be installed. - nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\"" - ${EndIf} - ${EndIf} -!endif !macroend !define PostUpdate "!insertmacro PostUpdate" @@ -720,54 +675,6 @@ !macroend !define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers" -!ifdef MOZ_MAINTENANCE_SERVICE -; Adds maintenance service certificate keys for the install dir. -; For the cert to work, it must also be signed by a trusted cert for the user. -!macro AddMaintCertKeys - Push $R0 - ; Allow main Mozilla cert information for updates - ; This call will push the needed key on the stack - ServicesHelper::PathToUniqueRegistryPath "$INSTDIR" - Pop $R0 - ${If} $R0 != "" - ; More than one certificate can be specified in a different subfolder - ; for example: $R0\1, but each individual binary can be signed - ; with at most one certificate. A fallback certificate can only be used - ; if the binary is replaced with a different certificate. - ; We always use the 64bit registry for certs. - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - - ; PrefetchProcessName was originally used to experiment with deleting - ; Windows prefetch as a speed optimization. It is no longer used though. - DeleteRegValue HKLM "$R0" "prefetchProcessName" - - ; Setting the Attempted value will ensure that a new Maintenance Service - ; install will never be attempted again after this from updates. The value - ; is used only to see if updates should attempt new service installs. - WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1 - - ; These values associate the allowed certificates for the current - ; installation. - WriteRegStr HKLM "$R0\0" "name" "${CERTIFICATE_NAME}" - WriteRegStr HKLM "$R0\0" "issuer" "${CERTIFICATE_ISSUER}" - ; These values associate the allowed certificates for the previous - ; installation, so that we can update from it cleanly using the - ; old updater.exe (which will still have this signature). - WriteRegStr HKLM "$R0\1" "name" "${CERTIFICATE_NAME_PREVIOUS}" - WriteRegStr HKLM "$R0\1" "issuer" "${CERTIFICATE_ISSUER_PREVIOUS}" - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} - ClearErrors - ${EndIf} - ; Restore the previously used value back - Pop $R0 -!macroend -!define AddMaintCertKeys "!insertmacro AddMaintCertKeys" -!endif - ; Removes various registry entries for reasons noted below (does not use SHCTX). !macro RemoveDeprecatedKeys StrCpy $0 "SOFTWARE\Classes" diff --git a/application/basilisk/installer/windows/nsis/uninstaller.nsi b/application/basilisk/installer/windows/nsis/uninstaller.nsi index 87f4d838a..c556b0a90 100644 --- a/application/basilisk/installer/windows/nsis/uninstaller.nsi +++ b/application/basilisk/installer/windows/nsis/uninstaller.nsi @@ -450,24 +450,6 @@ Section "Uninstall" ; uninstalls of Basilisk-release with reinstalls of Basilisk-release, for example. WriteRegStr HKCU "Software\Mozilla\Basilisk" "Uninstalled-${UpdateChannel}" "True" -!ifdef MOZ_MAINTENANCE_SERVICE - ; Get the path the allowed cert is at and remove it - ; Keep this block of code last since it modfies the reg view - ServicesHelper::PathToUniqueRegistryPath "$INSTDIR" - Pop $MaintCertKey - ${If} $MaintCertKey != "" - ; Always use the 64bit registry for certs on 64bit systems. - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - DeleteRegKey HKLM "$MaintCertKey" - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} - ${EndIf} - Call un.UninstallServiceIfNotUsed -!endif - ${un.IsFirewallSvcRunning} Pop $0 ${If} "$0" == "true" diff --git a/application/basilisk/locales/Makefile.in b/application/basilisk/locales/Makefile.in index b8aee0f14..0d8b1d86a 100644 --- a/application/basilisk/locales/Makefile.in +++ b/application/basilisk/locales/Makefile.in @@ -97,7 +97,9 @@ DEFINES += -DBOOKMARKS_INCLUDE_DIR=$(dir $(call MERGE_FILE,profile/bookmarks.inc libs-%: $(NSINSTALL) -D $(DIST)/install @$(MAKE) -C $(DEPTH)/toolkit/locales libs-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)' +ifdef MOZ_SERVICES_SYNC @$(MAKE) -C $(DEPTH)/services/sync/locales AB_CD=$* XPI_NAME=locale-$* +endif @$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* # @$(MAKE) -C ../extensions/pocket/locale AB_CD=$* XPI_NAME=locale-$* @$(MAKE) -C $(DEPTH)/intl/locales AB_CD=$* XPI_NAME=locale-$* @@ -168,10 +170,10 @@ endif ident: @printf 'fx_revision ' @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \ - $(STAGEDIST)/application.ini App SourceStamp + '$(STAGEDIST)'/application.ini App SourceStamp @printf 'buildid ' @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \ - $(STAGEDIST)/application.ini App BuildID + '$(STAGEDIST)'/application.ini App BuildID merge-%: ifdef LOCALE_MERGEDIR diff --git a/application/basilisk/locales/en-US/chrome/browser-region/region.properties b/application/basilisk/locales/en-US/chrome/browser-region/region.properties index e35fc7497..8782ae46f 100644 --- a/application/basilisk/locales/en-US/chrome/browser-region/region.properties +++ b/application/basilisk/locales/en-US/chrome/browser-region/region.properties @@ -9,6 +9,7 @@ browser.search.defaultenginename=DuckDuckGo browser.search.order.1=DuckDuckGo browser.search.order.2=Yahoo browser.search.order.3=Bing +browser.search.order.4=Ecosia # This is the default set of web based feed handlers shown in the reader # selection UI @@ -20,11 +21,7 @@ browser.contentHandlers.types.0.uri=https://add.my.yahoo.com/rss?url=%s # profile database. Note that "new" is defined as "has a different URL"; this # means that it's not possible to update the name of existing handler, so # don't make any spelling errors here. -gecko.handlerService.defaultHandlersVersion=4 - -# The default set of protocol handlers for webcal: -gecko.handlerService.schemes.webcal.0.name=30 Boxes -gecko.handlerService.schemes.webcal.0.uriTemplate=https://30boxes.com/external/widget?refer=ff&url=%s +gecko.handlerService.defaultHandlersVersion=5 # The default set of protocol handlers for mailto: gecko.handlerService.schemes.mailto.0.name=Yahoo! Mail diff --git a/application/basilisk/locales/en-US/chrome/browser/aboutAccounts.dtd b/application/basilisk/locales/en-US/chrome/browser/aboutAccounts.dtd deleted file mode 100644 index 358722156..000000000 --- a/application/basilisk/locales/en-US/chrome/browser/aboutAccounts.dtd +++ /dev/null @@ -1,16 +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/. --> - -<!ENTITY aboutAccounts.welcome "Welcome to &syncBrand.shortName.label;"> -<!ENTITY aboutAccounts.connected "Account connected"> - -<!ENTITY aboutAccountsConfig.description "Sign in to sync your tabs, bookmarks, passwords & more."> -<!ENTITY aboutAccountsConfig.startButton.label "Get started"> -<!ENTITY aboutAccountsConfig.useOldSync.label "Using an older version of Sync?"> -<!ENTITY aboutAccountsConfig.syncPreferences.label "Sync preferences"> -<!ENTITY aboutAccounts.noConnection.title "No connection"> -<!ENTITY aboutAccounts.noConnection.description "You must be connected to the Internet to sign in."> -<!ENTITY aboutAccounts.noConnection.retry "Try again"> -<!ENTITY aboutAccounts.badConfig.title "Bad configuration"> -<!ENTITY aboutAccounts.badConfig.description "Unable to determine your Firefox Account server configuration. Please try again later."> diff --git a/application/basilisk/locales/en-US/chrome/browser/aboutHome.dtd b/application/basilisk/locales/en-US/chrome/browser/aboutHome.dtd index 17b401c6c..40681c337 100644 --- a/application/basilisk/locales/en-US/chrome/browser/aboutHome.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/aboutHome.dtd @@ -4,8 +4,10 @@ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> %brandDTD; +#ifdef MOZ_SERVICES_SYNC <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd"> %syncBrandDTD; +#endif <!-- These strings are used in the about:home page --> @@ -32,7 +34,9 @@ <!ENTITY abouthome.preferencesButtonUnix.label "Preferences"> <!ENTITY abouthome.addonsButton.label "Add-ons"> <!ENTITY abouthome.downloadsButton.label "Downloads"> +#ifdef MOZ_SERVICES_SYNC <!ENTITY abouthome.syncButton.label "&syncBrand.shortName.label;"> +#endif <!-- LOCALIZATION NOTE (abouthome.aboutMozilla.label): The (invisible) label for the mozilla wordmark in the top-right corner that links to Mozilla's main diff --git a/application/basilisk/locales/en-US/chrome/browser/aboutRobots.dtd b/application/basilisk/locales/en-US/chrome/browser/aboutRobots.dtd deleted file mode 100644 index 23447add1..000000000 --- a/application/basilisk/locales/en-US/chrome/browser/aboutRobots.dtd +++ /dev/null @@ -1,29 +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/. --> - -<!-- These strings are used in the about:robots page, which ties in with the - robots theme used in the Firefox 3 Beta 2/3 first run pages. - They're just meant to be fun and whimsical, with references to some geeky - but well-known robots in movies and books. Be creative with translations! --> - -<!-- Nonsense line from the movie "The Day The Earth Stood Still". No translation needed. --> -<!ENTITY robots.pagetitle "Gort! Klaatu barada nikto!"> -<!-- Movie: Logan's Run... Box (cybog): "Welcome Humans! I am ready for you." --> -<!ENTITY robots.errorTitleText "Welcome Humans!"> -<!-- Movie: The Day The Earth Stood Still. Spoken by Klaatu. --> -<!ENTITY robots.errorShortDescText "We have come to visit you in peace and with goodwill!"> -<!-- Various books by Isaac Asimov. http://en.wikipedia.org/wiki/Three_Laws_of_Robotics --> -<!ENTITY robots.errorLongDesc1 "Robots may not injure a human being or, through inaction, allow a human being to come to harm."> -<!-- Movie: Blade Runner. Batty: "I've seen things you people wouldn’t believe..." --> -<!ENTITY robots.errorLongDesc2 "Robots have seen things you people wouldn’t believe."> -<!-- Book: Hitchhiker’s Guide To The Galaxy. What the Sirius Cybernetics Corporation calls robots. --> -<!ENTITY robots.errorLongDesc3 "Robots are Your Plastic Pal Who’s Fun To Be With."> -<!-- TV: Futurama. Bender's first line is "Bite my shiny metal ass." --> -<!ENTITY robots.errorLongDesc4 "Robots have shiny metal posteriors which should not be bitten."> -<!-- TV: Battlestar Galactica (2004 series). From the opening text. --> -<!ENTITY robots.errorTrailerDescText "And they have a plan."> -<!-- TV: Battlestar Galactica (2004 series). Common expletive referring to Cylons. --> -<!ENTITY robots.imgtitle "Frakkin' Toasters"> -<!-- Book: Hitchhiker's Guide To The Galaxy. Arthur presses a button and it warns him. --> -<!ENTITY robots.dontpress "Please do not press this button again."> diff --git a/application/basilisk/locales/en-US/chrome/browser/browser.dtd b/application/basilisk/locales/en-US/chrome/browser/browser.dtd index f75aa46a7..fe856129f 100644 --- a/application/basilisk/locales/en-US/chrome/browser/browser.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/browser.dtd @@ -40,12 +40,6 @@ can reach it easily. --> <!ENTITY pinTab.accesskey "P"> <!ENTITY unpinTab.label "Unpin Tab"> <!ENTITY unpinTab.accesskey "b"> -<!ENTITY sendTabToDevice.label "Send Tab to Device"> -<!ENTITY sendTabToDevice.accesskey "D"> -<!ENTITY sendPageToDevice.label "Send Page to Device"> -<!ENTITY sendPageToDevice.accesskey "D"> -<!ENTITY sendLinkToDevice.label "Send Link to Device"> -<!ENTITY sendLinkToDevice.accesskey "D"> <!ENTITY moveToNewWindow.label "Move to New Window"> <!ENTITY moveToNewWindow.accesskey "W"> <!ENTITY bookmarkAllTabs.label "Bookmark All Tabs…"> @@ -115,12 +109,6 @@ These should match what Safari and other Apple applications use on OS X Lion. -- <!ENTITY showAllTabsCmd.accesskey "A"> <!ENTITY toggleReaderMode.key "R"> -<!ENTITY fxaSignIn.label "Sign in to &syncBrand.shortName.label;"> -<!ENTITY fxaSignedIn.tooltip "Open &syncBrand.shortName.label; preferences"> -<!ENTITY fxaSignInError.label "Reconnect to &syncBrand.shortName.label;"> -<!ENTITY fxaUnverified.label "Verify Your Account"> - - <!ENTITY fullScreenMinimize.tooltip "Minimize"> <!ENTITY fullScreenRestore.tooltip "Restore"> <!ENTITY fullScreenClose.tooltip "Close"> @@ -207,8 +195,6 @@ These should match what Safari and other Apple applications use on OS X Lion. -- <!ENTITY urlbar.webRTCShareScreenNotificationAnchor.tooltip "Manage sharing your windows or screen with the site"> <!ENTITY urlbar.servicesNotificationAnchor.tooltip "Open install message panel"> -<!ENTITY urlbar.translateNotificationAnchor.tooltip "Translate this page"> -<!ENTITY urlbar.translatedNotificationAnchor.tooltip "Manage page translation"> <!ENTITY urlbar.emeNotificationAnchor.tooltip "Manage use of DRM software"> <!ENTITY urlbar.cameraBlocked.tooltip "You have blocked your camera for this website."> @@ -336,23 +322,6 @@ These should match what Safari and other Apple applications use on OS X Lion. -- <!ENTITY appMenuHistory.viewSidebar.label "View History Sidebar"> <!ENTITY appMenuHelp.tooltip "Open Help Menu"> -<!ENTITY appMenuRemoteTabs.label "Synced Tabs"> -<!-- LOCALIZATION NOTE (appMenuRemoteTabs.notabs.label): This is shown beneath - the name of a device when that device has no open tabs --> -<!ENTITY appMenuRemoteTabs.notabs.label "No open tabs"> -<!-- LOCALIZATION NOTE (appMenuRemoteTabs.tabsnotsyncing.label): This is shown - when Sync is configured but syncing tabs is disabled. --> -<!ENTITY appMenuRemoteTabs.tabsnotsyncing.label "Turn on tab syncing to view a list of tabs from your other devices."> -<!-- LOCALIZATION NOTE (appMenuRemoteTabs.noclients.label): This is shown - when Sync is configured but this appears to be the only device attached to - the account. We also show links to download Firefox for android/ios. --> -<!ENTITY appMenuRemoteTabs.noclients.title "No synced tabs… yet!"> -<!ENTITY appMenuRemoteTabs.noclients.subtitle "Want to see your tabs from other devices here?"> -<!ENTITY appMenuRemoteTabs.openprefs.label "Sync Preferences"> -<!ENTITY appMenuRemoteTabs.notsignedin.label "Sign in to view a list of tabs from your other devices."> -<!ENTITY appMenuRemoteTabs.signin.label "Sign in to Sync"> -<!ENTITY appMenuRemoteTabs.sidebar.label "View Synced Tabs Sidebar"> - <!ENTITY customizeMenu.addToToolbar.label "Add to Toolbar"> <!ENTITY customizeMenu.addToToolbar.accesskey "A"> <!ENTITY customizeMenu.addToPanel.label "Add to Menu"> @@ -726,43 +695,19 @@ you can use these alternative items. Otherwise, their values should be empty. - The word "toolbar" is appended automatically and should not be contained below! --> <!ENTITY tabsToolbar.label "Browser tabs"> -<!-- LOCALIZATION NOTE (syncTabsMenu3.label): This appears in the history menu --> -<!ENTITY syncTabsMenu3.label "Synced Tabs"> - -<!ENTITY syncedTabs.sidebar.label "Synced Tabs"> -<!ENTITY syncedTabs.sidebar.noclients.label "Sign in to Firefox from your other devices to view their tabs here."> -<!ENTITY syncedTabs.sidebar.noclients.title "No synced tabs… yet!"> -<!ENTITY syncedTabs.sidebar.noclients.subtitle "Want to see your tabs from other devices here?"> -<!ENTITY syncedTabs.sidebar.notsignedin.label "Sign in to view a list of tabs from your other devices."> -<!ENTITY syncedTabs.sidebar.notabs.label "No open tabs"> -<!ENTITY syncedTabs.sidebar.openprefs.label "Open &syncBrand.shortName.label; Preferences"> -<!-- LOCALIZATION NOTE (syncedTabs.sidebar.tabsnotsyncing.label): This is shown - when Sync is configured but syncing tabs is disabled. --> -<!ENTITY syncedTabs.sidebar.tabsnotsyncing.label "Turn on tab syncing to view a list of tabs from your other devices."> - -<!ENTITY syncedTabs.context.open.label "Open"> -<!ENTITY syncedTabs.context.open.accesskey "O"> -<!ENTITY syncedTabs.context.openInNewTab.label "Open in a New Tab"> -<!ENTITY syncedTabs.context.openInNewTab.accesskey "w"> -<!ENTITY syncedTabs.context.openInNewWindow.label "Open in a New Window"> -<!ENTITY syncedTabs.context.openInNewWindow.accesskey "N"> -<!ENTITY syncedTabs.context.openInNewPrivateWindow.label "Open in a New Private Window"> -<!ENTITY syncedTabs.context.openInNewPrivateWindow.accesskey "P"> -<!ENTITY syncedTabs.context.bookmarkSingleTab.label "Bookmark This Tab…"> -<!ENTITY syncedTabs.context.bookmarkSingleTab.accesskey "B"> -<!ENTITY syncedTabs.context.copy.label "Copy"> -<!ENTITY syncedTabs.context.copy.accesskey "C"> - +#ifdef MOZ_SERVICES_SYNC +<!-- LOCALIZATION NOTE (syncTabsMenu2.label): This appears in the history menu --> +<!ENTITY syncTabsMenu2.label "Tabs From Other Devices"> <!ENTITY syncBrand.shortName.label "Sync"> -<!ENTITY syncSignIn.label "Sign In To &syncBrand.shortName.label;…"> -<!ENTITY syncSignIn.accesskey "Y"> +<!ENTITY syncSetup.label "Set Up &syncBrand.shortName.label;…"> +<!ENTITY syncSetup.accesskey "Y"> <!ENTITY syncSyncNowItem.label "Sync Now"> <!ENTITY syncSyncNowItem.accesskey "S"> -<!ENTITY syncReAuthItem.label "Reconnect to &syncBrand.shortName.label;…"> -<!ENTITY syncReAuthItem.accesskey "R"> <!ENTITY syncToolbarButton.label "Sync"> +<!ENTITY syncTabsToolbarButton.label "Synced Tabs"> +#endif <!ENTITY customizeMode.menuAndToolbars.header2 "Additional Tools and Features"> <!ENTITY customizeMode.menuAndToolbars.empty "Want more tools?"> diff --git a/application/basilisk/locales/en-US/chrome/browser/browser.properties b/application/basilisk/locales/en-US/chrome/browser/browser.properties index f1c39839b..abec30bf1 100644 --- a/application/basilisk/locales/en-US/chrome/browser/browser.properties +++ b/application/basilisk/locales/en-US/chrome/browser/browser.properties @@ -638,37 +638,6 @@ e10s.accessibilityNotice.acceptButton.accesskey = O e10s.accessibilityNotice.enableAndRestart.label = Enable (Requires Restart) e10s.accessibilityNotice.enableAndRestart.accesskey = E -# LOCALIZATION NOTE (userContextPersonal.label, -# userContextWork.label, -# userContextShopping.label, -# userContextBanking.label, -# userContextNone.label): -# These strings specify the four predefined contexts included in support of the -# Contextual Identity / Containers project. Each context is meant to represent -# the context that the user is in when interacting with the site. Different -# contexts will store cookies and other information from those sites in -# different, isolated locations. You can enable the feature by typing -# about:config in the URL bar and changing privacy.userContext.enabled to true. -# Once enabled, you can open a new tab in a specific context by clicking -# File > New Container Tab > (1 of 4 contexts). Once opened, you will see these -# strings on the right-hand side of the URL bar. -userContextPersonal.label = Personal -userContextWork.label = Work -userContextBanking.label = Banking -userContextShopping.label = Shopping -userContextNone.label = No Container - -userContextPersonal.accesskey = P -userContextWork.accesskey = W -userContextBanking.accesskey = B -userContextShopping.accesskey = S -userContextNone.accesskey = N - -userContext.aboutPage.label = Manage containers -userContext.aboutPage.accesskey = O - -userContextOpenLink.label = Open Link in New %S Tab - muteTab.label = Mute Tab muteTab.accesskey = M unmuteTab.label = Unmute Tab diff --git a/application/basilisk/locales/en-US/chrome/browser/newTab.dtd b/application/basilisk/locales/en-US/chrome/browser/newTab.dtd index 392aeb957..32a3ad70d 100644 --- a/application/basilisk/locales/en-US/chrome/browser/newTab.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/newTab.dtd @@ -5,12 +5,9 @@ <!-- These strings are used in the about:newtab page --> <!ENTITY newtab.pageTitle "New Tab"> <!ENTITY newtab.customize.classic "Show your top sites"> -<!ENTITY newtab.customize.cog.enhanced "Include suggested sites"> <!ENTITY newtab.customize.cog.title2 "NEW TAB CONTROLS"> <!ENTITY newtab.customize.cog.learn "Learn about New Tab"> <!ENTITY newtab.customize.title "Customize your New Tab page"> -<!ENTITY newtab.customize.suggested "Show suggested and your top sites"> -<!ENTITY newtab.customize.topsites "Show your top sites"> <!ENTITY newtab.customize.blank2 "Show blank page"> <!ENTITY newtab.undo.removedLabel "Thumbnail removed."> <!ENTITY newtab.undo.undoButton "Undo."> diff --git a/application/basilisk/locales/en-US/chrome/browser/newTab.properties b/application/basilisk/locales/en-US/chrome/browser/newTab.properties index 7b3fe248e..922aa5847 100644 --- a/application/basilisk/locales/en-US/chrome/browser/newTab.properties +++ b/application/basilisk/locales/en-US/chrome/browser/newTab.properties @@ -5,42 +5,3 @@ newtab.pin=Pin this site at its current position newtab.unpin=Unpin this site newtab.block=Remove this site -# LOCALIZATION NOTE(newtab.sponsored.button): This text appears for sponsored -# and enhanced tiles on the same line as the tile's title, so prefer short -# strings to avoid overlap. This string should be uppercase. -newtab.sponsored.button=SPONSORED -# LOCALIZATION NOTE(newtab.suggested.button): This text appears for sponsored -# and suggested tiles on the same line as the tile's title, so prefer short -# strings to avoid overlap. This string should be uppercase. -newtab.suggested.tag=SUGGESTED -# LOCALIZATION NOTE(newtab.suggested.button): %1$S will be replaced inline by -# one of the user's top 100 sites that triggered this suggested tile. -# This text appears for suggested tiles under the tile's title, so prefer short -# strings to avoid truncating important text. -newtab.suggested.button=Suggested for %1$S visitors -# LOCALIZATION NOTE(newtab.sponsored.explain): %1$S will be replaced inline by -# the (X) block icon. %2$S will be replaced by an active link using string -# newtab.learn.link as text. -newtab.sponsored.explain=This tile is being shown to you on behalf of a Mozilla partner. You can remove it at any time by clicking the %1$S button. %2$S -# LOCALIZATION NOTE(newtab.sponsored.explain2): %1$S will be replaced inline by -# the (X) block icon. %2$S will be replaced by an active link using string -# newtab.learn.link as text. -newtab.sponsored.explain2=This site is suggested to you on behalf of a Mozilla partner. You can remove it at any time by clicking the %1$S button. %2$S -# LOCALIZATION NOTE(newtab.suggested.explain): %1$S will be replaced inline by -# the (X) block icon. %2$S will be replaced by an active link using string -# newtab.learn.link as text. -newtab.suggested.explain=This site is suggested to you by Mozilla. You can remove it at any time by clicking the %1$S button. %2$S -# LOCALIZATION NOTE(newtab.enhanced.explain): %1$S will be replaced inline by -# the gear icon used to customize the new tab window. %2$S will be replaced by -# an active link using string newtab.learn.link as text. -newtab.enhanced.explain=A Mozilla partner has visually enhanced this tile, replacing the screenshot. You can turn off enhanced tiles by clicking the %1$S button for your preferences. %2$S -newtab.intro1.paragraph1=Now when you open New Tab, you’ll also see sites we think might be interesting to you. Some may be suggested by Mozilla or sponsored by one of our partners. -# LOCALIZATION NOTE(newtab.intro1.paragraph2): %1$S will be replaced inline by -# an active link using string newtab.privacy.link as text. %2$S will be replaced -# inline by the gear icon used to customize the new tab window. -newtab.intro1.paragraph2=In order to provide this service, some data is automatically sent back to us in accordance with our %1$S. You can turn this off by unchecking the option under the gear icon (%2$S). -newtab.learn.link=Learn more… -newtab.privacy.link=Privacy Notice -newtab.learn.link2=More about New Tab -newtab.intro.header.update=New Tab got an update! -newtab.intro.gotit=Got it! diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/containers.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/containers.dtd deleted file mode 100644 index 58eca1ace..000000000 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/containers.dtd +++ /dev/null @@ -1,24 +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/. --> - -<!ENTITY label.label "Name"> -<!ENTITY addButton.label "Add New Container"> -<!ENTITY addButton.accesskey "A"> -<!-- « is « however it's not defined in XML --> -<!ENTITY backLink.label "« Go Back to Privacy"> - -<!ENTITY window.title "Add New Container"> -<!ENTITY window.width "45em"> - -<!ENTITY name.label "Name:"> -<!ENTITY name.accesskey "N"> -<!ENTITY icon.label "Icon:"> -<!ENTITY icon.accesskey "I"> -<!ENTITY color.label "Color:"> -<!ENTITY color.accesskey "o"> -<!ENTITY windowClose.key "w"> - -<!ENTITY button.ok.label "Done"> -<!ENTITY button.ok.accesskey "D"> - diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/containers.properties b/application/basilisk/locales/en-US/chrome/browser/preferences/containers.properties deleted file mode 100644 index 9866a0659..000000000 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/containers.properties +++ /dev/null @@ -1,31 +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/. - -containers.removeButton = Remove -containers.preferencesButton = Preferences -containers.colorHeading = Color: -containers.labelMinWidth = 4rem -containers.nameLabel = Name: -containers.namePlaceholder = Enter a container name -containers.submitButton = Done -containers.iconHeading = Icon: -containers.updateContainerTitle = %S Container Preferences - -containers.blue.label = Blue -containers.turquoise.label = Turquoise -containers.green.label = Green -containers.yellow.label = Yellow -containers.orange.label = Orange -containers.red.label = Red -containers.pink.label = Pink -containers.purple.label = Purple - -containers.fingerprint.label = Fingerprint -containers.briefcase.label = Briefcase -# LOCALIZATION NOTE (containers.dollar.label) -# String represents a money sign but currently uses a dollar sign so don't change to local currency -# See Bug 1291672 -containers.dollar.label = Dollar sign -containers.cart.label = Shopping cart -containers.circle.label = Dot diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd index 5d58ffa37..d1d83b3bc 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/preferences/content.dtd @@ -38,21 +38,6 @@ <!ENTITY chooseButton.label "Choose…"> <!ENTITY chooseButton.accesskey "o"> -<!ENTITY translateWebPages.label "Translate web content"> -<!ENTITY translateWebPages.accesskey "T"> -<!ENTITY translateExceptions.label "Exceptions…"> -<!ENTITY translateExceptions.accesskey "x"> - -<!-- LOCALIZATION NOTE (translation.options.attribution.beforeLogo, - - translation.options.attribution.afterLogo): - - These 2 strings are displayed before and after a 'Microsoft Translator' - - logo. - - The translations for these strings should match the translations in - - browser/translation.dtd - --> -<!ENTITY translation.options.attribution.beforeLogo "Translations by"> -<!ENTITY translation.options.attribution.afterLogo ""> - <!ENTITY drmContent.label "DRM content"> <!ENTITY playDRMContent.label "Play DRM content"> diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd index 5e7df9609..c83331328 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd @@ -14,7 +14,6 @@ <!ENTITY props.path.label "Path:"> <!ENTITY props.secure.label "Send For:"> <!ENTITY props.expires.label "Expires:"> -<!ENTITY props.container.label "Container:"> <!ENTITY window.title "Cookies"> <!ENTITY windowClose.key "w"> diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd index 7702c8c51..353e627d7 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd @@ -18,7 +18,6 @@ <!ENTITY paneContent.title "Content"> <!ENTITY paneApplications.title "Applications"> <!ENTITY panePrivacy.title "Privacy"> -<!ENTITY paneContainers.title "Container Tabs"> <!ENTITY paneSecurity.title "Security"> <!ENTITY paneAdvanced.title "Advanced"> diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties index da40f40a9..c0b7e1be0 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties +++ b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties @@ -21,8 +21,8 @@ acceptVeryLargeMinimumFont=Keep my changes anyway trackingprotectionpermissionstext=You have disabled Tracking Protection on these sites. trackingprotectionpermissionstitle=Exceptions - Tracking Protection -cookiepermissionstext=You can specify which websites are always or never allowed to use cookies. Type the exact address of the site you want to manage and then click Block, Allow for Session, or Allow. -cookiepermissionstitle=Exceptions - Cookies +cookiepermissionstext=You can specify which websites are always or never allowed to store cookies and site data. Type the exact address of the site you want to manage and then click Block, Allow for Session, or Allow. +cookiepermissionstitle=Exceptions - Cookies and Site Data addonspermissionstext=You can specify which websites are allowed to install add-ons. Type the exact address of the site you want to allow and then click Allow. addons_permissions_title=Allowed Sites - Add-ons Installation popuppermissionstext=You can specify which websites are allowed to open pop-up windows. Type the exact address of the site you want to allow and then click Allow. @@ -36,7 +36,7 @@ savedLoginsExceptions_desc=Logins for the following sites will not be saved: #### Block List Manager -blockliststext=You can choose which list Firefox will use to block Web elements that may track your browsing activity. +blockliststext=You can choose which list the browser will use to block Web elements that may track your browsing activity. blockliststitle=Block Lists # LOCALIZATION NOTE (mozNameTemplate): This template constructs the name of the # block list in the block lists dialog. It combines the list name and @@ -191,17 +191,3 @@ revertNoRestartButton=Revert restartNow=Restart Now restartLater=Restart Later - -disableContainersAlertTitle=Close All Container Tabs? - -# LOCALIZATION NOTE (disableContainersMsg): Semi-colon list of plural forms. -# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals -# #S is the number of container tabs -disableContainersMsg=If you disable Container Tabs now, #S container tab will be closed. Are you sure you want to disable Container Tabs?;If you disable Container Tabs now, #S container tabs will be closed. Are you sure you want to disable Container Tabs? - -# LOCALIZATION NOTE (disableContainersOkButton): Semi-colon list of plural forms. -# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals -# #S is the number of container tabs -disableContainersOkButton=Close #S Container Tab;Close #S Container Tabs - -disableContainersButton2=Keep enabled diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd index e6a7955fb..8820e92ab 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd @@ -49,10 +49,10 @@ <!ENTITY suggestionSettings.label "Change preferences for search engine suggestions…"> <!ENTITY suggestionSettings.accesskey "g"> -<!ENTITY acceptCookies.label "Accept cookies from sites"> +<!ENTITY acceptCookies.label "Allow sites to store cookies and site data"> <!ENTITY acceptCookies.accesskey "A"> -<!ENTITY acceptThirdParty.pre.label "Accept third-party cookies:"> +<!ENTITY acceptThirdParty.pre.label "Accept third-party cookies and site data:"> <!ENTITY acceptThirdParty.pre.accesskey "y"> <!ENTITY acceptThirdParty.always.label "Always"> <!ENTITY acceptThirdParty.never.label "Never"> @@ -77,7 +77,7 @@ <!ENTITY historyHeader.custom.label "Use custom settings for history"> <!ENTITY historyHeader.post.label ""> -<!ENTITY rememberDescription.label "&brandShortName; will remember your browsing, download, form and search history, and keep cookies from websites you visit."> +<!ENTITY rememberDescription.label "&brandShortName; will remember your browsing, download, form and search history, and keep cookies and site data from websites you visit."> <!-- LOCALIZATION NOTE (rememberActions.pre.label): include a trailing space as needed --> <!-- LOCALIZATION NOTE (rememberActions.middle.label): include a starting and trailing space as needed --> @@ -110,10 +110,3 @@ <!ENTITY clearOnCloseSettings.label "Settings…"> <!ENTITY clearOnCloseSettings.accesskey "t"> - -<!ENTITY browserContainersHeader.label "Container Tabs"> -<!ENTITY browserContainersLearnMore.label "Learn more"> -<!ENTITY browserContainersEnabled.label "Enable Container Tabs"> -<!ENTITY browserContainersEnabled.accesskey "n"> -<!ENTITY browserContainersSettings.label "Settings…"> -<!ENTITY browserContainersSettings.accesskey "i"> diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd index 78cadd74c..f6ef3b876 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd @@ -16,6 +16,7 @@ <!-- Manage Account --> <!ENTITY manageAccount.label "Manage Account"> <!ENTITY manageAccount.accesskey "n"> +<!ENTITY viewQuota.label "View Quota"> <!ENTITY changePassword2.label "Change Password…"> <!ENTITY myRecoveryKey.label "My Recovery Key"> <!ENTITY resetSync2.label "Reset Sync…"> @@ -38,80 +39,9 @@ <!-- Device Settings --> <!ENTITY syncDeviceName.label "Device Name:"> -<!ENTITY fxaSyncDeviceName.label "Device Name"> -<!ENTITY changeSyncDeviceName.label "Change Device Name…"> -<!ENTITY changeSyncDeviceName.accesskey "h"> -<!ENTITY cancelChangeSyncDeviceName.label "Cancel"> -<!ENTITY cancelChangeSyncDeviceName.accesskey "n"> -<!ENTITY saveChangeSyncDeviceName.label "Save"> -<!ENTITY saveChangeSyncDeviceName.accesskey "v"> +<!ENTITY syncDeviceName.accesskey "c"> <!ENTITY unlinkDevice.label "Unlink This Device"> <!-- Footer stuff --> <!ENTITY prefs.tosLink.label "Terms of Service"> <!ENTITY prefs.ppLink.label "Privacy Policy"> - -<!-- Firefox Accounts stuff --> -<!ENTITY fxaPrivacyNotice.link.label "Privacy Notice"> -<!ENTITY determiningAcctStatus.label "Determining your account status…"> - -<!-- LOCALIZATION NOTE (signedInUnverified.beforename.label, -signedInUnverified.aftername.label): these two string are used respectively -before and after the account email address. Localizers can use one of them, or -both, to better adapt this sentence to their language. ---> -<!ENTITY signedInUnverified.beforename.label ""> -<!ENTITY signedInUnverified.aftername.label "is not verified."> - -<!-- LOCALIZATION NOTE (signedInLoginFailure.beforename.label, -signedInLoginFailure.aftername.label): these two string are used respectively -before and after the account email address. Localizers can use one of them, or -both, to better adapt this sentence to their language. ---> -<!ENTITY signedInLoginFailure.beforename.label "Please sign in to reconnect"> -<!ENTITY signedInLoginFailure.aftername.label ""> - -<!ENTITY notSignedIn.label "You are not signed in."> -<!ENTITY signIn.label "Sign in"> -<!ENTITY signIn.accesskey "g"> -<!ENTITY profilePicture.tooltip "Change profile picture"> -<!ENTITY verifiedManage.label "Manage Account"> -<!ENTITY verifiedManage.accesskey "o"> -<!ENTITY disconnect.label "Disconnect…"> -<!ENTITY disconnect.accesskey "D"> -<!ENTITY verify.label "Verify Email"> -<!ENTITY verify.accesskey "V"> -<!ENTITY forget.label "Forget this Email"> -<!ENTITY forget.accesskey "F"> - -<!ENTITY welcome.description "Access your tabs, bookmarks, passwords and more wherever you use &brandShortName;."> -<!ENTITY welcome.signIn.label "Sign In"> -<!ENTITY welcome.createAccount.label "Create Account"> - -<!ENTITY welcome.useOldSync.label "Using an older version of Sync?"> - -<!ENTITY signedOut.caption "Take your Web with you"> -<!ENTITY signedOut.description "Synchronize your bookmarks, history, tabs, passwords, add-ons, and preferences across all your devices."> -<!ENTITY signedOut.accountBox.title "Connect with a &syncBrand.fxAccount.label;"> -<!ENTITY signedOut.accountBox.create "Create Account"> -<!ENTITY signedOut.accountBox.create.accesskey "C"> -<!ENTITY signedOut.accountBox.signin "Sign In"> -<!ENTITY signedOut.accountBox.signin.accesskey "I"> - -<!ENTITY signedIn.engines.label "Sync across all devices"> - -<!-- LOCALIZATION NOTE (mobilePromo3.*): the following strings will be used to - create a single sentence with active links. - The resulting sentence in English is: "Download Firefox for - Android or iOS to sync with your mobile device." --> - -<!ENTITY mobilePromo3.start "Download Firefox for "> -<!-- LOCALIZATION NOTE (mobilePromo3.androidLink): This is a link title that links to https://www.mozilla.org/firefox/android/ --> -<!ENTITY mobilePromo3.androidLink "Android"> - -<!-- LOCALIZATION NOTE (mobilePromo3.iOSBefore): This is text displayed between mobilePromo3.androidLink and mobilePromo3.iosLink --> -<!ENTITY mobilePromo3.iOSBefore " or "> -<!-- LOCALIZATION NOTE (mobilePromo3.iOSLink): This is a link title that links to https://www.mozilla.org/firefox/ios/ --> -<!ENTITY mobilePromo3.iOSLink "iOS"> - -<!ENTITY mobilePromo3.end " to sync with your mobile device."> diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/translation.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/translation.dtd deleted file mode 100644 index fc5fb2b7b..000000000 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/translation.dtd +++ /dev/null @@ -1,24 +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/. --> - -<!ENTITY window.title "Exceptions - Translation"> -<!ENTITY window.width "36em"> -<!ENTITY windowClose.key "w"> - -<!ENTITY noTranslationForLanguages.label "Translation will not be offered for the following languages:"> -<!ENTITY treehead.languageName.label "Languages"> -<!ENTITY removeLanguage.label "Remove Language"> -<!ENTITY removeLanguage.accesskey "R"> -<!ENTITY removeAllLanguages.label "Remove All Languages"> -<!ENTITY removeAllLanguages.accesskey "e"> - -<!ENTITY noTranslationForSites.label "Translation will not be offered for the following sites:"> -<!ENTITY treehead.siteName.label "Sites"> -<!ENTITY removeSite.label "Remove Site"> -<!ENTITY removeSite.accesskey "S"> -<!ENTITY removeAllSites.label "Remove All Sites"> -<!ENTITY removeAllSites.accesskey "i"> - -<!ENTITY button.close.label "Close"> -<!ENTITY button.close.accesskey "C"> diff --git a/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd b/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd index 0c9e9201a..bc4d1b3e0 100644 --- a/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd @@ -3,5 +3,4 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <!ENTITY syncBrand.shortName.label "Sync"> -<!ENTITY syncBrand.fullName.label "Firefox Sync"> -<!ENTITY syncBrand.fxAccount.label "Firefox Account"> +<!ENTITY syncBrand.fullName.label "Pale Moon Sync"> diff --git a/application/basilisk/locales/en-US/chrome/browser/syncKey.dtd b/application/basilisk/locales/en-US/chrome/browser/syncKey.dtd index 2ff001842..f37f2c92e 100644 --- a/application/basilisk/locales/en-US/chrome/browser/syncKey.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/syncKey.dtd @@ -5,12 +5,12 @@ <!ENTITY syncKey.page.title "Your &syncBrand.fullName.label; Key"> <!ENTITY syncKey.page.description2 "This key is used to decode the data in your &syncBrand.fullName.label; account. You will need to enter the key each time you configure &syncBrand.fullName.label; on a new device."> <!ENTITY syncKey.keepItSecret.heading "Keep it secret"> -<!ENTITY syncKey.keepItSecret.description "Your &syncBrand.fullName.label; account is encrypted to protect your privacy. Without this key, it would take years for anyone to decode your personal information. You are the only person who holds this key. This means you’re the only one who can access your &syncBrand.fullName.label; data."> +<!ENTITY syncKey.keepItSecret.description "Your &syncBrand.fullName.label; account is encrypted to protect your privacy. Without this key, it would take years for anyone to decode your personal information. You are the only person who holds this key. This means you're the only one who can access your &syncBrand.fullName.label; data."> <!ENTITY syncKey.keepItSafe.heading "Keep it safe"> <!ENTITY syncKey.keepItSafe1.description "Do not lose this key."> -<!ENTITY syncKey.keepItSafe2.description " We don’t keep a copy of your key (that wouldn’t be keeping it secret!) so "> -<!ENTITY syncKey.keepItSafe3.description "we can’t help you recover it"> -<!ENTITY syncKey.keepItSafe4a.description " if it’s lost. You’ll need to use this key any time you connect a new device to &syncBrand.fullName.label;."> +<!ENTITY syncKey.keepItSafe2.description " We don't keep a copy of your key (that wouldn't be keeping it secret!) so "> +<!ENTITY syncKey.keepItSafe3.description "we can't help you recover it"> +<!ENTITY syncKey.keepItSafe4a.description " if it's lost. You'll need to use this key any time you connect a new device to &syncBrand.fullName.label;."> <!ENTITY syncKey.findOutMore1.label "Find out more about &syncBrand.fullName.label; and your privacy at "> <!ENTITY syncKey.findOutMore2.label "."> <!ENTITY syncKey.footer1.label "&syncBrand.fullName.label; Terms of Service are available at "> diff --git a/application/basilisk/locales/en-US/chrome/browser/syncProgress.dtd b/application/basilisk/locales/en-US/chrome/browser/syncProgress.dtd new file mode 100644 index 000000000..db45cb935 --- /dev/null +++ b/application/basilisk/locales/en-US/chrome/browser/syncProgress.dtd @@ -0,0 +1,15 @@ +<!-- 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 % brandDTD + SYSTEM "chrome://branding/locale/brand.dtd"> + %brandDTD; + +<!-- These strings are used in the sync progress upload page --> +<!ENTITY syncProgress.pageTitle "Your First Sync"> +<!ENTITY syncProgress.textBlurb "Your data is now being encrypted and uploaded in the background. You can close this tab and continue using &brandShortName;."> +<!ENTITY syncProgress.closeButton "Close"> +<!ENTITY syncProgress.logoAltText "&brandShortName; logo"> +<!ENTITY syncProgress.diffText "&brandShortName; will now automatically sync in the background. You can close this tab and continue using &brandShortName;."> + diff --git a/application/basilisk/locales/en-US/chrome/browser/syncQuota.properties b/application/basilisk/locales/en-US/chrome/browser/syncQuota.properties index 099090ec9..0e1b857ca 100644 --- a/application/basilisk/locales/en-US/chrome/browser/syncQuota.properties +++ b/application/basilisk/locales/en-US/chrome/browser/syncQuota.properties @@ -30,7 +30,7 @@ quota.remove.label = Remove quota.treeCaption.label = Uncheck items to stop syncing them and free up space on the server. # LOCALIZATION NOTE (quota.removal.label): %S is a list of engines that will be # disabled and whose data will be removed once the user confirms. -quota.removal.label = Firefox Sync will remove the following data: %S. +quota.removal.label = Sync will remove the following data: %S. # LOCALIZATION NOTE (quota.list.separator): This is the separator string used # for the list of engines (incl. spaces where appropriate) quota.list.separator = ,\u0020 diff --git a/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd b/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd index 950a83553..7ee938e5d 100644 --- a/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd @@ -6,17 +6,17 @@ <!-- First page of the wizard --> -<!ENTITY setup.pickSetupType.description2 "Welcome! If you’ve never used &syncBrand.fullName.label; before, you will need to create a new account."> +<!ENTITY setup.pickSetupType.description2 "Welcome! If you've never used &syncBrand.fullName.label; before, you will need to create a new account."> <!ENTITY button.createNewAccount.label "Create a New Account"> <!ENTITY button.haveAccount.label "I Have an Account"> <!ENTITY setup.choicePage.title.label "Have you used &syncBrand.fullName.label; before?"> -<!ENTITY setup.choicePage.new.label "I’ve never used &syncBrand.shortName.label; before"> -<!ENTITY setup.choicePage.existing2.label "I’m already using &syncBrand.shortName.label; on another device"> +<!ENTITY setup.choicePage.new.label "I've never used &syncBrand.shortName.label; before"> +<!ENTITY setup.choicePage.existing2.label "I'm already using &syncBrand.shortName.label; on another device"> <!-- New Account AND Existing Account --> <!ENTITY server.label "Server"> -<!ENTITY serverType.default.label "Default: Mozilla &syncBrand.fullName.label; server"> +<!ENTITY serverType.default.label "Default: &syncBrand.fullName.label; server"> <!ENTITY serverType.custom2.label "Use a custom server…"> <!ENTITY signIn.account2.label "Account"> <!ENTITY signIn.account2.accesskey "A"> @@ -33,6 +33,8 @@ <!ENTITY setup.choosePassword.accesskey "P"> <!ENTITY setup.confirmPassword.label "Confirm Password"> <!ENTITY setup.confirmPassword.accesskey "m"> +<!ENTITY setup.setupMetro.label "Sync with Windows 8 style &brandShortName;"> +<!ENTITY setup.setupMetro.accesskey "S"> <!-- LOCALIZATION NOTE: tosAgree1, tosLink, tosAgree2, ppLink, tosAgree3 are joined with implicit white space, so spaces in the strings aren't necessary --> @@ -60,7 +62,7 @@ <!-- Existing Account Page 1: Pair a Device (incl. Pair a Device dialog strings) --> <!ENTITY pairDevice.title.label "Pair a Device"> <!ENTITY addDevice.showMeHow.label "Show me how."> -<!ENTITY addDevice.dontHaveDevice.label "I don’t have the device with me"> +<!ENTITY addDevice.dontHaveDevice.label "I don't have the device with me"> <!ENTITY pairDevice.setup.description.label "To activate, select "Pair a Device" on your other device."> <!ENTITY addDevice.setup.enterCode.label "Then, enter this code:"> <!ENTITY pairDevice.dialog.description.label "To activate your new device, select "Set Up Sync" on the device."> @@ -72,7 +74,7 @@ <!-- Existing Account Page 2: Manual Login --> <!ENTITY setup.signInPage.title.label "Sign In"> -<!ENTITY existingRecoveryKey.description "You can get a copy of your Recovery Key by going to &syncBrand.shortName.label; Preferences on your other device, and selecting "My Recovery Key" under "Manage Account"."> +<!ENTITY existingRecoveryKey.description "You can get a copy of your Recovery Key by going to &syncBrand.shortName.label; Options on your other device, and selecting "My Recovery Key" under "Manage Account"."> <!ENTITY verifying.label "Verifying…"> <!ENTITY resetPassword.label "Reset Password"> <!ENTITY resetSyncKey.label "I have lost my other device."> @@ -96,14 +98,14 @@ <!ENTITY engine.addons.label "Add-ons"> <!ENTITY engine.addons.accesskey "A"> -<!ENTITY choice2a.merge.main.label "Merge this device’s data with my &syncBrand.shortName.label; data"> +<!ENTITY choice2a.merge.main.label "Merge this device's data with my &syncBrand.shortName.label; data"> <!ENTITY choice2.merge.recommended.label "Recommended:"> <!ENTITY choice2a.client.main.label "Replace all data on this device with my &syncBrand.shortName.label; data"> -<!ENTITY choice2a.server.main.label "Replace all other devices with this device’s data"> +<!ENTITY choice2a.server.main.label "Replace all other devices with this device's data"> <!-- Confirm Merge Options --> <!ENTITY setup.optionsConfirmPage.title "Confirm"> -<!ENTITY confirm.merge2.label "&syncBrand.fullName.label; will now merge all this device’s browser data into your Sync account."> +<!ENTITY confirm.merge2.label "&syncBrand.fullName.label; will now merge all this device's browser data into your Sync account."> <!ENTITY confirm.client3.label "Warning: The following &brandShortName; data on this device will be deleted:"> <!ENTITY confirm.client2.moreinfo.label "&brandShortName; will then copy your &syncBrand.fullName.label; data to this device."> <!ENTITY confirm.server2.label "Warning: The following devices will be overwritten with your local data:"> diff --git a/application/basilisk/locales/en-US/chrome/browser/syncSetup.properties b/application/basilisk/locales/en-US/chrome/browser/syncSetup.properties index 9d388af86..8a5170adb 100644 --- a/application/basilisk/locales/en-US/chrome/browser/syncSetup.properties +++ b/application/basilisk/locales/en-US/chrome/browser/syncSetup.properties @@ -35,33 +35,17 @@ passwordsCount.label = #1 password;#1 passwords # LOCALIZATION NOTE (addonsCount.label): Semicolon-separated list of plural forms. # See: http://developer.mozilla.org/en/docs/Localization_and_Plurals # #1 is the number of add-ons, see the link above for forms -addonsCount.label = #1 add-on;#1 add-ons +addonsCount.label = #1 addon;#1 addons save.recoverykey.title = Save Recovery Key -save.recoverykey.defaultfilename = Firefox Recovery Key.html +save.recoverykey.defaultfilename = Pale Moon Recovery Key.html -newAccount.action.label = Firefox Sync is now set up to automatically sync all of your browser data. +newAccount.action.label = Sync is now set up to automatically sync all of your browser data. newAccount.change.label = You can choose exactly what to sync by selecting Sync Options below. -resetClient.change2.label = Firefox Sync will now merge all this device’s browser data into your Sync account. -wipeClient.change2.label = Firefox Sync will now replace all of the browser data on this device with the data in your Sync account. -wipeRemote.change2.label = Firefox Sync will now replace all of the browser data in your Sync account with the data on this device. +resetClient.change2.label = Sync will now merge all this device's browser data into your Sync account. +wipeClient.change2.label = Sync will now replace all of the browser data on this device with the data in your Sync account. +wipeRemote.change2.label = Sync will now replace all of the browser data in your Sync account with the data on this device. existingAccount.change.label = You can change this preference by selecting Sync Options below. # Several other strings are used (via Weave.Status.login), but they come from # /services/sync - -# Firefox Accounts based setup. -continue.label = Continue - -# LOCALIZATION NOTE (disconnect.label, disconnect.verify.title, disconnect.verify.bodyHeading, disconnect.verify.bodyText): -# These strings are used in the confirmation dialog shown when the user hits the disconnect button -# LOCALIZATION NOTE (disconnect.label): This is the label for the disconnect button -disconnect.label = Disconnect -disconnect.verify.title = Disconnect -disconnect.verify.bodyHeading = Disconnect from Sync? -disconnect.verify.bodyText = Your browsing data will remain on this computer, but it will no longer sync with your account. - -relinkVerify.title = Merge Warning -relinkVerify.heading = Are you sure you want to sign in to Sync? -# LOCALIZATION NOTE (relinkVerify.description): Email address of a user previously signed into sync. -relinkVerify.description = A different user was previously signed in to Sync on this computer. Signing in will merge this browser’s bookmarks, passwords and other settings with %S diff --git a/application/basilisk/locales/en-US/chrome/browser/translation.dtd b/application/basilisk/locales/en-US/chrome/browser/translation.dtd deleted file mode 100644 index ca8bb9d51..000000000 --- a/application/basilisk/locales/en-US/chrome/browser/translation.dtd +++ /dev/null @@ -1,75 +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/. --> - -<!-- LOCALIZATION NOTE (translation.thisPageIsIn.label, - - translation.translateThisPage.label): - - These 2 strings are used to construct a sentence that contains a dropdown - - showing the detected language of the current web page. - - In en-US it looks like this: - - This page is in [detected language] Translate this page? - - "detected language" here is a language name coming from the - - global/languageNames.properties file; for some locales it may not be in - - the correct grammar case to keep the same structure of the original - - sentence. --> -<!ENTITY translation.thisPageIsIn.label "This page is in"> -<!ENTITY translation.translateThisPage.label "Translate this page?"> -<!ENTITY translation.translate.button "Translate"> -<!ENTITY translation.notNow.button "Not Now"> - -<!ENTITY translation.translatingContent.label "Translating page content…"> - -<!-- LOCALIZATION NOTE (translation.translatedFrom.label, - - translation.translatedTo.label, - - translation.translatedToSuffix.label): - - These 3 strings are used to construct a sentence that contains 2 dropdowns - - showing the source and target language of a translated web page. - - In en-US it looks like this: - - This page has been translated from [from language] to [to language] - - "from language" and "to language" here are language names coming from the - - global/languageNames.properties file; for some locales they may not be in - - the correct grammar case to keep the same structure of the original - - sentence. - - - - translation.translatedToSuffix.label (empty in en-US) is for locales that - - need to display some text after the second drop down for the sentence to - - be grammatically correct. --> -<!ENTITY translation.translatedFrom.label "This page has been translated from"> -<!ENTITY translation.translatedTo.label "to"> -<!ENTITY translation.translatedToSuffix.label ""> - -<!ENTITY translation.showOriginal.button "Show Original"> -<!ENTITY translation.showTranslation.button "Show Translation"> - -<!ENTITY translation.errorTranslating.label "There has been an error translating this page."> -<!ENTITY translation.tryAgain.button "Try Again"> - -<!ENTITY translation.serviceUnavailable.label "Translation is not available at the moment. Please try again later."> - -<!ENTITY translation.options.menu "Options"> -<!-- LOCALIZATION NOTE (translation.options.neverForSite.accesskey, - - translation.options.preferences.accesskey): - - The accesskey values used here should not clash with the value used for - - translation.options.neverForLanguage.accesskey in translation.properties - --> -<!ENTITY translation.options.neverForSite.label "Never translate this site"> -<!ENTITY translation.options.neverForSite.accesskey "e"> -<!ENTITY translation.options.preferences.label "Translation preferences"> -<!ENTITY translation.options.preferences.accesskey "T"> - -<!-- LOCALIZATION NOTE (translation.options.attribution.beforeLogo, - - translation.options.attribution.afterLogo): - - These 2 strings are displayed before and after a 'Microsoft Translator' - - logo. - --> -<!ENTITY translation.options.attribution.beforeLogo "Translations by"> -<!ENTITY translation.options.attribution.afterLogo ""> - -<!-- LOCALIZATION NOTE (translation.options.attribution.poweredByYandex, - translation.options.attribution.beforeLogo, - - translation.options.attribution.afterLogo): - - translation.options.attribution.poweredByYandex is displayed instead of - - the other two strings when yandex translation engine is preferred by the - - user. - --> -<!ENTITY translation.options.attribution.yandexTranslate "Powered by Yandex.Translate"> diff --git a/application/basilisk/locales/en-US/chrome/browser/translation.properties b/application/basilisk/locales/en-US/chrome/browser/translation.properties deleted file mode 100644 index e62edbd0a..000000000 --- a/application/basilisk/locales/en-US/chrome/browser/translation.properties +++ /dev/null @@ -1,12 +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/. - -# LOCALIZATION NOTE (translation.options.neverForLanguage.label): -# %S is a language name coming from the global/languageNames.properties file. -translation.options.neverForLanguage.label=Never translate %S - -# LOCALIZATION NOTE (translation.options.neverForLanguage.accesskey): -# The accesskey value used here should not clash with the values used for -# translation.options.*.accesskey in translation.dtd -translation.options.neverForLanguage.accesskey=N diff --git a/application/basilisk/locales/en-US/installer/custom.properties b/application/basilisk/locales/en-US/installer/custom.properties index 4abb1a550..0f86f5528 100644 --- a/application/basilisk/locales/en-US/installer/custom.properties +++ b/application/basilisk/locales/en-US/installer/custom.properties @@ -25,10 +25,6 @@ OPTIONS_PAGE_TITLE=Setup Type OPTIONS_PAGE_SUBTITLE=Choose setup options SHORTCUTS_PAGE_TITLE=Set Up Shortcuts SHORTCUTS_PAGE_SUBTITLE=Create Program Icons -COMPONENTS_PAGE_TITLE=Set Up Optional Components -COMPONENTS_PAGE_SUBTITLE=Optional Recommended Components -OPTIONAL_COMPONENTS_DESC=The Maintenance Service will allow you to update $BrandShortName silently in the background. -MAINTENANCE_SERVICE_CHECKBOX_DESC=Install &Maintenance Service SUMMARY_PAGE_TITLE=Summary SUMMARY_PAGE_SUBTITLE=Ready to start installing $BrandShortName SUMMARY_INSTALLED_TO=$BrandShortName will be installed to the following location: diff --git a/application/basilisk/locales/en-US/installer/nsisstrings.properties b/application/basilisk/locales/en-US/installer/nsisstrings.properties deleted file mode 100644 index 389405696..000000000 --- a/application/basilisk/locales/en-US/installer/nsisstrings.properties +++ /dev/null @@ -1,67 +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/. - -# LOCALIZATION NOTE: - -# This file must be saved as UTF8 - -# Accesskeys are defined by prefixing the letter that is to be used for the -# accesskey with an ampersand (e.g. &). - -# Do not replace $BrandShortName, $BrandFullName, or $BrandFullNameDA with a -# custom string and always use the same one as used by the en-US files. -# $BrandFullNameDA allows the string to contain an ampersand (e.g. DA stands -# for double ampersand) and prevents the letter following the ampersand from -# being used as an accesskey. - -# You can use \n to create a newline in the string but only when the string -# from en-US contains a \n. - -WIN_CAPTION=$BrandShortName Setup - -INTRO_BLURB1=Thanks for choosing $BrandFullName, the browser that chooses you above everything else. -INSTALL_BLURB1=You're about to enjoy the very latest in speed, flexibility and security so you're always in control. -INSTALL_BLURB2=That's because $BrandShortName is made by a non-profit to make browsing and the Web better for you. -INSTALL_BLURB3=You're also joining a global community of users, contributors and developers working to make the best browser in the world. - -WARN_MIN_SUPPORTED_OSVER_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer. Please click the OK button for additional information. -WARN_MIN_SUPPORTED_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires a processor with ${MinSupportedCPU} support. Please click the OK button for additional information. -WARN_MIN_SUPPORTED_OSVER_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer and a processor with ${MinSupportedCPU} support. Please click the OK button for additional information. -WARN_WRITE_ACCESS=You don't have access to write to the installation directory.\n\nClick OK to select a different directory. -WARN_DISK_SPACE=You don't have sufficient disk space to install to this location.\n\nClick OK to select a different location. -WARN_ROOT_INSTALL=Unable to install to the root of your disk.\n\nClick OK to select a different location. -WARN_MANUALLY_CLOSE_APP_LAUNCH=$BrandShortName is already running.\n\nPlease close $BrandShortName prior to launching the version you have just installed. - -ERROR_DOWNLOAD=Your download was interrupted.\n\nPlease click the OK button to continue. - -INSTALL_BUTTON=&Install -UPGRADE_BUTTON=&Upgrade -CANCEL_BUTTON=Cancel -OPTIONS_BUTTON=&Options - -MAKE_DEFAULT=&Make $BrandShortName my default browser -CREATE_SHORTCUTS=Create Shortcuts for $BrandShortName: -ADD_SC_TASKBAR=On my &Task bar -ADD_SC_QUICKLAUNCHBAR=On my &Quick Launch bar -ADD_CheckboxShortcutInStartMenu=In my &Start Menu Programs Folder -ADD_CheckboxShortcutOnDesktop=On my &Desktop -SPACE_REQUIRED=Space Required: -SPACE_AVAILABLE=Space Available: -ONE_MOMENT_INSTALL=One moment, $BrandShortName will launch as soon as the install is complete… -ONE_MOMENT_UPGRADE=One moment, $BrandShortName will launch as soon as the upgrade is complete… -INSTALL_MAINT_SERVICE=&Install the $BrandShortName background update service -SEND_PING=S&end information about this installation to Mozilla -BROWSE_BUTTON=B&rowse… -DEST_FOLDER=Destination Folder - -DOWNLOADING_LABEL=Downloading $BrandShortName… -INSTALLING_LABEL=Installing $BrandShortName… -UPGRADING_LABEL=Upgrading $BrandShortName… - -SELECT_FOLDER_TEXT=Select the folder to install $BrandShortName in. - -BYTE=B -KILO=K -MEGA=M -GIGA=G diff --git a/application/basilisk/locales/jar.mn b/application/basilisk/locales/jar.mn index 9a847c7ed..345c0525a 100644 --- a/application/basilisk/locales/jar.mn +++ b/application/basilisk/locales/jar.mn @@ -7,12 +7,10 @@ @AB_CD@.jar: % locale browser @AB_CD@ %locale/browser/ * locale/browser/bookmarks.html (generic/profile/bookmarks.html.in) - locale/browser/aboutAccounts.dtd (%chrome/browser/aboutAccounts.dtd) locale/browser/aboutDialog.dtd (%chrome/browser/aboutDialog.dtd) locale/browser/aboutPrivateBrowsing.dtd (%chrome/browser/aboutPrivateBrowsing.dtd) locale/browser/aboutPrivateBrowsing.properties (%chrome/browser/aboutPrivateBrowsing.properties) - locale/browser/aboutRobots.dtd (%chrome/browser/aboutRobots.dtd) - locale/browser/aboutHome.dtd (%chrome/browser/aboutHome.dtd) +* locale/browser/aboutHome.dtd (%chrome/browser/aboutHome.dtd) locale/browser/accounts.properties (%chrome/browser/accounts.properties) #ifdef MOZ_SERVICES_HEALTHREPORT locale/browser/aboutHealthReport.dtd (%chrome/browser/aboutHealthReport.dtd) @@ -21,8 +19,7 @@ locale/browser/aboutSessionRestore.dtd (%chrome/browser/aboutSessionRestore.dtd) locale/browser/aboutTabCrashed.dtd (%chrome/browser/aboutTabCrashed.dtd) locale/browser/syncCustomize.dtd (%chrome/browser/syncCustomize.dtd) - locale/browser/aboutSyncTabs.dtd (%chrome/browser/aboutSyncTabs.dtd) - locale/browser/browser.dtd (%chrome/browser/browser.dtd) +* locale/browser/browser.dtd (%chrome/browser/browser.dtd) locale/browser/baseMenuOverlay.dtd (%chrome/browser/baseMenuOverlay.dtd) locale/browser/browser.properties (%chrome/browser/browser.properties) locale/browser/customizableui/customizableWidgets.properties (%chrome/browser/customizableui/customizableWidgets.properties) @@ -42,8 +39,6 @@ locale/browser/shellservice.properties (%chrome/browser/shellservice.properties) locale/browser/tabbrowser.properties (%chrome/browser/tabbrowser.properties) locale/browser/taskbar.properties (%chrome/browser/taskbar.properties) - locale/browser/translation.dtd (%chrome/browser/translation.dtd) - locale/browser/translation.properties (%chrome/browser/translation.properties) locale/browser/webrtcIndicator.properties (%chrome/browser/webrtcIndicator.properties) locale/browser/downloads/downloads.dtd (%chrome/browser/downloads/downloads.dtd) locale/browser/downloads/downloads.properties (%chrome/browser/downloads/downloads.properties) @@ -81,14 +76,14 @@ locale/browser/preferences/permissions.dtd (%chrome/browser/preferences/permissions.dtd) locale/browser/preferences/preferences.dtd (%chrome/browser/preferences/preferences.dtd) locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties) - locale/browser/preferences/containers.properties (%chrome/browser/preferences/containers.properties) * locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd) locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd) - locale/browser/preferences/containers.dtd (%chrome/browser/preferences/containers.dtd) +#ifdef MOZ_SERVICES_SYNC locale/browser/preferences/sync.dtd (%chrome/browser/preferences/sync.dtd) +#endif locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd) locale/browser/preferences/search.dtd (%chrome/browser/preferences/search.dtd) - locale/browser/preferences/translation.dtd (%chrome/browser/preferences/translation.dtd) +#ifdef MOZ_SERVICES_SYNC locale/browser/syncBrand.dtd (%chrome/browser/syncBrand.dtd) locale/browser/syncSetup.dtd (%chrome/browser/syncSetup.dtd) locale/browser/syncSetup.properties (%chrome/browser/syncSetup.properties) @@ -96,6 +91,9 @@ locale/browser/syncKey.dtd (%chrome/browser/syncKey.dtd) locale/browser/syncQuota.dtd (%chrome/browser/syncQuota.dtd) locale/browser/syncQuota.properties (%chrome/browser/syncQuota.properties) + locale/browser/syncProgress.dtd (%chrome/browser/syncProgress.dtd) + locale/browser/aboutSyncTabs.dtd (%chrome/browser/aboutSyncTabs.dtd) +#endif % resource search-plugins chrome://browser/locale/searchplugins/ #if BUILD_FASTER locale/browser/searchplugins/ (searchplugins/*.xml) diff --git a/application/basilisk/locales/l10n.ini b/application/basilisk/locales/l10n.ini index f1d22c259..78bafe8ca 100644 --- a/application/basilisk/locales/l10n.ini +++ b/application/basilisk/locales/l10n.ini @@ -16,7 +16,9 @@ dirs = browser # non-central apps might want to use %(topsrcdir)s here, or other vars # RFE: that needs to be supported by compare-locales, too, though toolkit = toolkit/locales/l10n.ini +#ifdef MOZ_SERVICES_SYNC services_sync = services/sync/locales/l10n.ini +#endif [extras] dirs = extensions/spellcheck diff --git a/application/basilisk/modules/AboutHome.jsm b/application/basilisk/modules/AboutHome.jsm index 639194c20..671448480 100644 --- a/application/basilisk/modules/AboutHome.jsm +++ b/application/basilisk/modules/AboutHome.jsm @@ -17,8 +17,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "AppConstants", "resource://gre/modules/AppConstants.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "AutoMigrate", "resource:///modules/AutoMigrate.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts", - "resource://gre/modules/FxAccounts.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Promise", diff --git a/application/basilisk/modules/AboutNewTab.jsm b/application/basilisk/modules/AboutNewTab.jsm index 4337c5a2d..e170e9c8a 100644 --- a/application/basilisk/modules/AboutNewTab.jsm +++ b/application/basilisk/modules/AboutNewTab.jsm @@ -33,7 +33,6 @@ var AboutNewTab = { customize: function(message) { NewTabUtils.allPages.enabled = message.data.enabled; - NewTabUtils.allPages.enhanced = message.data.enhanced; }, uninit: function() { diff --git a/application/basilisk/modules/ContentClick.jsm b/application/basilisk/modules/ContentClick.jsm index 40101d5d3..4cd665f8c 100644 --- a/application/basilisk/modules/ContentClick.jsm +++ b/application/basilisk/modules/ContentClick.jsm @@ -88,11 +88,6 @@ var ContentClick = { triggeringPrincipal: json.triggeringPrincipal, }; - // The new tab/window must use the same userContextId. - if (json.originAttributes.userContextId) { - params.userContextId = json.originAttributes.userContextId; - } - window.openLinkIn(json.href, where, params); } }; diff --git a/application/basilisk/modules/DirectoryLinksProvider.jsm b/application/basilisk/modules/DirectoryLinksProvider.jsm deleted file mode 100644 index 117564099..000000000 --- a/application/basilisk/modules/DirectoryLinksProvider.jsm +++ /dev/null @@ -1,1255 +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"; - -this.EXPORTED_SYMBOLS = ["DirectoryLinksProvider"]; - -const Ci = Components.interfaces; -const Cc = Components.classes; -const Cu = Components.utils; -const ParserUtils = Cc["@mozilla.org/parserutils;1"].getService(Ci.nsIParserUtils); - -Cu.importGlobalProperties(["XMLHttpRequest"]); - -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://gre/modules/Timer.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", - "resource://gre/modules/NetUtil.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "NewTabUtils", - "resource://gre/modules/NewTabUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "OS", - "resource://gre/modules/osfile.jsm") -XPCOMUtils.defineLazyModuleGetter(this, "Promise", - "resource://gre/modules/Promise.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils", - "resource://gre/modules/UpdateUtils.jsm"); -XPCOMUtils.defineLazyServiceGetter(this, "eTLD", - "@mozilla.org/network/effective-tld-service;1", - "nsIEffectiveTLDService"); -XPCOMUtils.defineLazyGetter(this, "gTextDecoder", () => { - return new TextDecoder(); -}); -XPCOMUtils.defineLazyGetter(this, "gCryptoHash", function () { - return Cc["@mozilla.org/security/hash;1"].createInstance(Ci.nsICryptoHash); -}); -XPCOMUtils.defineLazyGetter(this, "gUnicodeConverter", function () { - let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"] - .createInstance(Ci.nsIScriptableUnicodeConverter); - converter.charset = 'utf8'; - return converter; -}); - - -// The filename where directory links are stored locally -const DIRECTORY_LINKS_FILE = "directoryLinks.json"; -const DIRECTORY_LINKS_TYPE = "application/json"; - -// The preference that tells whether to match the OS locale -const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS"; - -// The preference that tells what locale the user selected -const PREF_SELECTED_LOCALE = "general.useragent.locale"; - -// The preference that tells where to obtain directory links -const PREF_DIRECTORY_SOURCE = "browser.newtabpage.directory.source"; - -// The preference that tells where to send click/view pings -const PREF_DIRECTORY_PING = "browser.newtabpage.directory.ping"; - -// The preference that tells if newtab is enhanced -const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced"; - -// Only allow link urls that are http(s) -const ALLOWED_LINK_SCHEMES = new Set(["http", "https"]); - -// Only allow link image urls that are https or data -const ALLOWED_IMAGE_SCHEMES = new Set(["https", "data"]); - -// Only allow urls to Mozilla's CDN or empty (for data URIs) -const ALLOWED_URL_BASE = new Set(["mozilla.net", ""]); - -// The frecency of a directory link -const DIRECTORY_FRECENCY = 1000; - -// The frecency of a suggested link -const SUGGESTED_FRECENCY = Infinity; - -// The filename where frequency cap data stored locally -const FREQUENCY_CAP_FILE = "frequencyCap.json"; - -// Default settings for daily and total frequency caps -const DEFAULT_DAILY_FREQUENCY_CAP = 3; -const DEFAULT_TOTAL_FREQUENCY_CAP = 10; - -// Default timeDelta to prune unused frequency cap objects -// currently set to 10 days in milliseconds -const DEFAULT_PRUNE_TIME_DELTA = 10*24*60*60*1000; - -// The min number of visible (not blocked) history tiles to have before showing suggested tiles -const MIN_VISIBLE_HISTORY_TILES = 8; - -// The max number of visible (not blocked) history tiles to test for inadjacency -const MAX_VISIBLE_HISTORY_TILES = 15; - -// Allowed ping actions remotely stored as columns: case-insensitive [a-z0-9_] -const PING_ACTIONS = ["block", "click", "pin", "sponsored", "sponsored_link", "unpin", "view"]; - -// Location of inadjacent sites json -const INADJACENCY_SOURCE = "chrome://browser/content/newtab/newTab.inadjacent.json"; - -// Fake URL to keep track of last block of a suggested tile in the frequency cap object -const FAKE_SUGGESTED_BLOCK_URL = "ignore://suggested_block"; - -// Time before suggested tile is allowed to play again after block - default to 1 day -const AFTER_SUGGESTED_BLOCK_DECAY_TIME = 24*60*60*1000; - -/** - * Singleton that serves as the provider of directory links. - * Directory links are a hard-coded set of links shown if a user's link - * inventory is empty. - */ -var DirectoryLinksProvider = { - - __linksURL: null, - - _observers: new Set(), - - // links download deferred, resolved upon download completion - _downloadDeferred: null, - - // download default interval is 24 hours in milliseconds - _downloadIntervalMS: 86400000, - - /** - * A mapping from eTLD+1 to an enhanced link objects - */ - _enhancedLinks: new Map(), - - /** - * A mapping from site to a list of suggested link objects - */ - _suggestedLinks: new Map(), - - /** - * Frequency Cap object - maintains daily and total tile counts, and frequency cap settings - */ - _frequencyCaps: {}, - - /** - * A set of top sites that we can provide suggested links for - */ - _topSitesWithSuggestedLinks: new Set(), - - /** - * lookup Set of inadjacent domains - */ - _inadjacentSites: new Set(), - - /** - * This flag is set if there is a suggested tile configured to avoid - * inadjacent sites in new tab - */ - _avoidInadjacentSites: false, - - /** - * This flag is set if _avoidInadjacentSites is true and there is - * an inadjacent site in the new tab - */ - _newTabHasInadjacentSite: false, - - get _observedPrefs() { - return Object.freeze({ - enhanced: PREF_NEWTAB_ENHANCED, - linksURL: PREF_DIRECTORY_SOURCE, - matchOSLocale: PREF_MATCH_OS_LOCALE, - prefSelectedLocale: PREF_SELECTED_LOCALE, - }); - }, - - get _linksURL() { - if (!this.__linksURL) { - try { - this.__linksURL = Services.prefs.getCharPref(this._observedPrefs["linksURL"]); - this.__linksURLModified = Services.prefs.prefHasUserValue(this._observedPrefs["linksURL"]); - } - catch (e) { - Cu.reportError("Error fetching directory links url from prefs: " + e); - } - } - return this.__linksURL; - }, - - /** - * Gets the currently selected locale for display. - * @return the selected locale or "en-US" if none is selected - */ - get locale() { - let matchOS; - try { - matchOS = Services.prefs.getBoolPref(PREF_MATCH_OS_LOCALE); - } - catch (e) {} - - if (matchOS) { - return Services.locale.getLocaleComponentForUserAgent(); - } - - try { - let locale = Services.prefs.getComplexValue(PREF_SELECTED_LOCALE, - Ci.nsIPrefLocalizedString); - if (locale) { - return locale.data; - } - } - catch (e) {} - - try { - return Services.prefs.getCharPref(PREF_SELECTED_LOCALE); - } - catch (e) {} - - return "en-US"; - }, - - /** - * Set appropriate default ping behavior controlled by enhanced pref - */ - _setDefaultEnhanced: function DirectoryLinksProvider_setDefaultEnhanced() { - if (!Services.prefs.prefHasUserValue(PREF_NEWTAB_ENHANCED)) { - let enhanced = Services.prefs.getBoolPref(PREF_NEWTAB_ENHANCED); - try { - // Default to not enhanced if DNT is set to tell websites to not track - if (Services.prefs.getBoolPref("privacy.donottrackheader.enabled")) { - enhanced = false; - } - } - catch (ex) {} - Services.prefs.setBoolPref(PREF_NEWTAB_ENHANCED, enhanced); - } - }, - - observe: function DirectoryLinksProvider_observe(aSubject, aTopic, aData) { - if (aTopic == "nsPref:changed") { - switch (aData) { - // Re-set the default in case the user clears the pref - case this._observedPrefs.enhanced: - this._setDefaultEnhanced(); - break; - - case this._observedPrefs.linksURL: - delete this.__linksURL; - // fallthrough - - // Force directory download on changes to fetch related prefs - case this._observedPrefs.matchOSLocale: - case this._observedPrefs.prefSelectedLocale: - this._fetchAndCacheLinksIfNecessary(true); - break; - } - } - }, - - _addPrefsObserver: function DirectoryLinksProvider_addObserver() { - for (let pref in this._observedPrefs) { - let prefName = this._observedPrefs[pref]; - Services.prefs.addObserver(prefName, this, false); - } - }, - - _removePrefsObserver: function DirectoryLinksProvider_removeObserver() { - for (let pref in this._observedPrefs) { - let prefName = this._observedPrefs[pref]; - Services.prefs.removeObserver(prefName, this); - } - }, - - _cacheSuggestedLinks: function(link) { - // Don't cache links that don't have the expected 'frecent_sites' - if (!link.frecent_sites) { - return; - } - - for (let suggestedSite of link.frecent_sites) { - let suggestedMap = this._suggestedLinks.get(suggestedSite) || new Map(); - suggestedMap.set(link.url, link); - this._setupStartEndTime(link); - this._suggestedLinks.set(suggestedSite, suggestedMap); - } - }, - - _fetchAndCacheLinks: function DirectoryLinksProvider_fetchAndCacheLinks(uri) { - // Replace with the same display locale used for selecting links data - uri = uri.replace("%LOCALE%", this.locale); - uri = uri.replace("%CHANNEL%", UpdateUtils.UpdateChannel); - - return this._downloadJsonData(uri).then(json => { - return OS.File.writeAtomic(this._directoryFilePath, json, {tmpPath: this._directoryFilePath + ".tmp"}); - }); - }, - - /** - * Downloads a links with json content - * @param download uri - * @return promise resolved to json string, "{}" returned if status != 200 - */ - _downloadJsonData: function DirectoryLinksProvider__downloadJsonData(uri) { - let deferred = Promise.defer(); - let xmlHttp = this._newXHR(); - - xmlHttp.onload = function(aResponse) { - let json = this.responseText; - if (this.status && this.status != 200) { - json = "{}"; - } - deferred.resolve(json); - }; - - xmlHttp.onerror = function(e) { - deferred.reject("Fetching " + uri + " results in error code: " + e.target.status); - }; - - try { - xmlHttp.open("GET", uri); - // Override the type so XHR doesn't complain about not well-formed XML - xmlHttp.overrideMimeType(DIRECTORY_LINKS_TYPE); - // Set the appropriate request type for servers that require correct types - xmlHttp.setRequestHeader("Content-Type", DIRECTORY_LINKS_TYPE); - xmlHttp.send(); - } catch (e) { - deferred.reject("Error fetching " + uri); - Cu.reportError(e); - } - return deferred.promise; - }, - - /** - * Downloads directory links if needed - * @return promise resolved immediately if no download needed, or upon completion - */ - _fetchAndCacheLinksIfNecessary: function DirectoryLinksProvider_fetchAndCacheLinksIfNecessary(forceDownload=false) { - if (this._downloadDeferred) { - // fetching links already - just return the promise - return this._downloadDeferred.promise; - } - - if (forceDownload || this._needsDownload) { - this._downloadDeferred = Promise.defer(); - this._fetchAndCacheLinks(this._linksURL).then(() => { - // the new file was successfully downloaded and cached, so update a timestamp - this._lastDownloadMS = Date.now(); - this._downloadDeferred.resolve(); - this._downloadDeferred = null; - this._callObservers("onManyLinksChanged") - }, - error => { - this._downloadDeferred.resolve(); - this._downloadDeferred = null; - this._callObservers("onDownloadFail"); - }); - return this._downloadDeferred.promise; - } - - // download is not needed - return Promise.resolve(); - }, - - /** - * @return true if download is needed, false otherwise - */ - get _needsDownload () { - // fail if last download occured less then 24 hours ago - if ((Date.now() - this._lastDownloadMS) > this._downloadIntervalMS) { - return true; - } - return false; - }, - - /** - * Create a new XMLHttpRequest that is anonymous, i.e., doesn't send cookies - */ - _newXHR() { - return new XMLHttpRequest({mozAnon: true}); - }, - - /** - * Reads directory links file and parses its content - * @return a promise resolved to an object with keys 'directory' and 'suggested', - * each containing a valid list of links, - * or {'directory': [], 'suggested': []} if read or parse fails. - */ - _readDirectoryLinksFile: function DirectoryLinksProvider_readDirectoryLinksFile() { - let emptyOutput = {directory: [], suggested: [], enhanced: []}; - return OS.File.read(this._directoryFilePath).then(binaryData => { - let output; - try { - let json = gTextDecoder.decode(binaryData); - let linksObj = JSON.parse(json); - output = {directory: linksObj.directory || [], - suggested: linksObj.suggested || [], - enhanced: linksObj.enhanced || []}; - } - catch (e) { - Cu.reportError(e); - } - return output || emptyOutput; - }, - error => { - Cu.reportError(error); - return emptyOutput; - }); - }, - - /** - * Translates link.time_limits to UTC miliseconds and sets - * link.startTime and link.endTime properties in link object - */ - _setupStartEndTime: function DirectoryLinksProvider_setupStartEndTime(link) { - // set start/end limits. Use ISO_8601 format: '2014-01-10T20:20:20.600Z' - // (details here http://en.wikipedia.org/wiki/ISO_8601) - // Note that if timezone is missing, FX will interpret as local time - // meaning that the server can sepecify any time, but if the capmaign - // needs to start at same time across multiple timezones, the server - // omits timezone indicator - if (!link.time_limits) { - return; - } - - let parsedTime; - if (link.time_limits.start) { - parsedTime = Date.parse(link.time_limits.start); - if (parsedTime && !isNaN(parsedTime)) { - link.startTime = parsedTime; - } - } - if (link.time_limits.end) { - parsedTime = Date.parse(link.time_limits.end); - if (parsedTime && !isNaN(parsedTime)) { - link.endTime = parsedTime; - } - } - }, - - /* - * Handles campaign timeout - */ - _onCampaignTimeout: function DirectoryLinksProvider_onCampaignTimeout() { - // _campaignTimeoutID is invalid here, so just set it to null - this._campaignTimeoutID = null; - this._updateSuggestedTile(); - }, - - /* - * Clears capmpaign timeout - */ - _clearCampaignTimeout: function DirectoryLinksProvider_clearCampaignTimeout() { - if (this._campaignTimeoutID) { - clearTimeout(this._campaignTimeoutID); - this._campaignTimeoutID = null; - } - }, - - /** - * Setup capmpaign timeout to recompute suggested tiles upon - * reaching soonest start or end time for the campaign - * @param timeout in milliseconds - */ - _setupCampaignTimeCheck: function DirectoryLinksProvider_setupCampaignTimeCheck(timeout) { - // sanity check - if (!timeout || timeout <= 0) { - return; - } - this._clearCampaignTimeout(); - // setup next timeout - this._campaignTimeoutID = setTimeout(this._onCampaignTimeout.bind(this), timeout); - }, - - /** - * Test link for campaign time limits: checks if link falls within start/end time - * and returns an object containing a use flag and the timeoutDate milliseconds - * when the link has to be re-checked for campaign start-ready or end-reach - * @param link - * @return object {use: true or false, timeoutDate: milliseconds or null} - */ - _testLinkForCampaignTimeLimits: function DirectoryLinksProvider_testLinkForCampaignTimeLimits(link) { - let currentTime = Date.now(); - // test for start time first - if (link.startTime && link.startTime > currentTime) { - // not yet ready for start - return {use: false, timeoutDate: link.startTime}; - } - // otherwise check for end time - if (link.endTime) { - // passed end time - if (link.endTime <= currentTime) { - return {use: false}; - } - // otherwise link is still ok, but we need to set timeoutDate - return {use: true, timeoutDate: link.endTime}; - } - // if we are here, the link is ok and no timeoutDate needed - return {use: true}; - }, - - /** - * Handles block on suggested tile: updates fake block url with current timestamp - */ - handleSuggestedTileBlock: function DirectoryLinksProvider_handleSuggestedTileBlock() { - this._updateFrequencyCapSettings({url: FAKE_SUGGESTED_BLOCK_URL}); - this._writeFrequencyCapFile(); - this._updateSuggestedTile(); - }, - - /** - * Checks if suggested tile is being blocked for the rest of "decay time" - * @return True if blocked, false otherwise - */ - _isSuggestedTileBlocked: function DirectoryLinksProvider__isSuggestedTileBlocked() { - let capObject = this._frequencyCaps[FAKE_SUGGESTED_BLOCK_URL]; - if (!capObject || !capObject.lastUpdated) { - // user never blocked suggested tile or lastUpdated is missing - return false; - } - // otherwise, make sure that enough time passed after suggested tile was blocked - return (capObject.lastUpdated + AFTER_SUGGESTED_BLOCK_DECAY_TIME) > Date.now(); - }, - - /** - * Report some action on a newtab page (view, click) - * @param sites Array of sites shown on newtab page - * @param action String of the behavior to report - * @param triggeringSiteIndex optional Int index of the site triggering action - * @return download promise - */ - reportSitesAction: function DirectoryLinksProvider_reportSitesAction(sites, action, triggeringSiteIndex) { - // Check if the suggested tile was shown - if (action == "view") { - sites.slice(0, triggeringSiteIndex + 1).filter(s => s).forEach(site => { - let {targetedSite, url} = site.link; - if (targetedSite) { - this._addFrequencyCapView(url); - } - }); - } - // any click action on a suggested tile should stop that tile suggestion - // click/block - user either removed a tile or went to a landing page - // pin - tile turned into history tile, should no longer be suggested - // unpin - the tile was pinned before, should not matter - else { - // suggested tile has targetedSite, or frecent_sites if it was pinned - let {frecent_sites, targetedSite, url} = sites[triggeringSiteIndex].link; - if (frecent_sites || targetedSite) { - this._setFrequencyCapClick(url); - } - } - - let newtabEnhanced = false; - let pingEndPoint = ""; - try { - newtabEnhanced = Services.prefs.getBoolPref(PREF_NEWTAB_ENHANCED); - pingEndPoint = Services.prefs.getCharPref(PREF_DIRECTORY_PING); - } - catch (ex) {} - - // Bug 1240245 - We no longer send pings, but frequency capping and fetching - // tests depend on the following actions, so references to PING remain. - let invalidAction = PING_ACTIONS.indexOf(action) == -1; - if (!newtabEnhanced || pingEndPoint == "" || invalidAction) { - return Promise.resolve(); - } - - return Task.spawn(function* () { - // since we updated views/clicks we need write _frequencyCaps to disk - yield this._writeFrequencyCapFile(); - // Use this as an opportunity to potentially fetch new links - yield this._fetchAndCacheLinksIfNecessary(); - }.bind(this)); - }, - - /** - * Get the enhanced link object for a link (whether history or directory) - */ - getEnhancedLink: function DirectoryLinksProvider_getEnhancedLink(link) { - // Use the provided link if it's already enhanced - return link.enhancedImageURI && link ? link : - this._enhancedLinks.get(NewTabUtils.extractSite(link.url)); - }, - - /** - * Check if a url's scheme is in a Set of allowed schemes and if the base - * domain is allowed. - * @param url to check - * @param allowed Set of allowed schemes - * @param checkBase boolean to check the base domain - */ - isURLAllowed(url, allowed, checkBase) { - // Assume no url is an allowed url - if (!url) { - return true; - } - - let scheme = "", base = ""; - try { - // A malformed url will not be allowed - let uri = Services.io.newURI(url, null, null); - scheme = uri.scheme; - - // URIs without base domains will be allowed - base = Services.eTLD.getBaseDomain(uri); - } - catch (ex) {} - // Require a scheme match and the base only if desired - return allowed.has(scheme) && (!checkBase || ALLOWED_URL_BASE.has(base)); - }, - - _escapeChars(text) { - let charMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - return text.replace(/[&<>"']/g, (character) => charMap[character]); - }, - - /** - * Gets the current set of directory links. - * @param aCallback The function that the array of links is passed to. - */ - getLinks: function DirectoryLinksProvider_getLinks(aCallback) { - this._readDirectoryLinksFile().then(rawLinks => { - // Reset the cache of suggested tiles and enhanced images for this new set of links - this._enhancedLinks.clear(); - this._suggestedLinks.clear(); - this._clearCampaignTimeout(); - this._avoidInadjacentSites = false; - - // Only check base domain for images when using the default pref - let checkBase = !this.__linksURLModified; - let validityFilter = function(link) { - // Make sure the link url is allowed and images too if they exist - return this.isURLAllowed(link.url, ALLOWED_LINK_SCHEMES, false) && - (!link.imageURI || - this.isURLAllowed(link.imageURI, ALLOWED_IMAGE_SCHEMES, checkBase)) && - (!link.enhancedImageURI || - this.isURLAllowed(link.enhancedImageURI, ALLOWED_IMAGE_SCHEMES, checkBase)); - }.bind(this); - - rawLinks.suggested.filter(validityFilter).forEach((link, position) => { - // Suggested sites must have an adgroup name. - if (!link.adgroup_name) { - return; - } - - let sanitizeFlags = ParserUtils.SanitizerCidEmbedsOnly | - ParserUtils.SanitizerDropForms | - ParserUtils.SanitizerDropNonCSSPresentation; - - link.explanation = this._escapeChars(link.explanation ? ParserUtils.convertToPlainText(link.explanation, sanitizeFlags, 0) : ""); - link.targetedName = this._escapeChars(ParserUtils.convertToPlainText(link.adgroup_name, sanitizeFlags, 0)); - link.lastVisitDate = rawLinks.suggested.length - position; - // check if link wants to avoid inadjacent sites - if (link.check_inadjacency) { - this._avoidInadjacentSites = true; - } - - // We cache suggested tiles here but do not push any of them in the links list yet. - // The decision for which suggested tile to include will be made separately. - this._cacheSuggestedLinks(link); - this._updateFrequencyCapSettings(link); - }); - - rawLinks.enhanced.filter(validityFilter).forEach((link, position) => { - link.lastVisitDate = rawLinks.enhanced.length - position; - - // Stash the enhanced image for the site - if (link.enhancedImageURI) { - this._enhancedLinks.set(NewTabUtils.extractSite(link.url), link); - } - }); - - let links = rawLinks.directory.filter(validityFilter).map((link, position) => { - link.lastVisitDate = rawLinks.directory.length - position; - link.frecency = DIRECTORY_FRECENCY; - return link; - }); - - // Allow for one link suggestion on top of the default directory links - this.maxNumLinks = links.length + 1; - - // prune frequency caps of outdated urls - this._pruneFrequencyCapUrls(); - // write frequency caps object to disk asynchronously - this._writeFrequencyCapFile(); - - return links; - }).catch(ex => { - Cu.reportError(ex); - return []; - }).then(links => { - aCallback(links); - this._populatePlacesLinks(); - }); - }, - - init: function DirectoryLinksProvider_init() { - this._setDefaultEnhanced(); - this._addPrefsObserver(); - // setup directory file path and last download timestamp - this._directoryFilePath = OS.Path.join(OS.Constants.Path.localProfileDir, DIRECTORY_LINKS_FILE); - this._lastDownloadMS = 0; - - // setup frequency cap file path - this._frequencyCapFilePath = OS.Path.join(OS.Constants.Path.localProfileDir, FREQUENCY_CAP_FILE); - // setup inadjacent sites URL - this._inadjacentSitesUrl = INADJACENCY_SOURCE; - - NewTabUtils.placesProvider.addObserver(this); - NewTabUtils.links.addObserver(this); - - return Task.spawn(function*() { - // get the last modified time of the links file if it exists - let doesFileExists = yield OS.File.exists(this._directoryFilePath); - if (doesFileExists) { - let fileInfo = yield OS.File.stat(this._directoryFilePath); - this._lastDownloadMS = Date.parse(fileInfo.lastModificationDate); - } - // read frequency cap file - yield this._readFrequencyCapFile(); - // fetch directory on startup without force - yield this._fetchAndCacheLinksIfNecessary(); - // fecth inadjacent sites on startup - yield this._loadInadjacentSites(); - }.bind(this)); - }, - - _handleManyLinksChanged: function() { - this._topSitesWithSuggestedLinks.clear(); - this._suggestedLinks.forEach((suggestedLinks, site) => { - if (NewTabUtils.isTopPlacesSite(site)) { - this._topSitesWithSuggestedLinks.add(site); - } - }); - this._updateSuggestedTile(); - }, - - /** - * Updates _topSitesWithSuggestedLinks based on the link that was changed. - * - * @return true if _topSitesWithSuggestedLinks was modified, false otherwise. - */ - _handleLinkChanged: function(aLink) { - let changedLinkSite = NewTabUtils.extractSite(aLink.url); - let linkStored = this._topSitesWithSuggestedLinks.has(changedLinkSite); - - if (!NewTabUtils.isTopPlacesSite(changedLinkSite) && linkStored) { - this._topSitesWithSuggestedLinks.delete(changedLinkSite); - return true; - } - - if (this._suggestedLinks.has(changedLinkSite) && - NewTabUtils.isTopPlacesSite(changedLinkSite) && !linkStored) { - this._topSitesWithSuggestedLinks.add(changedLinkSite); - return true; - } - - // always run _updateSuggestedTile if aLink is inadjacent - // and there are tiles configured to avoid it - if (this._avoidInadjacentSites && this._isInadjacentLink(aLink)) { - return true; - } - - return false; - }, - - _populatePlacesLinks: function () { - NewTabUtils.links.populateProviderCache(NewTabUtils.placesProvider, () => { - this._handleManyLinksChanged(); - }); - }, - - onDeleteURI: function(aProvider, aLink) { - let {url} = aLink; - // remove clicked flag for that url and - // call observer upon disk write completion - this._removeTileClick(url).then(() => { - this._callObservers("onDeleteURI", url); - }); - }, - - onClearHistory: function() { - // remove all clicked flags and call observers upon file write - this._removeAllTileClicks().then(() => { - this._callObservers("onClearHistory"); - }); - }, - - onLinkChanged: function (aProvider, aLink) { - // Make sure NewTabUtils.links handles the notification first. - setTimeout(() => { - if (this._handleLinkChanged(aLink) || this._shouldUpdateSuggestedTile()) { - this._updateSuggestedTile(); - } - }, 0); - }, - - onManyLinksChanged: function () { - // Make sure NewTabUtils.links handles the notification first. - setTimeout(() => { - this._handleManyLinksChanged(); - }, 0); - }, - - _getCurrentTopSiteCount: function() { - let visibleTopSiteCount = 0; - let newTabLinks = NewTabUtils.links.getLinks(); - for (let link of newTabLinks.slice(0, MIN_VISIBLE_HISTORY_TILES)) { - // compute visibleTopSiteCount for suggested tiles - if (link && (link.type == "history" || link.type == "enhanced")) { - visibleTopSiteCount++; - } - } - // since newTabLinks are available, set _newTabHasInadjacentSite here - // note that _shouldUpdateSuggestedTile is called by _updateSuggestedTile - this._newTabHasInadjacentSite = this._avoidInadjacentSites && this._checkForInadjacentSites(newTabLinks); - - return visibleTopSiteCount; - }, - - _shouldUpdateSuggestedTile: function() { - let sortedLinks = NewTabUtils.getProviderLinks(this); - - let mostFrecentLink = {}; - if (sortedLinks && sortedLinks.length) { - mostFrecentLink = sortedLinks[0] - } - - let currTopSiteCount = this._getCurrentTopSiteCount(); - if ((!mostFrecentLink.targetedSite && currTopSiteCount >= MIN_VISIBLE_HISTORY_TILES) || - (mostFrecentLink.targetedSite && currTopSiteCount < MIN_VISIBLE_HISTORY_TILES)) { - // If mostFrecentLink has a targetedSite then mostFrecentLink is a suggested link. - // If we have enough history links (8+) to show a suggested tile and we are not - // already showing one, then we should update (to *attempt* to add a suggested tile). - // OR if we don't have enough history to show a suggested tile (<8) and we are - // currently showing one, we should update (to remove it). - return true; - } - - return false; - }, - - /** - * Chooses and returns a suggested tile based on a user's top sites - * that we have an available suggested tile for. - * - * @return the chosen suggested tile, or undefined if there isn't one - */ - _updateSuggestedTile: function() { - let sortedLinks = NewTabUtils.getProviderLinks(this); - - if (!sortedLinks) { - // If NewTabUtils.links.resetCache() is called before getting here, - // sortedLinks may be undefined. - return undefined; - } - - // Delete the current suggested tile, if one exists. - let initialLength = sortedLinks.length; - if (initialLength) { - let mostFrecentLink = sortedLinks[0]; - if (mostFrecentLink.targetedSite) { - this._callObservers("onLinkChanged", { - url: mostFrecentLink.url, - frecency: SUGGESTED_FRECENCY, - lastVisitDate: mostFrecentLink.lastVisitDate, - type: mostFrecentLink.type, - }, 0, true); - } - } - - if (this._topSitesWithSuggestedLinks.size == 0 || - !this._shouldUpdateSuggestedTile() || - this._isSuggestedTileBlocked()) { - // There are no potential suggested links we can show or not - // enough history for a suggested tile, or suggested tile was - // recently blocked and wait time interval has not decayed yet - return undefined; - } - - // Create a flat list of all possible links we can show as suggested. - // Note that many top sites may map to the same suggested links, but we only - // want to count each suggested link once (based on url), thus possibleLinks is a map - // from url to suggestedLink. Thus, each link has an equal chance of being chosen at - // random from flattenedLinks if it appears only once. - let nextTimeout; - let possibleLinks = new Map(); - let targetedSites = new Map(); - this._topSitesWithSuggestedLinks.forEach(topSiteWithSuggestedLink => { - let suggestedLinksMap = this._suggestedLinks.get(topSiteWithSuggestedLink); - suggestedLinksMap.forEach((suggestedLink, url) => { - // Skip this link if we've shown it too many times already - if (!this._testFrequencyCapLimits(url)) { - return; - } - - // as we iterate suggestedLinks, check for campaign start/end - // time limits, and set nextTimeout to the closest timestamp - let {use, timeoutDate} = this._testLinkForCampaignTimeLimits(suggestedLink); - // update nextTimeout is necessary - if (timeoutDate && (!nextTimeout || nextTimeout > timeoutDate)) { - nextTimeout = timeoutDate; - } - // Skip link if it falls outside campaign time limits - if (!use) { - return; - } - - // Skip link if it avoids inadjacent sites and newtab has one - if (suggestedLink.check_inadjacency && this._newTabHasInadjacentSite) { - return; - } - - possibleLinks.set(url, suggestedLink); - - // Keep a map of URL to targeted sites. We later use this to show the user - // what site they visited to trigger this suggestion. - if (!targetedSites.get(url)) { - targetedSites.set(url, []); - } - targetedSites.get(url).push(topSiteWithSuggestedLink); - }) - }); - - // setup timeout check for starting or ending campaigns - if (nextTimeout) { - this._setupCampaignTimeCheck(nextTimeout - Date.now()); - } - - // We might have run out of possible links to show - let numLinks = possibleLinks.size; - if (numLinks == 0) { - return undefined; - } - - let flattenedLinks = [...possibleLinks.values()]; - - // Choose our suggested link at random - let suggestedIndex = Math.floor(Math.random() * numLinks); - let chosenSuggestedLink = flattenedLinks[suggestedIndex]; - - // Add the suggested link to the front with some extra values - this._callObservers("onLinkChanged", Object.assign({ - frecency: SUGGESTED_FRECENCY, - - // Choose the first site a user has visited as the target. In the future, - // this should be the site with the highest frecency. However, we currently - // store frecency by URL not by site. - targetedSite: targetedSites.get(chosenSuggestedLink.url).length ? - targetedSites.get(chosenSuggestedLink.url)[0] : null - }, chosenSuggestedLink)); - return chosenSuggestedLink; - }, - - /** - * Loads inadjacent sites - * @return a promise resolved when lookup Set for sites is built - */ - _loadInadjacentSites: function DirectoryLinksProvider_loadInadjacentSites() { - return this._downloadJsonData(this._inadjacentSitesUrl).then(jsonString => { - let jsonObject = {}; - try { - jsonObject = JSON.parse(jsonString); - } - catch (e) { - Cu.reportError(e); - } - - this._inadjacentSites = new Set(jsonObject.domains); - }); - }, - - /** - * Genegrates hash suitable for looking up inadjacent site - * @param value to hsh - * @return hased value, base64-ed - */ - _generateHash: function DirectoryLinksProvider_generateHash(value) { - let byteArr = gUnicodeConverter.convertToByteArray(value); - gCryptoHash.init(gCryptoHash.MD5); - gCryptoHash.update(byteArr, byteArr.length); - return gCryptoHash.finish(true); - }, - - /** - * Checks if link belongs to inadjacent domain - * @param link to check - * @return true for inadjacent domains, false otherwise - */ - _isInadjacentLink: function DirectoryLinksProvider_isInadjacentLink(link) { - let baseDomain = link.baseDomain || NewTabUtils.extractSite(link.url || ""); - if (!baseDomain) { - return false; - } - // check if hashed domain is inadjacent - return this._inadjacentSites.has(this._generateHash(baseDomain)); - }, - - /** - * Checks if new tab has inadjacent site - * @param new tab links (or nothing, in which case NewTabUtils.links.getLinks() is called - * @return true if new tab shows has inadjacent site - */ - _checkForInadjacentSites: function DirectoryLinksProvider_checkForInadjacentSites(newTabLink) { - let links = newTabLink || NewTabUtils.links.getLinks(); - for (let link of links.slice(0, MAX_VISIBLE_HISTORY_TILES)) { - // check links against inadjacent list - specifically include ALL link types - if (this._isInadjacentLink(link)) { - return true; - } - } - return false; - }, - - /** - * Reads json file, parses its content, and returns resulting object - * @param json file path - * @param json object to return in case file read or parse fails - * @return a promise resolved to a valid object or undefined upon error - */ - _readJsonFile: Task.async(function* (filePath, nullObject) { - let jsonObj; - try { - let binaryData = yield OS.File.read(filePath); - let json = gTextDecoder.decode(binaryData); - jsonObj = JSON.parse(json); - } - catch (e) {} - return jsonObj || nullObject; - }), - - /** - * Loads frequency cap object from file and parses its content - * @return a promise resolved upon load completion - * on error or non-exstent file _frequencyCaps is set to empty object - */ - _readFrequencyCapFile: Task.async(function* () { - // set _frequencyCaps object to file's content or empty object - this._frequencyCaps = yield this._readJsonFile(this._frequencyCapFilePath, {}); - }), - - /** - * Saves frequency cap object to file - * @return a promise resolved upon file i/o completion - */ - _writeFrequencyCapFile: function DirectoryLinksProvider_writeFrequencyCapFile() { - let json = JSON.stringify(this._frequencyCaps || {}); - return OS.File.writeAtomic(this._frequencyCapFilePath, json, {tmpPath: this._frequencyCapFilePath + ".tmp"}); - }, - - /** - * Clears frequency cap object and writes empty json to file - * @return a promise resolved upon file i/o completion - */ - _clearFrequencyCap: function DirectoryLinksProvider_clearFrequencyCap() { - this._frequencyCaps = {}; - return this._writeFrequencyCapFile(); - }, - - /** - * updates frequency cap configuration for a link - */ - _updateFrequencyCapSettings: function DirectoryLinksProvider_updateFrequencyCapSettings(link) { - let capsObject = this._frequencyCaps[link.url]; - if (!capsObject) { - // create an object with empty counts - capsObject = { - dailyViews: 0, - totalViews: 0, - lastShownDate: 0, - }; - this._frequencyCaps[link.url] = capsObject; - } - // set last updated timestamp - capsObject.lastUpdated = Date.now(); - // check for link configuration - if (link.frequency_caps) { - capsObject.dailyCap = link.frequency_caps.daily || DEFAULT_DAILY_FREQUENCY_CAP; - capsObject.totalCap = link.frequency_caps.total || DEFAULT_TOTAL_FREQUENCY_CAP; - } - else { - // fallback to defaults - capsObject.dailyCap = DEFAULT_DAILY_FREQUENCY_CAP; - capsObject.totalCap = DEFAULT_TOTAL_FREQUENCY_CAP; - } - }, - - /** - * Prunes frequency cap objects for outdated links - * @param timeDetla milliseconds - * all cap objects with lastUpdated less than (now() - timeDelta) - * will be removed. This is done to remove frequency cap objects - * for unused tile urls - */ - _pruneFrequencyCapUrls: function DirectoryLinksProvider_pruneFrequencyCapUrls(timeDelta = DEFAULT_PRUNE_TIME_DELTA) { - let timeThreshold = Date.now() - timeDelta; - Object.keys(this._frequencyCaps).forEach(url => { - // remove url if it is not ignorable and wasn't updated for a while - if (!url.startsWith("ignore") && this._frequencyCaps[url].lastUpdated <= timeThreshold) { - delete this._frequencyCaps[url]; - } - }); - }, - - /** - * Checks if supplied timestamp happened today - * @param timestamp in milliseconds - * @return true if the timestamp was made today, false otherwise - */ - _wasToday: function DirectoryLinksProvider_wasToday(timestamp) { - let showOn = new Date(timestamp); - let today = new Date(); - // call timestamps identical if both day and month are same - return showOn.getDate() == today.getDate() && - showOn.getMonth() == today.getMonth() && - showOn.getYear() == today.getYear(); - }, - - /** - * adds some number of views for a url - * @param url String url of the suggested link - */ - _addFrequencyCapView: function DirectoryLinksProvider_addFrequencyCapView(url) { - let capObject = this._frequencyCaps[url]; - // sanity check - if (!capObject) { - return; - } - - // if the day is new: reset the daily counter and lastShownDate - if (!this._wasToday(capObject.lastShownDate)) { - capObject.dailyViews = 0; - // update lastShownDate - capObject.lastShownDate = Date.now(); - } - - // bump both daily and total counters - capObject.totalViews++; - capObject.dailyViews++; - - // if any of the caps is reached - update suggested tiles - if (capObject.totalViews >= capObject.totalCap || - capObject.dailyViews >= capObject.dailyCap) { - this._updateSuggestedTile(); - } - }, - - /** - * Sets clicked flag for link url - * @param url String url of the suggested link - */ - _setFrequencyCapClick(url) { - let capObject = this._frequencyCaps[url]; - // sanity check - if (!capObject) { - return; - } - capObject.clicked = true; - // and update suggested tiles, since current tile became invalid - this._updateSuggestedTile(); - }, - - /** - * Tests frequency cap limits for link url - * @param url String url of the suggested link - * @return true if link is viewable, false otherwise - */ - _testFrequencyCapLimits: function DirectoryLinksProvider_testFrequencyCapLimits(url) { - let capObject = this._frequencyCaps[url]; - // sanity check: if url is missing - do not show this tile - if (!capObject) { - return false; - } - - // check for clicked set or total views reached - if (capObject.clicked || capObject.totalViews >= capObject.totalCap) { - return false; - } - - // otherwise check if link is over daily views limit - if (this._wasToday(capObject.lastShownDate) && - capObject.dailyViews >= capObject.dailyCap) { - return false; - } - - // we passed all cap tests: return true - return true; - }, - - /** - * Removes clicked flag from frequency cap entry for tile landing url - * @param url String url of the suggested link - * @return promise resolved upon disk write completion - */ - _removeTileClick: function DirectoryLinksProvider_removeTileClick(url = "") { - // remove trailing slash, to accomodate Places sending site urls ending with '/' - let noTrailingSlashUrl = url.replace(/\/$/, ""); - let capObject = this._frequencyCaps[url] || this._frequencyCaps[noTrailingSlashUrl]; - // return resolved promise if capObject is not found - if (!capObject) { - return Promise.resolve(); - } - // otherwise remove clicked flag - delete capObject.clicked; - return this._writeFrequencyCapFile(); - }, - - /** - * Removes all clicked flags from frequency cap object - * @return promise resolved upon disk write completion - */ - _removeAllTileClicks: function DirectoryLinksProvider_removeAllTileClicks() { - Object.keys(this._frequencyCaps).forEach(url => { - delete this._frequencyCaps[url].clicked; - }); - return this._writeFrequencyCapFile(); - }, - - /** - * Return the object to its pre-init state - */ - reset: function DirectoryLinksProvider_reset() { - delete this.__linksURL; - this._removePrefsObserver(); - this._removeObservers(); - }, - - addObserver: function DirectoryLinksProvider_addObserver(aObserver) { - this._observers.add(aObserver); - }, - - removeObserver: function DirectoryLinksProvider_removeObserver(aObserver) { - this._observers.delete(aObserver); - }, - - _callObservers(methodName, ...args) { - for (let obs of this._observers) { - if (typeof(obs[methodName]) == "function") { - try { - obs[methodName](this, ...args); - } catch (err) { - Cu.reportError(err); - } - } - } - }, - - _removeObservers: function() { - this._observers.clear(); - } -}; diff --git a/application/basilisk/modules/PermissionUI.jsm b/application/basilisk/modules/PermissionUI.jsm index 5fa0f9f06..5c8b94421 100644 --- a/application/basilisk/modules/PermissionUI.jsm +++ b/application/basilisk/modules/PermissionUI.jsm @@ -437,26 +437,12 @@ GeolocationPermissionPrompt.prototype = { }, get promptActions() { - // We collect Telemetry data on Geolocation prompts and how users - // respond to them. The probe keys are a bit verbose, so let's alias them. - const SHARE_LOCATION = - Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST_SHARE_LOCATION; - const ALWAYS_SHARE = - Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST_ALWAYS_SHARE; - const NEVER_SHARE = - Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST_NEVER_SHARE; - - let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI"); - let actions = [{ label: gBrowserBundle.GetStringFromName("geolocation.shareLocation"), accessKey: gBrowserBundle.GetStringFromName("geolocation.shareLocation.accesskey"), action: null, expireType: null, - callback: function() { - secHistogram.add(SHARE_LOCATION); - }, }]; if (!this.principal.URI.schemeIs("file")) { @@ -467,9 +453,6 @@ GeolocationPermissionPrompt.prototype = { gBrowserBundle.GetStringFromName("geolocation.alwaysShareLocation.accesskey"), action: Ci.nsIPermissionManager.ALLOW_ACTION, expireType: null, - callback: function() { - secHistogram.add(ALWAYS_SHARE); - }, }); // Never share location action. @@ -479,9 +462,6 @@ GeolocationPermissionPrompt.prototype = { gBrowserBundle.GetStringFromName("geolocation.neverShareLocation.accesskey"), action: Ci.nsIPermissionManager.DENY_ACTION, expireType: null, - callback: function() { - secHistogram.add(NEVER_SHARE); - }, }); } @@ -489,9 +469,6 @@ GeolocationPermissionPrompt.prototype = { }, onBeforeShow() { - let secHistogram = Services.telemetry.getHistogramById("SECURITY_UI"); - const SHOW_REQUEST = Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST; - secHistogram.add(SHOW_REQUEST); }, }; diff --git a/application/basilisk/modules/ProcessHangMonitor.jsm b/application/basilisk/modules/ProcessHangMonitor.jsm index e048f5b40..80c506ac7 100644 --- a/application/basilisk/modules/ProcessHangMonitor.jsm +++ b/application/basilisk/modules/ProcessHangMonitor.jsm @@ -304,19 +304,9 @@ var ProcessHangMonitor = { } }]; - if (AppConstants.MOZ_DEV_EDITION && report.hangType == report.SLOW_SCRIPT) { - buttons.push({ - label: bundle.getString("processHang.button_debug.label"), - accessKey: bundle.getString("processHang.button_debug.accessKey"), - callback: function() { - ProcessHangMonitor.debugScript(win); - } - }); - } - nb.appendNotification(bundle.getString("processHang.label"), "process-hang", - "chrome://browser/content/aboutRobots-icon.png", + "chrome://browser/skin/slowStartup-16.png", nb.PRIORITY_WARNING_HIGH, buttons); }, diff --git a/application/basilisk/modules/WindowsPreviewPerTab.jsm b/application/basilisk/modules/WindowsPreviewPerTab.jsm index 6586b5d3b..81c2f229f 100644 --- a/application/basilisk/modules/WindowsPreviewPerTab.jsm +++ b/application/basilisk/modules/WindowsPreviewPerTab.jsm @@ -597,6 +597,7 @@ TabWindow.prototype = { "file", "chrome", "resource", "about" ]), onLinkIconAvailable: function (aBrowser, aIconURL) { + let self = this; let requestURL = null; if (aIconURL) { let shouldRequestFaviconURL = true; @@ -613,15 +614,15 @@ TabWindow.prototype = { let isDefaultFavicon = !requestURL; getFaviconAsImage( requestURL, - PrivateBrowsingUtils.isWindowPrivate(this.win), + PrivateBrowsingUtils.isWindowPrivate(self.win), img => { - let index = this.tabbrowser.browsers.indexOf(aBrowser); + let index = self.tabbrowser.browsers.indexOf(aBrowser); // Only add it if we've found the index and the URI is still the same. // The tab could have closed, and there's no guarantee the icons // will have finished fetching 'in order'. if (index != -1) { - let tab = this.tabbrowser.tabs[index]; - let preview = this.previews.get(tab); + let tab = self.tabbrowser.tabs[index]; + let preview = self.previews.get(tab); if (tab.getAttribute("image") == aIconURL || (!preview.icon && isDefaultFavicon)) { preview.icon = img; diff --git a/application/basilisk/modules/moz.build b/application/basilisk/modules/moz.build index d043d4799..cd8f2ce62 100644 --- a/application/basilisk/modules/moz.build +++ b/application/basilisk/modules/moz.build @@ -16,7 +16,6 @@ EXTRA_JS_MODULES += [ 'ContentObservers.jsm', 'ContentSearch.jsm', 'ContentWebRTC.jsm', - 'DirectoryLinksProvider.jsm', 'E10SUtils.jsm', 'Feeds.jsm', 'FormSubmitObserver.jsm', diff --git a/application/basilisk/themes/linux/browser.css b/application/basilisk/themes/linux/browser.css index f9bd0bbd0..fbc5b651b 100644 --- a/application/basilisk/themes/linux/browser.css +++ b/application/basilisk/themes/linux/browser.css @@ -840,80 +840,6 @@ menuitem.bookmark-item { outline: 1px dotted -moz-DialogText; } -/* Translation infobar */ - -%include ../shared/translation/infobar.inc.css - -notification[value="translation"] { - min-height: 40px; -} - -notification[value="translation"], -notification[value="translation"] button, -notification[value="translation"] menulist { - min-height: 30px; - color: #5A5959; -} - -notification[value="translation"] { - background-color: #F2F1F0; -} - -notification[value="translation"] button, -notification[value="translation"] menulist { - padding-inline-end: 1ch; -} - -notification[value="translation"] menulist { - border: 1px solid #C1C1C1; - background-color: #FFF; -} - -notification[value="translation"] button { - border: 1px solid #C1C1C1; - background-color: #F2F1F0; -} - -notification[value="translation"] button, -notification[value="translation"] menulist, -notification[value="translation"] menulist > .menulist-label-box { - margin-inline-start: 1ch; - margin-inline-end: 1ch; -} - -notification[value="translation"] button:hover, -notification[value="translation"] button:active, -notification[value="translation"] menulist:hover, -notification[value="translation"] menulist:active { - background-color: #E2E1E0; -} - -notification[value="translation"] button[anonid="translate"] { - color: #FFF; - background-image: linear-gradient(#9FB938, #8DA726); - box-shadow: none; - border: 1px solid #829C1C; -} - -notification[value="translation"] button[anonid="translate"]:hover, -notification[value="translation"] button[anonid="translate"]:active { - background-image: linear-gradient(#8DA726, #8DA726); -} - -notification[value="translation"] button > .button-box, -notification[value="translation"] button[type="menu"] > .button-box > .button-menu-dropmarker { - padding: 0; - margin-inline-start: 3ch; -} - -notification[value="translation"] button:not([type="menu"]) > .button-box { - margin-inline-end: 3ch; -} - -notification[value="translation"] menulist > .menulist-dropmarker { - display: block; -} - /* AutoComplete */ %include ../shared/autocomplete.inc.css diff --git a/application/basilisk/themes/linux/devedition.css b/application/basilisk/themes/linux/devedition.css deleted file mode 100644 index 1f16d5d63..000000000 --- a/application/basilisk/themes/linux/devedition.css +++ /dev/null @@ -1,106 +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/. - -%include ../shared/devedition.inc.css - -:root { - --forwardbutton-width: 29px; -} - -:root[devtoolstheme="light"] { - --urlbar-dropmarker-url: url("chrome://browser/skin/devedition/urlbar-history-dropmarker.svg"); - --urlbar-dropmarker-region: rect(0px, 11px, 14px, 0px); - --urlbar-dropmarker-hover-region: rect(0, 22px, 14px, 11px); - --urlbar-dropmarker-active-region: rect(0px, 33px, 14px, 22px); - --urlbar-dropmarker-2x-url: url("chrome://browser/skin/devedition/urlbar-history-dropmarker.svg"); - --urlbar-dropmarker-2x-region: rect(0px, 11px, 14px, 0px); - --urlbar-dropmarker-hover-2x-region: rect(0, 22px, 14px, 11px); - --urlbar-dropmarker-active-2x-region: rect(0px, 33px, 14px, 22px); -} - -:root[devtoolstheme="dark"] .findbar-closebutton:not(:hover), -:root[devtoolstheme="dark"] #sidebar-header > .close-icon:not(:hover), -.tab-close-button[selected]:not(:hover) { - background-image: -moz-image-rect(url("chrome://global/skin/icons/close.svg"), 0, 80, 16, 64); -} - -/* The menubar and tabs toolbar should match the devedition theme */ -#TabsToolbar, -#toolbar-menubar { - -moz-appearance: none !important; -} -#main-menubar { - color: var(--chrome-color); -} -#main-menubar > menu:not([open]) { - color: inherit; -} - -/* Allow buttons with -moz-appearance set to look normal on hover and open states */ -#navigator-toolbox .toolbarbutton-1:-moz-any(:hover, [open="true"]), -#PlacesToolbar toolbarbutton.bookmark-item:-moz-any(:hover, [open="true"]) { - color: initial; -} - -/* Square back and forward buttons */ -#back-button > .toolbarbutton-icon, -#forward-button > .toolbarbutton-icon { - margin: 0; - border: 1px solid var(--chrome-nav-bar-controls-border-color); - padding: 2px 5px; - background: var(--chrome-nav-buttons-background); - box-shadow: none !important; -} - -#forward-button > .toolbarbutton-icon { - border-inline-start: none; -} - -/* Override a box shadow for disabled back button */ -#main-window:not([customizing]) #back-button[disabled] > .toolbarbutton-icon { - box-shadow: none !important; -} - -#back-button:hover:not([disabled="true"]) > .toolbarbutton-icon, -#forward-button:hover:not([disabled="true"]) > .toolbarbutton-icon { - background: var(--chrome-nav-buttons-hover-background) !important; -} - -#back-button > .toolbarbutton-icon { - border-radius: 2px 0 0 2px !important; -} - -.urlbar-history-dropmarker { - -moz-appearance: none; - padding: 0 3px; - list-style-image: var(--urlbar-dropmarker-url); - -moz-image-region: var(--urlbar-dropmarker-region); -} - -/* Add the proper background for tab overflow */ -#alltabs-button, -#new-tab-button { - background: var(--chrome-background-color); -} - -#new-tab-button:hover > .toolbarbutton-icon { - border-color: transparent !important; -} - -/* Prevent double border below tabs toolbar */ -#TabsToolbar:not([collapsed="true"]) + #nav-bar { - border-top-width: 0 !important; -} - -/* Fix the bad-looking text-shadow in the sidebar header: */ -.sidebar-header, -#sidebar-header { - text-shadow: none; -} - -.ac-type-icon { - /* Left-align the type icon in awesomebar popup results with the icon in the - urlbar. */ - margin-inline-start: 11px; -} diff --git a/application/basilisk/themes/linux/jar.mn b/application/basilisk/themes/linux/jar.mn index 189027812..81581dfaa 100644 --- a/application/basilisk/themes/linux/jar.mn +++ b/application/basilisk/themes/linux/jar.mn @@ -8,11 +8,11 @@ browser.jar: #include ../shared/jar.inc.mn skin/classic/browser/sanitizeDialog.css skin/classic/browser/aboutSessionRestore-window-icon.png +#ifdef MOZ_SERVICES_SYNC skin/classic/browser/aboutSyncTabs.css -* skin/classic/browser/syncedtabs/sidebar.css (syncedtabs/sidebar.css) +#endif skin/classic/browser/actionicon-tab.png * skin/classic/browser/browser.css -* skin/classic/browser/devedition.css * skin/classic/browser/browser-lightweightTheme.css skin/classic/browser/click-to-play-warning-stripes.png skin/classic/browser/Info.png @@ -107,6 +107,7 @@ browser.jar: skin/classic/browser/tabbrowser/tab-stroke-start@2x.png (tabbrowser/tab-stroke-start@2x.png) skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) +#ifdef MOZ_SERVICES_SYNC skin/classic/browser/sync-16.png skin/classic/browser/sync-32.png skin/classic/browser/sync-bg.png @@ -125,6 +126,8 @@ browser.jar: skin/classic/browser/syncQuota.css skin/classic/browser/syncProgress-horizontalbar.png skin/classic/browser/syncProgress-horizontalbar@2x.png + skin/classic/browser/syncProgress.css +#endif [extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: % override chrome://browser/skin/feeds/audioFeedIcon.png chrome://browser/skin/feeds/feedIcon.png diff --git a/application/basilisk/themes/linux/preferences/preferences.css b/application/basilisk/themes/linux/preferences/preferences.css index 45e2dc23d..5c1b102fa 100644 --- a/application/basilisk/themes/linux/preferences/preferences.css +++ b/application/basilisk/themes/linux/preferences/preferences.css @@ -20,12 +20,6 @@ font-weight: bold; } -/* Content Pane */ -#translationAttributionImage { - width: 70px; - cursor: pointer; -} - /* Modeless Window Dialogs */ .windowDialog, .windowDialog prefpane { diff --git a/application/basilisk/themes/linux/syncProgress.css b/application/basilisk/themes/linux/syncProgress.css new file mode 100644 index 000000000..d7aa59976 --- /dev/null +++ b/application/basilisk/themes/linux/syncProgress.css @@ -0,0 +1,46 @@ +/* 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/. */ +@import url(chrome://global/skin/inContentUI.css); + +:root { + height: 100%; + width: 100%; + padding: 0; +} + +body { + margin: 0; + padding: 0 2em; +} + +#floatingBox { + margin: 4em auto; + max-width: 40em; + min-width: 23em; + padding: 1em 1.5em; + position: relative; + text-align: center; +} + +#successLogo { + margin: 1em 2em; +} + +#loadingText { + margin: 2em 6em; +} + +#progressBar { + margin: 2em 10em; +} + +#uploadProgressBar{ + width: 100%; +} + +#bottomRow { + margin-top: 2em; + padding: 0; + text-align: end; +} diff --git a/application/basilisk/themes/linux/syncedtabs/sidebar.css b/application/basilisk/themes/linux/syncedtabs/sidebar.css deleted file mode 100644 index 04e00a7d4..000000000 --- a/application/basilisk/themes/linux/syncedtabs/sidebar.css +++ /dev/null @@ -1,69 +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/. */ - -%include ../../shared/syncedtabs/sidebar.inc.css - -/* These styles are intended to mimic XUL trees and the XUL search box. */ - -html { - border: 1px solid ThreeDShadow; - background-color: -moz-Field; - color: -moz-FieldText; - box-sizing: border-box; -} - -.item { - padding-inline-end: 0; -} - -.item-title { - margin: 1px 0 0; - margin-inline-end: 6px; -} - - -.search-box { - -moz-appearance: textfield; - cursor: text; - margin: 2px 4px; - border: 2px solid; - -moz-border-top-colors: ThreeDShadow ThreeDDarkShadow; - -moz-border-right-colors: ThreeDHighlight ThreeDLightShadow; - -moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow; - -moz-border-left-colors: ThreeDShadow ThreeDDarkShadow; - padding: 2px 2px 3px; - padding-inline-start: 4px; - background-color: -moz-Field; - color: -moz-FieldText; -} - -.textbox-search-clear { - background-image: url(moz-icon://stock/gtk-clear?size=menu); - background-repeat: no-repeat; - width: 16px; - height: 16px; -} - -.textbox-search-icon { - background-image: url(moz-icon://stock/gtk-find?size=menu); - background-repeat: no-repeat; - width: 16px; - height: 16px; - display: block; -} - -.textbox-search-icon[searchbutton]:not([disabled]) , -.textbox-search-clear:not([disabled]) { - cursor: pointer; -} - -.item.client .item-twisty-container { - -moz-appearance: treetwistyopen; - margin-top: 3px; - margin-left: 2px; -} - -.item.client.closed .item-twisty-container { - -moz-appearance: treetwisty; -} diff --git a/application/basilisk/themes/osx/browser.css b/application/basilisk/themes/osx/browser.css index 808bb20b1..70f1f6162 100644 --- a/application/basilisk/themes/osx/browser.css +++ b/application/basilisk/themes/osx/browser.css @@ -2920,139 +2920,6 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker { 0 0 3px 2px -moz-mac-focusring; } -/* Translation */ - -%include ../shared/translation/infobar.inc.css - -notification[value="translation"] { - color: #484848; - background-color: #EFEFEF; - background-image: none; - border-top: none; - border-bottom: 1px solid #c4c4c4; - padding-top: 1px; - padding-bottom: 1px; - min-height: 35px; -} - -.translate-infobar-element { - margin-top: 0 !important; - margin-bottom: 0 !important; -} - -button.translate-infobar-element { - background: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1)) repeat scroll 0% 0% padding-box transparent; - color: #333333; - border: 1px solid; - border-color: rgba(23, 51, 78, 0.15) rgba(23, 51, 78, 0.17) rgba(23, 51, 78, 0.2); - box-shadow: 0px 0px 2px rgba(255, 255, 255, 0.5) inset, 0px 1px 0px rgba(255, 255, 255, 0.2); - transition-property: background-color, border-color, box-shadow; - transition-duration: 150ms; - min-height: 22px; - min-width: 0; - padding: 0 0.8em !important; - margin-left: 0.25em; - margin-right: 0.25em; -} - -button.translate-infobar-element .button-text { - margin-left: 0 !important; - margin-right: 0 !important; -} - -label.translate-infobar-element { - padding-top: 2px; -} - -button.translate-infobar-element:hover { - background: #f0f0f0; - box-shadow: 0 1px 0 hsla(0,0%,100%,.1) inset, 0 0 0 1px hsla(0,0%,100%,.05) inset, 0 1px 0 hsla(210,54%,20%,.01), 0 0 4px hsla(206,100%,20%,.1); -} - -button.translate-infobar-element:active { - box-shadow: 0 1px 1px hsla(211,79%,6%,.1) inset, 0 0 1px hsla(211,79%,6%,.2) inset; - transition-duration: 0ms; -} - -button.translate-infobar-element[anonid="translate"] { - color: #ffffff; - background: linear-gradient(#4cb1ff, #1793e5); - 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(210,54%,20%,.03); - border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2); - padding: 0 1.1em !important;; -} - -button.translate-infobar-element[anonid="translate"]:hover { - background-image: linear-gradient(#66bdff, #0d9eff); - 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(210,54%,20%,.03), 0 0 4px hsla(206,100%,20%,.2); -} - -button.translate-infobar-element.options-menu-button { - padding-inline-start: 0.5em !important; - padding-inline-end: 0em !important; -} - -button.translate-infobar-element.options-menu-button > .button-box > .button-menu-dropmarker { - display: -moz-box; - list-style-image: url("chrome://global/skin/icons/glyph-dropdown.png"); - padding: 0 !important; - margin: 0 !important; -} - -@media (min-resolution: 2dppx) { - button.translate-infobar-element.options-menu-button > .button-box > .button-menu-dropmarker { - list-style-image: url("chrome://global/skin/icons/glyph-dropdown@2x.png"); - } - - button.translate-infobar-element.options-menu-button > .button-box > .button-menu-dropmarker > .dropmarker-icon { - width: 8px; - } -} - -menulist.translate-infobar-element { - text-shadow: 0 1px 1px #FEFFFE; - border: 1px solid; - border-color: rgba(23, 51, 78, 0.15) rgba(23, 51, 78, 0.17) rgba(23, 51, 78, 0.2); - box-shadow: 0 1px 1px 0 #FFFFFF, inset 0 2px 2px 0 #FFFFFF; - background-color: #F1F1F1; - background-image: linear-gradient(#FFFFFF, rgba(255,255,255,0.1)); - color: #333333; - padding: 0; - min-height: 22px !important; -} - -menulist.translate-infobar-element > .menulist-label-box { - padding-top: 1px; - padding-inline-start: 0.3em; - margin-top: 0; - margin-bottom: 0; -} - -menulist.translate-infobar-element:hover { - background: #f0f0f0; - box-shadow: 0 1px 0 hsla(0,0%,100%,.1) inset, 0 0 0 1px hsla(0,0%,100%,.05) inset, 0 1px 0 hsla(210,54%,20%,.01), 0 0 4px hsla(206,100%,20%,.1); -} - -menulist.translate-infobar-element[open="true"] { - background-image: linear-gradient(rgba(255,255,255,0.1), - rgba(255,255,255,0.6)); -} - -menulist.translate-infobar-element > .menulist-dropmarker { - display: -moz-box; - list-style-image: url("chrome://global/skin/icons/glyph-dropdown.png"); -} - -@media (min-resolution: 2dppx) { - menulist.translate-infobar-element > .menulist-dropmarker { - list-style-image: url("chrome://global/skin/icons/glyph-dropdown@2x.png"); - } - - menulist.translate-infobar-element > .menulist-dropmarker > .dropmarker-icon { - width: 8px; - } -} - .popup-notification-body[popupid="addon-progress"], .popup-notification-body[popupid="addon-install-confirmation"] { width: 28em; diff --git a/application/basilisk/themes/osx/devedition.css b/application/basilisk/themes/osx/devedition.css deleted file mode 100644 index c7a2bdd71..000000000 --- a/application/basilisk/themes/osx/devedition.css +++ /dev/null @@ -1,121 +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/. - -%include ../shared/devedition.inc.css - -:root { - --forwardbutton-width: 32px; -} - -/* Use only 1px separator between nav toolbox and page content */ -#navigator-toolbox::after { - border-top-style: none; - margin-top: -1px; -} - -/* Include extra space on left/right for dragging since there is no space above - the tabs */ -#main-window[tabsintitlebar] #TabsToolbar { - padding-left: 50px; - padding-right: 50px; - margin-bottom: 0; /* Don't overlap the inner highlight at the top of the nav-bar */ -} - -/* Get rid of 1px bright strip at the top of window */ -#main-window[tabsintitlebar] #titlebar-content { - background: var(--chrome-background-color); -} - -/* Resize things so that the native titlebar is in line with the tabs */ -#main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-buttonbox-container, -#main-window[tabsintitlebar] > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > #titlebar-fullscreen-button { - margin-top: 6px; -} - -/* Square back and forward buttons. Need !important on these because there - are a lot of more specific selectors sprinkled around elsewhere for changing - background / shadows for different states */ -#back-button, -#forward-button { - height: 24px !important; - box-shadow: none !important; - border: 1px solid var(--chrome-nav-bar-controls-border-color) !important; - background: var(--chrome-nav-buttons-background) !important; -} - -#forward-button { - border-inline-start: none !important; - /* browser.css and friends set up the width of the button to be 32px. - * They then set margin-left to -2px to ensure the button is not too wide - * compared to the back button, and set padding-left to center the icon - * correctly. - * In our theme, the back and forward buttons are the same width, with the - * back button being 32px with 1px border on both sides. To ensure the - * forward button's content box looks like it is the same size with width - * set to 32px and a 1px border on only 1 side, we overlap by 1px, so both - * buttons end up with a content box that looks like it's 30px. - */ - margin-left: -1px; - padding-left: 1px; -} - -#forward-button > .toolbarbutton-icon { - margin-left: 0; - margin-right: 0; -} - -#back-button:hover:not([disabled="true"]), -#forward-button:hover:not([disabled="true"]) { - background: var(--chrome-nav-buttons-hover-background) !important; -} - -#back-button { - border-radius: 3px 0 0 3px !important; - padding: 0 !important; - margin: 0 !important; -} - -#back-button:hover:active:not([disabled="true"]) { - -moz-image-region: rect(18px, 54px, 36px, 36px); -} - -/* Use smaller back button icon */ -@media (min-resolution: 2dppx) { - #back-button:hover:active:not([disabled="true"]) { - -moz-image-region: rect(36px, 108px, 72px, 72px); - } -} - -/* Don't use the default background for tabs toolbar */ -#TabsToolbar { - -moz-appearance: none !important; -} - -/* Prevent the hover styling from on the identity icon from overlapping the - urlbar border. */ -#identity-box { - margin-top: -1px !important; - margin-bottom: -1px !important; - padding-top: 3px !important; - padding-bottom: 3px !important; -} - -:root[devtoolstheme="dark"] .findbar-closebutton:not(:hover), -/* Tab styling - make sure to use an inverted icon for the selected tab - (brighttext only covers the unselected tabs) */ -.tab-close-button[selected=true]:not(:hover) { - -moz-image-region: rect(0, 64px, 16px, 48px); -} -@media (min-resolution: 2dppx) { - :root[devtoolstheme="dark"] .findbar-closebutton:not(:hover), - .tab-close-button[selected=true]:not(:hover) { - -moz-image-region: rect(0, 128px, 32px, 96px); - } -} - -.ac-type-icon { - /* Left-align the type icon in awesomebar popup results with the icon in the - urlbar. */ - margin-inline-start: 14px; -} diff --git a/application/basilisk/themes/osx/jar.mn b/application/basilisk/themes/osx/jar.mn index 27802843d..5dec6559a 100644 --- a/application/basilisk/themes/osx/jar.mn +++ b/application/basilisk/themes/osx/jar.mn @@ -7,12 +7,12 @@ browser.jar: #include ../shared/jar.inc.mn skin/classic/browser/sanitizeDialog.css skin/classic/browser/aboutSessionRestore-window-icon.png +#ifdef MOZ_SERVICES_SYNC skin/classic/browser/aboutSyncTabs.css -* skin/classic/browser/syncedtabs/sidebar.css (syncedtabs/sidebar.css) +#endif skin/classic/browser/actionicon-tab.png skin/classic/browser/actionicon-tab@2x.png * skin/classic/browser/browser.css -* skin/classic/browser/devedition.css * skin/classic/browser/browser-lightweightTheme.css skin/classic/browser/click-to-play-warning-stripes.png skin/classic/browser/Info.png @@ -159,6 +159,7 @@ browser.jar: skin/classic/browser/tabbrowser/tab-stroke-start@2x.png (tabbrowser/tab-stroke-start@2x.png) skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) skin/classic/browser/tabbrowser/tabDragIndicator@2x.png (tabbrowser/tabDragIndicator@2x.png) +#ifdef MOZ_SERVICES_SYNC skin/classic/browser/sync-16.png skin/classic/browser/sync-32.png skin/classic/browser/sync-bg.png @@ -179,6 +180,8 @@ browser.jar: skin/classic/browser/syncProgress-toolbar@2x.png skin/classic/browser/syncProgress-toolbar-inverted.png skin/classic/browser/syncProgress-toolbar-inverted@2x.png + skin/classic/browser/syncProgress.css +#endif skin/classic/browser/Toolbar-background-noise.png (Toolbar-background-noise.png) skin/classic/browser/lion/toolbarbutton-dropmarker.png (toolbarbutton-dropmarker-lion.png) skin/classic/browser/toolbarbutton-dropmarker@2x.png (toolbarbutton-dropmarker-lion@2x.png) @@ -195,8 +198,10 @@ browser.jar: skin/classic/browser/yosemite/menuPanel-help@2x.png (menuPanel-help-yosemite@2x.png) skin/classic/browser/yosemite/reload-stop-go.png (reload-stop-go-yosemite.png) skin/classic/browser/yosemite/reload-stop-go@2x.png (reload-stop-go-yosemite@2x.png) +#ifdef MOZ_SERVICES_SYNC skin/classic/browser/yosemite/sync-horizontalbar.png (sync-horizontalbar-yosemite.png) skin/classic/browser/yosemite/sync-horizontalbar@2x.png (sync-horizontalbar-yosemite@2x.png) +#endif skin/classic/browser/yosemite/tab-selected-end-inactive.svg (tabbrowser/tab-selected-end-yosemite-inactive.svg) skin/classic/browser/yosemite/tab-selected-start-inactive.svg (tabbrowser/tab-selected-start-yosemite-inactive.svg) skin/classic/browser/yosemite/tab-active-middle-inactive.png (tabbrowser/tab-active-middle-yosemite-inactive.png) @@ -224,5 +229,7 @@ browser.jar: % override chrome://browser/skin/menuPanel-help@2x.png chrome://browser/skin/yosemite/menuPanel-help@2x.png os=Darwin osversion>=10.10 % override chrome://browser/skin/reload-stop-go.png chrome://browser/skin/yosemite/reload-stop-go.png os=Darwin osversion>=10.10 % override chrome://browser/skin/reload-stop-go@2x.png chrome://browser/skin/yosemite/reload-stop-go@2x.png os=Darwin osversion>=10.10 +#ifdef MOZ_SERVICES_SYNC % override chrome://browser/skin/sync-horizontalbar.png chrome://browser/skin/yosemite/sync-horizontalbar.png os=Darwin osversion>=10.10 % override chrome://browser/skin/sync-horizontalbar@2x.png chrome://browser/skin/yosemite/sync-horizontalbar@2x.png os=Darwin osversion>=10.10 +#endif diff --git a/application/basilisk/themes/osx/preferences/preferences.css b/application/basilisk/themes/osx/preferences/preferences.css index 4f17ec58d..a8dcadc55 100644 --- a/application/basilisk/themes/osx/preferences/preferences.css +++ b/application/basilisk/themes/osx/preferences/preferences.css @@ -49,11 +49,6 @@ caption { border-bottom: 1px solid #ccc; } -#translationAttributionImage { - width: 70px; - cursor: pointer; -} - #browserUseCurrent, #browserUseBookmark, #browserUseBlank { diff --git a/application/basilisk/themes/osx/syncProgress.css b/application/basilisk/themes/osx/syncProgress.css new file mode 100644 index 000000000..d7aa59976 --- /dev/null +++ b/application/basilisk/themes/osx/syncProgress.css @@ -0,0 +1,46 @@ +/* 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/. */ +@import url(chrome://global/skin/inContentUI.css); + +:root { + height: 100%; + width: 100%; + padding: 0; +} + +body { + margin: 0; + padding: 0 2em; +} + +#floatingBox { + margin: 4em auto; + max-width: 40em; + min-width: 23em; + padding: 1em 1.5em; + position: relative; + text-align: center; +} + +#successLogo { + margin: 1em 2em; +} + +#loadingText { + margin: 2em 6em; +} + +#progressBar { + margin: 2em 10em; +} + +#uploadProgressBar{ + width: 100%; +} + +#bottomRow { + margin-top: 2em; + padding: 0; + text-align: end; +} diff --git a/application/basilisk/themes/osx/syncedtabs/sidebar.css b/application/basilisk/themes/osx/syncedtabs/sidebar.css deleted file mode 100644 index 4d1de766c..000000000 --- a/application/basilisk/themes/osx/syncedtabs/sidebar.css +++ /dev/null @@ -1,154 +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/. */ - -%include ../../shared/syncedtabs/sidebar.inc.css - -/* These styles are intended to mimic XUL trees and the XUL search box. */ - -.content-container { - -moz-appearance: -moz-mac-source-list; -} - -.item { - color: -moz-DialogText; -} - -.item-title-container { - box-sizing: border-box; - align-items: center; - height: 24px; - font-size: 12px; -} - -.item.selected > .item-title-container { - color: HighlightText; - font-weight: bold; -} - -.item.selected > .item-title-container { - -moz-appearance: -moz-mac-source-list-selection; -} - -.item.selected:focus > .item-title-container { - -moz-appearance: -moz-mac-active-source-list-selection; -} - -.item.client .item-twisty-container { - min-width: 16px; - height: 16px; - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-expanded"); -} - -@media not all and (-moz-mac-yosemite-theme) { - .item.client.selected .item-twisty-container { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-expanded-inverted"); - } - - .item.client.selected.closed .item-twisty-container { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-collapsed-inverted"); - } - - .item.client.selected .item-twisty-container:dir(rtl) { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-expanded-inverted"); - } - - .item.client.selected.closed .item-twisty-container:dir(rtl) { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-collapsed-inverted-rtl"); - } -} - -.item.client.closed .item-twisty-container { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-collapsed"); -} - -.item.client.selected:focus .item-twisty-container { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-expanded-inverted"); -} - -.item.client.selected.closed:focus .item-twisty-container { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-collapsed-inverted"); -} - -.item.client .item-twisty-container:dir(rtl) { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-expanded"); -} - -.item.client.closed .item-twisty-container:dir(rtl) { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-collapsed-rtl"); -} - -.item.client.selected:focus .item-twisty-container:dir(rtl) { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-expanded-inverted"); -} - -.item.client.selected.closed:focus .item-twisty-container:dir(rtl) { - background-image: url("chrome://global/skin/tree/arrow-disclosure.svg#arrow-disclosure-collapsed-inverted-rtl"); -} - -@media (-moz-mac-yosemite-theme) { - .item.selected > .item-title-container { - color: -moz-dialogtext; - font-weight: 500; - } - - .item.selected:focus > .item-title-container { - color: #fff; - } -} - -.sidebar-search-container { - border-bottom: 1px solid #bdbdbd; -} - -.search-box { - -moz-appearance: searchfield; - padding: 1px; - font-size: 12px; - cursor: text; - margin: 4px 8px 10px; - border-width: 3px; - border-style: solid; - border-color: currentcolor; - border-image: none; - -moz-border-top-colors: transparent #888 #000; - -moz-border-right-colors: transparent #FFF #000; - -moz-border-bottom-colors: transparent #FFF #000; - -moz-border-left-colors: transparent #888 #000; - border-top-right-radius: 2px; - border-bottom-left-radius: 2px; - background-color: #FFF; - color: #000; - -moz-user-select: text; - text-shadow: none; -} - -.search-box.compact > .textbox-input-box > .textbox-search-icons > .textbox-search-clear { - background-image: url(chrome://global/skin/icons/searchfield-cancel.svg); - background-repeat: no-repeat; - background-size: 11px 11px; - width: 11px; - height: 11px; -} - -.search-box.compact > .textbox-input-box > .textbox-search-icons > .textbox-search-icon { - display: none; -} - -.search-box[focused="true"] { - -moz-border-top-colors: -moz-mac-focusring -moz-mac-focusring #000000; - -moz-border-right-colors: -moz-mac-focusring -moz-mac-focusring #000000; - -moz-border-bottom-colors: -moz-mac-focusring -moz-mac-focusring #000000; - -moz-border-left-colors: -moz-mac-focusring -moz-mac-focusring #000000; -} - -.search-box.compact { - padding: 0px; - /* font size is in px because the XUL it was copied from uses px */ - font-size: 11px; -} - -.textbox-search-clear, -.textbox-search-icon { - margin-top: 1px; -} diff --git a/application/basilisk/themes/shared/browser.inc b/application/basilisk/themes/shared/browser.inc index 81caf94d6..6989f064a 100644 --- a/application/basilisk/themes/shared/browser.inc +++ b/application/basilisk/themes/shared/browser.inc @@ -2,7 +2,7 @@ % Note that zoom-reset-button is a bit different since it doesn't use an image and thus has the image with display: none. %define nestedButtons #zoom-out-button, #zoom-reset-button, #zoom-in-button, #cut-button, #copy-button, #paste-button -%define primaryToolbarButtons #back-button, #forward-button, #home-button, #print-button, #downloads-button, #bookmarks-menu-button, #new-tab-button, #new-window-button, #fullscreen-button, #sync-button, #feed-button, #open-file-button, #find-button, #developer-button, #preferences-button, #privatebrowsing-button, #save-page-button, #add-ons-button, #history-panelmenu, #nav-bar-overflow-button, #PanelUI-menu-button, #characterencoding-button, #email-link-button, #sidebar-button, @nestedButtons@, #e10s-button, #panic-button, #webide-button, #containers-panelmenu +%define primaryToolbarButtons #back-button, #forward-button, #home-button, #print-button, #downloads-button, #bookmarks-menu-button, #new-tab-button, #new-window-button, #fullscreen-button, #sync-button, #sync-tabs-button, #feed-button, #open-file-button, #find-button, #developer-button, #preferences-button, #privatebrowsing-button, #save-page-button, #add-ons-button, #history-panelmenu, #nav-bar-overflow-button, #PanelUI-menu-button, #characterencoding-button, #email-link-button, #sidebar-button, @nestedButtons@, #e10s-button, #panic-button, #webide-button, #containers-panelmenu %ifdef XP_MACOSX % Prior to 10.7 there wasn't a native fullscreen button so we use #restore-button to exit fullscreen diff --git a/application/basilisk/themes/shared/customizableui/panelUI.inc.css b/application/basilisk/themes/shared/customizableui/panelUI.inc.css index ba36da995..5550ef295 100644 --- a/application/basilisk/themes/shared/customizableui/panelUI.inc.css +++ b/application/basilisk/themes/shared/customizableui/panelUI.inc.css @@ -61,8 +61,7 @@ height: 13px; } -#PanelUI-menu-button[badge-status="download-warning"] > .toolbarbutton-badge-stack > .toolbarbutton-badge, -#PanelUI-menu-button[badge-status="fxa-needs-authentication"] > .toolbarbutton-badge-stack > .toolbarbutton-badge { +#PanelUI-menu-button[badge-status="download-warning"] > .toolbarbutton-badge-stack > .toolbarbutton-badge { box-shadow: none; filter: drop-shadow(0 1px 0 hsla(206, 50%, 10%, .15)); } @@ -86,13 +85,7 @@ background: #D90000; } -#PanelUI-menu-button[badge-status="fxa-needs-authentication"] > .toolbarbutton-badge-stack > .toolbarbutton-badge { - height: 13px; - background: transparent url(chrome://browser/skin/warning.svg) no-repeat center; -} - -#PanelUI-menu-button[badge-status="download-warning"] > .toolbarbutton-badge-stack > .toolbarbutton-badge:-moz-window-inactive, -#PanelUI-menu-button[badge-status="fxa-needs-authentication"] > .toolbarbutton-badge-stack > .toolbarbutton-badge:-moz-window-inactive { +#PanelUI-menu-button[badge-status="download-warning"] > .toolbarbutton-badge-stack > .toolbarbutton-badge:-moz-window-inactive { filter: none; } @@ -381,9 +374,6 @@ toolbaritem[cui-areatype="menu-panel"][sdkstylewidget="true"] > iframe { #PanelUI-multiView[viewtype="subview"] #PanelUI-mainView > #PanelUI-contents-scroller > #PanelUI-contents > .panel-wide-item, #PanelUI-multiView[viewtype="subview"] #PanelUI-mainView > #PanelUI-contents-scroller > #PanelUI-contents > .toolbarbutton-1:not([panel-multiview-anchor="true"]), #PanelUI-multiView[viewtype="subview"] #PanelUI-mainView > #PanelUI-footer > #PanelUI-update-status, -#PanelUI-multiView[viewtype="subview"] #PanelUI-mainView > #PanelUI-footer > #PanelUI-footer-fxa > #PanelUI-fxa-status > #PanelUI-fxa-avatar, -#PanelUI-multiView[viewtype="subview"] #PanelUI-mainView > #PanelUI-footer > #PanelUI-footer-fxa > #PanelUI-fxa-status > #PanelUI-fxa-label, -#PanelUI-multiView[viewtype="subview"] #PanelUI-mainView > #PanelUI-footer > #PanelUI-footer-fxa > #PanelUI-fxa-icon, #PanelUI-multiView[viewtype="subview"] #PanelUI-mainView > #PanelUI-footer > #PanelUI-footer-inner > toolbarseparator, #PanelUI-multiView[viewtype="subview"] #PanelUI-mainView > #PanelUI-footer > #PanelUI-footer-inner > #PanelUI-customize, #PanelUI-multiView[viewtype="subview"] #PanelUI-mainView > #PanelUI-footer > #PanelUI-footer-inner > #PanelUI-help:not([panel-multiview-anchor="true"]) { @@ -481,26 +471,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { margin: 0; } -#main-window[customizing] #PanelUI-footer-fxa { - display: none; -} - -#PanelUI-footer-fxa:not([fxastatus="signedin"]) > toolbarseparator, -#PanelUI-footer-fxa:not([fxastatus="signedin"]) > #PanelUI-fxa-icon, -#PanelUI-footer-fxa:not([fxaprofileimage]) > #PanelUI-fxa-status > #PanelUI-fxa-avatar { - display: none; -} - -#PanelUI-footer-fxa[fxastatus="error"] > #PanelUI-fxa-status::after { - content: url(chrome://browser/skin/warning.svg); - filter: drop-shadow(0 1px 0 hsla(206,50%,10%,.15)); - width: 47px; - padding-top: 1px; - display: block; - text-align: center; - position: relative; - top: 25%; -} #PanelUI-update-status[update-status]::after { content: ""; @@ -523,40 +493,28 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { background-color: #D90000; } -#PanelUI-fxa-status { - display: flex; - flex: 1 1 0%; - width: 1px; -} - -#PanelUI-footer-inner, -#PanelUI-footer-fxa:not([hidden]) { +#PanelUI-footer-inner { display: flex; border-top: 1px solid var(--panel-separator-color); } -#PanelUI-multiView[viewtype="subview"] #PanelUI-footer-inner, -#PanelUI-multiView[viewtype="subview"] #PanelUI-footer-fxa { +#PanelUI-multiView[viewtype="subview"] #PanelUI-footer-inner { position: relative; } -#PanelUI-footer-inner > toolbarseparator, -#PanelUI-footer-fxa > toolbarseparator { +#PanelUI-footer-inner > toolbarseparator { border: 0; border-left: 1px solid var(--panel-separator-color); margin: 7px 0 7px; -moz-appearance: none; } -#PanelUI-footer-inner:hover > toolbarseparator, -#PanelUI-footer-fxa:hover > toolbarseparator { +#PanelUI-footer-inner:hover > toolbarseparator { margin: 0; } #PanelUI-update-status, #PanelUI-help, -#PanelUI-fxa-label, -#PanelUI-fxa-icon, #PanelUI-customize, #PanelUI-quit { margin: 0; @@ -590,7 +548,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { } #PanelUI-update-status > .toolbarbutton-text, -#PanelUI-fxa-label > .toolbarbutton-text, #PanelUI-customize > .toolbarbutton-text { margin: 0; padding: 0 6px; @@ -598,37 +555,23 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { } #PanelUI-help > .toolbarbutton-text, -#PanelUI-quit > .toolbarbutton-text, -#PanelUI-fxa-avatar > .toolbarbutton-text { +#PanelUI-quit > .toolbarbutton-text { display: none; } #PanelUI-update-status > .toolbarbutton-icon, -#PanelUI-fxa-label > .toolbarbutton-icon, -#PanelUI-fxa-icon > .toolbarbutton-icon, #PanelUI-customize > .toolbarbutton-icon, #PanelUI-help > .toolbarbutton-icon, #PanelUI-quit > .toolbarbutton-icon { margin-inline-end: 0; } -#PanelUI-fxa-icon { - padding-inline-start: 15px; - padding-inline-end: 15px; -} - -#PanelUI-fxa-label, #PanelUI-customize { flex: 1; padding-inline-start: 15px; border-inline-start-style: none; } -#PanelUI-footer-fxa[fxaprofileimage="set"] > #PanelUI-fxa-status > #PanelUI-fxa-label, -#PanelUI-footer-fxa[fxaprofileimage="enabled"]:not([fxastatus="error"]) > #PanelUI-fxa-status > #PanelUI-fxa-label { - padding-inline-start: 0px; -} - #PanelUI-update-status { width: calc(@menuPanelWidth@ + 30px); padding-inline-start: 15px; @@ -639,130 +582,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { list-style-image: url(chrome://branding/content/icon16.png); } -#PanelUI-fxa-label, -#PanelUI-fxa-icon { - list-style-image: url(chrome://browser/skin/sync-horizontalbar.png); -} - -#PanelUI-remotetabs { - --panel-ui-sync-illustration-height: 157.5px; -} - -.PanelUI-remotetabs-instruction-title, -.PanelUI-remotetabs-instruction-label, -#PanelUI-remotetabs-mobile-promo { - /* If you change the margin here, the min-height of the synced tabs panel - (e.g. #PanelUI-remotetabs[mainview] #PanelUI-remotetabs-setupsync, etc) may - need adjusting (see bug 1248506) */ - margin: 15px; - text-align: center; - text-shadow: none; - max-width: 15em; - color: GrayText; -} - -.PanelUI-remotetabs-instruction-title { - font-size: 1.3em; -} - -/* The boxes with "instructions" get extra top and bottom padding for space - around the illustration and buttons */ -.PanelUI-remotetabs-instruction-box { - /* If you change the padding here, the min-height of the synced tabs panel - (e.g. #PanelUI-remotetabs[mainview] #PanelUI-remotetabs-setupsync, etc) may - need adjusting (see bug 1248506) */ - padding-bottom: 30px; - padding-top: 15px; -} - -.PanelUI-remotetabs-prefs-button { - -moz-appearance: none; - background-color: #0096dd; - /* !important for the color as an OSX specific rule when a lightweight theme - is used for buttons in the toolbox overrides. See bug 1238531 for details */ - color: white !important; - border-radius: 2px; - /* If you change the margin or padding below, the min-height of the synced tabs - panel (e.g. #PanelUI-remotetabs[mainview] #PanelUI-remotetabs-setupsync, - etc) may need adjusting (see bug 1248506) */ - margin-top: 10px; - margin-bottom: 10px; - padding: 8px; - text-shadow: none; - min-width: 200px; -} - -.PanelUI-remotetabs-prefs-button:hover, -.PanelUI-remotetabs-prefs-button:hover:active { - background-color: #018acb; -} - -.remotetabs-promo-link { - margin: 0; -} - -.PanelUI-remotetabs-notabsforclient-label { - color: GrayText; - /* This margin is to line this label up with the labels in toolbarbuttons. */ - margin-left: 28px; -} - -.fxaSyncIllustration { - height: var(--panel-ui-sync-illustration-height); - list-style-image: url(chrome://browser/skin/fxa/sync-illustration.svg); -} - -.PanelUI-remotetabs-prefs-button > .toolbarbutton-text { - /* !important to override ".cui-widget-panel toolbarbutton > .toolbarbutton-text" above. */ - text-align: center !important; - text-shadow: none; -} - -#PanelUI-remotetabs[mainview] { /* panel anchored to toolbar button might be too skinny */ - min-width: 19em; -} - -/* Work around bug 1224412 - these boxes will cause scrollbars to appear when - the panel is anchored to a toolbar button. -*/ -#PanelUI-remotetabs[mainview] #PanelUI-remotetabs-setupsync, -#PanelUI-remotetabs[mainview] #PanelUI-remotetabs-reauthsync, -#PanelUI-remotetabs[mainview] #PanelUI-remotetabs-nodevicespane, -#PanelUI-remotetabs[mainview] #PanelUI-remotetabs-tabsdisabledpane { - min-height: calc(var(--panel-ui-sync-illustration-height) + - 20px + /* margin of .PanelUI-remotetabs-prefs-button */ - 16px + /* padding of .PanelUI-remotetabs-prefs-button */ - 30px + /* margin of .PanelUI-remotetabs-instruction-label */ - 30px + 15px + /* padding of .PanelUI-remotetabs-instruction-box */ - 11em); -} - -#PanelUI-remotetabs-tabslist > label[itemtype="client"] { - color: GrayText; -} - -/* Collapse the non-active vboxes in the remotetabs deck to use only the - height the active box needs */ -#PanelUI-remotetabs-deck:not([selectedIndex="1"]) > #PanelUI-remotetabs-tabsdisabledpane, -#PanelUI-remotetabs-deck:not([selectedIndex="2"]) > #PanelUI-remotetabs-fetching, -#PanelUI-remotetabs-deck:not([selectedIndex="3"]) > #PanelUI-remotetabs-nodevicespane { - visibility: collapse; -} - -#PanelUI-remotetabs-main[devices-status="single"] > #PanelUI-remotetabs-buttons { - display: none; -} - -#PanelUI-fxa-icon[syncstatus="active"]:not([disabled]) { - list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar.png); -} - -#PanelUI-footer-fxa[fxastatus="migrate-signup"] > #PanelUI-fxa-status > #PanelUI-fxa-label, -#PanelUI-footer-fxa[fxastatus="migrate-verify"] > #PanelUI-fxa-status > #PanelUI-fxa-label { - list-style-image: url(chrome://browser/skin/warning.svg); - -moz-image-region: auto; -} - #PanelUI-customize { list-style-image: url(chrome://browser/skin/menuPanel-customize.png); } @@ -780,46 +599,12 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { list-style-image: url(chrome://browser/skin/menuPanel-exit.png); } -#PanelUI-fxa-label, -#PanelUI-fxa-icon, #PanelUI-customize, #PanelUI-help, #PanelUI-quit { -moz-image-region: rect(0, 16px, 16px, 0); } -#PanelUI-footer-fxa[fxastatus="signedin"] > #PanelUI-fxa-status > #PanelUI-fxa-label > .toolbarbutton-icon, -#PanelUI-footer-fxa[fxastatus="error"][fxaprofileimage="set"] > #PanelUI-fxa-status > #PanelUI-fxa-label > .toolbarbutton-icon { - display: none; -} - -#PanelUI-footer-fxa[fxastatus="error"]:not([fxaprofileimage="set"]) > #PanelUI-fxa-status > #PanelUI-fxa-avatar { - display: none; -} - -#PanelUI-fxa-status[disabled], -#PanelUI-fxa-icon[disabled] { - pointer-events: none; -} - -#PanelUI-fxa-avatar { - width: 32px; - height: 32px; - border-radius: 50%; - background-repeat: no-repeat; - background-position: 0 0; - background-size: contain; - align-self: center; - margin: 0px 7px; - padding: 0px; - border: 0px none; - margin-inline-end: 0; -} - -#PanelUI-footer-fxa[fxaprofileimage="enabled"] > #PanelUI-fxa-status > #PanelUI-fxa-avatar { - list-style-image: url(chrome://browser/skin/fxa/default-avatar.svg); -} - #PanelUI-customize:hover, #PanelUI-help:not([disabled]):hover, #PanelUI-quit:not([disabled]):hover { @@ -837,16 +622,10 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { } #PanelUI-help[disabled], -#PanelUI-quit[disabled], -#PanelUI-fxa-icon[disabled], -#PanelUI-fxa-avatar[disabled], -#PanelUI-fxa-label[disabled] > .toolbarbutton-icon, -#PanelUI-fxa-status::after { +#PanelUI-quit[disabled] { opacity: 0.4; } -#PanelUI-fxa-status:not([disabled]):hover, -#PanelUI-fxa-icon:not([disabled]):hover, #PanelUI-help:not([disabled]):hover, #PanelUI-customize:hover, #PanelUI-quit:not([disabled]):hover { @@ -854,8 +633,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { background-color: var(--arrowpanel-dimmed); } -#PanelUI-fxa-status:not([disabled]):hover:active, -#PanelUI-fxa-icon:not([disabled]):hover:active, #PanelUI-help:not([disabled]):hover:active, #PanelUI-customize:hover:active, #PanelUI-quit:not([disabled]):hover:active { @@ -864,27 +641,6 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { box-shadow: 0 1px 0 hsla(210,4%,10%,.05) inset; } -#PanelUI-fxa-status:not([disabled]):hover, -#PanelUI-fxa-status:not([disabled]):hover:active, -#PanelUI-fxa-icon:not([disabled]):hover, -#PanelUI-fxa-icon:not([disabled]):hover:active { - outline: none; -} - -#PanelUI-footer-fxa[fxastatus="error"] { - background-color: hsl(42,94%,88%); - border-top: 1px solid hsl(42,94%,70%); -} - -#PanelUI-footer-fxa[fxastatus="error"] > #PanelUI-fxa-status:hover { - background-color: hsl(42,94%,85%); -} - -#PanelUI-footer-fxa[fxastatus="error"] > #PanelUI-fxa-status:hover:active { - background-color: hsl(42,94%,82%); - box-shadow: 0 1px 0 hsla(210,4%,10%,.05) inset; -} - #PanelUI-update-status { color: black; } @@ -1150,19 +906,16 @@ menuitem.panel-subview-footer@menuStateActive@, color: GrayText; } -#PanelUI-remotetabs-tabslist > toolbarbutton, #PanelUI-historyItems > toolbarbutton { list-style-image: url("chrome://mozapps/skin/places/defaultFavicon.png"); } @media (min-resolution: 1.1dppx) { - #PanelUI-remotetabs-tabslist > toolbarbutton, #PanelUI-historyItems > toolbarbutton { list-style-image: url("chrome://mozapps/skin/places/defaultFavicon@2x.png"); } } -#PanelUI-remotetabs-tabslist > toolbarbutton > .toolbarbutton-icon, #PanelUI-recentlyClosedWindows > toolbarbutton > .toolbarbutton-icon, #PanelUI-recentlyClosedTabs > toolbarbutton > .toolbarbutton-icon, #PanelUI-historyItems > toolbarbutton > .toolbarbutton-icon { @@ -1616,15 +1369,6 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left { list-style-image: url(chrome://branding/content/icon32.png); } - #PanelUI-fxa-label, - #PanelUI-fxa-icon { - list-style-image: url(chrome://browser/skin/sync-horizontalbar@2x.png); - } - - #PanelUI-fxa-icon[syncstatus="active"]:not([disabled]) { - list-style-image: url(chrome://browser/skin/syncProgress-horizontalbar@2x.png); - } - #PanelUI-customize { list-style-image: url(chrome://browser/skin/menuPanel-customize@2x.png); } @@ -1641,8 +1385,6 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left { list-style-image: url(chrome://browser/skin/menuPanel-exit@2x.png); } - #PanelUI-fxa-label, - #PanelUI-fxa-icon, #PanelUI-customize, #PanelUI-help, #PanelUI-quit { @@ -1650,8 +1392,6 @@ menuitem[checked="true"].subviewbutton > .menu-iconic-left { } #PanelUI-update-status > .toolbarbutton-icon, - #PanelUI-fxa-label > .toolbarbutton-icon, - #PanelUI-fxa-icon > .toolbarbutton-icon, #PanelUI-customize > .toolbarbutton-icon, #PanelUI-help > .toolbarbutton-icon, #PanelUI-quit > .toolbarbutton-icon { diff --git a/application/basilisk/themes/shared/devedition.inc.css b/application/basilisk/themes/shared/devedition.inc.css deleted file mode 100644 index a5c0db948..000000000 --- a/application/basilisk/themes/shared/devedition.inc.css +++ /dev/null @@ -1,311 +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/. - -/* devedition.css is loaded in browser.xul after browser.css when it is - preffed on. The bulk of the styling is here in the shared file, but - there are overrides for each platform in their devedition.css files. */ - -:root { - --tab-toolbar-navbar-overlap: 0px; - --navbar-tab-toolbar-highlight-overlap: 0px; - --space-above-tabbar: 0px; - --toolbarbutton-text-shadow: none; - --backbutton-urlbar-overlap: 0px; -} - -:root[devtoolstheme="dark"] { - /* Chrome */ - --chrome-background-color: #272b35; - --chrome-color: #F5F7FA; - --chrome-secondary-background-color: #393F4C; - --chrome-navigator-toolbox-separator-color: rgba(0,0,0,.2); - --chrome-nav-bar-separator-color: rgba(0,0,0,.2); - --chrome-nav-buttons-background: #252C33; - --chrome-nav-buttons-hover-background: #1B2127; - --chrome-nav-bar-controls-border-color: #1D2328; - --chrome-selection-color: #fff; - --chrome-selection-background-color: #5675B9; - - /* Tabs */ - --tabs-toolbar-color: #F5F7FA; - --tab-background-color: #272b35; - --tab-hover-background-color: #07090a; - --tab-selection-color: #f5f7fa; - --tab-selection-background-color: #5675B9; - --tab-selection-box-shadow: none; - --pinned-tab-glow: radial-gradient(22px at center calc(100% - 2px), rgba(76,158,217,0.9) 13%, rgba(0,0,0,0.4) 16%, transparent 70%); - - /* Url and search bars */ - --url-and-searchbar-background-color: #171B1F; - --urlbar-separator-color: #5F6670; - --urlbar-dropmarker-url: url("chrome://browser/skin/devedition/urlbar-history-dropmarker.svg"); - --urlbar-dropmarker-region: rect(0px, 11px, 14px, 0px); - --urlbar-dropmarker-hover-region: rect(0, 22px, 14px, 11px); - --urlbar-dropmarker-active-region: rect(0px, 33px, 14px, 22px); - --urlbar-dropmarker-2x-url: url("chrome://browser/skin/devedition/urlbar-history-dropmarker.svg"); - --urlbar-dropmarker-2x-region: rect(0px, 11px, 14px, 0px); - --urlbar-dropmarker-hover-2x-region: rect(0, 22px, 14px, 11px); - --urlbar-dropmarker-active-2x-region: rect(0px, 33px, 14px, 22px); -} - -/* Override the lwtheme-specific styling for toolbar buttons */ -:root[devtoolstheme="dark"], -:root[devtoolstheme="dark"] toolbar:-moz-lwtheme { - --toolbarbutton-hover-background: rgba(25,33, 38,.6) linear-gradient(rgba(25,33,38,.6), rgba(25,33,38,.6)) padding-box; - --toolbarbutton-hover-boxshadow: none; - --toolbarbutton-hover-bordercolor: rgba(25,33,38,.6); - --toolbarbutton-active-background: rgba(25,33,38,1) linear-gradient(rgba(25,33,38,1), rgba(25,33,38,1)) border-box; - --toolbarbutton-active-boxshadow: none; - --toolbarbutton-active-bordercolor: rgba(25,33,38,.8); - --toolbarbutton-checkedhover-backgroundcolor: #3C5283; - -} - -:root[devtoolstheme="light"] { - --url-and-searchbar-background-color: #fff; - - --chrome-background-color: #E3E4E6; - --chrome-color: #18191a; - --chrome-secondary-background-color: #f5f6f7; - --chrome-navigator-toolbox-separator-color: #cccccc; - --chrome-nav-bar-separator-color: #B6B6B8; - --chrome-nav-buttons-background: #ffffff; /* --theme-body-background */ - --chrome-nav-buttons-hover-background: #DADBDB; - --chrome-nav-bar-controls-border-color: #ccc; - --chrome-selection-color: #f5f7fa; - --chrome-selection-background-color: #4c9ed9; - - --tab-background-color: #E3E4E6; - --tab-hover-background-color: #D7D8DA; - --tab-selection-color: #f5f7fa; - --tab-selection-background-color: #4c9ed9; - --tab-selection-box-shadow: none; - --pinned-tab-glow: radial-gradient(22px at center calc(100% - 2px), rgba(76,158,217,0.9) 13%, transparent 16%); -} - -/* Override the lwtheme-specific styling for toolbar buttons */ -:root[devtoolstheme="light"], -:root[devtoolstheme="light"] toolbar:-moz-lwtheme { - --toolbarbutton-hover-background: #eaeaea; - --toolbarbutton-hover-boxshadow: none; - --toolbarbutton-hover-bordercolor: rgba(0,0,0,0.1); - --toolbarbutton-active-background: #d7d7d8 border-box; - --toolbarbutton-active-boxshadow: none; - --toolbarbutton-active-bordercolor: rgba(0,0,0,0.15); - --toolbarbutton-checkedhover-backgroundcolor: #d7d7d8; -} - -/* Give some space to drag the window around while customizing - (normal space to left and right of tabs doesn't work in this case) */ -#main-window[tabsintitlebar][customizing] { - --space-above-tabbar: 9px; -} - -/* Override @tabCurveHalfWidth@ and @tabCurveWidth@. XXX: Switch to a CSS variable once the perf is sorted out - bug 1088771 */ -.tab-background-middle { - border-left-width: 0; - border-right-width: 0; - margin: 0; -} - -.tab-background, -.tabs-newtab-button { - margin-inline-end: 0; - margin-inline-start: 0; -} - -.tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox { - padding-inline-end: 0; - padding-inline-start: 0; -} - -.tab-background-start[selected=true]::after, -.tab-background-start[selected=true]::before, -.tab-background-start, -.tab-background-end, -.tab-background-end[selected=true]::after, -.tab-background-end[selected=true]::before { - width: 0; -} - -.tab-background-start[selected=true]::after, -.tab-background-end[selected=true]::after { - margin-inline-start: 0; -} -/* End override @tabCurveHalfWidth@ and @tabCurveWidth@ */ - -#urlbar ::-moz-selection, -#navigator-toolbox .searchbar-textbox ::-moz-selection, -.browserContainer > findbar ::-moz-selection { - background-color: var(--chrome-selection-background-color); - color: var(--chrome-selection-color); -} - -/* Change the base colors for the browser chrome */ - -#tabbrowser-tabs, -#TabsToolbar, -#browser-panel { - background: var(--chrome-background-color); - color: var(--chrome-color); -} - -#navigator-toolbox:-moz-lwtheme::after { - border-bottom-color: var(--chrome-navigator-toolbox-separator-color); -} - -#navigator-toolbox > toolbar:not(#TabsToolbar):not(#toolbar-menubar), -.browserContainer > findbar, -#browser-bottombox { - background-color: var(--chrome-secondary-background-color) !important; - background-image: none !important; - color: var(--chrome-color); -} - -/* Default findbar text color doesn't look good - Bug 1125677 */ -.browserContainer > findbar .findbar-find-status, -.browserContainer > findbar .found-matches { - color: inherit; -} - -#navigator-toolbox .toolbarbutton-1, -.browserContainer > findbar .findbar-button, -#PlacesToolbar toolbarbutton.bookmark-item { - color: var(--chrome-color); - text-shadow: var(--toolbarbutton-text-shadow); -} - -/* Using toolbar[brighttext] instead of important to override linux */ -toolbar[brighttext] #downloads-indicator-counter { - text-shadow: var(--toolbarbutton-text-shadow); - color: var(--chrome-color); -} - -#TabsToolbar { - text-shadow: none !important; -} - -/* URL bar and search bar*/ -#urlbar, -#navigator-toolbox .searchbar-textbox { - background-color: var(--url-and-searchbar-background-color) !important; - background-image: none !important; - color: inherit !important; - border: 1px solid var(--chrome-nav-bar-controls-border-color) !important; - box-shadow: none !important; -} - -%filter substitution -%define selectorPrefix :root[devtoolstheme="dark"] -%define selectorSuffix :-moz-lwtheme -%define iconVariant -white -%include identity-block/icons.inc.css - -#urlbar { - border-inline-start: none !important; - opacity: 1 !important; -} - -window:not([chromehidden~="toolbar"]) #urlbar-wrapper { - overflow: -moz-hidden-unscrollable; - clip-path: none; - margin-inline-start: 0; -} - -:root[devtoolstheme="dark"] #urlbar-zoom-button:hover { - background-color: rgba(255,255,255,.2); -} - -:root[devtoolstheme="dark"] #urlbar-zoom-button:hover:active { - background-color: rgba(255,255,255,.3); -} - -/* Nav bar specific stuff */ -#nav-bar { - margin-top: 0 !important; - border-top: none !important; - border-bottom: none !important; - border-radius: 0 !important; - box-shadow: 0 -1px var(--chrome-nav-bar-separator-color) !important; -} - -/* No extra vertical padding for nav bar */ -#nav-bar-customization-target, -#nav-bar { - padding-top: 0; - padding-bottom: 0; -} - -/* Use smaller back button icon */ -#back-button { - -moz-image-region: rect(0, 54px, 18px, 36px); -} - -@media (min-resolution: 1.1dppx) { - #back-button { - -moz-image-region: rect(0, 108px, 36px, 72px); - } -} - -.tab-background { - visibility: hidden; -} - -/* Tab separators */ -.tabbrowser-tab::after, -.tabbrowser-tab::before { - background: currentColor; - opacity: 0.2 !important; -} - -.tabbrowser-arrowscrollbox > .scrollbutton-down, -.tabbrowser-arrowscrollbox > .scrollbutton-up { - background-color: var(--tab-background-color); - border-color: transparent; -} - -.tabbrowser-tab { - /* We normally rely on other tab elements for pointer events, but this - theme hides those so we need it set here instead */ - pointer-events: auto; -} - -.tabbrowser-tab:-moz-any([image], [pinned]) > .tab-stack > .tab-content[attention]:not([selected="true"]), -.tabbrowser-tab > .tab-stack > .tab-content[pinned][titlechanged]:not([selected="true"]) { - background-image: var(--pinned-tab-glow); - background-position: center; - background-size: 100%; -} - -.tabbrowser-tab[image] > .tab-stack > .tab-content[attention]:not([pinned]):not([selected="true"]) { - background-position: left bottom var(--tab-toolbar-navbar-overlap); - background-size: 34px 100%; -} - -.tabbrowser-arrowscrollbox > .scrollbutton-down:not([disabled]):hover, -.tabbrowser-arrowscrollbox > .scrollbutton-up:not([disabled]):hover, -.tabbrowser-tab:hover { - background-color: var(--tab-hover-background-color); -} - -.tabbrowser-tab[visuallyselected] { - color: var(--tab-selection-color) !important; /* Override color: inherit */ - background-color: var(--tab-selection-background-color); -} - -.tab-icon-sound[soundplaying], -.tab-icon-sound[muted] { - filter: url(chrome://browser/skin/filters.svg#fill) !important; /* removes drop-shadow filter */ -} - -/* Don't need space for the tab curves (66px - 30px) */ -.tabs-newtab-button { - width: 36px; -} - -.tabs-newtab-button:hover { - /* Important needed because !important is used in browser.css */ - background-color: var(--tab-hover-background-color) !important; - background-image: none; -} diff --git a/application/basilisk/themes/shared/devedition/urlbar-history-dropmarker.svg b/application/basilisk/themes/shared/devedition/urlbar-history-dropmarker.svg deleted file mode 100644 index 115fbf127..000000000 --- a/application/basilisk/themes/shared/devedition/urlbar-history-dropmarker.svg +++ /dev/null @@ -1,22 +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/. --> -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="33" height="14" viewBox="0 0 33 14"> - <defs> - <polygon points="0,0 5.5,7 11,0" id="dropmarker-shape"/> - </defs> - <style> - use { - fill: #b6babf; - } - .hover { - fill: #61bdeb; - } - .active { - fill: #39ace6; - } - </style> - <use xlink:href="#dropmarker-shape" style="transform: translate(0, 4px)"/> - <use xlink:href="#dropmarker-shape" style="transform: translate(11px, 4px)" class="hover"/> - <use xlink:href="#dropmarker-shape" style="transform: translate(22px, 4px)" class="active"/> -</svg> diff --git a/application/basilisk/themes/shared/incontentprefs/containers.css b/application/basilisk/themes/shared/incontentprefs/containers.css deleted file mode 100644 index 5446dccce..000000000 --- a/application/basilisk/themes/shared/incontentprefs/containers.css +++ /dev/null @@ -1,32 +0,0 @@ -/* 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/. */ - -%include ../../../components/contextualidentity/content/usercontext.css - -.container-header-links { - margin-block-end: 15px; -} - -[data-identity-icon] { - margin: 0; - margin-inline-end: 16px; -} - -#containersView { - border: 0 none; - background: transparent; -} - -#containersView richlistitem { - margin: 0px; - margin-inline-end: 8px; - padding: 0; - padding-block-end: 8px; - border-block-end: 1px solid var(--in-content-header-border-color); -} - -#containersView richlistitem:last-of-type { - border-block-end: 0 none; - margin-block-end: 8px; -} diff --git a/application/basilisk/themes/shared/incontentprefs/preferences.inc.css b/application/basilisk/themes/shared/incontentprefs/preferences.inc.css index 0e62660de..20ea98327 100644 --- a/application/basilisk/themes/shared/incontentprefs/preferences.inc.css +++ b/application/basilisk/themes/shared/incontentprefs/preferences.inc.css @@ -237,8 +237,7 @@ treecol { /* Privacy pane */ #trackingProtectionPBMLearnMore, -#trackingProtectionLearnMore, -#browserContainersLearnMore { +#trackingProtectionLearnMore { margin-inline-start: 1.5em !important; margin-top: 0; font-weight: normal; diff --git a/application/basilisk/themes/shared/jar.inc.mn b/application/basilisk/themes/shared/jar.inc.mn index 588cf5364..d12971a4b 100644 --- a/application/basilisk/themes/shared/jar.inc.mn +++ b/application/basilisk/themes/shared/jar.inc.mn @@ -73,8 +73,6 @@ skin/classic/browser/preferences/in-content/favicon.ico (../shared/incontentprefs/favicon.ico) skin/classic/browser/preferences/in-content/icons.svg (../shared/incontentprefs/icons.svg) skin/classic/browser/preferences/in-content/search.css (../shared/incontentprefs/search.css) -* skin/classic/browser/preferences/in-content/containers.css (../shared/incontentprefs/containers.css) -* skin/classic/browser/preferences/containers.css (../shared/preferences/containers.css) skin/classic/browser/fxa/default-avatar.svg (../shared/fxa/default-avatar.svg) skin/classic/browser/fxa/logo.png (../shared/fxa/logo.png) skin/classic/browser/fxa/logo@2x.png (../shared/fxa/logo@2x.png) @@ -108,10 +106,6 @@ skin/classic/browser/theme-switcher-icon.png (../shared/theme-switcher-icon.png) skin/classic/browser/theme-switcher-icon@2x.png (../shared/theme-switcher-icon@2x.png) skin/classic/browser/toolbarbutton-dropdown-arrow.png (../shared/toolbarbutton-dropdown-arrow.png) - skin/classic/browser/translating-16.png (../shared/translation/translating-16.png) - skin/classic/browser/translating-16@2x.png (../shared/translation/translating-16@2x.png) - skin/classic/browser/translation-16.png (../shared/translation/translation-16.png) - skin/classic/browser/translation-16@2x.png (../shared/translation/translation-16@2x.png) skin/classic/browser/undoCloseTab.png (../shared/undoCloseTab.png) skin/classic/browser/undoCloseTab@2x.png (../shared/undoCloseTab@2x.png) skin/classic/browser/update-badge.svg (../shared/update-badge.svg) @@ -143,6 +137,5 @@ skin/classic/browser/privatebrowsing/private-browsing.svg (../shared/privatebrowsing/private-browsing.svg) skin/classic/browser/privatebrowsing/tracking-protection-off.svg (../shared/privatebrowsing/tracking-protection-off.svg) skin/classic/browser/privatebrowsing/tracking-protection.svg (../shared/privatebrowsing/tracking-protection.svg) - skin/classic/browser/devedition/urlbar-history-dropmarker.svg (../shared/devedition/urlbar-history-dropmarker.svg) skin/classic/browser/urlbar-star.svg (../shared/urlbar-star.svg) skin/classic/browser/urlbar-tab.svg (../shared/urlbar-tab.svg) diff --git a/application/basilisk/themes/shared/menupanel.inc.css b/application/basilisk/themes/shared/menupanel.inc.css index 266e1c83e..da2f07e1e 100644 --- a/application/basilisk/themes/shared/menupanel.inc.css +++ b/application/basilisk/themes/shared/menupanel.inc.css @@ -48,10 +48,29 @@ toolbarpaletteitem[place="palette"] > #save-page-button { -moz-image-region: rect(0px, 352px, 32px, 320px); } +%ifdef MOZ_SERVICES_SYNC #sync-button[cui-areatype="menu-panel"], toolbarpaletteitem[place="palette"] > #sync-button { + -moz-image-region: rect(0px, 384px, 32px, 352px) +} + +#sync-button[cui-areatype="menu-panel"][status="active"] { + list-style-image: url("chrome://browser/skin/syncProgress-menuPanel.png"); + -moz-image-region: rect(0, 32px, 32px, 0); +} + +@media (min-resolution: 1.1dppx) { + #sync-button[cui-areatype="menu-panel"][status="active"] { + list-style-image: url("chrome://browser/skin/syncProgress-menuPanel@2x.png"); + -moz-image-region: rect(0, 64px, 64px, 0); + } +} + +#sync-tabs-button[cui-areatype="menu-panel"], +toolbarpaletteitem[place="palette"] > #sync-tabs-button { -moz-image-region: rect(0px, 1024px, 32px, 992px); } +%endif #containers-panelmenu[cui-areatype="menu-panel"], toolbarpaletteitem[place="palette"] > #containers-panelmenu { diff --git a/application/basilisk/themes/shared/newtab/newTab.inc.css b/application/basilisk/themes/shared/newtab/newTab.inc.css index 8ecd603c9..5cbdb240e 100644 --- a/application/basilisk/themes/shared/newtab/newTab.inc.css +++ b/application/basilisk/themes/shared/newtab/newTab.inc.css @@ -99,19 +99,6 @@ border-radius: 2px; } -/* GRID */ -#topsites-heading { - color: #7A7A7A; - font-size: 1em; - font-weight: normal; - /* Position the heading such that it doesn't affect how many cells we - can fit into the grid. */ - position: absolute; - /* The top margin moves the heading away from the grid. - The horizontal margin aligns the heading with the cells. */ - margin: -1em 10px 0; -} - /* CELLS */ .newtab-cell { --cell-corner-radius: 8px; @@ -119,10 +106,6 @@ border-radius: var(--cell-corner-radius); } -body.compact .newtab-cell { - --cell-corner-radius: 2px; -} - .newtab-cell:empty { outline: 2px dashed #c1c1c1; outline-offset: -2px; @@ -172,49 +155,16 @@ body.compact .newtab-cell { transition: opacity 100ms ease-out; } -body.compact .newtab-thumbnail { - height: 100%; - border-radius: calc(var(--cell-corner-radius) + 1px); - outline: 1px solid hsla(0,0%,0%,.1); - -moz-outline-radius: var(--cell-corner-radius); - outline-offset: -1px; -} - .newtab-thumbnail.placeholder { color: white; font-size: 85px; line-height: 200%; } -body.compact .newtab-thumbnail.placeholder { - font-size: 45px; -} - -.newtab-cell:not([ignorehover]) .newtab-site:hover .newtab-thumbnail.enhanced-content { - opacity: 0; -} - -.newtab-site[type=affiliate] .newtab-thumbnail, -.newtab-site[type=enhanced] .newtab-thumbnail, -.newtab-site[type=organic] .newtab-thumbnail, -.newtab-site[type=sponsored] .newtab-thumbnail { - background-position: center center; -} - -body.compact .newtab-site[type=affiliate] .newtab-thumbnail { - background-position: center 30%; -} - -.newtab-site[type=affiliate] .newtab-thumbnail, -body:not(.compact) .newtab-site[type=enhanced] .newtab-thumbnail, -body:not(.compact) .newtab-site[type=organic] .newtab-thumbnail, -body:not(.compact) .newtab-site[type=sponsored] .newtab-thumbnail { - background-size: auto; -} - /* TITLES */ .newtab-title { + color: #5c5c5c; background-color: #F2F2F2; font-size: 13px; line-height: 30px; @@ -222,45 +172,13 @@ body:not(.compact) .newtab-site[type=sponsored] .newtab-thumbnail { border-radius: 0 0 var(--cell-corner-radius) var(--cell-corner-radius); } -body.compact .newtab-title { - background-color: hsla(0,0%,100%,.85); - font-size: 12px; - line-height: 21px; - border: 1px solid hsla(0,0%,80%,.8); - border-top-color: hsla(0,0%,0%,.1); - background-clip: padding-box; -} - -.newtab-title, -.newtab-suggested { - color: #5c5c5c; -} - -body.compact .newtab-title, -body.compact .newtab-suggested { - color: black; -} - -.newtab-suggested[active] { - background-color: rgba(51, 51, 51, 0.95); - border: 0; - color: white; -} - -body:not(.compact) .newtab-site:hover .newtab-title { +.newtab-site:hover .newtab-title { color: white; background-color: #333; border-color: #333; border-top-color: white; } -body.compact .newtab-site:hover .newtab-title { - color: white; - background-color: hsla(0,0%,20%,.85); - border-color: hsla(0,0%,0%,.8); - border-top-color: white; -} - .newtab-site[pinned] .newtab-title { padding-inline-start: 24px; } @@ -302,20 +220,6 @@ body.compact .newtab-site:hover .newtab-title { right: 4px; } -body.compact .newtab-control { - top: -8px; -} - -body.compact .newtab-control-pin:dir(ltr), -body.compact .newtab-control-block:dir(rtl) { - left: -8px; -} - -body.compact .newtab-control-block:dir(ltr), -body.compact .newtab-control-pin:dir(rtl) { - right: -8px; -} - .newtab-control-pin, .newtab-site[pinned] .newtab-control-pin:hover:active { background-image: -moz-image-rect(url(chrome://browser/skin/newtab/controls.svg), 0, 96, 32, 64); diff --git a/application/basilisk/themes/shared/notification-icons.inc.css b/application/basilisk/themes/shared/notification-icons.inc.css index f641e72c1..99451ba98 100644 --- a/application/basilisk/themes/shared/notification-icons.inc.css +++ b/application/basilisk/themes/shared/notification-icons.inc.css @@ -266,27 +266,3 @@ html|*#webRTC-previewVideo { opacity: 1; } } - -/* TRANSLATION */ - -.translation-icon { - list-style-image: url(chrome://browser/skin/translation-16.png); - -moz-image-region: rect(0px, 16px, 16px, 0px); -} - -.translation-icon.in-use { - -moz-image-region: rect(0px, 32px, 16px, 16px); -} - -%ifdef XP_MACOSX -@media (min-resolution: 1.1dppx) { - .translation-icon { - list-style-image: url(chrome://browser/skin/translation-16@2x.png); - -moz-image-region: rect(0px, 32px, 32px, 0px); - } - - .translation-icon.in-use { - -moz-image-region: rect(0px, 64px, 32px, 32px); - } -} -%endif diff --git a/application/basilisk/themes/shared/preferences/containers.css b/application/basilisk/themes/shared/preferences/containers.css deleted file mode 100644 index 3fb965331..000000000 --- a/application/basilisk/themes/shared/preferences/containers.css +++ /dev/null @@ -1,53 +0,0 @@ -/* 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/. */ - -%include ../../../components/contextualidentity/content/usercontext.css - -:root { - --preference-selected-color: #0996f8; - --preference-unselected-color: #333; - --preference-active-color: #858585; -} - -radiogroup { - display: flex; - margin-inline-start: 0.35rem; -} - -radio { - flex: auto; - display: flex; - align-items: center; - justify-content: center; - -moz-user-select: none; - outline: 2px solid transparent; - outline-offset: 4px; - -moz-outline-radius: 100%; - min-block-size: 24px; - min-inline-size: 24px; - border-radius: 50%; - padding: 2px; - margin: 10px; -} - -.icon-buttons > radio > [data-identity-icon] { - fill: #4d4d4d; -} - -radio > [data-identity-icon] { - inline-size: 22px; - block-size: 22px; -} - -radio[selected=true] { - outline-color: var(--preference-unselected-color); -} - -radio[focused=true] { - outline-color: var(--preference-selected-color); -} - -radio:hover:active { - outline-color: var(--preference-active-color); -} diff --git a/application/basilisk/themes/shared/syncedtabs/sidebar.inc.css b/application/basilisk/themes/shared/syncedtabs/sidebar.inc.css deleted file mode 100644 index 4e76a7fc5..000000000 --- a/application/basilisk/themes/shared/syncedtabs/sidebar.inc.css +++ /dev/null @@ -1,234 +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/. - -/* These styles are intended to mimic XUL trees and the XUL search box. */ - -html { - height: 100%; -} - -body { - height: 100%; - margin: 0; - font: message-box; - color: #333333; - -moz-user-select: none; -} - -/* The content-container holds the non-scrollable header and the scrollable - content area. -*/ -.content-container { - display: flex; - flex-flow: column; - height: 100%; -} - -/* The content header is not scrollable */ -.content-header { - flex: 0 1 auto; -} - -/* The main content area is scrollable and fills the rest of the area */ -.content-scrollable { - flex: 1 1 auto; - overflow: auto; -} - -.emptyListInfo { - cursor: default; - padding: 3em 1em; - text-align: center; -} - -.list, -.item-tabs-list { - display: flex; - flex-flow: column; - flex-grow: 1; -} - -.item.client { - opacity: 1; - max-height: unset; - display: unset; -} - -.item.client.closed .item-tabs-list { - display: none; -} - -.item { - display: inline-block; - opacity: 1; - flex: 1; - min-width: 0; - white-space: nowrap; - overflow: hidden; - outline: none; - color: -moz-FieldText; -} - -.item.selected > .item-title-container { - background-color: -moz-cellhighlight; - color: -moz-cellhighlighttext; - font-weight: bold; -} - -.item.selected:focus > .item-title-container { - background-color: Highlight; - color: HighlightText; -} - -.client .item.tab > .item-title-container { - padding-inline-start: 35px; -} - -.item.tab > .item-title-container { - padding-inline-start: 20px; -} - -.item.client.device-image-desktop > .item-title-container > .item-icon-container { - background-image: url("chrome://browser/skin/sync-desktopIcon.svg#icon"); -} - -.item.client.device-image-desktop.selected:focus > .item-title-container > .item-icon-container { - background-image: url("chrome://browser/skin/sync-desktopIcon.svg#icon-inverted"); -} - -.item.client.device-image-mobile > .item-title-container > .item-icon-container { - background-image: url("chrome://browser/skin/sync-mobileIcon.svg#icon"); -} - -.item.client.device-image-mobile.selected:focus > .item-title-container > .item-icon-container { - background-image: url("chrome://browser/skin/sync-mobileIcon.svg#icon-inverted"); -} - -.item.tab > .item-title-container > .item-icon-container { - background-image: url("chrome://mozapps/skin/places/defaultFavicon.png"); -} - -@media (min-resolution: 1.1dppx) { -.item.tab > .item-title-container > .item-icon-container { - background-image: url("chrome://mozapps/skin/places/defaultFavicon@2x.png"); - } -} - -.item-icon-container { - min-width: 16px; - max-width: 16px; - min-height: 16px; - max-height: 16px; - margin-right: 5px; - margin-left: 5px; - background-size: 16px 16px; - background-size: contain; - background-repeat: no-repeat; - background-position: center; -} - -.item-title-container { - display: flex; - flex-flow: row; - overflow: hidden; - flex-grow: 1; - padding: 1px 0px 1px 0px; -} - -.item-title { - flex-grow: 1; - overflow: hidden; - text-overflow: ellipsis; - margin: 0px; - line-height: 1.3; - cursor: default; -} - -.item[hidden] { - opacity: 0; - max-height: 0; - transition: opacity 150ms ease-in-out, max-height 150ms ease-in-out 150ms; -} - -.item.empty .item-title-container { - color: #aeaeae; -} - -.client .item.empty > .item-title-container { - padding-inline-start: 35px; -} - -.text-input-box { - display: flex; - flex-flow: row nowrap; -} - -.textbox-input-box { - display: flex; - flex-direction: row; -} - -.tabsFilter { - flex: 1; - /* min-width of anything to override the implicit "-moz-min-content" value. - 0px is safe as the sidebar itself has a constrained size meaning we will - never actually hit this minimum - */ - min-width: 0px; -} - -.sync-state > p { - padding-inline-end: 10px; - padding-inline-start: 10px; - color: #888; -} - -.text-link { - color: rgb(0, 149, 221); - cursor: pointer; -} - -.text-link:hover { - text-decoration: underline; -} - -.text-link, -.text-link:focus { - margin: 0px; - padding: 0px; - border: 0px; -} - -.deck .sync-state { - display: none; - opacity: 0; - transition: opacity 1.5s; - border-top: 1px solid #bdbdbd; -} - -.deck .sync-state.tabs-container { - border-top: 0px; -} - -.deck .sync-state.selected { - display: unset; - opacity: 100; -} - -.sidebar-search-container.tabs-container:not(.selected) { - display: none; -} - -.textbox-search-clear:not([disabled]) { - cursor: default; -} - -.textbox-search-icons .textbox-search-clear, -.filtered .textbox-search-icons .textbox-search-icon { - display: none; -} - -.filtered .textbox-search-icons .textbox-search-clear { - display: block; -} diff --git a/application/basilisk/themes/shared/toolbarbuttons.inc.css b/application/basilisk/themes/shared/toolbarbuttons.inc.css index c043b8192..8992bfcb1 100644 --- a/application/basilisk/themes/shared/toolbarbuttons.inc.css +++ b/application/basilisk/themes/shared/toolbarbuttons.inc.css @@ -52,9 +52,32 @@ toolbar[brighttext] #bookmarks-menu-button > .toolbarbutton-menubutton-dropmarke -moz-image-region: rect(0, 252px, 18px, 234px); } +%ifdef MOZ_SERVICES_SYNC #sync-button[cui-areatype="toolbar"] { + -moz-image-region: rect(0, 270px, 18px, 252px); +} + +#sync-button[cui-areatype="toolbar"][status="active"] { + list-style-image: url("chrome://browser/skin/syncProgress-toolbar.png"); + -moz-image-region: rect(0, 18px, 18px, 0); +} + +@media (-moz-os-version: windows-win7) { + #sync-button[cui-areatype="toolbar"][status="active"] { + list-style-image: url("chrome://browser/skin/syncProgress-toolbar-win7.png"); + -moz-image-region: rect(0, 18px, 18px, 0); + } +} + +toolbar[brighttext] #sync-button[cui-areatype="toolbar"][status="active"] { + list-style-image: url("chrome://browser/skin/syncProgress-toolbar-inverted.png"); + -moz-image-region: rect(0, 18px, 18px, 0); +} + +#sync-tabs-button[cui-areatype="toolbar"] { -moz-image-region: rect(0, 792px, 18px, 774px); } +%endif #containers-panelmenu[cui-areatype="toolbar"] { -moz-image-region: rect(0, 810px, 18px, 792px); @@ -226,9 +249,32 @@ toolbar[brighttext] #bookmarks-menu-button > .toolbarbutton-menubutton-dropmarke -moz-image-region: rect(0, 504px, 36px, 468px); } +%ifdef MOZ_SERVICES_SYNC #sync-button[cui-areatype="toolbar"] { + -moz-image-region: rect(0, 540px, 36px, 504px); + } + + #sync-button[cui-areatype="toolbar"][status="active"] { + list-style-image: url("chrome://browser/skin/syncProgress-toolbar@2x.png"); + -moz-image-region: rect(0, 36px, 36px, 0); + } + + @media (-moz-os-version: windows-win7) { + #sync-button[cui-areatype="toolbar"][status="active"] { + list-style-image: url("chrome://browser/skin/syncProgress-toolbar-win7@2x.png"); + -moz-image-region: rect(0, 36px, 36px, 0); + } + } + + toolbar[brighttext] #sync-button[cui-areatype="toolbar"][status="active"] { + list-style-image: url("chrome://browser/skin/syncProgress-toolbar-inverted@2x.png"); + -moz-image-region: rect(0, 36px, 36px, 0); + } + + #sync-tabs-button[cui-areatype="toolbar"] { -moz-image-region: rect(0, 1584px, 36px, 1548px); } +%endif #containers-panelmenu[cui-areatype="toolbar"] { -moz-image-region: rect(0, 1620px, 36px, 1584px); diff --git a/application/basilisk/themes/shared/translation/infobar.inc.css b/application/basilisk/themes/shared/translation/infobar.inc.css deleted file mode 100644 index 50d1acc01..000000000 --- a/application/basilisk/themes/shared/translation/infobar.inc.css +++ /dev/null @@ -1,95 +0,0 @@ -%if 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 -notification[value="translation"] .messageImage { - list-style-image: url(chrome://browser/skin/translation-16.png); - -moz-image-region: rect(0, 32px, 16px, 16px); -} - -@media (min-resolution: 1.25dppx) { - notification[value="translation"] .messageImage { - list-style-image: url(chrome://browser/skin/translation-16@2x.png); - -moz-image-region: rect(0, 64px, 32px, 32px); - } -} - -notification[value="translation"][state="translating"] .messageImage { - list-style-image: url(chrome://browser/skin/translating-16.png); - -moz-image-region: auto; -} - -@media (min-resolution: 1.25dppx) { - notification[value="translation"][state="translating"] .messageImage { - list-style-image: url(chrome://browser/skin/translating-16@2x.png); - } -} - -notification[value="translation"] hbox[anonid="details"] { - overflow: hidden; -} - -notification[value="translation"] button, -notification[value="translation"] menulist { - -moz-appearance: none; - border-width: 1px; - -moz-border-top-colors: none; - -moz-border-right-colors: none; - -moz-border-bottom-colors: none; - -moz-border-left-colors: none; - border-radius: 2px; - min-width: 0; - box-shadow: 0 1px rgba(255, 255, 255, 0.5), 0 1px rgba(255, 255, 255, 0.5) inset; -} - -notification[value="translation"] menulist > .menulist-dropmarker { - -moz-appearance: toolbarbutton-dropdown; - border: none; - background-color: transparent; - margin: auto; - padding: 5px 0; -} - -.translation-menupopup arrowscrollbox { - padding-bottom: 0; -} - -.translation-attribution { - cursor: pointer; - -moz-box-align: end; - font-size: small; -} - -.translation-attribution > label { - margin-bottom: 0; -} - -.translation-attribution > image { - width: 70px; -} - -.translation-welcome-panel { - width: 305px; -} - -.translation-welcome-logo { - height: 32px; - width: 32px; - list-style-image: url(chrome://browser/skin/translation-16@2x.png); - -moz-image-region: rect(0, 64px, 32px, 32px); -} - -.translation-welcome-content { - margin-inline-start: 16px; -} - -.translation-welcome-headline { - font-size: larger; - font-weight: bold; -} - -.translation-welcome-body { - padding: 1em 0; - margin: 0 0; -} diff --git a/application/basilisk/themes/shared/translation/translating-16.png b/application/basilisk/themes/shared/translation/translating-16.png Binary files differdeleted file mode 100644 index 71ca37c22..000000000 --- a/application/basilisk/themes/shared/translation/translating-16.png +++ /dev/null diff --git a/application/basilisk/themes/shared/translation/translating-16@2x.png b/application/basilisk/themes/shared/translation/translating-16@2x.png Binary files differdeleted file mode 100644 index ab6184047..000000000 --- a/application/basilisk/themes/shared/translation/translating-16@2x.png +++ /dev/null diff --git a/application/basilisk/themes/shared/translation/translation-16.png b/application/basilisk/themes/shared/translation/translation-16.png Binary files differdeleted file mode 100644 index 4b42dedcf..000000000 --- a/application/basilisk/themes/shared/translation/translation-16.png +++ /dev/null diff --git a/application/basilisk/themes/shared/translation/translation-16@2x.png b/application/basilisk/themes/shared/translation/translation-16@2x.png Binary files differdeleted file mode 100644 index 2105a3e4a..000000000 --- a/application/basilisk/themes/shared/translation/translation-16@2x.png +++ /dev/null diff --git a/application/basilisk/themes/windows/browser.css b/application/basilisk/themes/windows/browser.css index 2ed3e7e6a..9a965520a 100644 --- a/application/basilisk/themes/windows/browser.css +++ b/application/basilisk/themes/windows/browser.css @@ -193,9 +193,6 @@ toolbar:-moz-lwtheme { @media not all and (-moz-windows-compositor), not all and (-moz-windows-default-theme) { - /* Please keep the menu text colors in this media block in sync with - * devedition.css, minus the :not(:-moz-lwtheme) condition - see Bug 1165718. - */ :root[tabsintitlebar]:not([inFullscreen]):not(:-moz-lwtheme) { --titlebar-text-color: CaptionText; } @@ -2113,87 +2110,6 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] { outline: 1px dotted -moz-DialogText; } -/* Translation infobar */ - -%include ../shared/translation/infobar.inc.css - -notification[value="translation"] { - min-height: 40px; -} - -@media (-moz-windows-default-theme) { - notification[value="translation"], - notification[value="translation"] button, - notification[value="translation"] menulist { - min-height: 30px; - color: #545454; - } - - notification[value="translation"] { - background-color: #EEE; - } - - notification[value="translation"] button, - notification[value="translation"] menulist { - padding-inline-end: 1ch; - } - - notification[value="translation"] menulist { - border: 1px solid #C1C1C1; - background-color: #FFF; - } - - notification[value="translation"] button { - border: 1px solid #C1C1C1; - background-color: #FBFBFB; - } - - notification[value="translation"] button, - notification[value="translation"] menulist, - notification[value="translation"] menulist > .menulist-label-box { - margin-inline-start: 1ch; - margin-inline-end: 1ch; - } - - notification[value="translation"] button:hover, - notification[value="translation"] button:active, - notification[value="translation"] menulist:hover, - notification[value="translation"] menulist:active { - background-color: #EBEBEB; - } - - notification[value="translation"] button[anonid="translate"] { - color: #FFF; - background-color: #0095DD; - box-shadow: none; - border: 1px solid #006B9D; - } - - notification[value="translation"] button[anonid="translate"]:hover, - notification[value="translation"] button[anonid="translate"]:active { - background-color: #008ACB; - } - - notification[value="translation"] button[type="menu"] > .button-box > .button-menu-dropmarker, - notification[value="translation"] menulist > .menulist-dropmarker { - list-style-image: url("chrome://browser/skin/toolbarbutton-dropdown-arrow.png"); - } - - notification[value="translation"] button > .button-box, - notification[value="translation"] button[type="menu"] > .button-box > .button-menu-dropmarker { - padding: 0; - margin-inline-start: 3ch; - } - - notification[value="translation"] button:not([type="menu"]) > .button-box { - margin-inline-end: 3ch; - } -} - -.translation-menupopup { - -moz-appearance: none; -} - /* Bookmarks roots menu-items */ #subscribeToPageMenuitem:not([disabled]), #subscribeToPageMenupopup { diff --git a/application/basilisk/themes/windows/devedition.css b/application/basilisk/themes/windows/devedition.css deleted file mode 100644 index bdf4bb80e..000000000 --- a/application/basilisk/themes/windows/devedition.css +++ /dev/null @@ -1,316 +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/. - -%include ../shared/devedition.inc.css - -:root { - --forwardbutton-width: 29px; -} - -:root[devtoolstheme="dark"], -:root[devtoolstheme="light"] { - /* Matches the #browser-border-start, #browser-border-end color */ - --chrome-nav-bar-separator-color: rgba(10, 31, 51, 0.35); -} - -/* The window background is white due to no accentcolor in the lightweight - theme. It can't be changed to transparent when there is no compositor - (Win 7 in classic / basic theme), or else dragging and focus become - broken. So instead just show the normal titlebar in that case, and override - the window color as transparent when the compositor is available. */ -@media not all and (-moz-windows-compositor) { - #main-window[tabsintitlebar] #titlebar:-moz-lwtheme { - visibility: visible; - } - - #main-window { - background: var(--chrome-background-color) !important; - } -} - -@media (-moz-windows-compositor) { - #main-window { - background: transparent !important; - } -} - -#TabsToolbar::after { - display: none; -} - -#back-button > .toolbarbutton-icon, -#forward-button > .toolbarbutton-icon { - background: var(--chrome-nav-buttons-background) !important; - border-radius: 0 !important; - height: auto !important; - padding: var(--toolbarbutton-vertical-inner-padding) 5px !important; - margin: 0 !important; - border: 1px solid var(--chrome-nav-bar-controls-border-color) !important; - box-shadow: none !important; -} - -#back-button > .toolbarbutton-icon { - /* 18px icon + 2 * 5px padding + 2 * 1px border */ - width: 30px !important; -} - -#forward-button > .toolbarbutton-icon { - /* 18px icon + 2 * 5px padding + 1 * 1px border */ - width: 29px !important; -} - -/* the normal theme adds box-shadow: <stuff> !important when the back-button is [open]. Fix: */ -#back-button[open="true"] > .toolbarbutton-icon { - box-shadow: none !important; -} - -#forward-button > .toolbarbutton-icon { - border-inline-start: none !important; -} - -/* Override a box shadow for disabled back button */ -#main-window:not([customizing]) #back-button[disabled] > .toolbarbutton-icon { - box-shadow: none !important; -} - -/* Override !important properties for hovered back button */ -#main-window #back-button:hover:not([disabled="true"]) > .toolbarbutton-icon, -#main-window #forward-button:hover:not([disabled="true"]) > .toolbarbutton-icon { - background: var(--chrome-nav-buttons-hover-background) !important; - box-shadow: none !important; -} - -#back-button > .toolbarbutton-icon { - border-radius: 2px 0 0 2px !important; -} - -#nav-bar .toolbarbutton-1:not([type=menu-button]), -#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-button, -#nav-bar .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker { - padding-top: 2px; - padding-bottom: 2px; -} - -.tabbrowser-tab { - background-color: var(--tab-background-color); -} - -#toolbar-menubar { - text-shadow: none !important; -} - -:root[devtoolstheme="dark"] .findbar-closebutton, -:root[devtoolstheme="dark"] #sidebar-header > .close-icon, -/* Tab styling - make sure to use an inverted icon for the selected tab - (brighttext only covers the unselected tabs) */ -.tab-close-button[selected=true] { - list-style-image: url("chrome://global/skin/icons/close-inverted.png"); -} - -@media (min-resolution: 1.1dppx) { - :root[devtoolstheme="dark"] .findbar-closebutton, - :root[devtoolstheme="dark"] #sidebar-header > .close-icon, - .tab-close-button[selected=true] { - list-style-image: url("chrome://global/skin/icons/close-inverted@2x.png"); - } -} - -@media (-moz-os-version: windows-win7), - (-moz-os-version: windows-win8) { - :root { - --space-above-tabbar: 15px; - } - - /* It'd be nice if there was an element in the scrollbox's inner content - that collapsed to the current width of the tabs. Since there isn't we - need to handle overflowing and non-overflowing tabs separately. - - In the case of overflowing tabs, set a border-top on the entire container, - otherwise we need to set it on each element individually */ - #main-window[sizemode=normal] .tabbrowser-tabs[overflow="true"] { - background-clip: padding-box; - border-top: 1px solid var(--chrome-nav-bar-separator-color); - border-inline-end: 1px solid var(--chrome-nav-bar-separator-color); - background-color: var(--tab-background-color); /* Make sure there is no transparent gap during tab close animation */ - } - - /* Add a border to the left of the first tab (or scroll arrow). Using .tabbrowser-tabs - instead of #TabsToolbar because it will work even in customize mode. */ - #main-window[sizemode=normal] .tabbrowser-tabs { - background-clip: padding-box; - border-inline-start: 1px solid var(--chrome-nav-bar-separator-color); - border-inline-end: 1px solid transparent; - } - - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabbrowser-tab, - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabbrowser-arrowscrollbox > .scrollbutton-down, - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabbrowser-arrowscrollbox > .scrollbutton-up, - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabs-newtab-button { - background-clip: padding-box; - border-top: 1px solid var(--chrome-nav-bar-separator-color); - } - - /* Allow the border-top rule to take effect */ - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .tabbrowser-tab { - -moz-border-top-colors: none; - } - - #main-window[sizemode=normal] .tabbrowser-tabs:not([overflow="true"]) .closing-tabs-spacer { - background-clip: padding-box; - border-inline-start: 1px solid var(--chrome-nav-bar-separator-color); - } - - .tabs-newtab-button { - background: var(--tab-background-color); - } - - /* Use default window colors when in non-maximized mode */ - #tabbrowser-tabs, - #TabsToolbar, - #browser-panel, - #titlebar-content { - background: transparent; - } - - /* Ensure that the entire background is styled when maximized/fullscreen */ - #main-window:not([sizemode="normal"]):not([customizing]) #browser-panel { - background: var(--chrome-background-color) !important; - } - - /* The menu items need to be visible when the entire background is styled */ - #main-window:not([sizemode="normal"]) #main-menubar { - color: var(--chrome-color); - background-color: transparent; - } - - #main-window[sizemode="maximized"] #main-menubar > menu:not(:-moz-window-inactive) { - color: inherit; - } - - /* Use proper menu text styling in Win7 classic mode (copied from browser.css) */ - @media not all and (-moz-windows-compositor), - not all and (-moz-windows-default-theme) { - :root[tabsintitlebar]:not([inFullscreen]) { - --titlebar-text-color: CaptionText; - } - - :root[tabsintitlebar]:not([inFullscreen]):-moz-window-inactive { - --titlebar-text-color: InactiveCaptionText; - } - - #main-window[tabsintitlebar] #main-menubar > menu { - color: inherit; - } - } - - /* Use less opacity than normal since this is very dark, and on top of the default toolbar color */ - .tabbrowser-arrowscrollbox > .scrollbutton-up[disabled], - .tabbrowser-arrowscrollbox > .scrollbutton-down[disabled] { - opacity: .6; - } - - /* Override scrollbutton gradients in normal and hover state */ - .tabbrowser-arrowscrollbox > .scrollbutton-down, - .tabbrowser-arrowscrollbox > .scrollbutton-up { - background-image: none !important; - transition: none; /* scrollbutton-down has an unwanted transition on background color */ - } - - /* Restore draggable space on the sides of tabs when maximized */ - #main-window[sizemode="maximized"] .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox { - padding-left: 15px; - padding-right: 15px; - } - - /* Override the padding that's intended to compensate for tabs that can overlap border-radius on nav-bar in default theme. */ - #main-window[sizemode=normal]:not([customizing]) #TabsToolbar { - padding-left: 0; - padding-right: 0; - } -} - -/* Restored windows get an artificial border on windows, because the lwtheme background - * overlaps the regular window border. That isn't the case for us, so we avoid painting - * over the native border with our custom borders: */ -#browser-panel { - /* These are !important to avoid specificity-wars with the selectors that add borders here. */ - background-image: none !important; - border-top: none !important; -} - -#navigator-toolbox { - /* The side borders on the toolbox also look out-of-place because we don't paint over - * the native background color at all, and these are !important for the same reason as above. */ - border-left: none !important; - border-right: none !important; -} - -/* Disable dragging like in the default theme: */ -#main-window[tabsintitlebar] #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar):-moz-lwtheme { - -moz-window-dragging: no-drag; -} - -/* The sidebar header has no background now that the background of the #browser-panel - * has no image and is transparent. Fix: */ -.sidebar-header:-moz-lwtheme, -#sidebar-header { - background-color: var(--chrome-background-color); - color: var(--chrome-color); -} - -@media (-moz-os-version: windows-win7), - (-moz-os-version: windows-win8) { - /* And then we add them back on toolbars so that they don't look borderless: */ - #main-window:not([customizing])[sizemode=normal] #navigator-toolbox::after, - #main-window:not([customizing])[sizemode=normal] #navigator-toolbox > toolbar:not(#toolbar-menubar):not(#TabsToolbar) { - border-left: 1px solid hsla(209,67%,12%,0.35); - border-right: 1px solid hsla(209,67%,12%,0.35); - } -} - -@media (-moz-os-version: windows-win10) { - /* Always keep draggable space on the sides of tabs since there is no top margin on Win10 */ - #main-window .tabbrowser-arrowscrollbox > .arrowscrollbox-scrollbox { - padding-left: 15px; - padding-right: 15px; - } - - /* Force white caption buttons for the dark theme on Windows 10 */ - :root[devtoolstheme="dark"] #titlebar-min { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#minimize-white); - } - :root[devtoolstheme="dark"] #titlebar-max { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#maximize-white); - } - #main-window[devtoolstheme="dark"][sizemode="maximized"] #titlebar-max { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#restore-white); - } - :root[devtoolstheme="dark"] #titlebar-close { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#close-white); - } - - /* ... and normal ones for the light theme on Windows 10 */ - :root[devtoolstheme="light"] #titlebar-min { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#minimize); - } - :root[devtoolstheme="light"] #titlebar-max { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#maximize); - } - #main-window[devtoolstheme="light"][sizemode="maximized"] #titlebar-max { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#restore); - } - :root[devtoolstheme="light"] #titlebar-close { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#close); - } - - :root[devtoolstheme="light"] #titlebar-close:hover { - list-style-image: url(chrome://browser/skin/caption-buttons.svg#close-white); - } -} - -.ac-type-icon { - /* Left-align the type icon in awesomebar popup results with the icon in the - urlbar. */ - margin-inline-start: 13px; -} diff --git a/application/basilisk/themes/windows/jar.mn b/application/basilisk/themes/windows/jar.mn index e8db7eed2..b0b9ca454 100644 --- a/application/basilisk/themes/windows/jar.mn +++ b/application/basilisk/themes/windows/jar.mn @@ -7,13 +7,13 @@ browser.jar: #include ../shared/jar.inc.mn skin/classic/browser/sanitizeDialog.css skin/classic/browser/aboutSessionRestore-window-icon.png +#ifdef MOZ_SERVICES_SYNC skin/classic/browser/aboutSyncTabs.css -* skin/classic/browser/syncedtabs/sidebar.css (syncedtabs/sidebar.css) +#endif skin/classic/browser/actionicon-tab.png skin/classic/browser/actionicon-tab@2x.png skin/classic/browser/actionicon-tab-win7.png * skin/classic/browser/browser.css -* skin/classic/browser/devedition.css * skin/classic/browser/browser-lightweightTheme.css skin/classic/browser/caption-buttons.svg skin/classic/browser/click-to-play-warning-stripes.png @@ -141,6 +141,7 @@ browser.jar: skin/classic/browser/tabbrowser/tab-stroke-start.png (tabbrowser/tab-stroke-start.png) skin/classic/browser/tabbrowser/tab-stroke-start@2x.png (tabbrowser/tab-stroke-start@2x.png) skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) +#ifdef MOZ_SERVICES_SYNC skin/classic/browser/sync-16.png skin/classic/browser/sync-32.png skin/classic/browser/sync-128.png @@ -167,6 +168,8 @@ browser.jar: skin/classic/browser/syncProgress-toolbar-inverted@2x.png skin/classic/browser/syncProgress-toolbar-win7.png skin/classic/browser/syncProgress-toolbar-win7@2x.png + skin/classic/browser/syncProgress.css +#endif [extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar: % override chrome://browser/skin/page-livemarks.png chrome://browser/skin/feeds/feedIcon16.png @@ -182,12 +185,14 @@ browser.jar: % override chrome://browser/skin/privatebrowsing-mask-titlebar.png chrome://browser/skin/privatebrowsing-mask-titlebar-win7.png os=WINNT osversion<=6.1 % override chrome://browser/skin/reload-stop-go.png chrome://browser/skin/reload-stop-go-win7.png os=WINNT osversion<=6.1 % override chrome://browser/skin/reload-stop-go@2x.png chrome://browser/skin/reload-stop-go-win7@2x.png os=WINNT osversion<=6.1 +#ifdef MOZ_SERVICES_SYNC % override chrome://browser/skin/sync-horizontalbar.png chrome://browser/skin/sync-horizontalbar-win7.png os=WINNT osversion<=6.1 % override chrome://browser/skin/sync-horizontalbar@2x.png chrome://browser/skin/sync-horizontalbar-win7@2x.png os=WINNT osversion<=6.1 % override chrome://browser/skin/syncProgress-horizontalbar.png chrome://browser/skin/syncProgress-horizontalbar-win7.png os=WINNT osversion<=6.1 % override chrome://browser/skin/syncProgress-horizontalbar@2x.png chrome://browser/skin/syncProgress-horizontalbar-win7@2x.png os=WINNT osversion<=6.1 % override chrome://browser/skin/syncProgress-toolbar.png chrome://browser/skin/syncProgress-toolbar-win7.png os=WINNT osversion<=6.1 % override chrome://browser/skin/syncProgress-toolbar@2x.png chrome://browser/skin/syncProgress-toolbar-win7@2x.png os=WINNT osversion<=6.1 +#endif % override chrome://browser/skin/toolbarbutton-dropdown-arrow.png chrome://browser/skin/toolbarbutton-dropdown-arrow-win7.png os=WINNT osversion<=6.1 % override chrome://browser/skin/urlbar-history-dropmarker.png chrome://browser/skin/urlbar-history-dropmarker-win7.png os=WINNT osversion<=6.1 % override chrome://browser/skin/urlbar-history-dropmarker@2x.png chrome://browser/skin/urlbar-history-dropmarker-win7@2x.png os=WINNT osversion<=6.1 diff --git a/application/basilisk/themes/windows/preferences/preferences.css b/application/basilisk/themes/windows/preferences/preferences.css index bd1ec3083..c6c063b53 100644 --- a/application/basilisk/themes/windows/preferences/preferences.css +++ b/application/basilisk/themes/windows/preferences/preferences.css @@ -15,13 +15,6 @@ #isNotDefaultLabel { font-weight: bold; } - -/* Content Pane */ -#translationAttributionImage { - width: 70px; - cursor: pointer; -} - /* Modeless Window Dialogs */ .windowDialog, .windowDialog prefpane { diff --git a/application/basilisk/themes/windows/syncProgress.css b/application/basilisk/themes/windows/syncProgress.css new file mode 100644 index 000000000..d7aa59976 --- /dev/null +++ b/application/basilisk/themes/windows/syncProgress.css @@ -0,0 +1,46 @@ +/* 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/. */ +@import url(chrome://global/skin/inContentUI.css); + +:root { + height: 100%; + width: 100%; + padding: 0; +} + +body { + margin: 0; + padding: 0 2em; +} + +#floatingBox { + margin: 4em auto; + max-width: 40em; + min-width: 23em; + padding: 1em 1.5em; + position: relative; + text-align: center; +} + +#successLogo { + margin: 1em 2em; +} + +#loadingText { + margin: 2em 6em; +} + +#progressBar { + margin: 2em 10em; +} + +#uploadProgressBar{ + width: 100%; +} + +#bottomRow { + margin-top: 2em; + padding: 0; + text-align: end; +} diff --git a/application/basilisk/themes/windows/syncedtabs/sidebar.css b/application/basilisk/themes/windows/syncedtabs/sidebar.css deleted file mode 100644 index 6473206bc..000000000 --- a/application/basilisk/themes/windows/syncedtabs/sidebar.css +++ /dev/null @@ -1,132 +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/. */ - -%include ../../shared/syncedtabs/sidebar.inc.css - -/* These styles are intended to mimic XUL trees and the XUL search box. */ - -html { - background-color: #EEF3FA; -} - -.item { - padding-inline-end: 0; -} - -.item-title { - margin: 1px 0 0; -} - -.item-title { - margin-inline-end: 6px; -} - -.search-box { - -moz-appearance: textfield; - cursor: text; - margin: 2px 4px; - padding: 2px 2px 3px; - padding-inline-start: 4px; - color: -moz-FieldText; -} - -.textbox-search-icon { - width: 16px; - height: 16px; - background-image: url(chrome://global/skin/icons/Search-glass.png); - background-repeat: no-repeat; - display: block; -} - -.textbox-search-icon:-moz-locale-dir(rtl) { - transform: scaleX(-1); -} - -.textbox-search-icon[searchbutton]:not([disabled]) { - cursor: pointer; -} - -.textbox-search-clear { - width: 16px; - height: 16px; - background-image: url(chrome://global/skin/icons/Search-close.png); - background-repeat: no-repeat; -} - -.textbox-search-clear:not([disabled]) { - cursor: default; -} - -.textbox-search-icon:not([disabled]) { - cursor: text; -} - -.textbox-search-clear:not([disabled]):hover , -.textbox-search-icon:not([disabled]):hover { - background-position: -16px 0; -} - -.textbox-search-clear:not([disabled]):hover:active , -.textbox-search-icon:not([disabled]):hover:active { - background-position: -32px 0; -} - -.client .item.tab > .item-title-container { - padding-inline-start: 26px; -} -.item.tab > .item-title-container { - padding-inline-start: 14px; -} - -.item-icon-container { - min-width: 16px; - max-width: 16px; - min-height: 16px; - max-height: 16px; - margin-right: 5px; - background-size: 16px 16px; - background-repeat: no-repeat; - background-position: center; -} - -.item-twisty-container { - background-size: contain; - background-repeat: no-repeat; - background-position: center; - padding-top: 5px; - min-width: 9px; /* The image's width is 9 pixels */ - height: 9px; -} - -.item.client .item-twisty-container { - background-image: url("chrome://global/skin/tree/twisty.svg#open"); -} - -.item.client.closed .item-twisty-container { - background-image: url("chrome://global/skin/tree/twisty.svg#clsd"); -} - -.item.client .item-twisty-container:hover { - background-image: url("chrome://global/skin/tree/twisty.svg#open-hover"); -} - -.item.client.closed .item-twisty-container:hover { - background-image: url("chrome://global/skin/tree/twisty.svg#clsd-hover"); -} - -.item.client .item-twisty-container:dir(rtl) { - background-image: url("chrome://global/skin/tree/twisty.svg#open-rtl"); -} - -.item.client.closed .item-twisty-container:dir(rtl) { - background-image: url("chrome://global/skin/tree/twisty.svg#clsd-rtl"); -} - -.item.client .item-twisty-container:hover:dir(rtl) { - background-image: url("chrome://global/skin/tree/twisty.svg#open-hover-rtl"); -} - -.item.client.closed .item-twisty-container:hover:dir(rtl) { - background-image: url("chrome://global/skin/tree/twisty.svg#clsd-hover-rtl"); -} diff --git a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm b/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm deleted file mode 100644 index fd981bca3..000000000 --- a/application/basilisk/tools/mozscreenshots/mozscreenshots/extension/configurations/DevEdition.jsm +++ /dev/null @@ -1,42 +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"; - -this.EXPORTED_SYMBOLS = ["DevEdition"]; - -const {classes: Cc, interfaces: Ci, utils: Cu} = Components; -const THEME_ID = "firefox-devedition@mozilla.org"; - -Cu.import("resource://gre/modules/LightweightThemeManager.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); - -this.DevEdition = { - init(libDir) {}, - - configurations: { - devEditionLight: { - applyConfig: Task.async(() => { - Services.prefs.setCharPref("devtools.theme", "light"); - LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme(THEME_ID); - Services.prefs.setBoolPref("browser.devedition.theme.showCustomizeButton", true); - }), - }, - devEditionDark: { - applyConfig: Task.async(() => { - Services.prefs.setCharPref("devtools.theme", "dark"); - LightweightThemeManager.currentTheme = LightweightThemeManager.getUsedTheme(THEME_ID); - Services.prefs.setBoolPref("browser.devedition.theme.showCustomizeButton", true); - }), - }, - devEditionOff: { - applyConfig: Task.async(() => { - Services.prefs.clearUserPref("devtools.theme"); - LightweightThemeManager.currentTheme = null; - Services.prefs.clearUserPref("browser.devedition.theme.showCustomizeButton"); - }), - }, - }, -}; diff --git a/application/palemoon/app/Makefile.in b/application/palemoon/app/Makefile.in index c0f01212c..d008010ec 100644 --- a/application/palemoon/app/Makefile.in +++ b/application/palemoon/app/Makefile.in @@ -80,26 +80,26 @@ MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_A .PHONY: repackage tools repackage:: $(PROGRAM) - $(MKDIR) -p $(dist_dest)/Contents/MacOS - $(MKDIR) -p $(dist_dest)/Contents/Resources/$(AB).lproj - rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents $(dist_dest) --exclude English.lproj - rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(dist_dest)/Contents/Resources/$(AB).lproj - sed -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' -e 's/%MOZ_MACBUNDLE_ID%/$(MOZ_MACBUNDLE_ID)/' -e 's/%MAC_BUNDLE_VERSION%/$(MAC_BUNDLE_VERSION)/' $(srcdir)/macbuild/Contents/Info.plist.in > $(dist_dest)/Contents/Info.plist - sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(dist_dest)/Contents/Resources/$(AB).lproj/InfoPlist.strings - rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ $(dist_dest)/Contents/Resources - rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ $(dist_dest)/Contents/MacOS - $(RM) $(dist_dest)/Contents/MacOS/$(PROGRAM) - rsync -aL $(PROGRAM) $(dist_dest)/Contents/MacOS - cp -RL $(DIST)/branding/firefox.icns $(dist_dest)/Contents/Resources/firefox.icns - cp -RL $(DIST)/branding/document.icns $(dist_dest)/Contents/Resources/document.icns - printf APPLMOZB > $(dist_dest)/Contents/PkgInfo + $(MKDIR) -p '$(dist_dest)/Contents/MacOS' + $(MKDIR) -p '$(dist_dest)/Contents/Resources/$(AB).lproj' + rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents '$(dist_dest)' --exclude English.lproj + rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ '$(dist_dest)/Contents/Resources/$(AB).lproj' + sed -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' -e 's/%MOZ_MACBUNDLE_ID%/$(MOZ_MACBUNDLE_ID)/' -e 's/%MAC_BUNDLE_VERSION%/$(MAC_BUNDLE_VERSION)/' $(srcdir)/macbuild/Contents/Info.plist.in > '$(dist_dest)/Contents/Info.plist' + sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > '$(dist_dest)/Contents/Resources/$(AB).lproj/InfoPlist.strings' + rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ '$(dist_dest)/Contents/Resources' + rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS' + $(RM) '$(dist_dest)/Contents/MacOS/$(PROGRAM)' + rsync -aL $(PROGRAM) '$(dist_dest)/Contents/MacOS' + cp -RL $(DIST)/branding/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns' + cp -RL $(DIST)/branding/document.icns '$(dist_dest)/Contents/Resources/document.icns' + printf APPLMOZB > '$(dist_dest)/Contents/PkgInfo' endif ifdef LIBXUL_SDK #{ ifndef SKIP_COPY_XULRUNNER #{ libs:: ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) #{ - rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(dist_dest)/Contents/Frameworks + rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework '$(dist_dest)/Contents/Frameworks' else $(NSINSTALL) -D $(DIST)/bin/xulrunner (cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -) diff --git a/application/palemoon/app/blocklist.xml b/application/palemoon/app/blocklist.xml index 296b8ad24..fa594aabe 100644 --- a/application/palemoon/app/blocklist.xml +++ b/application/palemoon/app/blocklist.xml @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<blocklist lastupdate="1521130300000" +<blocklist lastupdate="1554898538000" xmlns="http://www.mozilla.org/2006/addons-blocklist"> <emItems> <emItem blockID="i545" id="superlrcs@svenyor.net"> @@ -2513,7 +2513,22 @@ xmlns="http://www.mozilla.org/2006/addons-blocklist"> <versionRange minVersion="0" maxVersion="52.4.2" severity="3"> </versionRange> <prefs></prefs> - </emItem> + </emItem> + <emItem blockID="pm112" id="{73a6fe31-595d-460b-a920-fcc0f8843232}"> + <versionRange minVersion="0" maxVersion="*" severity="1"> + </versionRange> + <prefs></prefs> + </emItem> + <emItem blockID="pm113" id="addonsmanagerfix@sonco.com"> + <versionRange minVersion="0" maxVersion="*" severity="3"> + </versionRange> + <prefs></prefs> + </emItem> + <emItem blockID="pm114" id="jid1-KKzOGWgsW3Ao4Q@jetpack"> + <versionRange minVersion="2.9.9" maxVersion="2.9.9" severity="3"> + </versionRange> + <prefs></prefs> + </emItem> </emItems> <pluginItems> <pluginItem blockID="p26"> diff --git a/application/palemoon/app/moz.build b/application/palemoon/app/moz.build index 8b358b622..8166760af 100644 --- a/application/palemoon/app/moz.build +++ b/application/palemoon/app/moz.build @@ -6,7 +6,6 @@ DIRS += ['profile/extensions'] - GeckoProgram(CONFIG['MOZ_APP_NAME']) JS_PREFERENCE_PP_FILES += [ @@ -18,18 +17,15 @@ if CONFIG['LIBXUL_SDK']: 'profile/channel-prefs.js', ] -SOURCES += [ - 'nsBrowserApp.cpp', -] +SOURCES += ['nsBrowserApp.cpp'] FINAL_TARGET_FILES += ['blocklist.xml'] +FINAL_TARGET_FILES.defaults += ['permissions'] FINAL_TARGET_FILES.defaults.profile += ['profile/prefs.js'] DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] -LOCAL_INCLUDES += [ - '!/build', -] +LOCAL_INCLUDES += ['!/build'] LOCAL_INCLUDES += [ '/toolkit/xre', @@ -37,9 +33,7 @@ LOCAL_INCLUDES += [ '/xpcom/build', ] -USE_LIBS += [ - 'mozglue', -] +USE_LIBS += ['mozglue'] if CONFIG['_MSC_VER']: # Always enter a Windows program through wmain, whether or not we're diff --git a/application/palemoon/app/permissions b/application/palemoon/app/permissions new file mode 100644 index 000000000..4d90be82a --- /dev/null +++ b/application/palemoon/app/permissions @@ -0,0 +1,14 @@ +# This file has default permissions for the permission manager.
+# The file-format is strict:
+# * matchtype \t type \t permission \t host
+# * "origin" should be used for matchtype, "host" is supported for legacy reasons
+# * type is a string that identifies the type of permission (e.g. "cookie")
+# * permission is an integer between 1 and 15
+# See nsPermissionManager.cpp for more...
+
+# XPInstall
+origin install 1 http://www.palemoon.org
+origin install 1 https://www.palemoon.org
+
+origin install 1 http://addons.palemoon.org
+origin install 1 https://addons.palemoon.org
diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index 15accd146..df46ea4b6 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -37,20 +37,20 @@ pref("extensions.strictCompatibility", false); // for it to be compatible by default. pref("extensions.minCompatibleAppVersion", "1.5"); -// 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% +#define AM_DOMAIN addons.palemoon.org +#define AM_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% +// Preferences for AMO integration 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"); +pref("extensions.getAddons.get.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%"); +pref("extensions.getAddons.getWithPerformance.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%"); +pref("extensions.getAddons.search.browseURL", "https://@AM_DOMAIN@/search/?terms=%TERMS%"); +pref("extensions.getAddons.search.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=search&q=%TERMS%&locale=%LOCALE%&os=%OS%&version=%VERSION%"); +pref("extensions.webservice.discoverURL", "http://@AM_DOMAIN@/?component=discover"); +pref("extensions.getAddons.recommended.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=recommended&locale=%LOCALE%&os=%OS%"); +pref("extensions.getAddons.browseAddons", "http://@AM_DOMAIN@/"); +pref("extensions.getAddons.recommended.browseURL", "https://@AM_DOMAIN@/?component=integration&type=external&request=recommended"); // Blocklist preferences pref("extensions.blocklist.enabled", true); @@ -70,10 +70,10 @@ pref("extensions.update.autoUpdateDefault", true); pref("extensions.autoDisableScopes", 15); // Dictionary download preference -pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/"); +pref("browser.dictionaries.download.url", "https://@AM_DOMAIN@/dictionaries/"); // Get More Tools link URL -pref("browser.getdevtools.url","https://@APO_AM_URL@/external/devtools"); +pref("browser.getdevtools.url","https://@AM_DOMAIN@/?component=integration&type=external&request=devtools"); // Feedback URL pref("browser.feedback.url", "https://forum.palemoon.org"); @@ -160,7 +160,7 @@ pref("app.update.silent", false); pref("app.update.staging.enabled", true); // Update service URL: -pref("app.update.url", "https://aus.palemoon.org/?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&buildid=%BUILD_ID%&channel=%CHANNEL%"); +pref("app.update.url", "https://aus.palemoon.org/?application=%PRODUCT%&version=%VERSION%&arch=%BUILD_TARGET%&toolkit=%WIDGET_TOOLKIT%&buildid=%BUILD_ID%&channel=%CHANNEL%"); // app.update.url.manual is in branding section // app.update.url.details is in branding section @@ -194,8 +194,8 @@ pref("app.update.incompatible.mode", 0); // .. etc .. // pref("extensions.update.enabled", true); -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.url", "https://@AM_DOMAIN@/?component=aus&@AM_AUS_ARGS@"); +pref("extensions.update.background.url", "https://@AM_DOMAIN@/?component=aus&@AM_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 @@ -206,9 +206,6 @@ pref("extensions.dss.switchPending", false); // Non-dynamic switch pending af pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name", "chrome://browser/locale/browser.properties"); pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description", "chrome://browser/locale/browser.properties"); -pref("xpinstall.whitelist.add", "addons.mozilla.org,www.palemoon.org,addons.palemoon.org"); -pref("xpinstall.whitelist.add.36", ""); -pref("xpinstall.whitelist.add.180", ""); pref("xpinstall.whitelist.required", false); // Allow installing XPI add-ons by direct URL requests (no referrer) pref("xpinstall.whitelist.directRequest", true); @@ -229,10 +226,10 @@ pref("keyword.enabled", true); pref("general.useragent.locale", "@AB_CD@"); pref("general.skins.selectedSkin", "classic/1.0"); -// Native UA mode by default +// Native UA mode by default for unbranded pref("general.useragent.compatMode", 0); -pref("general.useragent.compatmode.gecko", false); -pref("general.useragent.compatmode.firefox", false); +pref("general.useragent.compatMode.gecko", false); +pref("general.useragent.compatMode.firefox", false); pref("general.smoothScroll", true); #ifdef UNIX_BUT_NOT_MAC @@ -264,6 +261,9 @@ pref("browser.slowStartup.maxSamples", 5); pref("browser.enable_automatic_image_resizing", true); pref("browser.chrome.site_icons", true); pref("browser.chrome.favicons", true); +// If enabled, will process favicons by drawing them on a canvas, +// optimizing display size for the UI. This also strips animations. +pref("browser.chrome.favicons.process", false); // browser.warnOnQuit == false will override all other possible prompts when quitting or restarting pref("browser.warnOnQuit", true); // browser.showQuitWarning specifically controls the quit warning dialog. We @@ -359,7 +359,7 @@ pref("browser.download.panel.shown", false); pref("browser.download.panel.firstSessionCompleted", false); // search engines URL -pref("browser.search.searchEnginesURL", "https://@APO_AM_URL@/external/searchplugins"); +pref("browser.search.searchEnginesURL", "https://@AM_DOMAIN@/?component=integration&type=external&request=searchplugins"); // pointer to the default engine name pref("browser.search.defaultenginename", "chrome://browser-region/locale/region.properties"); @@ -463,6 +463,10 @@ pref("browser.tabs.closeButtons", 1); // false return to the adjacent tab (old default) pref("browser.tabs.selectOwnerOnClose", true); +pref("browser.tabs.showAudioPlayingIcon", true); +// This should match Chromium's audio indicator delay. +pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000); + pref("browser.allTabs.previews", true); pref("browser.ctrlTab.previews", true); pref("browser.ctrlTab.recentlyUsedLimit", 7); @@ -678,6 +682,15 @@ pref("plugins.update.notifyUser", false); //Enable tri-state option (Always/Never/Ask) pref("plugins.click_to_play", true); +// Platform pref is to enable all plugins by default. +// Uncomment this pref to default to click-to-play +// pref("plugin.default.state", 1); + +// Don't load plugin instances with no src declared. +// These prefs are documented in detail in all.js. +pref("plugins.favorfallback.mode", "follow-ctp"); +pref("plugins.favorfallback.rules", "nosrc"); + #ifdef XP_WIN pref("browser.preferences.instantApply", false); #else @@ -1065,20 +1078,20 @@ pref("prompts.tab_modal.focusSwitch", true); // Defines the url to be used for new tabs. pref("browser.newtab.url", "about:logopage"); +pref("browser.newtab.choice", 1); + // Activates preloading of the new tab url. pref("browser.newtab.preload", false); // Toggles the content of 'about:newtab'. Shows the grid when enabled. pref("browser.newtabpage.enabled", true); -// XXX: Remove this when "enhanced" tiles are dead -pref("browser.newtabpage.enhanced", false); +// Disables capturing of page thumbnails +pref("browser.pagethumbnails.capturing_disabled", 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); @@ -1093,6 +1106,9 @@ pref("full-screen-api.enabled", true); // 0-100 (currently) pref("permissions.places-sites-limit", 50); +// Built-in default permissions. +pref("permissions.manager.defaultsUrl", "resource://app/defaults/permissions"); + // Startup Crash Tracking // number of startup crashes that can occur before starting into safe mode automatically // (this pref has no effect if more than 6 hours have passed since the last crash) @@ -1109,6 +1125,9 @@ pref("security.csp.speccompliant", true); // Block insecure active content on https pages pref("security.mixed_content.block_active_content", true); +// Disable Microsoft Family Safety MitM support +pref("security.family_safety.mode", 0); + // Override the Gecko-default value of false for Pale Moon. pref("plain_text.wrap_long_lines", true); @@ -1148,18 +1167,13 @@ pref("toolkit.pageThumbs.minHeight", 180); 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.0) Gecko/20100101 Firefox/27.0"); -#else -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.0) Gecko/20100101 Firefox/27.0"); -#endif +// When a user cancels this number of authentication dialogs coming from +// a single web page (eTLD+1) in a row, all following authentication dialogs +// will be blocked (automatically canceled) for that page. +// This counter is per-tab and per-domain to minimize false positives. +// The counter resets when the page is reloaded from the UI +// (content-reloads do NOT clear this to mitigate reloading tricks). +pref("prompts.authentication_dialog_abuse_limit", 3); // ****************** s4e prefs ****************** pref("status4evar.addonbar.borderStyle", false); diff --git a/application/palemoon/base/content/aboutDialog.css b/application/palemoon/base/content/aboutDialog.css index d171a0bc1..d96eba5a2 100644 --- a/application/palemoon/base/content/aboutDialog.css +++ b/application/palemoon/base/content/aboutDialog.css @@ -2,56 +2,53 @@ * 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/. */ -#PMaboutDialog { - width: 620px; +#aboutPMDialogContainer { + width: 700px; + height: 410px; } -#PMrightBox { - background-image: url("chrome://branding/content/about-wordmark.png"); - background-repeat: no-repeat; - /* padding-top creates room for the wordmark */ - padding-top: 38px; - margin-top:20px; +#aboutVersionBox { + font-family: Arial, helvetica; + height: 38 px; } -#PMrightBox:-moz-locale-dir(rtl) { - background-position: 100% 0; -} - -#PMbottomBox { - padding: 15px 10px 0; -} - -#PMversion { - margin-top: 10px; - -moz-margin-start: 0; +#aboutVersion { + text-align: center; + font-size: 18px; + font-weight: bold; + margin: 4px; } #distribution, #distributionId { + text-align: center; + font-size: 14px; font-weight: bold; display: none; margin-top: 0; margin-bottom: 0; } -.text-blurb { - margin-bottom: 10px; - -moz-margin-start: 0; - -moz-padding-start: 0; +#aboutTextBox { + font-family: Arial, helvetica; + font-size: 14px; + margin: 5px 20px; + padding: 4px 10px 0px; + border-radius: 3px; + color: black; + background-color: rgba(240, 240, 240, .6); +} + +#aboutLinkBox { + font-family: Arial, helvetica; } -#updateButton, -#updateDeck > hbox > label { - -moz-margin-start: 0; - -moz-padding-start: 0; +.text-credits { + margin: 5px 0px; } -.update-throbber { - width: 16px; - min-height: 16px; - -moz-margin-end: 3px; - list-style-image: url("chrome://global/skin/icons/loading_16.png"); +.text-center { + text-align: center; } .text-link, @@ -63,5 +60,15 @@ .bottom-link, .bottom-link:focus { text-align: center; + text-decoration: none !important; + padding: 4px; + border-radius: 3px; + color: #244C8A; + background-color: rgba(240, 240, 240, .7); margin: 0 40px; + transition: background-color 0.5s ease-out; +} + +.bottom-link:hover { + background-color: rgba(240, 240, 255, .95); } diff --git a/application/palemoon/base/content/aboutDialog.js b/application/palemoon/base/content/aboutDialog.js index f4c2a990c..e4e18f2cf 100644 --- a/application/palemoon/base/content/aboutDialog.js +++ b/application/palemoon/base/content/aboutDialog.js @@ -42,13 +42,9 @@ function init(aEvent) if (/[ab]\d+$/.test(version)) { let buildID = Services.appinfo.appBuildID; let buildDate = buildID.slice(0,4) + "-" + buildID.slice(4,6) + "-" + buildID.slice(6,8); - document.getElementById("PMversion").textContent += " (" + buildDate + ")"; + document.getElementById("aboutVersion").textContent += " (" + buildDate + ")"; } -#ifdef MOZ_UPDATER - gAppUpdater = new appUpdater(); -#endif - #ifdef XP_MACOSX // it may not be sized at this point, and we need its width to calculate its position window.sizeToContent(); @@ -64,527 +60,3 @@ function init(aEvent) relnotes.setAttribute("href", releaseNotesURL); } } - -#ifdef MOZ_UPDATER -Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -Components.utils.import("resource://gre/modules/DownloadUtils.jsm"); -Components.utils.import("resource://gre/modules/AddonManager.jsm"); - -var gAppUpdater; - -function onUnload(aEvent) { - if (gAppUpdater.isChecking) - gAppUpdater.checker.stopChecking(Components.interfaces.nsIUpdateChecker.CURRENT_CHECK); - // Safe to call even when there isn't a download in progress. - gAppUpdater.removeDownloadListener(); - gAppUpdater = null; -} - - -function appUpdater() -{ - this.updateDeck = document.getElementById("updateDeck"); - - // Hide the update deck when there is already an update window open to avoid - // syncing issues between them. - if (Services.wm.getMostRecentWindow("Update:Wizard")) { - this.updateDeck.hidden = true; - return; - } - - XPCOMUtils.defineLazyServiceGetter(this, "aus", - "@mozilla.org/updates/update-service;1", - "nsIApplicationUpdateService"); - XPCOMUtils.defineLazyServiceGetter(this, "checker", - "@mozilla.org/updates/update-checker;1", - "nsIUpdateChecker"); - XPCOMUtils.defineLazyServiceGetter(this, "um", - "@mozilla.org/updates/update-manager;1", - "nsIUpdateManager"); - - this.bundle = Services.strings. - createBundle("chrome://browser/locale/browser.properties"); - - this.updateBtn = document.getElementById("updateButton"); - - // The button label value must be set so its height is correct. - this.setupUpdateButton("update.checkInsideButton"); - - let manualURL = Services.urlFormatter.formatURLPref("app.update.url.manual"); - let manualLink = document.getElementById("manualLink"); - manualLink.value = manualURL; - manualLink.href = manualURL; - document.getElementById("failedLink").href = manualURL; - - if (this.updateDisabledAndLocked) { - this.selectPanel("adminDisabled"); - return; - } - - if (this.isPending || this.isApplied) { - this.setupUpdateButton("update.restart." + - (this.isMajor ? "upgradeButton" : "updateButton")); - return; - } - - if (this.aus.isOtherInstanceHandlingUpdates) { - this.selectPanel("otherInstanceHandlingUpdates"); - return; - } - - if (this.isDownloading) { - this.startDownload(); - return; - } - - if (this.updateEnabled && this.updateAuto) { - this.selectPanel("checkingForUpdates"); - this.isChecking = true; - this.checker.checkForUpdates(this.updateCheckListener, true); - return; - } -} - -appUpdater.prototype = -{ - // true when there is an update check in progress. - isChecking: false, - - // true when there is an update already staged / ready to be applied. - get isPending() { - if (this.update) { - return this.update.state == "pending" || - this.update.state == "pending-service"; - } - return this.um.activeUpdate && - (this.um.activeUpdate.state == "pending" || - this.um.activeUpdate.state == "pending-service"); - }, - - // true when there is an update already installed in the background. - get isApplied() { - if (this.update) - return this.update.state == "applied" || - this.update.state == "applied-service"; - return this.um.activeUpdate && - (this.um.activeUpdate.state == "applied" || - this.um.activeUpdate.state == "applied-service"); - }, - - // true when there is an update download in progress. - get isDownloading() { - if (this.update) - return this.update.state == "downloading"; - return this.um.activeUpdate && - this.um.activeUpdate.state == "downloading"; - }, - - // true when the update type is major. - get isMajor() { - if (this.update) - return this.update.type == "major"; - return this.um.activeUpdate.type == "major"; - }, - - // true when updating is disabled by an administrator. - get updateDisabledAndLocked() { - return !this.updateEnabled && - Services.prefs.prefIsLocked("app.update.enabled"); - }, - - // true when updating is enabled. - get updateEnabled() { - try { - return Services.prefs.getBoolPref("app.update.enabled"); - } - catch (e) { } - return true; // Firefox default is true - }, - - // true when updating in background is enabled. - get backgroundUpdateEnabled() { - return this.updateEnabled && - gAppUpdater.aus.canStageUpdates; - }, - - // true when updating is automatic. - get updateAuto() { - try { - return Services.prefs.getBoolPref("app.update.auto"); - } - catch (e) { } - return true; // Firefox default is true - }, - - /** - * Sets the deck's selected panel. - * - * @param aChildID - * The id of the deck's child to select. - */ - selectPanel: function(aChildID) { - this.updateDeck.selectedPanel = document.getElementById(aChildID); - this.updateBtn.disabled = (aChildID != "updateButtonBox"); - }, - - /** - * Sets the update button's label and accesskey. - * - * @param aKeyPrefix - * The prefix for the properties file entry to use for setting the - * label and accesskey. - */ - setupUpdateButton: function(aKeyPrefix) { - this.updateBtn.label = this.bundle.GetStringFromName(aKeyPrefix + ".label"); - this.updateBtn.accessKey = this.bundle.GetStringFromName(aKeyPrefix + ".accesskey"); - if (!document.commandDispatcher.focusedElement || - document.commandDispatcher.focusedElement == this.updateBtn) - this.updateBtn.focus(); - }, - - /** - * Handles oncommand for the update button. - */ - buttonOnCommand: function() { - if (this.isPending || this.isApplied) { - // Notify all windows that an application quit has been requested. - let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"]. - createInstance(Components.interfaces.nsISupportsPRBool); - Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart"); - - // Something aborted the quit process. - if (cancelQuit.data) - return; - - let appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"]. - getService(Components.interfaces.nsIAppStartup); - - // If already in safe mode restart in safe mode (bug 327119) - if (Services.appinfo.inSafeMode) { - appStartup.restartInSafeMode(Components.interfaces.nsIAppStartup.eAttemptQuit); - return; - } - - appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit | - Components.interfaces.nsIAppStartup.eRestart); - return; - } - - const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul"; - // Firefox no longer displays a license for updates and the licenseURL check - // is just in case a distibution does. - if (this.update) { - var ary = null; - ary = Components.classes["@mozilla.org/supports-array;1"]. - createInstance(Components.interfaces.nsISupportsArray); - ary.AppendElement(this.update); - var openFeatures = "chrome,centerscreen,dialog=no,resizable=no,titlebar,toolbar=no"; - Services.ww.openWindow(null, URI_UPDATE_PROMPT_DIALOG, "", openFeatures, ary); - window.close(); - return; - } - - this.selectPanel("checkingForUpdates"); - this.isChecking = true; - this.checker.checkForUpdates(this.updateCheckListener, true); - }, - - /** - * Implements nsIUpdateCheckListener. The methods implemented by - * nsIUpdateCheckListener are in a different scope from nsIIncrementalDownload - * to make it clear which are used by each interface. - */ - updateCheckListener: { - /** - * See nsIUpdateService.idl - */ - onCheckComplete: function(aRequest, aUpdates, aUpdateCount) { - gAppUpdater.isChecking = false; - gAppUpdater.update = gAppUpdater.aus. - selectUpdate(aUpdates, aUpdates.length); - if (!gAppUpdater.update) { - gAppUpdater.selectPanel("noUpdatesFound"); - return; - } - - if (gAppUpdater.update.unsupported) { - if (gAppUpdater.update.detailsURL) { - let unsupportedLink = document.getElementById("unsupportedLink"); - unsupportedLink.href = gAppUpdater.update.detailsURL; - } - gAppUpdater.selectPanel("unsupportedSystem"); - return; - } - - if (!gAppUpdater.aus.canApplyUpdates) { - gAppUpdater.selectPanel("manualUpdate"); - return; - } - - gAppUpdater.selectPanel("updateButtonBox"); - gAppUpdater.setupUpdateButton("update.openUpdateUI." + - (this.isMajor ? "upgradeButton" - : "applyButton")); - }, - - /** - * See nsIUpdateService.idl - */ - onError: function(aRequest, aUpdate) { - // Errors in the update check are treated as no updates found. If the - // update check fails repeatedly without a success the user will be - // notified with the normal app update user interface so this is safe. - gAppUpdater.isChecking = false; - gAppUpdater.selectPanel("noUpdatesFound"); - }, - - /** - * See nsISupports.idl - */ - QueryInterface: function(aIID) { - if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) && - !aIID.equals(Components.interfaces.nsISupports)) - throw Components.results.NS_ERROR_NO_INTERFACE; - return this; - } - }, - - /** - * Checks the compatibility of add-ons for the application update. - */ - checkAddonCompatibility: function() { - var self = this; - AddonManager.getAllAddons(function(aAddons) { - self.addons = []; - self.addonsCheckedCount = 0; - aAddons.forEach(function(aAddon) { - // Protect against code that overrides the add-ons manager and doesn't - // implement the isCompatibleWith or the findUpdates method. - if (!("isCompatibleWith" in aAddon) || !("findUpdates" in aAddon)) { - let errMsg = "Add-on doesn't implement either the isCompatibleWith " + - "or the findUpdates method!"; - if (aAddon.id) - errMsg += " Add-on ID: " + aAddon.id; - Components.utils.reportError(errMsg); - return; - } - - // If an add-on isn't appDisabled and isn't userDisabled then it is - // either active now or the user expects it to be active after the - // restart. If that is the case and the add-on is not installed by the - // application and is not compatible with the new application version - // then the user should be warned that the add-on will become - // incompatible. If an addon's type equals plugin it is skipped since - // checking plugins compatibility information isn't supported and - // getting the scope property of a plugin breaks in some environments - // (see bug 566787). - try { - if (aAddon.type != "plugin" && aAddon.isCompatible && - !aAddon.appDisabled && !aAddon.userDisabled && - aAddon.scope != AddonManager.SCOPE_APPLICATION && - !aAddon.isCompatibleWith(self.update.appVersion, - self.update.platformVersion)) - self.addons.push(aAddon); - } - catch (e) { - Components.utils.reportError(e); - } - }); - self.addonsTotalCount = self.addons.length; - if (self.addonsTotalCount == 0) { - self.startDownload(); - return; - } - - self.checkAddonsForUpdates(); - }); - }, - - /** - * Checks if there are updates for add-ons that are incompatible with the - * application update. - */ - checkAddonsForUpdates: function() { - this.addons.forEach(function(aAddon) { - aAddon.findUpdates(this, AddonManager.UPDATE_WHEN_NEW_APP_DETECTED, - this.update.appVersion, - this.update.platformVersion); - }, this); - }, - - /** - * See XPIProvider.jsm - */ - onCompatibilityUpdateAvailable: function(aAddon) { - for (var i = 0; i < this.addons.length; ++i) { - if (this.addons[i].id == aAddon.id) { - this.addons.splice(i, 1); - break; - } - } - }, - - /** - * See XPIProvider.jsm - */ - onUpdateAvailable: function(aAddon, aInstall) { - if (!Services.blocklist.isAddonBlocklisted(aAddon.id, aInstall.version, - this.update.appVersion, - this.update.platformVersion)) { - // Compatibility or new version updates mean the same thing here. - this.onCompatibilityUpdateAvailable(aAddon); - } - }, - - /** - * See XPIProvider.jsm - */ - onUpdateFinished: function(aAddon) { - ++this.addonsCheckedCount; - - if (this.addonsCheckedCount < this.addonsTotalCount) - return; - - if (this.addons.length == 0) { - // Compatibility updates or new version updates were found for all add-ons - this.startDownload(); - return; - } - - this.selectPanel("updateButtonBox"); - this.setupUpdateButton("update.openUpdateUI." + - (this.isMajor ? "upgradeButton" : "applyButton")); - }, - - /** - * Starts the download of an update mar. - */ - startDownload: function() { - if (!this.update) - this.update = this.um.activeUpdate; - this.update.QueryInterface(Components.interfaces.nsIWritablePropertyBag); - this.update.setProperty("foregroundDownload", "true"); - - this.aus.pauseDownload(); - let state = this.aus.downloadUpdate(this.update, false); - if (state == "failed") { - this.selectPanel("downloadFailed"); - return; - } - - this.setupDownloadingUI(); - }, - - /** - * Switches to the UI responsible for tracking the download. - */ - setupDownloadingUI: function() { - this.downloadStatus = document.getElementById("downloadStatus"); - this.downloadStatus.value = - DownloadUtils.getTransferTotal(0, this.update.selectedPatch.size); - this.selectPanel("downloading"); - this.aus.addDownloadListener(this); - }, - - removeDownloadListener: function() { - if (this.aus) { - this.aus.removeDownloadListener(this); - } - }, - - /** - * See nsIRequestObserver.idl - */ - onStartRequest: function(aRequest, aContext) { - }, - - /** - * See nsIRequestObserver.idl - */ - onStopRequest: function(aRequest, aContext, aStatusCode) { - switch (aStatusCode) { - case Components.results.NS_ERROR_UNEXPECTED: - if (this.update.selectedPatch.state == "download-failed" && - (this.update.isCompleteUpdate || this.update.patchCount != 2)) { - // Verification error of complete patch, informational text is held in - // the update object. - this.removeDownloadListener(); - this.selectPanel("downloadFailed"); - break; - } - // Verification failed for a partial patch, complete patch is now - // downloading so return early and do NOT remove the download listener! - break; - case Components.results.NS_BINDING_ABORTED: - // Do not remove UI listener since the user may resume downloading again. - break; - case Components.results.NS_OK: - this.removeDownloadListener(); - if (this.backgroundUpdateEnabled) { - this.selectPanel("applying"); - let update = this.um.activeUpdate; - let self = this; - Services.obs.addObserver(function (aSubject, aTopic, aData) { - // Update the UI when the background updater is finished - let status = aData; - if (status == "applied" || status == "applied-service" || - status == "pending" || status == "pending-service") { - // If the update is successfully applied, or if the updater has - // fallen back to non-staged updates, show the Restart to Update - // button. - self.selectPanel("updateButtonBox"); - self.setupUpdateButton("update.restart." + - (self.isMajor ? "upgradeButton" : "updateButton")); - } else if (status == "failed") { - // Background update has failed, let's show the UI responsible for - // prompting the user to update manually. - self.selectPanel("downloadFailed"); - } else if (status == "downloading") { - // We've fallen back to downloading the full update because the - // partial update failed to get staged in the background. - // Therefore we need to keep our observer. - self.setupDownloadingUI(); - return; - } - Services.obs.removeObserver(arguments.callee, "update-staged"); - }, "update-staged", false); - } else { - this.selectPanel("updateButtonBox"); - this.setupUpdateButton("update.restart." + - (this.isMajor ? "upgradeButton" : "updateButton")); - } - break; - default: - this.removeDownloadListener(); - this.selectPanel("downloadFailed"); - break; - } - - }, - - /** - * See nsIProgressEventSink.idl - */ - onStatus: function(aRequest, aContext, aStatus, aStatusArg) { - }, - - /** - * See nsIProgressEventSink.idl - */ - onProgress: function(aRequest, aContext, aProgress, aProgressMax) { - this.downloadStatus.value = - DownloadUtils.getTransferTotal(aProgress, aProgressMax); - }, - - /** - * See nsISupports.idl - */ - QueryInterface: function(aIID) { - if (!aIID.equals(Components.interfaces.nsIProgressEventSink) && - !aIID.equals(Components.interfaces.nsIRequestObserver) && - !aIID.equals(Components.interfaces.nsISupports)) - throw Components.results.NS_ERROR_NO_INTERFACE; - return this; - } -}; -#endif diff --git a/application/palemoon/base/content/aboutDialog.xul b/application/palemoon/base/content/aboutDialog.xul index 5c344f55d..6edfc2155 100644 --- a/application/palemoon/base/content/aboutDialog.xul +++ b/application/palemoon/base/content/aboutDialog.xul @@ -24,9 +24,6 @@ id="PMaboutDialog" windowtype="Browser:About" onload="init(event);" -#ifdef MOZ_UPDATER - onunload="onUnload(event);" -#endif #ifdef XP_MACOSX inwindowmenu="false" #else @@ -38,86 +35,48 @@ <script type="application/javascript" src="chrome://browser/content/aboutDialog.js"/> - <vbox id="aboutPMDialogContainer"> - <hbox id="PMclientBox"> - <vbox id="PMleftBox" flex="1"/> - <vbox id="PMrightBox" flex="1"> + <vbox id="aboutPMDialogContainer" flex="1"> + <vbox id="aboutHeaderBox" /> + <vbox id="aboutVersionBox" flex="3"> #ifdef HAVE_64BIT_BUILD -#expand <label id="PMversion">Version: __MOZ_APP_VERSION__ (64-bit)</label> +#expand <label id="aboutVersion">Version: __MOZ_APP_VERSION__ (64-bit)</label> #else -#expand <label id="PMversion">Version: __MOZ_APP_VERSION__ (32-bit)</label> +#expand <label id="aboutVersion">Version: __MOZ_APP_VERSION__ (32-bit)</label> #endif <label id="distribution" class="text-blurb"/> <label id="distributionId" class="text-blurb"/> - <vbox id="detailsBox"> - <vbox id="updateBox"> -#ifdef MOZ_UPDATER - <deck id="updateDeck" orient="vertical"> - <hbox id="updateButtonBox" align="center"> - <button id="updateButton" align="start" - oncommand="gAppUpdater.buttonOnCommand();"/> - <spacer flex="1"/> - </hbox> - <hbox id="checkingForUpdates" align="center"> - <image class="update-throbber"/><label>&update.checkingForUpdates;</label> - </hbox> - <hbox id="checkingAddonCompat" align="center"> - <image class="update-throbber"/><label>&update.checkingAddonCompat;</label> - </hbox> - <hbox id="downloading" align="center"> - <image class="update-throbber"/><label>&update.downloading.start;</label><label id="downloadStatus"/><label>&update.downloading.end;</label> - </hbox> - <hbox id="applying" align="center"> - <image class="update-throbber"/><label>&update.applying;</label> - </hbox> - <hbox id="downloadFailed" align="center"> - <label>&update.failed.start;</label><label id="failedLink" class="text-link">&update.failed.linkText;</label><label>&update.failed.end;</label> - </hbox> - <hbox id="adminDisabled" align="center"> - <label>&update.adminDisabled;</label> - </hbox> - <hbox id="noUpdatesFound" align="center"> - <label>&update.noUpdatesFound;</label> - </hbox> - <hbox id="manualUpdate" align="center"> - <label>&update.manual.start;</label><label id="manualLink" class="text-link"/><label>&update.manual.end;</label> - </hbox> - </deck> -#endif - </vbox> - - <description class="text-pmcreds"> + </vbox> + <vbox id="aboutTextBox" flex="1"> + <description class="text-credits text-center"> #if defined(MOZ_OFFICIAL_BRANDING) || defined(MC_OFFICIAL) #ifdef MC_PRIVATE_BUILD This is a private build of Pale Moon. If you did not manually build this copy from source yourself, then please download an official version from the <label class="text-link" href="http://www.palemoon.org/">Pale Moon website</label>. #else - Pale Moon is released by <label class="text-link" href="http://www.moonchildproductions.info">Moonchild Productions</label>. + <label class="text-link" href="http://www.palemoon.org">Pale Moon</label> is released by <label class="text-link" href="http://www.moonchildproductions.info">Moonchild Productions</label>. </description> - <description class="text-pmcreds"> + <description class="text-credits text-center"> Special thanks to all our supporters and donors for making this browser possible! </description> - <description class="text-blurb"> + <description class="text-credits"> If you wish to contribute, please consider helping out by providing support to other users on the <label class="text-link" href="https://forum.palemoon.org/">Pale Moon forum</label> or getting involved in our development by tackling some of the issues found in our GitHub issue tracker. #endif #else &brandFullName; is released by &vendorShortName;. </description> - <description class="text-blurb"> + <description class="text-credits"> This is an unofficial build of Pale Moon. For official builds, please go to <label class="text-link" href="http://www.palemoon.org/">the Pale Moon website</label>. #endif </description> - </vbox> - </vbox> - </hbox> - <vbox id="PMbottomBox"> + </vbox> + <vbox id="aboutLinkBox"> <hbox pack="center"> - <label class="text-link bottom-link" href="about:license">Licensing information</label> <label class="text-link bottom-link" href="about:rights">End-user rights</label> + <label class="text-link bottom-link" href="about:license">Licensing information</label> <label class="text-link bottom-link" id="releaseNotesURL">Release notes</label> </hbox> - <description id="PMtrademark">&trademarkInfo.part1;</description> + <description id="aboutPMtrademark">&trademarkInfo.part1;</description> </vbox> </vbox> diff --git a/application/palemoon/base/content/aboutRobots-icon.png b/application/palemoon/base/content/aboutRobots-icon.png Binary files differdeleted file mode 100644 index 1c4899aaf..000000000 --- a/application/palemoon/base/content/aboutRobots-icon.png +++ /dev/null diff --git a/application/palemoon/base/content/aboutRobots-widget-left.png b/application/palemoon/base/content/aboutRobots-widget-left.png Binary files differdeleted file mode 100644 index 3a1e48d5f..000000000 --- a/application/palemoon/base/content/aboutRobots-widget-left.png +++ /dev/null diff --git a/application/palemoon/base/content/aboutRobots.xhtml b/application/palemoon/base/content/aboutRobots.xhtml deleted file mode 100644 index 23fe3ba17..000000000 --- a/application/palemoon/base/content/aboutRobots.xhtml +++ /dev/null @@ -1,108 +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/. --> - -<!DOCTYPE html [ - <!ENTITY % htmlDTD - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" - "DTD/xhtml1-strict.dtd"> - %htmlDTD; - <!ENTITY % netErrorDTD - SYSTEM "chrome://global/locale/netError.dtd"> - %netErrorDTD; - <!ENTITY % globalDTD - SYSTEM "chrome://global/locale/global.dtd"> - %globalDTD; - <!ENTITY % aboutrobotsDTD - SYSTEM "chrome://browser/locale/aboutRobots.dtd"> - %aboutrobotsDTD; -]> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title>&robots.pagetitle;</title> - <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" /> - <link rel="icon" type="image/png" id="favicon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACGFjVEwAAAASAAAAAJNtBPIAAAAaZmNUTAAAAAAAAAAQAAAAEAAAAAAAAAAALuAD6AABhIDeugAAALhJREFUOI2Nk8sNxCAMRDlGohauXFOMpfTiAlxICqAELltHLqlgctg1InzMRhpFAc%2BLGWTnmoeZYamt78zXdZmaQtQMADlnU0OIAlbmJUBEcO4bRKQY2rUXIPmAGnDuG%2FBx3%2FfvOPVaDUg%2BoAPUf1PArIMCSD5glMEsUGaG%2BkyAFWIBaCsKuA%2BHGCNijLgP133XgOEtaPFMy2vUolEGJoCIzBmoRUR9%2B7rxj16DZaW%2FmgtmxnJ8V3oAnApQwNS5zpcAAAAaZmNUTAAAAAEAAAAQAAAAEAAAAAAAAAAAAB4D6AIB52fclgAAACpmZEFUAAAAAjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9WF%2Bu8QAAABpmY1RMAAAAAwAAABAAAAAQAAAAAAAAAAAAHgPoAgEK8Q9%2FAAAAFmZkQVQAAAAEOI1jYBgFo2AUjAIIAAAEEAAB0xIn4wAAABpmY1RMAAAABQAAABAAAAAQAAAAAAAAAAAAHgPoAgHnO30FAAAAQGZkQVQAAAAGOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVfozYcAAAABpmY1RMAAAABwAAABAAAAAQAAAAAAAAAAAAHgPoAgEKra7sAAAAFmZkQVQAAAAIOI1jYBgFo2AUjAIIAAAEEAABM9s3hAAAABpmY1RMAAAACQAAABAAAAAQAAAAAAAAAAAAHgPoAgHn3p%2BwAAAAKmZkQVQAAAAKOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F1BhPl6AAAAGmZjVEwAAAALAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQpITFkAAAAWZmRBVAAAAAw4jWNgGAWjYBSMAggAAAQQAAHaszpmAAAAGmZjVEwAAAANAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeeCPiMAAABAZmRBVAAAAA44jWNgGJ5gpxrDf2LEcIL%2FpzAVYxPDavP%2FUwz%2FpW79%2F%2F%2F%2FFMP%2FnWoQjC5GOxcgu4QYsVEwCmAAAOE0KxUmBL0KAAAAGmZjVEwAAAAPAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQoU7coAAAAWZmRBVAAAABA4jWNgGAWjYBSMAggAAAQQAAEpOBELAAAAGmZjVEwAAAARAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeYVWtoAAAAqZmRBVAAAABI4jWNgGAVYQXNz839ixHBq3qnG8B9ZAzYx2rlgFIwCcgAA8psX%2FWvpAecAAAAaZmNUTAAAABMAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC4OJMwAAABZmZEFUAAAAFDiNY2AYBaNgFIwCCAAABBAAAcBQHOkAAAAaZmNUTAAAABUAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5kn7SQAAAEBmZEFUAAAAFjiNY2AYnmCnGsN%2FYsRwgv%2BnMBVjE8Nq8%2F9TDP%2Blbv3%2F%2F%2F8Uw%2F%2BdahCMLkY7FyC7hBixUTAKYAAA4TQrFc%2BcEoQAAAAaZmNUTAAAABcAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC98ooAAAABZmZEFUAAAAGDiNY2AYBaNgFIwCCAAABBAAASCZDI4AAAAaZmNUTAAAABkAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5qwZ%2FAAAACpmZEFUAAAAGjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9cjJWbAAAABpmY1RMAAAAGwAAABAAAAAQAAAAAAAAAAAAHgPoAgELOsoVAAAAFmZkQVQAAAAcOI1jYBgFo2AUjAIIAAAEEAAByfEBbAAAABpmY1RMAAAAHQAAABAAAAAQAAAAAAAAAAAAHgPoAgHm8LhvAAAAQGZkQVQAAAAeOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVlxR3%2FgAAABpmY1RMAAAAHwAAABAAAAAQAAAAAAAAAAAAHgPoAgELZmuGAAAAFmZkQVQAAAAgOI1jYBgFo2AUjAIIAAAEEAABHP5cFQAAABpmY1RMAAAAIQAAABAAAAAQAAAAAAAAAAAAHgPoAgHlgtAOAAAAKmZkQVQAAAAiOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F0%2FMvDdAAAAAElFTkSuQmCC"/> - - <script type="application/javascript"><![CDATA[ - var buttonClicked = false; - function robotButton() - { - var button = document.getElementById('errorTryAgain'); - if (buttonClicked) { - button.style.visibility = "hidden"; - } else { - var newLabel = button.getAttribute("label2"); - button.textContent = newLabel; - buttonClicked = true; - } - } - ]]></script> - - <style type="text/css"><![CDATA[ - #errorPageContainer { - background-image: none; - } - - #errorPageContainer:before { - content: url('chrome://browser/content/aboutRobots-icon.png'); - position: absolute; - } - - body[dir=rtl] #icon, - body[dir=rtl] #errorPageContainer:before { - transform: scaleX(-1); - } - ]]></style> - </head> - - <body dir="&locale.dir;"> - - <!-- PAGE CONTAINER (for styling purposes only) --> - <div id="errorPageContainer"> - - <!-- Error Title --> - <div id="errorTitle"> - <h1 id="errorTitleText">&robots.errorTitleText;</h1> - </div> - - <!-- LONG CONTENT (the section most likely to require scrolling) --> - <div id="errorLongContent"> - - <!-- Short Description --> - <div id="errorShortDesc"> - <p id="errorShortDescText">&robots.errorShortDescText;</p> - </div> - - <!-- Long Description (Note: See netError.dtd for used XHTML tags) --> - <div id="errorLongDesc"> - <ul> - <li>&robots.errorLongDesc1;</li> - <li>&robots.errorLongDesc2;</li> - <li>&robots.errorLongDesc3;</li> - <li>&robots.errorLongDesc4;</li> - </ul> - </div> - - <!-- Short Description --> - <div id="errorTrailerDesc"> - <p id="errorTrailerDescText">&robots.errorTrailerDescText;</p> - </div> - - </div> - - <!-- Button --> - <button id="errorTryAgain" - label2="&robots.dontpress;" - onclick="robotButton();">&retry.label;</button> - - <img src="chrome://browser/content/aboutRobots-widget-left.png" - style="position: absolute; bottom: -12px; left: -10px;"/> - <img src="chrome://browser/content/aboutRobots-widget-left.png" - style="position: absolute; bottom: -12px; right: -10px; transform: scaleX(-1);"/> - </div> - - </body> -</html> diff --git a/application/palemoon/base/content/baseMenuOverlay.xul b/application/palemoon/base/content/baseMenuOverlay.xul index e9019dc55..bccdec265 100644 --- a/application/palemoon/base/content/baseMenuOverlay.xul +++ b/application/palemoon/base/content/baseMenuOverlay.xul @@ -41,7 +41,7 @@ label="&helpMenu.label;" accesskey="&helpMenu.accesskey;"> #endif - <menupopup id="menu_HelpPopup"> + <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();"> <menuitem id="menu_openHelp" oncommand="openHelpLink('firefox-help')" onclick="checkForMiddleClick(this, event);" @@ -57,15 +57,29 @@ label="&helpTroubleshootingInfo.label;" oncommand="openTroubleshootingPage()" onclick="checkForMiddleClick(this, event);"/> + <menuitem id="helpSafeMode" + accesskey="&helpSafeMode.accesskey;" + label="&helpSafeMode.label;" + oncommand="restart(true);"/> + <menuseparator/> + <menuitem id="releaseNotes" + accesskey="&helpReleaseNotes.accesskey;" + label="&helpReleaseNotes.label;" + oncommand="openReleaseNotes();" + onclick="checkForMiddleClick(this, event);"/> <menuitem id="feedbackPage" accesskey="&helpFeedbackPage.accesskey;" label="&helpFeedbackPage.label;" oncommand="openFeedbackPage()" onclick="checkForMiddleClick(this, event);"/> - <menuitem id="helpSafeMode" - accesskey="&helpSafeMode.accesskey;" - label="&helpSafeMode.label;" - oncommand="restart(true);"/> + <menuseparator id="updatesSeparator"/> + <menuitem id="checkForUpdates" class="menuitem-iconic" +#ifdef MOZ_UPDATER + label="&updateCmd.label;" + oncommand="checkForUpdates();"/> +#else + hidden="true"/> +#endif <menuseparator id="aboutSeparator"/> <menuitem id="aboutName" accesskey="&aboutProduct.accesskey;" diff --git a/application/palemoon/base/content/browser-addons.js b/application/palemoon/base/content/browser-addons.js index f5c398f33..630a0cf79 100644 --- a/application/palemoon/base/content/browser-addons.js +++ b/application/palemoon/base/content/browser-addons.js @@ -263,7 +263,7 @@ var AddonsMgrListener = { onDisabled: function(aAddon) this.onUninstalled(), }; - +#ifdef MOZ_PERSONAS var LightWeightThemeWebInstaller = { handleEvent: function (event) { switch (event.type) { @@ -534,3 +534,4 @@ var LightweightThemeListener = { this.updateStyleSheet("url(" + themeData.headerURL + ")"); }, }; +#endif diff --git a/application/palemoon/base/content/browser-appmenu.inc b/application/palemoon/base/content/browser-appmenu.inc index cfc855484..9d202c965 100644 --- a/application/palemoon/base/content/browser-appmenu.inc +++ b/application/palemoon/base/content/browser-appmenu.inc @@ -341,7 +341,7 @@ <splitmenu id="appmenu_help" label="&helpMenu.label;" oncommand="openHelpLink('firefox-help')"> - <menupopup id="appmenu_helpMenupopup"> + <menupopup id="appmenu_helpMenupopup" onpopupshowing="buildHelpMenu();"> <menuitem id="appmenu_openHelp" label="&helpMenu.label;" oncommand="openHelpLink('firefox-help')" @@ -350,14 +350,26 @@ label="&helpTroubleshootingInfo.label;" oncommand="openTroubleshootingPage()" onclick="checkForMiddleClick(this,event);"/> + <menuitem id="appmenu_safeMode" + label="&appMenuSafeMode.label;" + oncommand="restart(true);"/> + <menuseparator/> + <menuitem id="appmenu_releaseNotes" + accesskey="&helpReleaseNotes.accesskey;" + label="&helpReleaseNotes.label;" + oncommand="openReleaseNotes();" + onclick="checkForMiddleClick(this, event);"/> <menuitem id="appmenu_feedbackPage" label="&helpFeedbackPage.label;" oncommand="openFeedbackPage()" onclick="checkForMiddleClick(this, event);"/> +#ifdef MOZ_UPDATER <menuseparator/> - <menuitem id="appmenu_safeMode" - label="&appMenuSafeMode.label;" - oncommand="restart(true);"/> + <menuitem id="appmenu_checkForUpdates" + class="menuitem-iconic" + label="&updateCmd.label;" + oncommand="checkForUpdates();"/> +#endif <menuseparator/> <menuitem id="appmenu_about" label="&aboutProduct.label;" diff --git a/application/palemoon/base/content/browser-context.inc b/application/palemoon/base/content/browser-context.inc index f672ede61..38c472508 100644 --- a/application/palemoon/base/content/browser-context.inc +++ b/application/palemoon/base/content/browser-context.inc @@ -70,7 +70,7 @@ label="&mediaUnmute.label;" accesskey="&mediaUnmute.accesskey;" oncommand="gContextMenu.mediaCommand('unmute');"/> - <menu id="context-media-playbackrate" label="&mediaPlaybackRate.label;" accesskey="&mediaPlaybackRate.accesskey;"> + <menu id="context-media-playbackrate" label="&mediaPlaybackRate2.label;" accesskey="&mediaPlaybackRate2.accesskey;"> <menupopup> <menuitem id="context-media-playbackrate-050x" label="&mediaPlaybackRate050x.label;" @@ -99,6 +99,11 @@ oncommand="gContextMenu.mediaCommand('playbackRate', 2.0);"/> </menupopup> </menu> + <menuitem id="context-media-loop" + label="&mediaLoop.label;" + accesskey="&mediaLoop.accesskey;" + type="checkbox" + oncommand="gContextMenu.mediaCommand('loop');"/> <menuitem id="context-media-showcontrols" label="&mediaShowControls.label;" accesskey="&mediaShowControls.accesskey;" diff --git a/application/palemoon/base/content/browser-fullScreen.js b/application/palemoon/base/content/browser-fullScreen.js index b1235a8d3..e816ce5c1 100644 --- a/application/palemoon/base/content/browser-fullScreen.js +++ b/application/palemoon/base/content/browser-fullScreen.js @@ -53,17 +53,9 @@ 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); + if (gPrefService.getBoolPref("browser.fullscreen.autohide")) { + gBrowser.mPanelContainer.addEventListener("mousemove", + this._collapseCallback, false); } // 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 @@ -149,7 +141,8 @@ var FullScreen = { cleanup: function () { if (!window.fullScreen) { - MousePosTracker.removeListener(this); + gBrowser.mPanelContainer.removeEventListener("mousemove", + this._collapseCallback, false); document.removeEventListener("keypress", this._keyToggleCallback, false); document.removeEventListener("popupshown", this._setPopupOpen, false); document.removeEventListener("popuphidden", this._setPopupOpen, false); @@ -164,17 +157,12 @@ var FullScreen = { } }, - getMouseTargetRect: function() - { - return this._mouseTargetRect; - }, - // Event callbacks _expandCallback: function() { FullScreen.showNavToolbox(); }, - onMouseEnter: function() + _collapseCallback: function() { FullScreen.hideNavToolbox(); }, @@ -328,14 +316,8 @@ var FullScreen = { // Track whether mouse is near the toolbox this._isChromeCollapsed = false; if (trackMouse) { - let rect = gBrowser.mPanelContainer.getBoundingClientRect(); - this._mouseTargetRect = { - top: rect.top + 50, - bottom: rect.bottom, - left: rect.left, - right: rect.right - }; - MousePosTracker.addListener(this); + gBrowser.mPanelContainer.addEventListener("mousemove", + this._collapseCallback, false); } }, @@ -378,7 +360,8 @@ var FullScreen = { gNavToolbox.style.marginTop = -gNavToolbox.getBoundingClientRect().height + "px"; this._isChromeCollapsed = true; - MousePosTracker.removeListener(this); + gBrowser.mPanelContainer.removeEventListener("mousemove", + this._collapseCallback, false); }, showXULChrome: function(aTag, aShow) diff --git a/application/palemoon/base/content/browser-menudragging.js b/application/palemoon/base/content/browser-menudragging.js index cf26b2ba4..f3f00d72c 100644 --- a/application/palemoon/base/content/browser-menudragging.js +++ b/application/palemoon/base/content/browser-menudragging.js @@ -52,11 +52,9 @@ var browserMenuDragging = { initPref: function(){ this.STAY_OPEN_ONDRAGEXIT = - this.getPref('browser.menu.dragging.stayOpen', - 'bool', false); + Services.prefs.getBoolPref('browser.menu.dragging.stayOpen', false); this.DEBUG = - this.getPref('browser.menu.dragging.debug', - 'bool', false); + Services.prefs.getBoolPref('browser.menu.dragging.debug', false); }, //delayed startup @@ -291,26 +289,6 @@ var browserMenuDragging = { .logStringMessage(aMsg); }, - getPref: function(aPrefString, aPrefType, aDefault){ - var xpPref = Components.classes["@mozilla.org/preferences-service;1"] - .getService(Components.interfaces.nsIPrefService); - try{ - switch (aPrefType){ - case 'complex': - return xpPref.getComplexValue(aPrefString, Components.interfaces.nsILocalFile); break; - case 'str': - return xpPref.getCharPref(aPrefString).toString(); break; - case 'int': - return xpPref.getIntPref(aPrefString); break; - case 'bool': - default: - return xpPref.getBoolPref(aPrefString); break; - } - }catch(e){ - } - return aDefault; - }, - setPref: function(aPrefString, aPrefType, aValue){ var xpPref = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefService); diff --git a/application/palemoon/base/content/browser-sets.inc b/application/palemoon/base/content/browser-sets.inc index 64228678e..78fce2670 100644 --- a/application/palemoon/base/content/browser-sets.inc +++ b/application/palemoon/base/content/browser-sets.inc @@ -32,6 +32,7 @@ <command id="cmd_printPreview" oncommand="PrintUtils.printPreview(PrintPreviewListener);"/> <command id="cmd_close" oncommand="BrowserCloseTabOrWindow()"/> <command id="cmd_closeWindow" oncommand="BrowserTryToCloseWindow()"/> + <command id="cmd_toggleMute" oncommand="gBrowser.selectedTab.toggleMuteAudio()"/> <command id="cmd_ToggleTabsOnTop" oncommand="TabsOnTop.toggle()"/> <command id="cmd_CustomizeToolbars" oncommand="BrowserCustomizeToolbar()"/> <command id="cmd_restartApplication" oncommand="restart(false);"/> @@ -79,7 +80,6 @@ <command id="Browser:NextTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(1, true);"/> <command id="Browser:PrevTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(-1, true);"/> <command id="Browser:ShowAllTabs" oncommand="allTabs.open();"/> - <command id="Browser:FocusNextFrame" oncommand="focusNextFrame(event);"/> <command id="cmd_fullZoomReduce" oncommand="FullZoom.reduce()"/> <command id="cmd_fullZoomEnlarge" oncommand="FullZoom.enlarge()"/> <command id="cmd_fullZoomReset" oncommand="FullZoom.reset()"/> @@ -213,6 +213,7 @@ <key id="printKb" key="&printCmd.commandkey;" command="cmd_print" modifiers="accel"/> <key id="key_close" key="&closeCmd.key;" command="cmd_close" modifiers="accel"/> <key id="key_closeWindow" key="&closeCmd.key;" command="cmd_closeWindow" modifiers="accel,shift"/> + <key id="key_toggleMute" key="&toggleMuteCmd.key;" command="cmd_toggleMute" modifiers="control"/> <key id="key_undo" key="&undoCmd.key;" modifiers="accel"/> @@ -251,8 +252,6 @@ #ifndef XP_MACOSX <key id="showAllHistoryKb" key="&showAllHistoryCmd.commandkey;" command="Browser:ShowAllHistory" modifiers="accel,shift"/> <key keycode="VK_F5" command="Browser:ReloadSkipCache" modifiers="accel"/> - <key keycode="VK_F6" command="Browser:FocusNextFrame"/> - <key keycode="VK_F6" command="Browser:FocusNextFrame" modifiers="shift"/> <key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/> #else <key id="key_fullScreen" key="&fullScreenCmd.macCommandKey;" command="View:FullScreen" modifiers="accel,control"/> diff --git a/application/palemoon/base/content/browser-syncui.js b/application/palemoon/base/content/browser-syncui.js index 67056e221..86f6f48f1 100644 --- a/application/palemoon/base/content/browser-syncui.js +++ b/application/palemoon/base/content/browser-syncui.js @@ -83,10 +83,7 @@ var gSyncUI = { _wasDelayed: false, _needsSetup: function SUI__needsSetup() { - let firstSync = ""; - try { - firstSync = Services.prefs.getCharPref("services.sync.firstSync"); - } catch (e) { } + let firstSync = Services.prefs.getCharPref("services.sync.firstSync", ""); return Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED || firstSync == "notReady"; }, @@ -96,17 +93,25 @@ var gSyncUI = { document.getElementById("sync-setup-state").hidden = !needsSetup; document.getElementById("sync-syncnow-state").hidden = needsSetup; - if (!gBrowser) + if (!gBrowser) { return; + } let button = document.getElementById("sync-button"); - if (!button) + if (!button) { return; + } button.removeAttribute("status"); + this._updateLastSyncTime(); - if (needsSetup) + + if (needsSetup) { button.removeAttribute("tooltiptext"); + button.setAttribute("label", this._stringBundle.GetStringFromName("setupsync.label")); + } else { + button.setAttribute("label", this._stringBundle.GetStringFromName("syncnow.label")); + } }, @@ -120,6 +125,7 @@ var gSyncUI = { return; button.setAttribute("status", "active"); + button.setAttribute("label", this._stringBundle.GetStringFromName("syncing2.label")); }, onSyncDelay: function SUI_onSyncDelay() { @@ -285,11 +291,7 @@ var gSyncUI = { if (!syncButton) return; - let lastSync; - try { - lastSync = Services.prefs.getCharPref("services.sync.lastSync"); - } - catch (e) { }; + let lastSync = Services.prefs.getCharPref("services.sync.lastSync", ""); if (!lastSync || this._needsSetup()) { syncButton.removeAttribute("tooltiptext"); return; diff --git a/application/palemoon/base/content/browser-tabPreviews.js b/application/palemoon/base/content/browser-tabPreviews.js index eaae78ba8..e0755b81d 100644 --- a/application/palemoon/base/content/browser-tabPreviews.js +++ b/application/palemoon/base/content/browser-tabPreviews.js @@ -940,6 +940,13 @@ var allTabs = { aPreview.setAttribute("image", aPreview._tab.image); else aPreview.removeAttribute("image"); + + aPreview.removeAttribute("soundplaying"); + aPreview.removeAttribute("muted"); + if (aPreview._tab.hasAttribute("muted")) + aPreview.setAttribute("muted", "true"); + else if (aPreview._tab.hasAttribute("soundplaying")) + aPreview.setAttribute("soundplaying", "true"); var thumbnail = tabPreviews.get(aPreview._tab); if (aPreview.firstChild) { diff --git a/application/palemoon/base/content/browser-tabPreviews.xml b/application/palemoon/base/content/browser-tabPreviews.xml index e957649e7..4f54321ea 100644 --- a/application/palemoon/base/content/browser-tabPreviews.xml +++ b/application/palemoon/base/content/browser-tabPreviews.xml @@ -42,7 +42,10 @@ <xul:hbox class="tabPreview-canvas" xbl:inherits="style=canvasstyle"> <children/> </xul:hbox> - <xul:label flex="1" xbl:inherits="value=label,crop" class="allTabs-preview-label plain"/> + <xul:hbox align="center"> + <xul:image xbl:inherits="soundplaying,muted" class="allTabs-endimage"/> + <xul:label flex="1" xbl:inherits="value=label,crop" class="allTabs-preview-label plain"/> + </xul:hbox> </xul:vbox> <xul:hbox class="allTabs-favicon-container"> <xul:image class="allTabs-favicon" xbl:inherits="src=image"/> diff --git a/application/palemoon/base/content/browser-title.css b/application/palemoon/base/content/browser-title.css index 66b5e6731..5f7e77564 100644 --- a/application/palemoon/base/content/browser-title.css +++ b/application/palemoon/base/content/browser-title.css @@ -50,13 +50,6 @@ right: -12px; } -/* Lightweight Themes */ - -#main-window:-moz-lwtheme::after { - color: inherit; - text-shadow: inherit; -} - /* Windows Classic theme */ @media all and (-moz-windows-classic) { @@ -192,6 +185,13 @@ } +/* Lightweight Themes */ + +#main-window:-moz-lwtheme::after { + color: inherit; + text-shadow: inherit; +} + /* Hide for small windows */ diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index 7421fc5c3..7615bc92a 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -53,13 +53,20 @@ var gEditUIVisible = true; // Smart getter for the findbar. If you don't wish to force the creation of // the findbar, check gFindBarInitialized first. - -this.__defineGetter__("gFindBar", function() { - return window.gBrowser.getFindBar(); -}); - -this.__defineGetter__("gFindBarInitialized", function() { - return window.gBrowser.isFindBarInitialized(); +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.mCurrentBrowser; + window.gFindBarInitialized = true; + return findbar; }); XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils", @@ -405,6 +412,10 @@ var gURLBarSettings = { }, writePlaceholder: function() { + if (!gURLBar) { + return; + } + let attribute = "placeholder"; let prefs = this.prefSuggests.map(pref => { return this.prefSuggest + pref; @@ -969,6 +980,7 @@ var gBrowserInit = { CombinedStopReload.init(); allTabs.readPref(); TabsOnTop.init(); + AudioIndicator.init(); gPrivateBrowsingUI.init(); TabsInTitlebar.init(); retrieveToolbarIconsizesFromTheme(); @@ -1139,7 +1151,7 @@ var gBrowserInit = { // Setup click-and-hold gestures access to the session history // menus if global click-and-hold isn't turned on - if (!getBoolPref("ui.click_hold_context_menus", false)) + if (!Services.prefs.getBoolPref("ui.click_hold_context_menus", false)) SetClickAndHoldHandlers(); // Initialize the full zoom setting. @@ -1204,9 +1216,11 @@ var gBrowserInit = { placesContext.addEventListener("popuphiding", updateEditUIVisibility, false); #endif +#ifdef MOZ_PERSONAS gBrowser.mPanelContainer.addEventListener("InstallBrowserTheme", LightWeightThemeWebInstaller, false, true); gBrowser.mPanelContainer.addEventListener("PreviewBrowserTheme", LightWeightThemeWebInstaller, false, true); gBrowser.mPanelContainer.addEventListener("ResetBrowserThemePreview", LightWeightThemeWebInstaller, false, true); +#endif // Bug 666808 - AeroPeek support for e10s if (!gMultiProcessBrowser) { @@ -1357,6 +1371,8 @@ var gBrowserInit = { BookmarkingUI.uninit(); TabsOnTop.uninit(); + + AudioIndicator.uninit(); TabsInTitlebar.uninit(); @@ -1773,7 +1789,7 @@ function BrowserGoHome(aEvent) { case "tabshifted": case "tab": urls = homePage.split("|"); - var loadInBackground = getBoolPref("browser.tabs.loadBookmarksInBackground", false); + var loadInBackground = Services.prefs.getBoolPref("browser.tabs.loadBookmarksInBackground", false); gBrowser.loadTabs(urls, loadInBackground); break; case "window": @@ -2414,24 +2430,27 @@ function BrowserOnAboutPageLoad(doc) { /* === about:home === */ if (doc.documentURI.toLowerCase() == "about:home") { - let ss = Components.classes["@mozilla.org/browser/sessionstore;1"]. - getService(Components.interfaces.nsISessionStore); - if (ss.canRestoreLastSession && - !PrivateBrowsingUtils.isWindowPrivate(window)) - doc.getElementById("launcher").setAttribute("session", "true"); + if (!PrivateBrowsingUtils.isWindowPrivate(window)) { + let wrapper = {}; + Cu.import("resource:///modules/sessionstore/SessionStore.jsm", wrapper); + let ss = wrapper.SessionStore; + ss.promiseInitialized.then(function() { + if (ss.canRestoreLastSession) { + doc.getElementById("launcher").setAttribute("session", "true"); + } + }).then(null, function onError(x) { + Cu.reportError("Error in SessionStore init while processing 'about:home': " + x); + }); + } // Inject search engine and snippets URL. let docElt = doc.documentElement; - // set the following attributes BEFORE searchEngineURL, which triggers to - // show the snippets when it's set. - docElt.setAttribute("snippetsURL", AboutHomeUtils.snippetsURL); if (AboutHomeUtils.showKnowYourRights) { docElt.setAttribute("showKnowYourRights", "true"); // Set pref to indicate we've shown the notification. let currentVersion = Services.prefs.getIntPref("browser.rights.version"); Services.prefs.setBoolPref("browser.rights." + currentVersion + ".shown", true); } - docElt.setAttribute("snippetsVersion", AboutHomeUtils.snippetsVersion); function updateSearchEngine() { let engine = AboutHomeUtils.defaultSearchEngine; @@ -2439,7 +2458,7 @@ function BrowserOnAboutPageLoad(doc) { docElt.setAttribute("searchEnginePostData", engine.postDataString || ""); docElt.setAttribute("searchEngineURL", engine.searchURL); } - updateSearchEngine(); + Services.search.init(updateSearchEngine); // Listen for the event that's triggered when the user changes search engine. // At this point we simply reload about:home to reflect the change. @@ -2464,7 +2483,7 @@ function BrowserOnAboutPageLoad(doc) { docElt.setAttribute("searchEnginePostData", engine.postDataString || ""); docElt.setAttribute("searchEngineURL", engine.searchURL); } - updateSearchEngine(); + Services.search.init(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. @@ -2644,6 +2663,11 @@ function getWebNavigation() } function BrowserReloadWithFlags(reloadFlags) { + + // Reset DOS mitigation for auth prompts when user initiates a reload. + let browser = gBrowser.selectedBrowser; + delete browser.authPromptCounter; + /* First, we'll try to use the session history object to reload so * that framesets are handled properly. If we're in a special * window (such as view-source) that has no session history, fall @@ -3029,7 +3053,9 @@ const DOMLinkHandler = { /^(?:https?|ftp):/i.test(link.href) && !PrivateBrowsingUtils.isWindowPrivate(window)) { var engine = { title: link.title, href: link.href }; - BrowserSearch.addEngine(engine, link.ownerDocument); + Services.search.init(function () { + BrowserSearch.addEngine(engine, link.ownerDocument); + }); searchAdded = true; } } @@ -3378,7 +3404,7 @@ function BrowserCustomizeToolbar() { TabsInTitlebar.allowedBy("customizing-toolbars", false); var customizeURL = "chrome://global/content/customizeToolbar.xul"; - gCustomizeSheet = getBoolPref("toolbar.customization.usesheet", false); + gCustomizeSheet = Services.prefs.getBoolPref("toolbar.customization.usesheet", false); if (gCustomizeSheet) { let sheetFrame = document.createElement("iframe"); @@ -3447,6 +3473,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) { // Update the urlbar if (gURLBar) { + gURLBarSettings.writePlaceholder(); URLBarSetURI(); XULBrowserWindow.asyncUpdateUI(); BookmarkingUI.updateStarState(); @@ -3462,7 +3489,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) { cmd.removeAttribute("disabled"); // make sure to re-enable click-and-hold - if (!getBoolPref("ui.click_hold_context_menus", false)) + if (!Services.prefs.getBoolPref("ui.click_hold_context_menus", false)) SetClickAndHoldHandlers(); gBrowser.selectedBrowser.focus(); @@ -4389,7 +4416,13 @@ nsBrowserAccess.prototype = { openURI: function (aURI, aOpener, aWhere, aContext) { var newWindow = null; - var isExternal = (aContext == Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL); + var isExternal = !!(aContext & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL); + + if (aOpener && isExternal) { + Cu.reportError("nsBrowserAccess.openURI did not expect an opener to be " + + "passed if the context is OPEN_EXTERNAL."); + throw Cr.NS_ERROR_FAILURE; + } if (isExternal && aURI && aURI.schemeIs("chrome")) { dump("use -chrome command-line option to load external chrome urls\n"); @@ -4446,14 +4479,15 @@ nsBrowserAccess.prototype = { } let loadInBackground = gPrefService.getBoolPref("browser.tabs.loadDivertedInBackground"); - let referrer = aOpener ? makeURI(aOpener.location.href) : null; + let openerWindow = (aContext & Ci.nsIBrowserDOMWindow.OPEN_NO_OPENER) ? null : aOpener; let tab = win.gBrowser.loadOneTab(aURI ? aURI.spec : "about:blank", { triggeringPrincipal: triggeringPrincipal, referrerURI: referrer, referrerPolicy: referrerPolicy, fromExternal: isExternal, - inBackground: loadInBackground}); + inBackground: loadInBackground, + opener: openerWindow }); let browser = win.gBrowser.getBrowserForTab(tab); if (gPrefService.getBoolPref("browser.tabs.noWindowActivationOnExternal")) { @@ -4583,6 +4617,42 @@ function setToolbarVisibility(toolbar, isVisible) { ToolbarIconColor.inferFromText(); } +var AudioIndicator = { + init: function () { + Services.prefs.addObserver(this._prefName, this, false); + this.syncUI(); + }, + + uninit: function () { + Services.prefs.removeObserver(this._prefName, this); + }, + + toggle: function () { + this.enabled = !Services.prefs.getBoolPref(this._prefName); + }, + + syncUI: function () { + document.getElementById("context_toggleMuteTab").setAttribute("hidden", this.enabled); + document.getElementById("key_toggleMute").setAttribute("disabled", this.enabled); + }, + + get enabled () { + return !Services.prefs.getBoolPref(this._prefName); + }, + + set enabled (val) { + Services.prefs.setBoolPref(this._prefName, !!val); + return val; + }, + + observe: function (subject, topic, data) { + if (topic == "nsPref:changed") + this.syncUI(); + }, + + _prefName: "browser.tabs.showAudioPlayingIcon" +} + var TabsOnTop = { init: function TabsOnTop_init() { Services.prefs.addObserver(this._prefName, this, false); @@ -5272,9 +5342,6 @@ function handleDroppedLink(event, urlOrLinks, name) let lastLocationChange = gBrowser.selectedBrowser.lastLocationChange; - let userContextId = gBrowser.selectedBrowser - .getAttribute("usercontextid") || 0; - let inBackground = Services.prefs.getBoolPref("browser.tabs.loadInBackground"); if (event.shiftKey) inBackground = !inBackground; @@ -5293,7 +5360,6 @@ function handleDroppedLink(event, urlOrLinks, name) replace: true, allowThirdPartyFixup: false, postDatas, - userContextId, }); } }); @@ -7007,6 +7073,17 @@ function restoreLastSession() { var TabContextMenu = { contextTab: null, + _updateToggleMuteMenuItem(aTab, aConditionFn) { + ["muted", "soundplaying"].forEach(attr => { + if (!aConditionFn || aConditionFn(attr)) { + if (aTab.hasAttribute(attr)) { + aTab.toggleMuteMenuItem.setAttribute(attr, "true"); + } else { + aTab.toggleMuteMenuItem.removeAttribute(attr); + } + } + }); + }, updateContextMenu: function updateContextMenu(aPopupMenu) { this.contextTab = aPopupMenu.triggerNode.localName == "tab" ? aPopupMenu.triggerNode : gBrowser.selectedTab; @@ -7053,6 +7130,35 @@ var TabContextMenu = { bookmarkAllTabs.hidden = this.contextTab.pinned; if (!bookmarkAllTabs.hidden) PlacesCommandHook.updateBookmarkAllTabsCommand(); + + // Adjust the state of the toggle mute menu item. + let toggleMute = document.getElementById("context_toggleMuteTab"); + if (this.contextTab.hasAttribute("muted")) { + toggleMute.label = gNavigatorBundle.getString("unmuteTab.label"); + toggleMute.accessKey = gNavigatorBundle.getString("unmuteTab.accesskey"); + } else { + toggleMute.label = gNavigatorBundle.getString("muteTab.label"); + toggleMute.accessKey = gNavigatorBundle.getString("muteTab.accesskey"); + } + + this.contextTab.toggleMuteMenuItem = toggleMute; + this._updateToggleMuteMenuItem(this.contextTab); + + this.contextTab.addEventListener("TabAttrModified", this, false); + aPopupMenu.addEventListener("popuphiding", this, false); + }, + handleEvent(aEvent) { + switch (aEvent.type) { + case "popuphiding": + gBrowser.removeEventListener("TabAttrModified", this); + aEvent.target.removeEventListener("popuphiding", this); + break; + case "TabAttrModified": + let tab = aEvent.target; + this._updateToggleMuteMenuItem(tab, + attr => aEvent.detail.changed.indexOf(attr) >= 0); + break; + } } }; @@ -7222,14 +7328,6 @@ var MousePosTracker = { } }; -function focusNextFrame(event) { - let fm = Services.focus; - let dir = event.shiftKey ? fm.MOVEFOCUS_BACKWARDDOC : fm.MOVEFOCUS_FORWARDDOC; - let element = fm.moveFocus(window, null, dir, fm.FLAG_BYKEY); - if (element.ownerDocument == document) - focusAndSelectUrlBar(); -} - var BrowserChromeTest = { _cb: null, _ready: false, diff --git a/application/palemoon/base/content/browser.xul b/application/palemoon/base/content/browser.xul index 90899bb88..0a249afa9 100644 --- a/application/palemoon/base/content/browser.xul +++ b/application/palemoon/base/content/browser.xul @@ -53,12 +53,15 @@ titlemodifier_privatebrowsing="&mainWindow.titlemodifier; &mainWindow.titlePrivateBrowsingSuffix;" #endif titlemenuseparator="&mainWindow.titlemodifiermenuseparator;" +#ifdef MOZ_PERSONAS lightweightthemes="true" lightweightthemesfooter="browser-bottombox" +#endif windowtype="navigator:browser" macanimationtype="document" screenX="4" screenY="4" fullscreenbutton="true" + retargetdocumentfocus="urlbar" persist="screenX screenY width height sizemode"> # All JS files which are not content (only) dependent that browser.xul @@ -86,6 +89,7 @@ onpopuphidden="if (event.target == this) TabContextMenu.contextTab = null;"> <menuitem id="context_reloadTab" label="&reloadTab.label;" accesskey="&reloadTab.accesskey;" oncommand="gBrowser.reloadTab(TabContextMenu.contextTab);"/> + <menuitem id="context_toggleMuteTab" oncommand="TabContextMenu.contextTab.toggleMuteAudio();"/> <menuseparator/> <menuitem id="context_pinTab" label="&pinTab.label;" accesskey="&pinTab.accesskey;" @@ -963,7 +967,8 @@ tabcontainer="tabbrowser-tabs" contentcontextmenu="contentAreaContextMenu" autocompletepopup="PopupAutoComplete" - datetimepicker="DateTimePickerPanel"/> + datetimepicker="DateTimePickerPanel" + authdosprotected="true"/> <chatbar id="pinnedchats" layer="true" mousethrough="always" hidden="true"/> <statuspanel id="statusbar-display" inactive="true"/> </vbox> diff --git a/application/palemoon/base/content/content.js b/application/palemoon/base/content/content.js index 653dac3e3..211a24a8b 100644 --- a/application/palemoon/base/content/content.js +++ b/application/palemoon/base/content/content.js @@ -139,7 +139,6 @@ var handleContentContextMenu = function (event) { let selectionInfo = BrowserUtils.getSelectionDetails(content); let loadContext = docShell.QueryInterface(Ci.nsILoadContext); - let userContextId = loadContext.originAttributes.userContextId; let browser = docShell.chromeEventHandler; let mainWin = browser.ownerGlobal; @@ -160,7 +159,6 @@ var handleContentContextMenu = function (event) { selectionInfo: selectionInfo, loginFillInfo, parentAllowsMixedContent, - userContextId, }; } diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js index 19b2fac77..916dd2637 100644 --- a/application/palemoon/base/content/nsContextMenu.js +++ b/application/palemoon/base/content/nsContextMenu.js @@ -381,6 +381,7 @@ nsContextMenu.prototype = { this.showItem("context-media-mute", onMedia && !this.target.muted); this.showItem("context-media-unmute", onMedia && this.target.muted); this.showItem("context-media-playbackrate", onMedia); + this.showItem("context-media-loop", onMedia); this.showItem("context-media-showcontrols", onMedia && !this.target.controls); this.showItem("context-media-hidecontrols", onMedia && this.target.controls); this.showItem("context-video-fullscreen", this.onVideo && this.target.ownerDocument.mozFullScreenElement == null); @@ -394,6 +395,7 @@ nsContextMenu.prototype = { this.setItemAttr("context-media-playbackrate-100x", "checked", this.target.playbackRate == 1.0); this.setItemAttr("context-media-playbackrate-150x", "checked", this.target.playbackRate == 1.5); this.setItemAttr("context-media-playbackrate-200x", "checked", this.target.playbackRate == 2.0); + this.setItemAttr("context-media-loop", "checked", this.target.loop); var hasError = this.target.error != null || this.target.networkState == this.target.NETWORK_NO_SOURCE; this.setItemAttr("context-media-play", "disabled", hasError); @@ -838,30 +840,8 @@ nsContextMenu.prototype = { // View Partial Source viewPartialSource: function(aContext) { - var focusedWindow = document.commandDispatcher.focusedWindow; - if (focusedWindow == window) - focusedWindow = content; - - var docCharset = null; - if (focusedWindow) - docCharset = "charset=" + focusedWindow.document.characterSet; - - // "View Selection Source" and others such as "View MathML Source" - // are mutually exclusive, with the precedence given to the selection - // when there is one - var reference = null; - if (aContext == "selection") - reference = focusedWindow.getSelection(); - else if (aContext == "mathml") - reference = this.target; - else - throw "not reached"; - - // unused (and play nice for fragments generated via XSLT too) - var docUrl = null; - window.openDialog("chrome://global/content/viewPartialSource.xul", - "_blank", "scrollbars,resizable,chrome,dialog=no", - docUrl, docCharset, reference, aContext); + let target = aContext == "mathml" ? this.target : null; + top.gViewSourceUtils.viewPartialSourceInBrowser(gBrowser.selectedBrowser, target); }, // Open new "view source" window with the frame's URL. @@ -1553,6 +1533,9 @@ nsContextMenu.prototype = { case "pause": media.pause(); break; + case "loop": + media.loop = !media.loop; + break; case "mute": media.muted = true; break; diff --git a/application/palemoon/base/content/palemoon.xhtml b/application/palemoon/base/content/palemoon.xhtml index 96757052c..f145550a9 100644 --- a/application/palemoon/base/content/palemoon.xhtml +++ b/application/palemoon/base/content/palemoon.xhtml @@ -13,7 +13,7 @@ <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset='utf-8' /> - <title>&chronicles.title.55.2;</title> + <title>&chronicles.title.66.1;</title> <style type="text/css"> html { @@ -54,11 +54,11 @@ a { <section> <p id="moztext"> - &chronicles.quote.55.2; + &chronicles.quote.66.1; </p> <p id="from"> - &chronicles.from.55.2; + &chronicles.from.66.1; </p> </section> diff --git a/application/palemoon/base/content/sanitize.js b/application/palemoon/base/content/sanitize.js index 0c85fa215..b4d13d895 100644 --- a/application/palemoon/base/content/sanitize.js +++ b/application/palemoon/base/content/sanitize.js @@ -257,18 +257,13 @@ Sanitizer.prototype = { .getService(Components.interfaces.nsIWindowMediator); var windows = windowManager.getEnumerator("navigator:browser"); while (windows.hasMoreElements()) { - let currentWindow = windows.getNext(); - let currentDocument = currentWindow.document; + let currentDocument = windows.getNext().document; let searchBar = currentDocument.getElementById("searchbar"); if (searchBar) searchBar.textbox.reset(); - 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 findBar = currentDocument.getElementById("FindToolbar"); + if (findBar) + findBar.clear(); } let change = { op: "remove" }; @@ -284,8 +279,7 @@ Sanitizer.prototype = { .getService(Components.interfaces.nsIWindowMediator); var windows = windowManager.getEnumerator("navigator:browser"); while (windows.hasMoreElements()) { - let currentWindow = windows.getNext(); - let currentDocument = currentWindow.document; + let currentDocument = windows.getNext().document; let searchBar = currentDocument.getElementById("searchbar"); if (searchBar) { let transactionMgr = searchBar.textbox.editor.transactionManager; @@ -296,12 +290,8 @@ Sanitizer.prototype = { return false; } } - let tabBrowser = currentWindow.gBrowser; - let findBarCanClear = Array.some(tabBrowser.tabs, function (aTab) { - return tabBrowser.isFindBarInitialized(aTab) && - tabBrowser.getFindBar(aTab).canClear; - }); - if (findBarCanClear) { + let findBar = currentDocument.getElementById("FindToolbar"); + if (findBar && findBar.canClear) { aCallback("formdata", true, aArg); return false; } diff --git a/application/palemoon/base/content/tabbrowser.css b/application/palemoon/base/content/tabbrowser.css index 94d6dbb2e..43536b27a 100644 --- a/application/palemoon/base/content/tabbrowser.css +++ b/application/palemoon/base/content/tabbrowser.css @@ -45,10 +45,19 @@ tabpanels { } .tab-throbber:not([busy]), -.tab-throbber[busy] + .tab-icon-image { +.tab-throbber[busy] + .tab-icon-image, +.tab-icon-sound:not([soundplaying]):not([muted]):not([blocked]), +.tab-icon-sound[pinned], +.tab-icon-overlay { display: none; } +.tab-icon-overlay[soundplaying][pinned], +.tab-icon-overlay[muted][pinned], +.tab-icon-overlay[blocked][pinned] { + display: -moz-box; +} + .closing-tabs-spacer { pointer-events: none; } diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index d5735149e..b5edd54b7 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -30,7 +30,7 @@ <xul:vbox flex="1" class="browserContainer"> <xul:stack flex="1" class="browserStack" anonid="browserStack"> <xul:browser anonid="initialBrowser" type="content-primary" message="true" disablehistory="true" - xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,datetimepicker"/> + xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,datetimepicker,authdosprotected"/> </xul:stack> </xul:vbox> </xul:hbox> @@ -128,10 +128,6 @@ false </field> - <field name="_lastFindValue"> - "" - </field> - <property name="_numPinnedTabs" readonly="true"> <getter><![CDATA[ for (var i = 0; i < this.tabs.length; i++) { @@ -158,43 +154,6 @@ ]]></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) @@ -443,11 +402,18 @@ let promptBox = { appendPrompt : function(args, onCloseCallback) { let newPrompt = document.createElementNS(XUL_NS, "tabmodalprompt"); - stack.appendChild(newPrompt); + // stack.appendChild(newPrompt); + stack.insertBefore(newPrompt, browser.nextSibling); browser.setAttribute("tabmodalPromptShowing", true); newPrompt.clientTop; // style flush to assure binding is attached + let prompts = this.listPrompts(); + if (prompts.length > 1) { + // Let's hide ourself behind the current prompt. + newPrompt.hidden = true; + } + let tab = self._getTabForContentWindow(browser.contentWindow); newPrompt.init(args, tab, onCloseCallback); return newPrompt; @@ -459,6 +425,7 @@ let prompts = this.listPrompts(); if (prompts.length) { let prompt = prompts[prompts.length - 1]; + prompt.hidden = false; prompt.Dialog.setDefaultFocus(); } else { browser.removeAttribute("tabmodalPromptShowing"); @@ -479,6 +446,22 @@ </body> </method> + <method name="getTabFromAudioEvent"> + <parameter name="aEvent"/> + <body> + <![CDATA[ + if (!Services.prefs.getBoolPref("browser.tabs.showAudioPlayingIcon") || + !aEvent.isTrusted) { + return null; + } + + var browser = aEvent.originalTarget; + var tab = this.getTabForBrowser(browser); + return tab; + ]]> + </body> + </method> + <method name="_callProgressListeners"> <parameter name="aBrowser"/> <parameter name="aMethod"/> @@ -657,7 +640,7 @@ if (this.mTab.hasAttribute("busy")) { this.mTab.removeAttribute("busy"); - this.mTabBrowser._tabAttrModified(this.mTab); + this.mTabBrowser._tabAttrModified(this.mTab, ["busy"]); if (!this.mTab.selected) this.mTab.setAttribute("unread", "true"); } @@ -727,6 +710,8 @@ let topLevel = aWebProgress.isTopLevel; if (topLevel) { + let isSameDocument = + !!(aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT); // We need to clear the typed value // if the document failed to load, to make sure the urlbar reflects the // failed URI (particularly for SSL errors). However, don't clear the value @@ -737,6 +722,19 @@ aLocation.spec != "about:blank")) this.mBrowser.userTypedValue = null; + // If the browser was playing audio, we should remove the playing state. + if (this.mTab.hasAttribute("soundplaying") && !isSameDocument) { + clearTimeout(this.mTab._soundPlayingAttrRemovalTimer); + this.mTab._soundPlayingAttrRemovalTimer = 0; + this.mTab.removeAttribute("soundplaying"); + this.mTabBrowser._tabAttrModified(this.mTab, ["soundplaying"]); + } + + // If the browser was previously muted, we should restore the muted state. + if (this.mTab.hasAttribute("muted")) { + this.mTab.linkedBrowser.mute(); + } + // Don't clear the favicon if this onLocationChange was // triggered by a pushState or a replaceState. See bug 550565. if (!gMultiProcessBrowser) { @@ -747,8 +745,7 @@ let autocomplete = this.mTabBrowser._placesAutocomplete; if (this.mBrowser.registeredOpenURI) { - autocomplete.unregisterOpenPage(this.mBrowser.registeredOpenURI, - this.mBrowser.getAttribute("usercontextid") || 0); + autocomplete.unregisterOpenPage(this.mBrowser.registeredOpenURI); delete this.mBrowser.registeredOpenURI; } // Tabs in private windows aren't registered as "Open" so @@ -756,8 +753,7 @@ if (!isBlankPageURL(aLocation.spec) && (!PrivateBrowsingUtils.isWindowPrivate(window) || PrivateBrowsingUtils.permanentPrivateBrowsing)) { - autocomplete.registerOpenPage(aLocation, - this.mBrowser.getAttribute("usercontextid") || 0); + autocomplete.registerOpenPage(aLocation); this.mBrowser.registeredOpenURI = aLocation; } } @@ -835,19 +831,41 @@ } let sizedIconUrl = browser.mIconURL || ""; - if (sizedIconUrl) { - let size = Math.round(16 * window.devicePixelRatio); - sizedIconUrl += (sizedIconUrl.includes("#") ? "&" : "#") + - "-moz-resolution=" + size + "," + size; - } if (sizedIconUrl != aTab.getAttribute("image")) { - if (browser.mIconURL) //PMed + if (sizedIconUrl) aTab.setAttribute("image", sizedIconUrl); else aTab.removeAttribute("image"); - this._tabAttrModified(aTab); + this._tabAttrModified(aTab, ["image"]); } + if (Services.prefs.getBoolPref("browser.chrome.favicons.process")) { + let favImage = new Image; + favImage.src = browser.mIconURL; + var tabBrowser = this; + favImage.onload = function () { + try { + // Draw the icon on a hidden canvas + var canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); + var tabImg = document.getAnonymousElementByAttribute(aTab, "anonid", "tab-icon"); + var w = tabImg.boxObject.width; + var h = tabImg.boxObject.height; + canvas.width = w; + canvas.height = h; + var ctx = canvas.getContext('2d'); + ctx.drawImage(favImage, 0, 0, w, h); + icon = canvas.toDataURL(); + browser.mIconURL = icon; + aTab.setAttribute("image", icon); + } + catch (e) { + console.warn("Processing of favicon failed."); + // Canvas failed: icon remains as it was + } + tabBrowser._callProgressListeners(browser, "onLinkIconAvailable", [browser.mIconURL]); + } + } + this._callProgressListeners(browser, "onLinkIconAvailable", [browser.mIconURL]); ]]> </body> @@ -1082,6 +1100,11 @@ // Bug 666809 - SecurityUI support for e10s var webProgress = this.mCurrentBrowser.webProgress; var securityUI = this.mCurrentBrowser.securityUI; + + // Update global findbar with new content browser + if (gFindBarInitialized) { + gFindBar.browser = newBrowser; + } this._callProgressListeners(null, "onLocationChange", [webProgress, null, loc, 0], true, @@ -1104,11 +1127,9 @@ this.mCurrentTab.removeAttribute("unread"); this.selectedTab.lastAccessed = Date.now(); - let oldFindBar = oldTab._findBar; - if (oldFindBar && - oldFindBar.findMode == oldFindBar.FIND_NORMAL && - !oldFindBar.hidden) - this._lastFindValue = oldFindBar._findField.value; + // Bug 666816 - TypeAheadFind support for e10s + if (!gMultiProcessBrowser) + this._fastFind.setDocShell(this.mCurrentBrowser.docShell); this.updateTitlebar(); @@ -1154,16 +1175,11 @@ }); this.mCurrentTab.dispatchEvent(event); - this._tabAttrModified(oldTab); - this._tabAttrModified(this.mCurrentTab); + this._tabAttrModified(oldTab, ["selected"]); + this._tabAttrModified(this.mCurrentTab, ["selected"]); // 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) { @@ -1199,12 +1215,11 @@ } } - // Focus the find bar if it was previously focused for that tab. - if (gFindBarInitialized && !gFindBar.hidden && - this.selectedTab._findBarFocused) { - gFindBar._findField.focus(); + // If the find bar is focused, keep it focused. + if (gFindBarInitialized && + !gFindBar.hidden && + gFindBar.getElement("findbar-textbox").getAttribute("focused") == "true") break; - } // Otherwise, focus the content area. let fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager); @@ -1231,14 +1246,18 @@ <method name="_tabAttrModified"> <parameter name="aTab"/> + <parameter name="aChanged"/> <body><![CDATA[ if (aTab.closing) return; - // This event should be dispatched when any of these attributes change: - // label, crop, busy, image, selected - var event = document.createEvent("Events"); - event.initEvent("TabAttrModified", true, false); + let event = new CustomEvent("TabAttrModified", { + bubbles: true, + cancelable: false, + detail: { + changed: aChanged, + } + }); aTab.dispatchEvent(event); ]]></body> </method> @@ -1249,7 +1268,7 @@ <![CDATA[ aTab.label = this.mStringBundle.getString("tabs.connecting"); aTab.crop = "end"; - this._tabAttrModified(aTab); + this._tabAttrModified(aTab, ["label", "crop"]); ]]> </body> </method> @@ -1294,7 +1313,7 @@ aTab.label = title; aTab.crop = crop; - this._tabAttrModified(aTab); + this._tabAttrModified(aTab, ["label", "crop"]); if (aTab.selected) this.updateTitlebar(); @@ -1318,6 +1337,7 @@ var aFromExternal; var aRelatedToCurrent; var aOriginPrincipal; + var aOpener; if (arguments.length == 2 && typeof arguments[1] == "object" && !(arguments[1] instanceof Ci.nsIURI)) { @@ -1332,6 +1352,7 @@ aFromExternal = params.fromExternal; aRelatedToCurrent = params.relatedToCurrent; aOriginPrincipal = params.originPrincipal; + aOpener = params.opener; } var bgLoad = (aLoadInBackground != null) ? aLoadInBackground : @@ -1347,7 +1368,8 @@ allowThirdPartyFixup: aAllowThirdPartyFixup, fromExternal: aFromExternal, originPrincipal: aOriginPrincipal, - relatedToCurrent: aRelatedToCurrent}); + relatedToCurrent: aRelatedToCurrent, + opener: aOpener }); if (!bgLoad) this.selectedTab = tab; @@ -1365,7 +1387,6 @@ let aTargetTab; let aNewIndex = -1; let aPostDatas = []; - let aUserContextId; if (arguments.length == 2 && typeof arguments[1] == "object") { let params = arguments[1]; @@ -1376,7 +1397,6 @@ aNewIndex = typeof params.newIndex === "number" ? params.newIndex : aNewIndex; aPostDatas = params.postDatas || aPostDatas; - aUserContextId = params.userContextId; } if (!aURIs.length) @@ -1425,8 +1445,7 @@ ownerTab: owner, skipAnimation: multiple, allowThirdPartyFixup: aAllowThirdPartyFixup, - postData: aPostDatas[0], - userContextId: aUserContextId + postData: aPostDatas[0] }); if (aNewIndex !== -1) { this.moveTabTo(firstTabAdded, aNewIndex); @@ -1439,8 +1458,7 @@ let tab = this.addTab(aURIs[i], { skipAnimation: true, allowThirdPartyFixup: aAllowThirdPartyFixup, - postData: aPostDatas[i], - userContextId: aUserContextId + postData: aPostDatas[i] }); if (targetTabIndex !== -1) this.moveTabTo(tab, ++tabNum); @@ -1473,6 +1491,8 @@ var aRelatedToCurrent; var aSkipAnimation; var aOriginPrincipal; + var aSkipBackgroundNotify; + var aOpener; if (arguments.length == 2 && typeof arguments[1] == "object" && !(arguments[1] instanceof Ci.nsIURI)) { @@ -1488,6 +1508,8 @@ aRelatedToCurrent = params.relatedToCurrent; aSkipAnimation = params.skipAnimation; aOriginPrincipal = params.originPrincipal; + aOpener = params.opener; + aSkipBackgroundNotify = params.skipBackgroundNotify; } // if we're adding tabs, we're past interrupt mode, ditch the owner @@ -1511,6 +1533,11 @@ t.setAttribute("crop", "end"); t.setAttribute("validate", "never"); //PMed t.setAttribute("onerror", "this.removeAttribute('image');"); + + if (aSkipBackgroundNotify) { + t.setAttribute("skipbackgroundnotify", true); + } + t.className = "tabbrowser-tab"; this.tabContainer._unlockTabSizing(); @@ -1556,6 +1583,10 @@ b.setAttribute("showresizer", "true"); } + if (aOpener) { + b.QueryInterface(Ci.nsIFrameLoaderOwner).presetOpenerWindow(aOpener); + } + if (this.hasAttribute("autocompletepopup")) b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup")); b.setAttribute("autoscrollpopup", this._autoScrollPopup.id); @@ -1563,6 +1594,10 @@ if (this.hasAttribute("datetimepicker")) { b.setAttribute("datetimepicker", this.getAttribute("datetimepicker")); } + + if (this.hasAttribute("authdosprotected")) { + b.setAttribute("authdosprotected", this.getAttribute("authdosprotected")); + } // Create the browserStack container var stack = document.createElementNS(NS_XUL, "stack"); @@ -1622,6 +1657,7 @@ 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 @@ -2029,8 +2065,7 @@ this.mTabListeners[aTab._tPos].destroy(); if (browser.registeredOpenURI && !aTabWillBeMoved) { - this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI, - browser.getAttribute("usercontextid") || 0); + this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI); delete browser.registeredOpenURI; } @@ -2275,6 +2310,14 @@ var remoteBrowser = aOtherTab.ownerDocument.defaultView.gBrowser; var isPending = aOtherTab.hasAttribute("pending"); + // Expedite the removal of the icon if it was already scheduled. + if (aOtherTab._soundPlayingAttrRemovalTimer) { + clearTimeout(aOtherTab._soundPlayingAttrRemovalTimer); + aOtherTab._soundPlayingAttrRemovalTimer = 0; + aOtherTab.removeAttribute("soundplaying"); + remoteBrowser._tabAttrModified(aOtherTab, ["soundplaying"]); + } + // First, start teardown of the other browser. Make sure to not // fire the beforeunload event in the process. Close the other // window if this was its last tab. @@ -2284,6 +2327,18 @@ let ourBrowser = this.getBrowserForTab(aOurTab); let otherBrowser = aOtherTab.linkedBrowser; + let modifiedAttrs = []; + if (aOtherTab.hasAttribute("muted")) { + aOurTab.setAttribute("muted", "true"); + aOurTab.muteReason = aOtherTab.muteReason; + ourBrowser.mute(); + modifiedAttrs.push("muted"); + } + if (aOtherTab.hasAttribute("soundplaying")) { + aOurTab.setAttribute("soundplaying", "true"); + modifiedAttrs.push("soundplaying"); + } + // If the other tab is pending (i.e. has not been restored, yet) // then do not switch docShells but retrieve the other tab's state // and apply it to our tab. @@ -2302,7 +2357,7 @@ var isBusy = aOtherTab.hasAttribute("busy"); if (isBusy) { aOurTab.setAttribute("busy", "true"); - this._tabAttrModified(aOurTab); + modifiedAttrs.push("busy"); if (aOurTab.selected) this.mIsBusy = true; } @@ -2310,17 +2365,6 @@ 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); @@ -2333,6 +2377,10 @@ // of replaceTabWithWindow), notify onLocationChange, etc. if (aOurTab.selected) this.updateCurrentBrowser(true); + + if (modifiedAttrs.length) { + this._tabAttrModified(aOurTab, modifiedAttrs); + } ]]> </body> </method> @@ -2385,8 +2433,7 @@ <![CDATA[ // If the current URI is registered as open remove it from the list. if (aOurBrowser.registeredOpenURI) { - this._placesAutocomplete.unregisterOpenPage(aOurBrowser.registeredOpenURI, - aOurBrowser.getAttribute("usercontextid") || 0); + this._placesAutocomplete.unregisterOpenPage(aOurBrowser.registeredOpenURI); delete aOurBrowser.registeredOpenURI; } @@ -2419,7 +2466,10 @@ <parameter name="aTab"/> <body> <![CDATA[ - this.getBrowserForTab(aTab).reload(); + let browser = this.getBrowserForTab(aTab); + // Reset DOS mitigation for basic auth prompt + delete browser.authPromptCounter; + browser.reload(); ]]> </body> </method> @@ -2873,6 +2923,21 @@ 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> @@ -2982,19 +3047,6 @@ onget="return this.mCurrentBrowser.docShell" readonly="true"/> - <property name="messageManager" - readonly="true"> - <getter> - <![CDATA[ - let frameLoader = this.mCurrentBrowser.frameLoader; - if (!frameLoader) { - return null; - } - return frameLoader.messageManager; - ]]> - </getter> - </property> - <property name="webNavigation" onget="return this.mCurrentBrowser.webNavigation" readonly="true"/> @@ -3129,9 +3181,25 @@ event.preventDefault(); return; } - event.target.setAttribute("label", tab.mOverCloseButton ? - tab.getAttribute("closetabtext") : - tab.getAttribute("label")); + + var stringID, label; + if (tab.mOverCloseButton) { + stringID = "tabs.closeTab"; + } else if (tab._overPlayingIcon) { + if (tab.linkedBrowser.audioBlocked) { + stringID = "tabs.unblockAudio.tooltip"; + } else { + stringID = tab.linkedBrowser.audioMuted ? + "tabs.unmuteAudio.tooltip" : + "tabs.muteAudio.tooltip"; + } + } else { + label = tab.getAttribute("label"); + } + if (stringID && !label) { + label = this.mStringBundle.getString(stringID); + } + event.target.setAttribute("label", label); ]]></body> </method> @@ -3176,28 +3244,6 @@ window.focus(); break; } - case "Findbar:Keypress": - 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> @@ -3264,11 +3310,6 @@ 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> @@ -3302,8 +3343,7 @@ for (var i = 0; i < this.mTabListeners.length; ++i) { let browser = this.getBrowserAtIndex(i); if (browser.registeredOpenURI) { - this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI, - browser.getAttribute("usercontextid") || 0); + this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI); delete browser.registeredOpenURI; } browser.webProgress.removeProgressListener(this.mTabFilters[i]); @@ -3372,6 +3412,7 @@ ]]> </getter> </property> + <field name="_soundPlayingAttrRemovalTimer">0</field> </implementation> <handlers> @@ -3419,6 +3460,78 @@ tab.setAttribute("titlechanged", "true"); ]]> </handler> + <handler event="DOMAudioPlaybackStarted"> + <![CDATA[ + var tab = getTabFromAudioEvent(event) + if (!tab) { + return; + } + + clearTimeout(tab._soundPlayingAttrRemovalTimer); + tab._soundPlayingAttrRemovalTimer = 0; + + let modifiedAttrs = []; + if (tab.hasAttribute("soundplaying-scheduledremoval")) { + tab.removeAttribute("soundplaying-scheduledremoval"); + modifiedAttrs.push("soundplaying-scheduledremoval"); + } + + if (!tab.hasAttribute("soundplaying")) { + tab.setAttribute("soundplaying", true); + modifiedAttrs.push("soundplaying"); + } + + this._tabAttrModified(tab, modifiedAttrs); + ]]> + </handler> + <handler event="DOMAudioPlaybackStopped"> + <![CDATA[ + var tab = getTabFromAudioEvent(event) + if (!tab) { + return; + } + + if (tab.hasAttribute("soundplaying")) { + let removalDelay = Services.prefs.getIntPref("browser.tabs.delayHidingAudioPlayingIconMS"); + + tab.style.setProperty("--soundplaying-removal-delay", `${removalDelay - 300}ms`); + tab.setAttribute("soundplaying-scheduledremoval", "true"); + this._tabAttrModified(tab, ["soundplaying-scheduledremoval"]); + + tab._soundPlayingAttrRemovalTimer = setTimeout(() => { + tab.removeAttribute("soundplaying-scheduledremoval"); + tab.removeAttribute("soundplaying"); + this._tabAttrModified(tab, ["soundplaying", "soundplaying-scheduledremoval"]); + }, removalDelay); + } + ]]> + </handler> + <handler event="DOMAudioPlaybackBlockStarted"> + <![CDATA[ + var tab = getTabFromAudioEvent(event) + if (!tab) { + return; + } + + if (!tab.hasAttribute("blocked")) { + tab.setAttribute("blocked", true); + this._tabAttrModified(tab, ["blocked"]); + } + ]]> + </handler> + <handler event="DOMAudioPlaybackBlockStopped"> + <![CDATA[ + var tab = getTabFromAudioEvent(event) + if (!tab) { + return; + } + + if (tab.hasAttribute("blocked")) { + tab.removeAttribute("blocked"); + this._tabAttrModified(tab, ["blocked"]); + } + ]]> + </handler> </handlers> </binding> @@ -3523,23 +3636,17 @@ 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); - try { - this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled"); - } catch (ex) { - this._tabAnimationLoggingEnabled = false; - } + this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled", false); this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled"); ]]> </constructor> <destructor> <![CDATA[ - Services.prefs.removeObserver("accessibility.typeaheadfind", this._prefObserver); Services.prefs.removeObserver("browser.tabs.", this._prefObserver); ]]> </destructor> @@ -3605,9 +3712,6 @@ 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(); @@ -4214,7 +4318,11 @@ this._fillTrailingGap(); this._handleTabSelect(); } else { - this._notifyBackgroundTab(tab); + if (tab.hasAttribute("skipbackgroundnotify")) { + tab.removeAttribute("skipbackgroundnotify"); + } else { + this._notifyBackgroundTab(tab); + } } // XXXmano: this is a temporary workaround for bug 345399 @@ -4356,17 +4464,76 @@ event.originalTarget.localName != "box") return; - // See hack note in the tabbrowser-close-tab-button binding + // See comments in the "mousedown" and "click" event handlers of the + // tabbrowser-tabs binding. if (!this._blockDblClick) BrowserOpenTab(); event.preventDefault(); ]]></handler> - <handler event="click"><![CDATA[ - if (event.button != 1) - return; + <!-- Consider that the in-tab close button is only shown on the active + tab. When clicking on an inactive tab at the position where the + close button will appear during the click, no "click" event will be + dispatched, because the mousedown and mouseup events don't have the + same event target. For that reason use "mousedown" instead of "click" + to implement in-tab close button behavior. (Pale Moon UXP issue #775) + --> + <handler event="mousedown" button="0" phase="capturing"><![CDATA[ + /* The only sequence in which a second click event (i.e. dblclik) + * can be dispatched on an in-tab close button is when it is shown + * after the first click (i.e. the first click event was dispatched + * on the tab). This happens when we show the close button only on + * the active tab. (bug 352021) + * The only sequence in which a third click event can be dispatched + * on an in-tab close button is when the tab was opened with a + * double click on the tabbar. (bug 378344) + * In both cases, it is most likely that the close button area has + * been accidentally clicked, therefore we do not close the tab. + * + * We don't want to ignore processing of more than one click event, + * though, since the user might actually be repeatedly clicking to + * close many tabs at once. + * + * Also prevent errant doubleclick on the close button from opening + * a new tab (bug 343628): + * Since we're removing the event target, if the user double-clicks + * the button, the dblclick event will be dispatched with the tabbar + * as its event target (and explicit/originalTarget), which treats + * that as a mouse gesture for opening a new tab. + * In this context, we're manually blocking the dblclick event. + */ + + // Reset flags at the beginning of a series of clicks: + if (event.detail == 1) { + this.flagClickOnCloseButton = false; + this.flagActivateTabOrClickOnTabbar = false; + } + + this.blockCloseButtonOnDblclick = this.flagActivateTabOrClickOnTabbar; + this._blockDblClick = this.flagClickOnCloseButton; + + // Set flags: + let eventTargetIsCloseButton = + event.originalTarget.classList.contains("tab-close-button"); + this.flagClickOnCloseButton = eventTargetIsCloseButton; + this.flagActivateTabOrClickOnTabbar = + ((!eventTargetIsCloseButton && event.detail == 1) || + event.originalTarget.localName == "box"); + ]]></handler> + <handler event="click" button="0"><![CDATA[ + // See comment in the "mousedown" event handler of the + // tabbrowser-tabs binding. + if (event.originalTarget.classList.contains("tab-close-button") && + !this.blockCloseButtonOnDblclick) { + gBrowser.removeTab(document.getBindingParent(event.originalTarget), + {animate: true, byMouse: true,}); + this._blockDblClick = true; + } + ]]></handler> + + <handler event="click" button="1"><![CDATA[ if (event.target.localName == "tab") { if (this.childNodes.length > 1 || !this._closeWindowWithLastTab) this.tabbrowser.removeTab(event.target, {animate: true, byMouse: true}); @@ -4631,8 +4798,6 @@ inBackground = !inBackground; let targetTab = this._getDragTargetTab(event); - let userContextId = this.selectedItem - .getAttribute("usercontextid") || 0; let replace = !(!targetTab || dropEffect == "copy"); let newIndex = this._getDropIndex(event); let urls = links.map(link => link.url); @@ -4642,7 +4807,6 @@ allowThirdPartyFixup: true, targetTab, newIndex, - userContextId, }); } @@ -4739,63 +4903,6 @@ <binding id="tabbrowser-close-tab-button" extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton-image"> <handlers> - <handler event="click" button="0"><![CDATA[ - var bindingParent = document.getBindingParent(this); - var tabContainer = bindingParent.parentNode; - /* The only sequence in which a second click event (i.e. dblclik) - * can be dispatched on an in-tab close button is when it is shown - * after the first click (i.e. the first click event was dispatched - * on the tab). This happens when we show the close button only on - * the active tab. (bug 352021) - * The only sequence in which a third click event can be dispatched - * on an in-tab close button is when the tab was opened with a - * double click on the tabbar. (bug 378344) - * In both cases, it is most likely that the close button area has - * been accidentally clicked, therefore we do not close the tab. - * - * We don't want to ignore processing of more than one click event, - * though, since the user might actually be repeatedly clicking to - * close many tabs at once. - */ - if (event.detail > 1 && !this._ignoredClick) { - this._ignoredClick = true; - return; - } - - // Reset the "ignored click" flag - this._ignoredClick = false; - - tabContainer.tabbrowser.removeTab(bindingParent, {animate: true, byMouse: true}); - tabContainer._blockDblClick = true; - - /* XXXmano hack (see bug 343628): - * Since we're removing the event target, if the user - * double-clicks this button, the dblclick event will be dispatched - * with the tabbar as its event target (and explicit/originalTarget), - * which treats that as a mouse gesture for opening a new tab. - * In this context, we're manually blocking the dblclick event - * (see dblclick handler). - */ - var clickedOnce = false; - function enableDblClick(event) { - var target = event.originalTarget; - if (target.className == 'tab-close-button') - target._ignoredClick = true; - if (!clickedOnce) { - clickedOnce = true; - return; - } - tabContainer._blockDblClick = false; - tabContainer.removeEventListener("click", enableDblClick, true); - } - tabContainer.addEventListener("click", enableDblClick, true); - ]]></handler> - - <handler event="dblclick" button="0" phase="capturing"> - // for the one-close-button case - event.stopPropagation(); - </handler> - <handler event="dragstart"> event.stopPropagation(); </handler> @@ -4829,10 +4936,18 @@ class="tab-icon-image" role="presentation" anonid="tab-icon"/> + <xul:image xbl:inherits="busy,soundplaying,soundplaying-scheduledremoval,pinned,muted,blocked,selected" + anonid="overlay-icon" + class="tab-icon-overlay" + role="presentation"/> <xul:label flex="1" xbl:inherits="value=label,crop,accesskey,fadein,pinned,selected" class="tab-text tab-label" role="presentation"/> + <xul:image xbl:inherits="soundplaying,soundplaying-scheduledremoval,pinned,muted,blocked,selected" + anonid="soundplaying-icon" + class="tab-icon-sound" + role="presentation"/> <xul:toolbarbutton anonid="close-button" xbl:inherits="fadein,pinned,selected" class="tab-close-button close-icon"/> @@ -4853,9 +4968,59 @@ </property> <field name="mOverCloseButton">false</field> + <property name="_overPlayingIcon" readonly="true"> + <getter><![CDATA[ + let iconVisible = this.hasAttribute("soundplaying") || + this.hasAttribute("muted") || + this.hasAttribute("blocked"); + let soundPlayingIcon = + document.getAnonymousElementByAttribute(this, "anonid", "soundplaying-icon"); + let overlayIcon = + document.getAnonymousElementByAttribute(this, "anonid", "overlay-icon"); + + return soundPlayingIcon && soundPlayingIcon.matches(":hover") || + (overlayIcon && overlayIcon.matches(":hover") && iconVisible); + ]]></getter> + </property> <field name="mCorrespondingMenuitem">null</field> <field name="closing">false</field> <field name="lastAccessed">0</field> + + <method name="toggleMuteAudio"> + <parameter name="aMuteReason"/> + <body> + <![CDATA[ + let tabContainer = this.parentNode; + let browser = this.linkedBrowser; + let modifiedAttrs = []; + if (browser.audioBlocked) { + this.removeAttribute("blocked"); + modifiedAttrs.push("blocked"); + + // We don't want sound icon flickering between "blocked", "none" and + // "sound-playing", here adding the "soundplaying" is to keep the + // transition smoothly. + if (!this.hasAttribute("soundplaying")) { + this.setAttribute("soundplaying", true); + modifiedAttrs.push("soundplaying"); + } + + browser.resumeMedia(); + } else { + if (browser.audioMuted) { + browser.unmute(); + this.removeAttribute("muted"); + } else { + browser.mute(); + this.setAttribute("muted", "true"); + } + this.muteReason = aMuteReason || null; + modifiedAttrs.push("muted"); + } + tabContainer.tabbrowser._tabAttrModified(this, modifiedAttrs); + ]]> + </body> + </method> </implementation> <handlers> @@ -4914,7 +5079,8 @@ if (this.selected) { this.style.MozUserFocus = 'ignore'; this.clientTop; // just using this to flush style updates - } else if (this.mOverCloseButton) { + } else if (this.mOverCloseButton || + this._overPlayingIcon) { // Prevent tabbox.xml from selecting the tab. event.stopPropagation(); } @@ -4923,6 +5089,17 @@ <handler event="mouseup"> this.style.MozUserFocus = ''; </handler> + <handler event="click"> + <![CDATA[ + if (event.button != 0) { + return; + } + + if (this._overPlayingIcon) { + this.toggleMuteAudio(); + } + ]]> + </handler> </handlers> </binding> @@ -5028,6 +5205,24 @@ aMenuitem.setAttribute("selected", "true"); else aMenuitem.removeAttribute("selected"); + + function addEndImage() { + let endImage = document.createElement("image"); + endImage.setAttribute("class", "allTabs-endimage"); + let endImageContainer = document.createElement("hbox"); + endImageContainer.setAttribute("align", "center"); + endImageContainer.setAttribute("pack", "center"); + endImageContainer.appendChild(endImage); + aMenuitem.appendChild(endImageContainer); + return endImage; + } + + if (aMenuitem.firstChild) + aMenuitem.firstChild.remove(); + if (aTab.hasAttribute("muted")) + addEndImage().setAttribute("muted", "true"); + else if (aTab.hasAttribute("soundplaying")) + addEndImage().setAttribute("soundplaying", "true"); ]]></body> </method> </implementation> diff --git a/application/palemoon/base/content/urlbarBindings.xml b/application/palemoon/base/content/urlbarBindings.xml index d188e6658..d2d9cc720 100644 --- a/application/palemoon/base/content/urlbarBindings.xml +++ b/application/palemoon/base/content/urlbarBindings.xml @@ -302,6 +302,10 @@ // but don't let that interfere with the loading of the url. Cu.reportError(ex); } + + // Reset DOS mitigations for the basic auth prompt. + let browser = gBrowser.selectedBrowser; + delete browser.authPromptCounter; function loadCurrent() { let flags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP; diff --git a/application/palemoon/base/content/utilityOverlay.js b/application/palemoon/base/content/utilityOverlay.js index 2c1a95f83..1d284ba2a 100644 --- a/application/palemoon/base/content/utilityOverlay.js +++ b/application/palemoon/base/content/utilityOverlay.js @@ -12,6 +12,9 @@ Components.utils.import("resource:///modules/RecentWindow.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ShellService", "resource:///modules/ShellService.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Deprecated", + "resource://gre/modules/Deprecated.jsm"); + XPCOMUtils.defineLazyGetter(this, "BROWSER_NEW_TAB_URL", function () { const PREF = "browser.newtab.url"; @@ -57,6 +60,14 @@ function getBrowserURL() return "chrome://browser/content/browser.xul"; } +function getBoolPref(pref, defaultValue) { + Deprecated.warning("getBoolPref is deprecated and will be removed in a future release. " + + "You should use Services.pref.getBoolPref (Services.jsm).", + "https://github.com/MoonchildProductions/UXP/issues/989"); + return Services.prefs.getBoolPref(pref, defaultValue); +} + + function getTopWin(skipPopups) { // If this is called in a browser window, use that window regardless of // whether it's the frontmost window, since commands can be executed in @@ -75,16 +86,6 @@ function openTopWin(url) { openUILinkIn(url, "current"); } -function getBoolPref(prefname, def) -{ - try { - return Services.prefs.getBoolPref(prefname); - } - catch(er) { - return def; - } -} - /* openUILink handles clicks on UI elements that cause URLs to load. * * As the third argument, you may pass an object with the same properties as @@ -151,7 +152,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt ) // ignoreButton allows "middle-click paste" to use function without always opening in a new window. var middle = !ignoreButton && e.button == 1; - var middleUsesTabs = getBoolPref("browser.tabs.opentabfor.middleclick", true); + var middleUsesTabs = Services.prefs.getBoolPref("browser.tabs.opentabfor.middleclick", true); // Don't do anything special with right-mouse clicks. They're probably clicks on context menu items. @@ -162,7 +163,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt ) #endif return shift ? "tabshifted" : "tab"; - if (alt && getBoolPref("browser.altClickSave", false)) + if (alt && Services.prefs.getBoolPref("browser.altClickSave", false)) return "save"; if (shift || (middle && !middleUsesTabs)) @@ -334,7 +335,7 @@ function openLinkIn(url, where, params) { if (loadInBackground == null) { loadInBackground = aFromChrome ? false : - getBoolPref("browser.tabs.loadInBackground"); + Services.prefs.getBoolPref("browser.tabs.loadInBackground"); } let uriObj; @@ -515,7 +516,7 @@ function getShellService() function isBidiEnabled() { // first check the pref. - if (getBoolPref("bidi.browser.ui", false)) + if (Services.prefs.getBoolPref("bidi.browser.ui", false)) return true; // if the pref isn't set, check for an RTL locale and force the pref to true @@ -541,6 +542,135 @@ function isBidiEnabled() { return rv; } +#ifdef MOZ_UPDATER +/** + * Opens the update manager and checks for updates to the application. + */ +function checkForUpdates() +{ + var um = + Components.classes["@mozilla.org/updates/update-manager;1"]. + getService(Components.interfaces.nsIUpdateManager); + var prompter = + Components.classes["@mozilla.org/updates/update-prompt;1"]. + createInstance(Components.interfaces.nsIUpdatePrompt); + + // If there's an update ready to be applied, show the "Update Downloaded" + // UI instead and let the user know they have to restart the application for + // the changes to be applied. + if (um.activeUpdate && ["pending", "pending-elevate", "applied"].includes(um.activeUpdate.state)) + prompter.showUpdateDownloaded(um.activeUpdate); + else + prompter.checkForUpdates(); +} +#endif + +/** + * Set up the help menu software update items to show proper status, + * also disabling the items if update is disabled. + */ +function buildHelpMenu() +{ +#ifdef MOZ_UPDATER + var updates = + Components.classes["@mozilla.org/updates/update-service;1"]. + getService(Components.interfaces.nsIApplicationUpdateService); + var um = + Components.classes["@mozilla.org/updates/update-manager;1"]. + getService(Components.interfaces.nsIUpdateManager); + + // Disable the UI if the update enabled pref has been locked by the + // administrator or if we cannot update for some other reason. + var checkForUpdates = document.getElementById("checkForUpdates"); + var appMenuCheckForUpdates = document.getElementById("appmenu_checkForUpdates"); + var canCheckForUpdates = updates.canCheckForUpdates; + + checkForUpdates.setAttribute("disabled", !canCheckForUpdates); + + if (appMenuCheckForUpdates) { + appMenuCheckForUpdates.setAttribute("disabled", !canCheckForUpdates); + } + + if (!canCheckForUpdates) { + return; + } + + var strings = document.getElementById("bundle_browser"); + var activeUpdate = um.activeUpdate; + + // If there's an active update, substitute its name into the label + // we show for this item, otherwise display a generic label. + function getStringWithUpdateName(key) { + if (activeUpdate && activeUpdate.name) + return strings.getFormattedString(key, [activeUpdate.name]); + return strings.getString(key + "Fallback"); + } + + // By default, show "Check for Updates..." from updatesItem_default or + // updatesItem_defaultFallback + var key = "default"; + if (activeUpdate) { + switch (activeUpdate.state) { + case "downloading": + // If we're downloading an update at present, show the text: + // "Downloading Thunderbird x.x..." from updatesItem_downloading or + // updatesItem_downloadingFallback, otherwise we're paused, and show + // "Resume Downloading Thunderbird x.x..." from updatesItem_resume or + // updatesItem_resumeFallback + key = updates.isDownloading ? "downloading" : "resume"; + break; + case "pending": + // If we're waiting for the user to restart, show: "Apply Downloaded + // Updates Now..." from updatesItem_pending or + // updatesItem_pendingFallback + key = "pending"; + break; + } + } + + checkForUpdates.label = getStringWithUpdateName("updatesItem_" + key); + + if (appMenuCheckForUpdates) { + appMenuCheckForUpdates.label = getStringWithUpdateName("updatesItem_" + key); + } + + // updatesItem_default.accesskey, updatesItem_downloading.accesskey, + // updatesItem_resume.accesskey or updatesItem_pending.accesskey + checkForUpdates.accessKey = strings.getString("updatesItem_" + key + + ".accesskey"); + + if (appMenuCheckForUpdates) { + appMenuCheckForUpdates.accessKey = strings.getString("updatesItem_" + key + + ".accesskey"); + } + + if (um.activeUpdate && updates.isDownloading) { + checkForUpdates.setAttribute("loading", "true"); + if (appMenuCheckForUpdates) { + appMenuCheckForUpdates.setAttribute("loading", "true"); + } + } else { + checkForUpdates.removeAttribute("loading"); + if (appMenuCheckForUpdates) { + appMenuCheckForUpdates.removeAttribute("loading"); + } + } +#else +#ifndef XP_MACOSX + // Some extensions may rely on these being present so only hide the about + // separator when there are no elements besides the check for updates menuitem + // in between the about separator and the updates separator. + var updatesSeparator = document.getElementById("updatesSeparator"); + var aboutSeparator = document.getElementById("aboutSeparator"); + var checkForUpdates = document.getElementById("checkForUpdates"); + if (updatesSeparator.nextSibling === checkForUpdates && + checkForUpdates.nextSibling === aboutSeparator) + updatesSeparator.hidden = true; +#endif +#endif +} + + function openAboutDialog() { var enumerator = Services.wm.getEnumerator("Browser:About"); while (enumerator.hasMoreElements()) { @@ -562,7 +692,7 @@ function openAboutDialog() { function openPreferences(paneID, extraArgs) { - var instantApply = getBoolPref("browser.preferences.instantApply", false); + var instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply", false); var features = "chrome,titlebar,toolbar,centerscreen" + (instantApply ? ",dialog=no" : ",modal"); var win = Services.wm.getMostRecentWindow("Browser:Preferences"); @@ -591,6 +721,18 @@ function openAdvancedPreferences(tabID) } /** + * Opens the release notes page for this version of the application. + */ +function openReleaseNotes() +{ + var relnotesURL = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"] + .getService(Components.interfaces.nsIURLFormatter) + .formatURLPref("app.releaseNotesURL"); + + openUILinkIn(relnotesURL, "tab"); +} + +/** * Opens the troubleshooting information (about:support) page for this version * of the application. */ @@ -743,7 +885,7 @@ function openHelpLink(aHelpTopic, aCalledFromModal) { function openPrefsHelp() { // non-instant apply prefwindows are usually modal, so we can't open in the topmost window, // since its probably behind the window. - var instantApply = getBoolPref("browser.preferences.instantApply"); + var instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply"); var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic; openHelpLink(helpTopic, !instantApply); diff --git a/application/palemoon/base/jar.mn b/application/palemoon/base/jar.mn index d8c3f4b21..735b6d0cf 100644 --- a/application/palemoon/base/jar.mn +++ b/application/palemoon/base/jar.mn @@ -2,135 +2,78 @@ # 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 %content/browser/ contentaccessible=yes +% content browser %content/browser/ contentaccessible=yes #ifdef XP_MACOSX -% overlay chrome://mozapps/content/downloads/downloads.xul chrome://browser/content/downloadManagerOverlay.xul -% overlay chrome://global/content/console.xul chrome://browser/content/jsConsoleOverlay.xul -% overlay chrome://mozapps/content/update/updates.xul chrome://browser/content/softwareUpdateOverlay.xul +% overlay chrome://mozapps/content/downloads/downloads.xul chrome://browser/content/downloadManagerOverlay.xul +% overlay chrome://global/content/console.xul chrome://browser/content/jsConsoleOverlay.xul +% overlay chrome://mozapps/content/update/updates.xul chrome://browser/content/softwareUpdateOverlay.xul #endif #ifdef XP_WIN -% overlay chrome://browser/content/browser.xul chrome://browser/content/win6BrowserOverlay.xul os=WINNT osversion>=6 +% overlay chrome://browser/content/browser.xul chrome://browser/content/win6BrowserOverlay.xul os=WINNT osversion>=6 #endif -% overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul -% overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul -% style chrome://global/content/customizeToolbar.xul chrome://browser/content/browser.css -% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/ -* content/browser/aboutDialog.xul (content/aboutDialog.xul) -* content/browser/aboutDialog.js (content/aboutDialog.js) - content/browser/aboutDialog.css (content/aboutDialog.css) - content/browser/aboutRobots.xhtml (content/aboutRobots.xhtml) - content/browser/abouthome/aboutHome.xhtml (content/abouthome/aboutHome.xhtml) - content/browser/abouthome/aboutHome.js (content/abouthome/aboutHome.js) -* content/browser/abouthome/aboutHome.css (content/abouthome/aboutHome.css) - content/browser/abouthome/noise.png (content/abouthome/noise.png) - content/browser/abouthome/snippet1.png (content/abouthome/snippet1.png) - content/browser/abouthome/snippet2.png (content/abouthome/snippet2.png) - content/browser/abouthome/downloads.png (content/abouthome/downloads.png) - content/browser/abouthome/bookmarks.png (content/abouthome/bookmarks.png) - content/browser/abouthome/history.png (content/abouthome/history.png) - content/browser/abouthome/addons.png (content/abouthome/addons.png) - content/browser/abouthome/sync.png (content/abouthome/sync.png) - content/browser/abouthome/settings.png (content/abouthome/settings.png) - content/browser/abouthome/restore.png (content/abouthome/restore.png) - content/browser/abouthome/restore-large.png (content/abouthome/restore-large.png) - content/browser/abouthome/snippet1@2x.png (content/abouthome/snippet1@2x.png) - content/browser/abouthome/snippet2@2x.png (content/abouthome/snippet2@2x.png) - content/browser/abouthome/downloads@2x.png (content/abouthome/downloads@2x.png) - content/browser/abouthome/bookmarks@2x.png (content/abouthome/bookmarks@2x.png) - content/browser/abouthome/history@2x.png (content/abouthome/history@2x.png) - content/browser/abouthome/addons@2x.png (content/abouthome/addons@2x.png) - content/browser/abouthome/sync@2x.png (content/abouthome/sync@2x.png) - content/browser/abouthome/settings@2x.png (content/abouthome/settings@2x.png) - content/browser/abouthome/restore@2x.png (content/abouthome/restore@2x.png) - content/browser/abouthome/restore-large@2x.png (content/abouthome/restore-large@2x.png) - content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png) - content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png) - content/browser/autorecovery.js (content/autorecovery.js) - content/browser/autorecovery.xul (content/autorecovery.xul) -* content/browser/browser.css (content/browser.css) - content/browser/browser-menudragging.xul (content/browser-menudragging.xul) - content/browser/browser-menudragging.js (content/browser-menudragging.js) - content/browser/browser-title.css (content/browser-title.css) -* content/browser/browser.js (content/browser.js) -* content/browser/browser.xul (content/browser.xul) +% overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul +% overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul +% style chrome://global/content/customizeToolbar.xul chrome://browser/content/browser.css +% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/ +* content/browser/aboutDialog.xul (content/aboutDialog.xul) +* content/browser/aboutDialog.js (content/aboutDialog.js) + content/browser/aboutDialog.css (content/aboutDialog.css) + content/browser/autorecovery.js (content/autorecovery.js) + content/browser/autorecovery.xul (content/autorecovery.xul) +* content/browser/browser.css (content/browser.css) + content/browser/browser-menudragging.xul (content/browser-menudragging.xul) + content/browser/browser-menudragging.js (content/browser-menudragging.js) + content/browser/browser-title.css (content/browser-title.css) +* content/browser/browser.js (content/browser.js) +* content/browser/browser.xul (content/browser.xul) #ifdef MOZ_DEVTOOLS - content/browser/browser-devtools-theme.js (content/browser-devtools-theme.js) + content/browser/browser-devtools-theme.js (content/browser-devtools-theme.js) #endif -* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) - content/browser/content.js (content/content.js) - content/browser/padlock.xul (content/padlock.xul) - content/browser/padlock.js (content/padlock.js) - content/browser/padlock.css (content/padlock.css) - content/browser/padlock_mod_ev.png (content/padlock_mod_ev.png) - content/browser/padlock_mod_https.png (content/padlock_mod_https.png) - content/browser/padlock_mod_low.png (content/padlock_mod_low.png) - content/browser/padlock_mod_broken.png (content/padlock_mod_broken.png) - content/browser/padlock_classic_ev.png (content/padlock_classic_ev.png) - 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/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) - content/browser/pageinfo/pageInfo.js (content/pageinfo/pageInfo.js) - content/browser/pageinfo/pageInfo.css (content/pageinfo/pageInfo.css) - content/browser/pageinfo/pageInfo.xml (content/pageinfo/pageInfo.xml) - content/browser/pageinfo/feeds.js (content/pageinfo/feeds.js) - content/browser/pageinfo/feeds.xml (content/pageinfo/feeds.xml) - content/browser/pageinfo/permissions.js (content/pageinfo/permissions.js) - content/browser/pageinfo/security.js (content/pageinfo/security.js) -#ifdef MOZ_SERVICES_SYNC - content/browser/sync/aboutSyncTabs.xul (content/sync/aboutSyncTabs.xul) - content/browser/sync/aboutSyncTabs.js (content/sync/aboutSyncTabs.js) - content/browser/sync/aboutSyncTabs.css (content/sync/aboutSyncTabs.css) - content/browser/sync/aboutSyncTabs-bindings.xml (content/sync/aboutSyncTabs-bindings.xml) - content/browser/sync/setup.xul (content/sync/setup.xul) - content/browser/sync/addDevice.js (content/sync/addDevice.js) - content/browser/sync/addDevice.xul (content/sync/addDevice.xul) - content/browser/sync/setup.js (content/sync/setup.js) - content/browser/sync/genericChange.xul (content/sync/genericChange.xul) - content/browser/sync/genericChange.js (content/sync/genericChange.js) - content/browser/sync/key.xhtml (content/sync/key.xhtml) - content/browser/sync/notification.xml (content/sync/notification.xml) - content/browser/sync/quota.xul (content/sync/quota.xul) - content/browser/sync/quota.js (content/sync/quota.js) - content/browser/sync/utils.js (content/sync/utils.js) - content/browser/sync/progress.js (content/sync/progress.js) - content/browser/sync/progress.xhtml (content/sync/progress.xhtml) -#endif - content/browser/openLocation.js (content/openLocation.js) - content/browser/openLocation.xul (content/openLocation.xul) - content/browser/safeMode.css (content/safeMode.css) - content/browser/safeMode.js (content/safeMode.js) -* content/browser/safeMode.xul (content/safeMode.xul) -* content/browser/sanitize.js (content/sanitize.js) -* content/browser/sanitize.xul (content/sanitize.xul) -* content/browser/sanitizeDialog.js (content/sanitizeDialog.js) - content/browser/sanitizeDialog.css (content/sanitizeDialog.css) - content/browser/autocomplete.css (content/autocomplete.css) -* content/browser/autocomplete.xml (content/autocomplete.xml) - content/browser/tabbrowser.css (content/tabbrowser.css) -* content/browser/tabbrowser.xml (content/tabbrowser.xml) -* content/browser/urlbarBindings.xml (content/urlbarBindings.xml) -* content/browser/utilityOverlay.js (content/utilityOverlay.js) - content/browser/web-panels.js (content/web-panels.js) -* content/browser/web-panels.xul (content/web-panels.xul) -* content/browser/baseMenuOverlay.xul (content/baseMenuOverlay.xul) -* content/browser/nsContextMenu.js (content/nsContextMenu.js) +* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) + content/browser/content.js (content/content.js) + content/browser/padlock.xul (content/padlock.xul) + content/browser/padlock.js (content/padlock.js) + content/browser/padlock.css (content/padlock.css) + content/browser/padlock_mod_ev.png (content/padlock_mod_ev.png) + content/browser/padlock_mod_https.png (content/padlock_mod_https.png) + content/browser/padlock_mod_low.png (content/padlock_mod_low.png) + content/browser/padlock_mod_broken.png (content/padlock_mod_broken.png) + content/browser/padlock_classic_ev.png (content/padlock_classic_ev.png) + 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/palemoon.xhtml (content/palemoon.xhtml) + content/browser/openLocation.js (content/openLocation.js) + content/browser/openLocation.xul (content/openLocation.xul) + content/browser/safeMode.css (content/safeMode.css) + content/browser/safeMode.js (content/safeMode.js) +* content/browser/safeMode.xul (content/safeMode.xul) +* content/browser/sanitize.js (content/sanitize.js) +* content/browser/sanitize.xul (content/sanitize.xul) +* content/browser/sanitizeDialog.js (content/sanitizeDialog.js) + content/browser/sanitizeDialog.css (content/sanitizeDialog.css) + content/browser/autocomplete.css (content/autocomplete.css) +* content/browser/autocomplete.xml (content/autocomplete.xml) + content/browser/tabbrowser.css (content/tabbrowser.css) +* content/browser/tabbrowser.xml (content/tabbrowser.xml) +* content/browser/urlbarBindings.xml (content/urlbarBindings.xml) +* content/browser/utilityOverlay.js (content/utilityOverlay.js) + content/browser/web-panels.js (content/web-panels.js) +* content/browser/web-panels.xul (content/web-panels.xul) +* content/browser/baseMenuOverlay.xul (content/baseMenuOverlay.xul) +* content/browser/nsContextMenu.js (content/nsContextMenu.js) # XXX: We should exclude this one as well (bug 71895) -* content/browser/hiddenWindow.xul (content/hiddenWindow.xul) +* content/browser/hiddenWindow.xul (content/hiddenWindow.xul) #ifdef XP_MACOSX -* content/browser/macBrowserOverlay.xul (content/macBrowserOverlay.xul) -* content/browser/downloadManagerOverlay.xul (content/downloadManagerOverlay.xul) -* content/browser/jsConsoleOverlay.xul (content/jsConsoleOverlay.xul) -* content/browser/softwareUpdateOverlay.xul (content/softwareUpdateOverlay.xul) +* content/browser/macBrowserOverlay.xul (content/macBrowserOverlay.xul) +* content/browser/downloadManagerOverlay.xul (content/downloadManagerOverlay.xul) +* content/browser/jsConsoleOverlay.xul (content/jsConsoleOverlay.xul) +* content/browser/softwareUpdateOverlay.xul (content/softwareUpdateOverlay.xul) #endif -* content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul) +* content/browser/viewSourceOverlay.xul (content/viewSourceOverlay.xul) #ifdef XP_WIN - content/browser/win6BrowserOverlay.xul (content/win6BrowserOverlay.xul) + content/browser/win6BrowserOverlay.xul (content/win6BrowserOverlay.xul) #endif # the following files are browser-specific overrides -* content/browser/license.html (/toolkit/content/license.html) +* content/browser/license.html (/toolkit/content/license.html) % override chrome://global/content/license.html chrome://browser/content/license.html diff --git a/application/palemoon/branding/official/VisualElements_150.png b/application/palemoon/branding/official/VisualElements_150.png Binary files differindex aa784449d..0100b7dde 100644 --- a/application/palemoon/branding/official/VisualElements_150.png +++ b/application/palemoon/branding/official/VisualElements_150.png diff --git a/application/palemoon/branding/official/VisualElements_70.png b/application/palemoon/branding/official/VisualElements_70.png Binary files differindex e785bfbc1..147a6f804 100644 --- a/application/palemoon/branding/official/VisualElements_70.png +++ b/application/palemoon/branding/official/VisualElements_70.png diff --git a/application/palemoon/branding/official/branding.nsi b/application/palemoon/branding/official/branding.nsi index 2b6dbe7bd..3bceda900 100644 --- a/application/palemoon/branding/official/branding.nsi +++ b/application/palemoon/branding/official/branding.nsi @@ -11,39 +11,6 @@ !define BrandFullNameInternal "Pale Moon" !define CompanyName "Moonchild Productions" !define URLInfoAbout "http://www.palemoon.org/" -!define URLUpdateInfo "http://www.palemoon.org/releasenotes-ng.shtml" - -; The OFFICIAL define is a workaround to support different urls for Release and -; Beta since they share the same branding when building with other branches that -; set the update channel to beta. -!define OFFICIAL -!define URLStubDownload "" -!define URLManualDownload "http://www.palemoon.org/download-ng.shtml" -!define Channel "release" - -# The installer's certificate name and issuer expected by the stub installer -# !define CertNameDownload "Mozilla Corporation" -# !define CertIssuerDownload "Thawte Code Signing CA - G2" - -# Dialog units are used so the UI displays correctly with the system's DPI -# settings. -# The dialog units for the bitmap's dimensions should match exactly with the -# bitmap's width and height in pixels. -!define APPNAME_BMP_WIDTH_DU "134u" -!define APPNAME_BMP_HEIGHT_DU "36u" -!define INTRO_BLURB_WIDTH_DU "258u" -!define INTRO_BLURB_EDGE_DU "170u" -!define INTRO_BLURB_LTR_TOP_DU "20u" -!define INTRO_BLURB_RTL_TOP_DU "12u" - -# UI Colors that can be customized for each channel -!define FOOTER_CONTROL_TEXT_COLOR_NORMAL 0x000033 -!define FOOTER_CONTROL_TEXT_COLOR_FADED 0x666699 -!define FOOTER_BKGRD_COLOR 0xFFFFFF -!define INTRO_BLURB_TEXT_COLOR 0x666699 -!define OPTIONS_TEXT_COLOR_NORMAL 0x000000 -!define OPTIONS_TEXT_COLOR_FADED 0x666699 -!define OPTIONS_BKGRD_COLOR 0xF0F0F0 -!define INSTALL_BLURB_TEXT_COLOR 0x666699 -!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0x666699 -!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0x9999C0 +!define URLUpdateInfo "http://www.palemoon.org/releasenotes.shtml" +!define HelpLink "http://www.palemoon.org/troubleshooting.shtml" +!define URLSystemRequirements "http://www.palemoon.org/download.shtml" diff --git a/application/palemoon/branding/official/configure.sh b/application/palemoon/branding/official/configure.sh index a9818b4a7..8943f5819 100644 --- a/application/palemoon/branding/official/configure.sh +++ b/application/palemoon/branding/official/configure.sh @@ -2,5 +2,5 @@ # 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/. -MOZ_APP_DISPLAYNAME=PaleMoon +MOZ_APP_DISPLAYNAME="Pale Moon" # MOZ_UA_BUILDID=20100101 diff --git a/application/palemoon/branding/official/content/about-background.jpg b/application/palemoon/branding/official/content/about-background.jpg Binary files differnew file mode 100644 index 000000000..21e97986a --- /dev/null +++ b/application/palemoon/branding/official/content/about-background.jpg diff --git a/application/palemoon/branding/official/content/about-background.png b/application/palemoon/branding/official/content/about-background.png Binary files differdeleted file mode 100644 index 99dd74e58..000000000 --- a/application/palemoon/branding/official/content/about-background.png +++ /dev/null diff --git a/application/palemoon/branding/official/content/about-logo.png b/application/palemoon/branding/official/content/about-logo.png Binary files differindex 0a475c028..93536f033 100644 --- a/application/palemoon/branding/official/content/about-logo.png +++ b/application/palemoon/branding/official/content/about-logo.png diff --git a/application/palemoon/branding/official/content/about-logo@2x.png b/application/palemoon/branding/official/content/about-logo@2x.png Binary files differindex c9d9d43de..d87a62309 100644 --- a/application/palemoon/branding/official/content/about-logo@2x.png +++ b/application/palemoon/branding/official/content/about-logo@2x.png diff --git a/application/palemoon/branding/official/content/about-wordmark.png b/application/palemoon/branding/official/content/about-wordmark.png Binary files differindex 5d51e1d4d..1b849be2e 100644 --- a/application/palemoon/branding/official/content/about-wordmark.png +++ b/application/palemoon/branding/official/content/about-wordmark.png diff --git a/application/palemoon/branding/official/content/about-wordmark.svg b/application/palemoon/branding/official/content/about-wordmark.svg index e0dcc255f..708adaaec 100644 --- a/application/palemoon/branding/official/content/about-wordmark.svg +++ b/application/palemoon/branding/official/content/about-wordmark.svg @@ -1,44 +1,48 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="245.75363" - height="34.463379" - id="svg2" version="1.1" - inkscape:version="0.48.5 r10040" - sodipodi:docname="drawing.svg"> + id="svg2" + height="44.113129" + width="314.56464"> <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.979899" - inkscape:cx="122.96783" - inkscape:cy="-35.932748" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - inkscape:window-width="1169" - inkscape:window-height="763" - inkscape:window-x="66" - inkscape:window-y="66" - inkscape:window-maximized="0" - fit-margin-top="0" - fit-margin-left="0" - fit-margin-right="0" - fit-margin-bottom="0" /> + id="defs4"> + <filter + id="filter4610" + style="color-interpolation-filters:sRGB"> + <feFlood + id="feFlood4600" + result="flood" + flood-color="rgb(252,252,247)" + flood-opacity="1" /> + <feComposite + id="feComposite4602" + result="composite1" + operator="in" + in2="SourceGraphic" + in="flood" /> + <feGaussianBlur + id="feGaussianBlur4604" + result="blur" + stdDeviation="1" + in="composite1" /> + <feOffset + id="feOffset4606" + result="offset" + dy="0" + dx="2.77556e-017" /> + <feComposite + id="feComposite4608" + result="composite2" + operator="over" + in2="offset" + in="SourceGraphic" /> + </filter> + </defs> <metadata id="metadata7"> <rdf:RDF> @@ -52,81 +56,78 @@ </rdf:RDF> </metadata> <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(-51.826283,-53.778809)"> + transform="translate(-29.067649,-53.687969)" + id="layer1"> <text - xml:space="preserve" - style="font-size:48px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Museo 500;-inkscape-font-specification:Museo 500" - x="32.324883" - y="30.087807" id="text2985" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan2987" - x="32.324883" - y="30.087807" /></text> + y="32.093662" + x="34.479874" + style="font-style:normal;font-weight:normal;font-size:12.80000019px;line-height:0%;font-family:'Museo 500';-inkscape-font-specification:'Museo 500';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672" + xml:space="preserve"><tspan + style="font-size:51.20000076px;line-height:1.25;stroke-width:1.06666672" + y="32.093662" + x="34.479874" + id="tspan2987"> </tspan></text> <flowRoot - xml:space="preserve" + style="font-style:normal;font-weight:normal;font-size:12.80000019px;line-height:0.01%;font-family:'Museo 500';-inkscape-font-specification:'Museo 500';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672" id="flowRoot2989" - style="font-size:48px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Museo 500;-inkscape-font-specification:Museo 500"><flowRegion + xml:space="preserve"><flowRegion + style="stroke-width:1.06666672" id="flowRegion2991"><rect - id="rect2993" - width="654.57886" - height="371.73615" - x="44.446712" - y="104.8391" /></flowRegion><flowPara - id="flowPara2995" /></flowRoot> <g - id="g3795"> - <g - id="text2997" - style="font-size:48px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#262678;fill-opacity:1;stroke:none;font-family:Museo 500;-inkscape-font-specification:Museo 500"> - <path - id="path3779" - d="m 54.9464,87.666504 0,-29.759766 -3.120117,0 0,-4.127929 14.928222,0 c 3.135722,3.3e-5 5.687722,0.96805 7.656006,2.904052 1.968235,1.936065 2.952365,4.503933 2.952393,7.703614 -2.8e-5,3.199727 -0.99197,5.791765 -2.97583,7.776123 -1.98391,1.984388 -4.528097,2.976575 -7.632569,2.976562 l -7.007812,0 0,12.527344 z m 4.800293,-16.655274 6.240234,0 c 1.983381,1.7e-5 3.55125,-0.592023 4.703613,-1.776123 1.152322,-1.184062 1.728494,-2.800027 1.728516,-4.8479 -2.2e-5,-2.016576 -0.568137,-3.600803 -1.704346,-4.752686 -1.13625,-1.151826 -2.696063,-1.727753 -4.679443,-1.727783 l -6.288574,0 z" - inkscape:connector-curvature="0" /> - <path - id="path3781" - d="m 80.184193,80.850586 c -2e-6,-1.248039 0.256101,-2.360098 0.76831,-3.336182 0.512204,-0.976063 1.224362,-1.744128 2.136475,-2.304199 0.912104,-0.560045 1.856194,-1.031969 2.832275,-1.415771 0.976066,-0.383775 2.080069,-0.663804 3.312012,-0.840088 1.231921,-0.176255 2.24779,-0.288315 3.047607,-0.336182 0.79979,-0.04784 1.647934,-0.07176 2.544434,-0.07178 l 1.056152,0 0,-0.240235 c -1.7e-5,-2.11131 -0.416032,-3.607158 -1.248047,-4.487548 -0.832046,-0.880351 -2.208021,-1.320536 -4.127929,-1.320557 -0.896496,2.1e-5 -1.784679,0.136007 -2.664551,0.407959 -0.879891,0.271993 -1.319832,0.76003 -1.319824,1.464111 l 0,1.393067 -4.368164,0 0,-2.400879 c -4e-6,-0.927713 0.312007,-1.719705 0.936035,-2.375977 0.624018,-0.656227 1.431878,-1.12815 2.423584,-1.415771 0.991691,-0.287574 1.887686,-0.487525 2.687988,-0.599854 0.800282,-0.11228 1.584217,-0.168432 2.351807,-0.168457 3.680648,2.5e-5 6.264874,0.840112 7.752685,2.520264 1.487772,1.680196 2.231668,4.008075 2.231688,6.983642 l 0,10.319825 c -2e-5,0.704105 0.35203,1.056156 1.05615,1.056152 l 1.96729,0 0,3.984375 -4.3667,0 c -2.01662,0 -3.02492,-0.928222 -3.024902,-2.784668 l 0.09668,-1.439941 -0.09668,0 c -0.06349,0.127933 -0.143329,0.303959 -0.239502,0.528076 -0.09621,0.224124 -0.360369,0.608157 -0.792481,1.152099 -0.432145,0.543948 -0.920182,1.023928 -1.464111,1.439942 -0.54396,0.416016 -1.279799,0.800049 -2.20752,1.152099 -0.927746,0.352051 -1.935558,0.528076 -3.023437,0.528076 -2.240242,0 -4.17652,-0.656005 -5.808838,-1.968017 -1.632327,-1.312009 -2.448488,-3.119869 -2.448486,-5.423584 z m 5.66455,-2.831543 c -0.639655,0.671884 -0.959479,1.535653 -0.959472,2.591309 -7e-6,1.05567 0.399895,1.967534 1.199707,2.735595 0.799796,0.76807 1.919912,1.152103 3.360351,1.1521 1.855456,3e-6 3.399156,-0.807857 4.631104,-2.423584 1.231917,-1.615716 1.847883,-3.383536 1.8479,-5.303467 l 0,-0.815918 -1.199707,0 c -1.183609,1.2e-5 -2.21559,0.03981 -3.095947,0.119385 -0.880383,0.0796 -1.904552,0.255626 -3.07251,0.528076 -1.167978,0.272472 -2.071785,0.744639 -2.711426,1.416504 z" - inkscape:connector-curvature="0" /> - <path - id="path3783" - d="m 108.54943,84.594727 0,-25.776856 c -1e-5,-0.703095 -0.35206,-1.054658 -1.05616,-1.054687 l -1.96875,0 0,-3.984375 4.6084,0 c 1.08789,3.3e-5 1.87182,0.240023 2.35181,0.71997 0.47997,0.480013 0.71996,1.263948 0.71997,2.351807 l 0,25.775391 c -1e-5,0.704105 0.35204,1.056156 1.05615,1.056152 l 1.96875,0 0,3.984375 -4.6084,0 c -1.08789,0 -1.87183,-0.23999 -2.3518,-0.719971 -0.47999,-0.479979 -0.71998,-1.263914 -0.71997,-2.351806 z" - inkscape:connector-curvature="0" /> - <path - id="path3785" - d="m 119.13732,75.522949 c 0,-3.808578 1.15185,-6.88084 3.45556,-9.216797 2.30371,-2.335913 5.21581,-3.503881 8.73633,-3.503906 3.29588,2.5e-5 5.86375,1.072045 7.70362,3.216065 1.83982,2.144062 2.75974,4.86403 2.75976,8.159912 l -0.14355,1.92041 -17.71289,0 c 0.1289,2.496103 0.99315,4.472175 2.59277,5.928222 1.5996,1.456059 3.51952,2.184086 5.75976,2.184082 1.24804,4e-6 2.4641,-0.239986 3.6482,-0.71997 1.18406,-0.479976 2.04807,-0.944087 2.59204,-1.392334 l 0.86426,-0.720703 2.01562,3.312011 c -0.25588,0.256839 -0.63991,0.585208 -1.1521,0.985108 -0.51223,0.399904 -1.58425,0.927735 -3.21606,1.583496 -1.63186,0.655761 -3.29592,0.983642 -4.99219,0.983642 -3.80763,0 -6.91138,-1.208007 -9.31128,-3.624023 -2.3999,-2.41601 -3.59985,-5.447745 -3.59985,-9.095215 z m 4.99219,-2.833008 12.86279,0 c -0.0635,-1.951155 -0.63918,-3.470928 -1.72705,-4.559326 -1.08791,-1.088358 -2.41603,-1.632547 -3.98438,-1.632568 -1.82423,2.1e-5 -3.38429,0.536153 -4.68017,1.608398 -1.29591,1.072284 -2.11964,2.600115 -2.47119,4.583496 z" - inkscape:connector-curvature="0" /> - <path - id="path3787" - d="m 157.83702,87.666504 0,-4.12793 1.63184,0 c 0.64062,4e-6 0.99267,-0.352046 1.05615,-1.056152 l 2.3042,-28.703613 4.94385,0 7.96875,17.95166 1.68018,4.271484 0.0952,0 c 0.57615,-1.631823 1.13621,-3.055649 1.68018,-4.271484 l 7.96875,-17.95166 4.94384,0 2.3042,28.703613 c 0.0634,0.704106 0.415,1.056156 1.05469,1.056152 l 1.58496,0 0,4.12793 -4.27295,0 c -1.0557,0 -1.81546,-0.23999 -2.27929,-0.719971 -0.4639,-0.479979 -0.72806,-1.263914 -0.79248,-2.351806 l -1.39161,-17.904786 -0.0952,-4.990722 -0.0967,0 c -0.63968,2.111352 -1.23148,3.774924 -1.77539,4.990722 l -6.86426,14.879883 -4.03271,0 -6.86426,-14.879883 c -0.25587,-0.511697 -0.53566,-1.191628 -0.83936,-2.039795 -0.30372,-0.84812 -0.53565,-1.559789 -0.6958,-2.135009 l -0.28857,-0.864258 -0.0952,0 c 0.0312,2.015649 -9.8e-4,3.695335 -0.0967,5.039062 l -1.34326,17.904786 c -0.0645,1.087892 -0.32862,1.871827 -0.79248,2.351806 -0.46387,0.479981 -1.23975,0.719971 -2.32764,0.719971 z" - inkscape:connector-curvature="0" /> - <path - id="path3789" - d="m 203.55333,84.594727 c -2.52734,-2.432612 -3.79101,-5.472892 -3.79101,-9.12085 0,-3.647933 1.26391,-6.671856 3.79175,-9.071777 2.52782,-2.399879 5.61595,-3.599829 9.2644,-3.599854 3.67967,2.5e-5 6.78343,1.199975 9.31128,3.599854 2.5278,2.399921 3.79172,5.423844 3.79175,9.071777 -3e-5,3.647958 -1.272,6.687994 -3.81592,9.120117 -2.54397,2.43213 -5.63991,3.648193 -9.28784,3.648193 -3.64796,0 -6.73609,-1.215819 -9.26441,-3.64746 z m 3.38379,-15.312012 c -1.61524,1.631853 -2.42286,3.695815 -2.42285,6.191894 -1e-5,2.496104 0.80785,4.57618 2.42358,6.240235 1.61572,1.664067 3.57592,2.496097 5.88062,2.496093 2.33592,4e-6 4.31175,-0.82397 5.92749,-2.471923 1.6157,-1.647942 2.42356,-3.736075 2.42358,-6.264405 -2e-5,-2.496079 -0.80788,-4.560041 -2.42358,-6.191894 -1.61574,-1.631816 -3.59157,-2.447733 -5.92749,-2.447754 -2.3047,2.1e-5 -4.26515,0.815938 -5.88135,2.447754 z" - inkscape:connector-curvature="0" /> - <path - id="path3791" - d="m 233.17833,84.594727 c -2.52734,-2.432612 -3.79101,-5.472892 -3.79101,-9.12085 0,-3.647933 1.26391,-6.671856 3.79175,-9.071777 2.52782,-2.399879 5.61595,-3.599829 9.2644,-3.599854 3.67967,2.5e-5 6.78343,1.199975 9.31128,3.599854 2.5278,2.399921 3.79172,5.423844 3.79175,9.071777 -3e-5,3.647958 -1.272,6.687994 -3.81592,9.120117 -2.54397,2.43213 -5.63991,3.648193 -9.28784,3.648193 -3.64796,0 -6.73609,-1.215819 -9.26441,-3.64746 z m 3.38379,-15.312012 c -1.61524,1.631853 -2.42286,3.695815 -2.42285,6.191894 -1e-5,2.496104 0.80785,4.57618 2.42358,6.240235 1.61572,1.664067 3.57592,2.496097 5.88062,2.496093 2.33592,4e-6 4.31175,-0.82397 5.92749,-2.471923 1.6157,-1.647942 2.42356,-3.736075 2.42358,-6.264405 -2e-5,-2.496079 -0.80788,-4.560041 -2.42358,-6.191894 -1.61574,-1.631816 -3.59157,-2.447733 -5.92749,-2.447754 -2.3047,2.1e-5 -4.26515,0.815938 -5.88135,2.447754 z" - inkscape:connector-curvature="0" /> - <path - id="path3793" - d="m 261.36339,87.666504 0,-19.248047 c 0,-0.704082 -0.35205,-1.056132 -1.05615,-1.056152 l -1.96729,0 0,-3.984375 4.46338,0 c 2.04785,2.4e-5 3.07177,0.896019 3.07178,2.687988 l 0,0.912598 -0.0952,1.391601 0.0952,0 c 0.64062,-1.375956 1.72899,-2.647927 3.26514,-3.815918 1.53612,-1.167944 3.48777,-1.751928 5.85498,-1.751953 2.84861,2.5e-5 4.95286,0.768091 6.31274,2.304199 1.35984,1.536154 2.03977,3.872089 2.0398,7.007813 l 0,10.511719 c -3e-5,0.704105 0.35202,1.056156 1.05615,1.056152 l 1.96728,0 0,3.984375 -4.60693,0 c -1.08791,0 -1.87185,-0.23999 -2.35181,-0.719971 -0.48,-0.479979 -0.71999,-1.263914 -0.71997,-2.351806 l 0,-11.424317 c -2e-5,-1.952132 -0.31203,-3.456037 -0.93603,-4.511719 -0.62405,-1.055644 -1.83205,-1.583475 -3.62403,-1.583496 -1.85646,2.1e-5 -3.48072,0.552022 -4.8728,1.656006 -1.3921,1.104022 -2.32789,2.535905 -2.80737,4.295654 -0.2881,0.832046 -0.43214,1.919935 -0.43213,3.263672 l 0,11.375977 z" - inkscape:connector-curvature="0" /> - </g> - <g - id="text3769" - style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#262678;fill-opacity:1;stroke:none;font-family:Museo 500;-inkscape-font-specification:Museo 500"> - <path - id="path3774" - d="m 285.52277,60.897457 0,-6.199951 -1.41999,0 c -0.14669,6e-6 -0.22003,0.07335 -0.22003,0.220032 l 0,0.449829 -0.88989,0 0,-0.929871 c 0,-0.226637 0.0433,-0.383294 0.12985,-0.469971 0.0866,-0.08666 0.24328,-0.129997 0.47012,-0.130004 l 4.85993,0 c 0.22664,7e-6 0.38329,0.04334 0.46997,0.130004 0.0867,0.08668 0.13,0.243334 0.13,0.469971 l 0,0.929871 -0.88989,0 0,-0.449829 c 0,-0.146682 -0.0734,-0.220026 -0.22003,-0.220032 l -1.41998,0 0,6.199951 z" - inkscape:connector-curvature="0" /> - <path - id="path3776" - d="m 289.40979,60.897457 0,-0.859985 0.33997,0 c 0.13346,10e-7 0.2068,-0.07334 0.22003,-0.220032 l 0.48004,-5.979919 1.02997,0 1.66015,3.739929 0.35004,0.889892 0.0198,0 c 0.12003,-0.339963 0.23671,-0.636593 0.35003,-0.889892 l 1.66016,-3.739929 1.02997,0 0.48004,5.979919 c 0.0132,0.146689 0.0865,0.220033 0.21973,0.220032 l 0.3302,0 0,0.859985 -0.8902,0 c -0.21994,0 -0.37822,-0.05 -0.47486,-0.149994 -0.0966,-0.09999 -0.15167,-0.263315 -0.1651,-0.489959 l -0.28991,-3.730164 -0.0198,-1.039734 -0.0201,0 c -0.13327,0.439865 -0.25656,0.786443 -0.36987,1.039734 l -1.43006,3.099976 -0.84015,0 -1.43005,-3.099976 c -0.0533,-0.106604 -0.11159,-0.248256 -0.17487,-0.424957 -0.0633,-0.176692 -0.11159,-0.324957 -0.14495,-0.444794 l -0.0601,-0.180054 -0.0198,0 c 0.007,0.419927 -2.1e-4,0.769862 -0.0201,1.049805 l -0.27985,3.730164 c -0.0134,0.226644 -0.0685,0.389964 -0.1651,0.489959 -0.0966,0.1 -0.25828,0.149994 -0.48492,0.149994 z" - inkscape:connector-curvature="0" /> - </g> + style="stroke-width:1.13777781" + y="111.82838" + x="47.409828" + height="396.51855" + width="698.21747" + id="rect2993" /></flowRegion><flowPara + style="font-size:51.20000076px;line-height:1.25;stroke-width:1.06666672" + id="flowPara2995"> </flowPara></flowRoot> <g + id="text2997" + style="font-style:normal;font-weight:normal;font-size:48px;line-height:125%;font-family:'Museo 500';-inkscape-font-specification:'Museo 500';letter-spacing:0px;word-spacing:0px;fill:#0b3575;fill-opacity:1;stroke:none;filter:url(#filter4610)"> + <path + id="path3779" + d="M 58.609493,93.510938 V 61.767187 h -3.328124 v -4.403124 h 15.923436 c 3.34477,3.5e-5 6.066904,1.032587 8.166407,3.097655 2.09945,2.065136 3.149189,4.804196 3.149219,8.217189 -3e-5,3.413042 -1.058101,6.177882 -3.174219,8.294531 -2.11617,2.11668 -4.82997,3.175013 -8.141407,3.174999 h -7.474999 v 13.362501 z m 5.120313,-17.765626 h 6.656249 c 2.115607,1.8e-5 3.788,-0.631491 5.017188,-1.894531 1.229143,-1.263 1.843727,-2.986696 1.84375,-5.171094 -2.3e-5,-2.151014 -0.606013,-3.840856 -1.817969,-5.069531 -1.212,-1.228615 -2.875801,-1.842937 -4.991406,-1.842969 h -6.707812 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> + <path + id="path3781" + d="m 85.529806,86.240625 c -2e-6,-1.331242 0.273174,-2.517438 0.819531,-3.558594 0.54635,-1.041134 1.305986,-1.860403 2.278906,-2.457812 0.972911,-0.597382 1.97994,-1.100767 3.021094,-1.510156 1.041137,-0.40936 2.21874,-0.708058 3.532812,-0.896094 1.314049,-0.188005 2.397643,-0.307536 3.250781,-0.358594 0.853109,-0.05103 1.7578,-0.07654 2.71406,-0.07656 h 1.12657 v -0.256251 c -2e-5,-2.252064 -0.44377,-3.847635 -1.33125,-4.786718 -0.88752,-0.939041 -2.355227,-1.408572 -4.403129,-1.408594 -0.956263,2.2e-5 -1.903658,0.145074 -2.842188,0.435156 -0.93855,0.290126 -1.407821,0.810699 -1.407812,1.561719 v 1.485938 h -4.659375 v -2.560938 c -4e-6,-0.98956 0.332807,-1.834352 0.998437,-2.534375 0.665619,-0.699976 1.527337,-1.20336 2.585156,-1.510156 1.057804,-0.306746 2.013532,-0.520027 2.867188,-0.639844 0.853634,-0.119766 1.689831,-0.179661 2.508594,-0.179688 3.926029,2.7e-5 6.682529,0.89612 8.269529,2.688282 1.58696,1.792209 2.38045,4.27528 2.38047,7.449218 v 11.007813 c -2e-5,0.751046 0.3755,1.126567 1.12656,1.126562 h 2.09844 v 4.25 h -4.65781 c -2.15106,0 -3.22658,-0.990103 -3.22656,-2.970312 l 0.10312,-1.535937 h -0.10312 c -0.0677,0.136462 -0.15289,0.324223 -0.25547,0.563281 -0.10263,0.239065 -0.3844,0.648701 -0.84532,1.228905 -0.46095,0.580212 -0.98152,1.09219 -1.561714,1.535939 -0.580224,0.44375 -1.365119,0.853385 -2.354688,1.228905 -0.989596,0.375521 -2.064596,0.563281 -3.225,0.563281 -2.389591,0 -4.454955,-0.699738 -6.196094,-2.099218 -1.741149,-1.399476 -2.61172,-3.32786 -2.611718,-5.785156 z m 6.042187,-3.020312 c -0.682299,0.716676 -1.023445,1.638029 -1.023437,2.764062 -8e-6,1.126048 0.426554,2.098703 1.279687,2.917968 0.853116,0.819275 2.047906,1.22891 3.584375,1.228907 1.979153,3e-6 3.625766,-0.861714 4.939842,-2.585156 1.31405,-1.723431 1.97108,-3.609105 1.9711,-5.657032 V 81.01875 h -1.27969 c -1.262519,1.3e-5 -2.363298,0.04246 -3.302346,0.127344 -0.939075,0.08491 -2.031522,0.272668 -3.277344,0.563281 -1.245843,0.290637 -2.209904,0.794282 -2.892187,1.510938 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> + <path + id="path3783" + d="M 115.78606,90.234375 V 62.739062 c -1e-5,-0.749968 -0.37553,-1.124968 -1.12657,-1.124999 h -2.1 v -4.25 h 4.91562 c 1.16042,3.5e-5 1.99661,0.256024 2.5086,0.767968 0.51197,0.512014 0.76796,1.348211 0.76797,2.508594 v 27.49375 c -10e-6,0.751046 0.37551,1.126567 1.12656,1.126563 h 2.1 v 4.25 h -4.91563 c -1.16041,0 -1.99662,-0.25599 -2.50858,-0.767969 -0.51199,-0.511978 -0.76798,-1.348175 -0.76797,-2.508594 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> + <path + id="path3785" + d="m 127.07981,80.557812 c 0,-4.062483 1.22864,-7.339562 3.68593,-9.83125 2.45729,-2.49164 5.56353,-3.737473 9.31875,-3.7375 3.51561,2.7e-5 6.25467,1.143515 8.2172,3.43047 1.96247,2.286999 2.94372,5.188298 2.94374,8.703906 l -0.15312,2.048437 h -18.89375 c 0.13749,2.66251 1.05936,4.77032 2.76562,6.323437 1.70624,1.55313 3.75416,2.329692 6.14375,2.329687 1.33124,5e-6 2.62837,-0.255985 3.89141,-0.767968 1.263,-0.511974 2.18461,-1.007026 2.76484,-1.485156 l 0.92188,-0.76875 2.14999,3.532812 c -0.27294,0.273962 -0.68257,0.624222 -1.2289,1.050782 -0.54638,0.426564 -1.68987,0.989584 -3.43047,1.689062 -1.74065,0.699479 -3.51565,1.049218 -5.325,1.049218 -4.06147,0 -7.37214,-1.28854 -9.93203,-3.865624 -2.5599,-2.577077 -3.83984,-5.810928 -3.83984,-9.701563 z m 5.325,-3.021875 h 13.72031 c -0.0677,-2.081232 -0.68179,-3.702323 -1.84219,-4.863281 -1.16043,-1.160915 -2.5771,-1.741383 -4.25,-1.741406 -1.94585,2.3e-5 -3.60991,0.571897 -4.99218,1.715625 -1.38231,1.143769 -2.26095,2.773456 -2.63594,4.889062 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> + <path + id="path3787" + d="m 168.35949,93.510938 v -4.403126 h 1.74063 c 0.68333,5e-6 1.05885,-0.375515 1.12656,-1.126562 l 2.45781,-30.617187 h 5.27344 l 8.5,19.148437 1.79219,4.55625 h 0.10155 c 0.61456,-1.740611 1.21196,-3.259359 1.79219,-4.55625 l 8.5,-19.148437 h 5.27343 l 2.45781,30.617187 c 0.0676,0.751047 0.44267,1.126567 1.12501,1.126562 h 1.69062 v 4.403126 h -4.55781 c -1.12608,0 -1.93649,-0.25599 -2.43125,-0.767969 -0.49482,-0.511978 -0.77659,-1.348175 -0.84531,-2.508594 L 200.87198,71.135937 200.77043,65.8125 h -0.10314 c -0.68233,2.252109 -1.31358,4.026586 -1.89375,5.323437 l -7.32188,15.871875 h -4.30156 l -7.32188,-15.871875 c -0.27292,-0.54581 -0.57137,-1.27107 -0.89531,-2.175781 -0.32397,-0.904662 -0.57136,-1.663775 -0.74219,-2.277343 l -0.30781,-0.921875 h -0.10154 c 0.0333,2.150025 -0.001,3.94169 -0.10315,5.374999 l -1.43281,19.098438 c -0.0688,1.160419 -0.35053,1.996616 -0.84531,2.508594 -0.4948,0.511979 -1.3224,0.767969 -2.48282,0.767969 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> + <path + id="path3789" + d="m 217.12355,90.234375 c -2.69583,-2.594786 -4.04374,-5.837751 -4.04374,-9.728906 0,-3.891129 1.34817,-7.116647 4.04453,-9.676562 2.69634,-2.559871 5.99035,-3.839818 9.88203,-3.839845 3.92498,2.7e-5 7.23566,1.279974 9.93203,3.839845 2.69632,2.559915 4.0445,5.785433 4.04453,9.676562 -3e-5,3.891155 -1.3568,7.13386 -4.07031,9.728125 -2.71357,2.594272 -6.01591,3.891405 -9.90703,3.891405 -3.89116,0 -7.18516,-1.296873 -9.88204,-3.890624 z m 3.60938,-16.332812 c -1.72292,1.740643 -2.58439,3.942202 -2.58438,6.604687 -1e-5,2.662511 0.86171,4.881258 2.58516,6.65625 1.72343,1.775005 3.81431,2.662504 6.27266,2.662499 2.49165,5e-6 4.5992,-0.878901 6.32265,-2.636717 1.72342,-1.757805 2.58513,-3.985147 2.58516,-6.682032 -3e-5,-2.662485 -0.86174,-4.864044 -2.58516,-6.604687 -1.72345,-1.740604 -3.831,-2.610916 -6.32265,-2.610938 -2.45835,2.2e-5 -4.5495,0.870334 -6.27344,2.610938 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> + <path + id="path3791" + d="m 248.72355,90.234375 c -2.69583,-2.594786 -4.04374,-5.837751 -4.04374,-9.728906 0,-3.891129 1.34817,-7.116647 4.04453,-9.676562 2.69634,-2.559871 5.99035,-3.839818 9.88203,-3.839845 3.92498,2.7e-5 7.23566,1.279974 9.93203,3.839845 2.69632,2.559915 4.0445,5.785433 4.04453,9.676562 -3e-5,3.891155 -1.3568,7.13386 -4.07031,9.728125 -2.71357,2.594272 -6.01591,3.891405 -9.90703,3.891405 -3.89116,0 -7.18516,-1.296873 -9.88204,-3.890624 z m 3.60938,-16.332812 c -1.72292,1.740643 -2.58439,3.942202 -2.58438,6.604687 -1e-5,2.662511 0.86171,4.881258 2.58516,6.65625 1.72343,1.775005 3.81431,2.662504 6.27266,2.662499 2.49165,5e-6 4.5992,-0.878901 6.32265,-2.636717 1.72342,-1.757805 2.58513,-3.985147 2.58516,-6.682032 -3e-5,-2.662485 -0.86174,-4.864044 -2.58516,-6.604687 -1.72345,-1.740604 -3.831,-2.610916 -6.32265,-2.610938 -2.45835,2.2e-5 -4.5495,0.870334 -6.27344,2.610938 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> + <path + id="path3793" + d="M 278.78762,93.510938 V 72.979687 c 0,-0.75102 -0.37552,-1.12654 -1.12656,-1.126562 h -2.09845 v -4.25 h 4.76094 c 2.18438,2.6e-5 3.27656,0.955754 3.27657,2.867188 v 0.973437 l -0.10155,1.484375 h 0.10155 c 0.68333,-1.467687 1.84425,-2.824456 3.48281,-4.070313 1.63853,-1.245807 3.72029,-1.868723 6.24532,-1.86875 3.03851,2.7e-5 5.28305,0.819297 6.73358,2.457813 1.4505,1.638564 2.17576,4.130228 2.17579,7.475 v 11.2125 c -3e-5,0.751046 0.37549,1.126567 1.12656,1.126563 h 2.09843 v 4.25 h -4.91406 c -1.16043,0 -1.99664,-0.25599 -2.50859,-0.767969 -0.512,-0.511978 -0.76799,-1.348175 -0.76797,-2.508594 V 78.048437 c -2e-5,-2.082274 -0.33283,-3.686439 -0.99843,-4.8125 -0.66566,-1.12602 -1.95419,-1.68904 -3.86563,-1.689062 -1.98023,2.2e-5 -3.71277,0.588823 -5.19766,1.766406 -1.4849,1.177624 -2.48308,2.704965 -2.99453,4.582031 -0.3073,0.887516 -0.46095,2.047931 -0.46093,3.48125 v 12.134376 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> + </g> + <g + id="text3769" + style="font-style:normal;font-weight:normal;font-size:10px;line-height:125%;font-family:'Museo 500';-inkscape-font-specification:'Museo 500';letter-spacing:0px;word-spacing:0px;fill:#0b3575;fill-opacity:1;stroke:none;filter:url(#filter4610)"> + <path + id="path3774" + d="m 304.55762,64.957287 v -6.613281 h -1.51465 c -0.15647,7e-6 -0.2347,0.07824 -0.2347,0.234701 v 0.479818 h -0.94922 v -0.991863 c 0,-0.241746 0.0462,-0.408847 0.13851,-0.501302 0.0924,-0.09244 0.2595,-0.138663 0.50146,-0.138671 h 5.18392 c 0.24175,8e-6 0.40885,0.04623 0.50131,0.138671 0.0925,0.09246 0.13866,0.259556 0.13866,0.501302 v 0.991863 h -0.94921 v -0.479818 c 0,-0.156461 -0.0783,-0.234694 -0.2347,-0.234701 h -1.51465 v 6.613281 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> + <path + id="path3776" + d="M 308.70378,64.957287 V 64.03997 h 0.36263 c 0.14236,10e-7 0.22059,-0.07823 0.2347,-0.234701 l 0.51204,-6.37858 h 1.09864 l 1.77082,3.989258 0.37338,0.949218 h 0.0211 c 0.12803,-0.362627 0.25249,-0.679033 0.37336,-0.949218 l 1.77084,-3.989258 h 1.09864 l 0.51204,6.37858 c 0.0141,0.156469 0.0923,0.234702 0.23438,0.234701 h 0.35221 v 0.917317 h -0.94955 c -0.2346,0 -0.40343,-0.05333 -0.50651,-0.159993 -0.10304,-0.106656 -0.16178,-0.280869 -0.17611,-0.522623 l -0.30924,-3.978842 -0.0211,-1.109049 h -0.0214 c -0.14215,0.469189 -0.27366,0.838872 -0.39452,1.109049 l -1.5254,3.306641 h -0.89616 l -1.52539,-3.306641 c -0.0568,-0.113711 -0.11903,-0.264806 -0.18653,-0.453287 -0.0675,-0.188472 -0.11903,-0.346621 -0.15461,-0.474447 l -0.0641,-0.192058 h -0.0211 c 0.007,0.447922 -2.2e-4,0.821186 -0.0214,1.119792 l -0.2985,3.978842 c -0.0143,0.241754 -0.0731,0.415962 -0.17611,0.522623 -0.10304,0.106667 -0.2755,0.159993 -0.51725,0.159993 z" + style="fill:#0b3575;fill-opacity:1;stroke-width:1.06666672" /> </g> </g> </svg> diff --git a/application/palemoon/branding/official/content/about.png b/application/palemoon/branding/official/content/about.png Binary files differindex e34dd11ed..0a4fbb393 100644 --- a/application/palemoon/branding/official/content/about.png +++ b/application/palemoon/branding/official/content/about.png diff --git a/application/palemoon/branding/official/content/aboutDialog.css b/application/palemoon/branding/official/content/aboutDialog.css index dbf04ae0a..5bcc229e7 100644 --- a/application/palemoon/branding/official/content/aboutDialog.css +++ b/application/palemoon/branding/official/content/aboutDialog.css @@ -3,41 +3,51 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #aboutPMDialogContainer { - background-image: url("chrome://branding/content/about-background.png"); + background-image: url("chrome://branding/content/about-background.jpg"); background-repeat: no-repeat; - background-color: #F7F7F7; - background-size: cover; - color: #000020; + background-color: #9ABCD5; + color: #101020; } -#PMleftBox { - /* background-image: url("chrome://branding/content/about-logo.png"); */ +#aboutHeaderBox { + background-image: url("chrome://branding/content/about-wordmark.png"); background-repeat: no-repeat; - /* min-width and min-height create room for the logo */ - min-width: 210px; - min-height: 210px; - margin-top:20px; - -moz-margin-start: 30px; + background-position: center center; + height: 44px; } -#PMrightBox { - margin-left: 30px; - margin-right: 30px; +#aboutVersionBox { + text-shadow: 1px 1px 0px #9ABCD5; } -#PMbottomBox { - padding: 15px 10px 0; - background-color: rgba(240,240,255,.7); -} +#aboutTextBox { + animation: 3s fadeIn; + animation-fill-mode: forwards; + text-shadow: 1px 1px 0px #9ABCD5; + color: #101020; +} -#PMupdateDeck > hbox > label:not([class="text-link"]) { - color: #909090; +@keyframes fadeIn { + 0% { + opacity: 0; + } + 50% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +#aboutLinkBox { + padding: 15px 10px 0; } -#PMtrademark { - font-size: xx-small; +#aboutPMtrademark { + font-size: 10px; text-align: center; - color: #999999; + color: #C0C0C0; + text-shadow: 1px 1px 0px #000000; margin-top: 10px; margin-bottom: 10px; } diff --git a/application/palemoon/branding/official/content/icon48.png b/application/palemoon/branding/official/content/icon48.png Binary files differindex abc17585f..c3a98f128 100644 --- a/application/palemoon/branding/official/content/icon48.png +++ b/application/palemoon/branding/official/content/icon48.png diff --git a/application/palemoon/branding/official/content/icon64.png b/application/palemoon/branding/official/content/icon64.png Binary files differindex bccb5e8ec..93a7ce23c 100644 --- a/application/palemoon/branding/official/content/icon64.png +++ b/application/palemoon/branding/official/content/icon64.png diff --git a/application/palemoon/branding/official/content/jar.mn b/application/palemoon/branding/official/content/jar.mn index d8038bf9e..83ef1ed15 100644 --- a/application/palemoon/branding/official/content/jar.mn +++ b/application/palemoon/branding/official/content/jar.mn @@ -5,7 +5,7 @@ browser.jar: % content branding %content/branding/ contentaccessible=yes content/branding/about.png (about.png) - content/branding/about-background.png (about-background.png) + content/branding/about-background.jpg (about-background.jpg) content/branding/about-logo.png (about-logo.png) content/branding/about-logo@2x.png (about-logo@2x.png) content/branding/about-wordmark.png (about-wordmark.png) diff --git a/application/palemoon/branding/official/content/moz.build b/application/palemoon/branding/official/content/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/branding/official/content/moz.build +++ b/application/palemoon/branding/official/content/moz.build @@ -4,5 +4,4 @@ # 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']
\ No newline at end of file diff --git a/application/palemoon/branding/official/default16.png b/application/palemoon/branding/official/default16.png Binary files differindex d58dbc5cc..b840a3acf 100644 --- a/application/palemoon/branding/official/default16.png +++ b/application/palemoon/branding/official/default16.png diff --git a/application/palemoon/branding/official/default22.png b/application/palemoon/branding/official/default22.png Binary files differindex 3b7a33e4a..4e290f84b 100644 --- a/application/palemoon/branding/official/default22.png +++ b/application/palemoon/branding/official/default22.png diff --git a/application/palemoon/branding/official/default24.png b/application/palemoon/branding/official/default24.png Binary files differindex e70cc06f3..f47d3ef23 100644 --- a/application/palemoon/branding/official/default24.png +++ b/application/palemoon/branding/official/default24.png diff --git a/application/palemoon/branding/official/default256.png b/application/palemoon/branding/official/default256.png Binary files differindex 9a5e7ccab..53adcfa73 100644 --- a/application/palemoon/branding/official/default256.png +++ b/application/palemoon/branding/official/default256.png diff --git a/application/palemoon/branding/official/default32.png b/application/palemoon/branding/official/default32.png Binary files differindex 5be7a3378..fde9707d8 100644 --- a/application/palemoon/branding/official/default32.png +++ b/application/palemoon/branding/official/default32.png diff --git a/application/palemoon/branding/official/default48.png b/application/palemoon/branding/official/default48.png Binary files differindex 9cd9712f7..c3a98f128 100644 --- a/application/palemoon/branding/official/default48.png +++ b/application/palemoon/branding/official/default48.png diff --git a/application/palemoon/branding/official/disk.icns b/application/palemoon/branding/official/disk.icns Binary files differindex 8dc67b202..f3a549583 100644 --- a/application/palemoon/branding/official/disk.icns +++ b/application/palemoon/branding/official/disk.icns diff --git a/application/palemoon/branding/official/disk.ico b/application/palemoon/branding/official/disk.ico Binary files differdeleted file mode 100644 index cc5412a3a..000000000 --- a/application/palemoon/branding/official/disk.ico +++ /dev/null diff --git a/application/palemoon/branding/official/document.icns b/application/palemoon/branding/official/document.icns Binary files differindex 74c2b4c1e..c9f33dbfa 100644 --- a/application/palemoon/branding/official/document.icns +++ b/application/palemoon/branding/official/document.icns diff --git a/application/palemoon/branding/official/document.ico b/application/palemoon/branding/official/document.ico Binary files differindex 762655001..2f843dbd1 100644 --- a/application/palemoon/branding/official/document.ico +++ b/application/palemoon/branding/official/document.ico diff --git a/application/palemoon/branding/official/firefox.icns b/application/palemoon/branding/official/firefox.icns Binary files differindex e1a2f9a46..87f9ac751 100644 --- a/application/palemoon/branding/official/firefox.icns +++ b/application/palemoon/branding/official/firefox.icns diff --git a/application/palemoon/branding/official/firefox.ico b/application/palemoon/branding/official/firefox.ico Binary files differindex 33bb04e99..ea25fd887 100644 --- a/application/palemoon/branding/official/firefox.ico +++ b/application/palemoon/branding/official/firefox.ico diff --git a/application/palemoon/branding/official/locales/jar.mn b/application/palemoon/branding/official/locales/jar.mn index 79078217e..f02dd95f3 100644 --- a/application/palemoon/branding/official/locales/jar.mn +++ b/application/palemoon/branding/official/locales/jar.mn @@ -6,6 +6,6 @@ @AB_CD@.jar: % locale branding @AB_CD@ %locale/branding/ - locale/branding/brand.dtd (%brand.dtd) - locale/branding/brand.properties (%brand.properties) - locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) + locale/branding/brand.dtd (%brand.dtd) + locale/branding/brand.properties (%brand.properties) + locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) diff --git a/application/palemoon/branding/official/locales/moz.build b/application/palemoon/branding/official/locales/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/branding/official/locales/moz.build +++ b/application/palemoon/branding/official/locales/moz.build @@ -4,5 +4,4 @@ # 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']
\ No newline at end of file diff --git a/application/palemoon/branding/official/mozicon128.png b/application/palemoon/branding/official/mozicon128.png Binary files differindex b19a61fdc..35eafcb08 100644 --- a/application/palemoon/branding/official/mozicon128.png +++ b/application/palemoon/branding/official/mozicon128.png diff --git a/application/palemoon/branding/official/palemoon.desktop b/application/palemoon/branding/official/palemoon.desktop index 0e6c104b4..440092b33 100644 --- a/application/palemoon/branding/official/palemoon.desktop +++ b/application/palemoon/branding/official/palemoon.desktop @@ -64,7 +64,7 @@ Comment[ko]=웹을 돌아 다닙니다 Comment[ku]=Li torê bigere Comment[lt]=Naršykite internete Comment[nb]=Surf på nettet -Comment[nl]=Verken het internet +Comment[nl]=Surf op het internet Comment[nn]=Surf på nettet Comment[no]=Surf på nettet Comment[pl]=Przeglądanie stron WWW @@ -87,8 +87,9 @@ Type=Application Icon=palemoon Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp; -StartupNotify=true +StartupNotify=false Actions=NewTab;NewWindow;NewPrivateWindow; +StartupWMClass="pale moon" [Desktop Action NewTab] Name=Open new tab diff --git a/application/palemoon/branding/official/wizHeader.bmp b/application/palemoon/branding/official/wizHeader.bmp Binary files differindex 368e01b90..c023036b6 100644 --- a/application/palemoon/branding/official/wizHeader.bmp +++ b/application/palemoon/branding/official/wizHeader.bmp diff --git a/application/palemoon/branding/official/wizHeaderRTL.bmp b/application/palemoon/branding/official/wizHeaderRTL.bmp Binary files differindex 0671342c1..11edaa883 100644 --- a/application/palemoon/branding/official/wizHeaderRTL.bmp +++ b/application/palemoon/branding/official/wizHeaderRTL.bmp diff --git a/application/palemoon/branding/official/wizWatermark.bmp b/application/palemoon/branding/official/wizWatermark.bmp Binary files differindex 778749aa2..ad7703d8f 100644 --- a/application/palemoon/branding/official/wizWatermark.bmp +++ b/application/palemoon/branding/official/wizWatermark.bmp diff --git a/application/palemoon/branding/shared/pref/preferences.inc b/application/palemoon/branding/shared/pref/preferences.inc index 721c2c90e..fe1a2f003 100644 --- a/application/palemoon/branding/shared/pref/preferences.inc +++ b/application/palemoon/branding/shared/pref/preferences.inc @@ -1,6 +1,3 @@ -#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% - // ===| General |============================================================== pref("startup.homepage_welcome_url","http://www.palemoon.org/firstrun.shtml"); @@ -15,8 +12,6 @@ pref("browser.identity.ssl_domain_display", 1); //show domain verified SSL (blue // ===| Application Update Service |=========================================== -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 // background (in seconds) pref("app.update.download.backgroundInterval", 600); @@ -29,14 +24,7 @@ pref("app.update.promptWaitTime", 172800); // ===| Add-ons Manager |====================================================== // Add-on window fixes -pref("extensions.getMoreThemesURL", "https://@APO_AM_URL@/external/themes"); - -// Extensions Blocklist -pref("extensions.blocklist.url","http://blocklist.palemoon.org/%VERSION%/blocklist.xml"); -pref("extensions.blocklist.itemURL", "http://blocklist.palemoon.org/info/?id=%blockID%"); - -// Dictionary URL -pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/"); +pref("extensions.getMoreThemesURL", "https://addons.palemoon.org/themes/"); pref("extensions.update.autoUpdateDefault", true); // Automatically update extensions by default pref("extensions.getAddons.maxResults", 10); diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc index e5e727ee5..028b29b41 100644 --- a/application/palemoon/branding/shared/pref/uaoverrides.inc +++ b/application/palemoon/branding/shared/pref/uaoverrides.inc @@ -21,6 +21,11 @@ #define OS_SLICE Windows NT 6.1; WOW64;
#endif
+// Special-case AMO
+// We send the native UA slice now, since they no longer offer any compatible extensions for us.
+// This will result in an "only with Firefox" message which suits us fine, because it's the truth.
+pref("@GUAO_PREF@.addons.mozilla.org","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
+
// Required for domains that have proven unresponsive to requests from users
pref("@GUAO_PREF@.live.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)");
pref("@GUAO_PREF@.msn.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)");
@@ -35,8 +40,8 @@ pref("@GUAO_PREF@.gstatic.com","Mozilla/5.0 (@OS_SLICE@ rv:31.9) @GK_SLICE@ @GRE pref("@GUAO_PREF@.yahoo.com","Mozilla/5.0 (@OS_SLICE@ rv:99.9) @GK_SLICE@ Firefox/99.9 (Pale Moon)");
pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (@OS_SLICE@ rv:42.0) @GK_SLICE@ Firefox/42.0 @PM_SLICE@");
pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (@OS_SLICE@ rv:42.0) @GK_SLICE@ Firefox/42.0");
+pref("@GUAO_PREF@.dropbox.com","Mozilla/5.0 (@OS_SLICE@ rv:99.9) @GK_SLICE@ Firefox/99.9 (Pale Moon)");
-pref("@GUAO_PREF@.dropbox.com","Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko");
pref("@GUAO_PREF@.players.brightcove.net","Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko");
// The never-ending Facebook debacle...
@@ -53,11 +58,13 @@ pref("@GUAO_PREF@.soundcloud.com","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GR // Daily motion only likes strict Firefox UAs
pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (@OS_SLICE@ rv:52.0) @GK_SLICE@ Firefox/52.0");
+
// 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@");
+pref("@GUAO_PREF@.firefox.com","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)");
@@ -67,7 +74,7 @@ pref("@GUAO_PREF@.netflix.com","Mozilla/5.0 (@OS_SLICE@ rv:45.9) @GK_SLICE@ Fire pref("@GUAO_PREF@.netflximg.net","Mozilla/5.0 (@OS_SLICE@ rv:45.9) @GK_SLICE@ Firefox/45.9");
// UA-sniffing domains that are "app/vendor-specific" and do not like Pale Moon
-pref("@GUAO_PREF@.web.whatsapp.com","Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36");
+pref("@GUAO_PREF@.web.whatsapp.com","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36");
// The following domains do not like the Goanna slice
pref("@GUAO_PREF@.hitbox.tv","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@");
diff --git a/application/palemoon/branding/unofficial/branding.nsi b/application/palemoon/branding/unofficial/branding.nsi index cf1642eaf..62ed242a2 100644 --- a/application/palemoon/branding/unofficial/branding.nsi +++ b/application/palemoon/branding/unofficial/branding.nsi @@ -12,29 +12,5 @@ !define CompanyName "Moonchild Productions" !define URLInfoAbout "http://www.palemoon.org" !define URLUpdateInfo "http://www.palemoon.org" - -!define URLManualDownload "http://www.palemoon.org/download-ng.shtml" -!define Channel "unofficial" - -# Dialog units are used so the UI displays correctly with the system's DPI -# settings. -# The dialog units for the bitmap's dimensions should match exactly with the -# bitmap's width and height in pixels. -!define APPNAME_BMP_WIDTH_DU 159u -!define APPNAME_BMP_HEIGHT_DU 26u -!define INTRO_BLURB_WIDTH_DU "230u" -!define INTRO_BLURB_EDGE_DU "198u" -!define INTRO_BLURB_LTR_TOP_DU "16u" -!define INTRO_BLURB_RTL_TOP_DU "11u" - -# UI Colors that can be customized for each channel -!define FOOTER_CONTROL_TEXT_COLOR_NORMAL 0x000000 -!define FOOTER_CONTROL_TEXT_COLOR_FADED 0x999999 -!define FOOTER_BKGRD_COLOR 0xFFFFFF -!define INTRO_BLURB_TEXT_COLOR 0xFFFFFF -!define OPTIONS_TEXT_COLOR_NORMAL 0xFFFFFF -!define OPTIONS_TEXT_COLOR_FADED 0xA1AAB3 -!define OPTIONS_BKGRD_COLOR 0x0F1B26 -!define INSTALL_BLURB_TEXT_COLOR 0xFFFFFF -!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0xFFFFFF -!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0xA1AAB3 +!define HelpLink "http://www.palemoon.org" +!define URLSystemRequirements "http://www.palemoon.org/download.shtml" diff --git a/application/palemoon/branding/unofficial/configure.sh b/application/palemoon/branding/unofficial/configure.sh index 05a1e1b87..c03b8382a 100644 --- a/application/palemoon/branding/unofficial/configure.sh +++ b/application/palemoon/branding/unofficial/configure.sh @@ -2,4 +2,4 @@ # 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/. -MOZ_APP_DISPLAYNAME=NewMoon +MOZ_APP_DISPLAYNAME="New Moon" diff --git a/application/palemoon/branding/unofficial/content/about-background.png b/application/palemoon/branding/unofficial/content/about-background.png Binary files differindex 006818637..c034041f6 100644 --- a/application/palemoon/branding/unofficial/content/about-background.png +++ b/application/palemoon/branding/unofficial/content/about-background.png diff --git a/application/palemoon/branding/unofficial/content/about-wordmark.png b/application/palemoon/branding/unofficial/content/about-wordmark.png Binary files differdeleted file mode 100644 index 41889ba39..000000000 --- a/application/palemoon/branding/unofficial/content/about-wordmark.png +++ /dev/null diff --git a/application/palemoon/branding/unofficial/content/about-wordmark.svg b/application/palemoon/branding/unofficial/content/about-wordmark.svg deleted file mode 100644 index fd0f1745e..000000000 --- a/application/palemoon/branding/unofficial/content/about-wordmark.svg +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - -<svg version="1.1" id="aboutWordmark" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="132px" height="48px" viewBox="0 0 132 48" xml:space="preserve"> - - <path fill="#55575C"/> - -</svg> diff --git a/application/palemoon/branding/unofficial/content/aboutDialog.css b/application/palemoon/branding/unofficial/content/aboutDialog.css index 3f7c5ec23..5cc6b428a 100644 --- a/application/palemoon/branding/unofficial/content/aboutDialog.css +++ b/application/palemoon/branding/unofficial/content/aboutDialog.css @@ -9,16 +9,11 @@ color: #fff; } -.text-link { - color: #eef !important; +#aboutVersionBox { + /* No wordmark: leave empty space */ + margin-top: 20px; } -#PMrightBox { - /* this margin prevents text from overlapping the planet image */ - margin-left: 280px; - margin-right: 20px; -} - -#PMbottomBox { - background-color: rgba(0,0,0,.7); +#aboutLinkBox { + padding: 15px 10px 20px; } diff --git a/application/palemoon/branding/unofficial/content/jar.mn b/application/palemoon/branding/unofficial/content/jar.mn index 821aa03bc..353695792 100644 --- a/application/palemoon/branding/unofficial/content/jar.mn +++ b/application/palemoon/branding/unofficial/content/jar.mn @@ -4,13 +4,12 @@ browser.jar: % content branding %content/branding/ contentaccessible=yes - content/branding/about.png (about.png) - content/branding/about-background.png (about-background.png) - content/branding/about-logo.png (about-logo.png) - content/branding/about-logo@2x.png (about-logo@2x.png) - content/branding/about-wordmark.svg (about-wordmark.svg) - content/branding/icon48.png (icon48.png) - content/branding/icon64.png (icon64.png) - content/branding/icon16.png (../default16.png) - content/branding/icon32.png (../default32.png) - content/branding/aboutDialog.css (aboutDialog.css) + content/branding/about.png (about.png) + content/branding/about-background.png (about-background.png) + content/branding/about-logo.png (about-logo.png) + content/branding/about-logo@2x.png (about-logo@2x.png) + content/branding/icon48.png (icon48.png) + content/branding/icon64.png (icon64.png) + content/branding/icon16.png (../default16.png) + content/branding/icon32.png (../default32.png) + content/branding/aboutDialog.css (aboutDialog.css) diff --git a/application/palemoon/branding/unofficial/content/moz.build b/application/palemoon/branding/unofficial/content/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/branding/unofficial/content/moz.build +++ b/application/palemoon/branding/unofficial/content/moz.build @@ -4,5 +4,4 @@ # 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']
\ No newline at end of file diff --git a/application/palemoon/branding/unofficial/locales/jar.mn b/application/palemoon/branding/unofficial/locales/jar.mn index 88aa07434..9de6cfc83 100644 --- a/application/palemoon/branding/unofficial/locales/jar.mn +++ b/application/palemoon/branding/unofficial/locales/jar.mn @@ -7,6 +7,6 @@ @AB_CD@.jar: % locale branding @AB_CD@ %locale/branding/ # Unofficial branding only exists in en-US - locale/branding/brand.dtd (en-US/brand.dtd) - locale/branding/brand.properties (en-US/brand.properties) - locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) + locale/branding/brand.dtd (en-US/brand.dtd) + locale/branding/brand.properties (en-US/brand.properties) + locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) diff --git a/application/palemoon/branding/unofficial/newmoon.desktop b/application/palemoon/branding/unofficial/newmoon.desktop index 6dcf32477..3b337fdd4 100644 --- a/application/palemoon/branding/unofficial/newmoon.desktop +++ b/application/palemoon/branding/unofficial/newmoon.desktop @@ -87,8 +87,9 @@ Type=Application Icon=palemoon Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp; -StartupNotify=true +StartupNotify=false Actions=NewTab;NewWindow;NewPrivateWindow; +StartupWMClass="new moon" [Desktop Action NewTab] Name=Open new tab diff --git a/application/palemoon/branding/unstable/branding.nsi b/application/palemoon/branding/unstable/branding.nsi index 4a9199b22..535cfde33 100644 --- a/application/palemoon/branding/unstable/branding.nsi +++ b/application/palemoon/branding/unstable/branding.nsi @@ -11,36 +11,6 @@ !define BrandFullNameInternal "Pale Moon" !define CompanyName "Moonchild Productions" !define URLInfoAbout "http://www.palemoon.org/" -!define URLUpdateInfo "http://www.palemoon.org/unstable.shtml" - -; The OFFICIAL define is a workaround to support different urls for Release and -; Beta since they share the same branding when building with other branches that -; set the update channel to beta. -!define OFFICIAL -!define URLStubDownload "" -!define URLManualDownload "http://www.palemoon.org/unstable.shtml" -!define Channel "unstable" - - -# Dialog units are used so the UI displays correctly with the system's DPI -# settings. -# The dialog units for the bitmap's dimensions should match exactly with the -# bitmap's width and height in pixels. -!define APPNAME_BMP_WIDTH_DU "134u" -!define APPNAME_BMP_HEIGHT_DU "36u" -!define INTRO_BLURB_WIDTH_DU "258u" -!define INTRO_BLURB_EDGE_DU "170u" -!define INTRO_BLURB_LTR_TOP_DU "20u" -!define INTRO_BLURB_RTL_TOP_DU "12u" - -# UI Colors that can be customized for each channel -!define FOOTER_CONTROL_TEXT_COLOR_NORMAL 0x000033 -!define FOOTER_CONTROL_TEXT_COLOR_FADED 0x666699 -!define FOOTER_BKGRD_COLOR 0xFFFFFF -!define INTRO_BLURB_TEXT_COLOR 0x666699 -!define OPTIONS_TEXT_COLOR_NORMAL 0x000000 -!define OPTIONS_TEXT_COLOR_FADED 0x666699 -!define OPTIONS_BKGRD_COLOR 0xF0F0F0 -!define INSTALL_BLURB_TEXT_COLOR 0x666699 -!define INSTALL_PROGRESS_TEXT_COLOR_NORMAL 0x666699 -!define INSTALL_PROGRESS_TEXT_COLOR_FADED 0x9999C0 +!define URLUpdateInfo "http://www.palemoon.org/unstable/" +!define HelpLink "http://www.palemoon.org/unstable/" +!define URLSystemRequirements "http://www.palemoon.org/download.shtml" diff --git a/application/palemoon/branding/unstable/configure.sh b/application/palemoon/branding/unstable/configure.sh index 814133dfa..8943f5819 100644 --- a/application/palemoon/branding/unstable/configure.sh +++ b/application/palemoon/branding/unstable/configure.sh @@ -2,5 +2,5 @@ # 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/. -MOZ_APP_DISPLAYNAME=Palemoon +MOZ_APP_DISPLAYNAME="Pale Moon" # MOZ_UA_BUILDID=20100101 diff --git a/application/palemoon/branding/unstable/content/about-background.jpg b/application/palemoon/branding/unstable/content/about-background.jpg Binary files differnew file mode 100644 index 000000000..a33b33183 --- /dev/null +++ b/application/palemoon/branding/unstable/content/about-background.jpg diff --git a/application/palemoon/branding/unstable/content/about-background.png b/application/palemoon/branding/unstable/content/about-background.png Binary files differdeleted file mode 100644 index 3d20e0658..000000000 --- a/application/palemoon/branding/unstable/content/about-background.png +++ /dev/null diff --git a/application/palemoon/branding/unstable/content/about-wordmark.png b/application/palemoon/branding/unstable/content/about-wordmark.png Binary files differindex deb60b6b9..bf09f15a0 100644 --- a/application/palemoon/branding/unstable/content/about-wordmark.png +++ b/application/palemoon/branding/unstable/content/about-wordmark.png diff --git a/application/palemoon/branding/unstable/content/about-wordmark.svg b/application/palemoon/branding/unstable/content/about-wordmark.svg deleted file mode 100644 index fd0f1745e..000000000 --- a/application/palemoon/branding/unstable/content/about-wordmark.svg +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - -<svg version="1.1" id="aboutWordmark" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="132px" height="48px" viewBox="0 0 132 48" xml:space="preserve"> - - <path fill="#55575C"/> - -</svg> diff --git a/application/palemoon/branding/unstable/content/aboutDialog.css b/application/palemoon/branding/unstable/content/aboutDialog.css index 9af49ba10..de71f259c 100644 --- a/application/palemoon/branding/unstable/content/aboutDialog.css +++ b/application/palemoon/branding/unstable/content/aboutDialog.css @@ -3,45 +3,51 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #aboutPMDialogContainer { - background-image: url("chrome://branding/content/about-background.png"); + background-image: url("chrome://branding/content/about-background.jpg"); background-repeat: no-repeat; - background-color: #100000; - background-size: cover; - color: #E0E0FF; + background-color: #D5BC9A; + color: #202010; } -#PMleftBox { - background-image: url("chrome://branding/content/about-logo.png"); +#aboutHeaderBox { + background-image: url("chrome://branding/content/about-wordmark.png"); background-repeat: no-repeat; - /* min-width and min-height create room for the logo */ - min-width: 210px; - min-height: 210px; - margin-top:20px; - -moz-margin-start: 30px; + background-position: center center; + height: 44px; } -#PMrightBox { - margin-left: 30px; - margin-right: 30px; +#aboutVersionBox { + text-shadow: 1px 1px 0px #D5BC9A; } -#detailsBox > description > .text-link { - color: #CDC36F; +#aboutTextBox { + animation: 3s fadeIn; + animation-fill-mode: forwards; + text-shadow: 1px 1px 0px #D5BC9A; + color: #202010; } -#PMbottomBox { - padding: 15px 10px 0; - background-color: rgba(240,240,255,.7); -} +@keyframes fadeIn { + 0% { + opacity: 0; + } + 50% { + opacity: 0; + } + 100% { + opacity: 1; + } +} -#PMupdateDeck > hbox > label:not([class="text-link"]) { - color: #909090; +#aboutLinkBox { + padding: 15px 10px 0; } -#PMtrademark { - font-size: xx-small; +#aboutPMtrademark { + font-size: 10px; text-align: center; - color: #333333; + color: #C0C0C0; + text-shadow: 1px 1px 0px #000000; margin-top: 10px; margin-bottom: 10px; } diff --git a/application/palemoon/branding/unstable/content/jar.mn b/application/palemoon/branding/unstable/content/jar.mn index d8038bf9e..fcb789031 100644 --- a/application/palemoon/branding/unstable/content/jar.mn +++ b/application/palemoon/branding/unstable/content/jar.mn @@ -4,13 +4,13 @@ browser.jar: % content branding %content/branding/ contentaccessible=yes - content/branding/about.png (about.png) - content/branding/about-background.png (about-background.png) - content/branding/about-logo.png (about-logo.png) - content/branding/about-logo@2x.png (about-logo@2x.png) - content/branding/about-wordmark.png (about-wordmark.png) - content/branding/icon48.png (icon48.png) - content/branding/icon64.png (icon64.png) - content/branding/icon16.png (../default16.png) - content/branding/icon32.png (../default32.png) - content/branding/aboutDialog.css (aboutDialog.css) + content/branding/about.png (about.png) + content/branding/about-background.jpg (about-background.jpg) + content/branding/about-logo.png (about-logo.png) + content/branding/about-logo@2x.png (about-logo@2x.png) + content/branding/about-wordmark.png (about-wordmark.png) + content/branding/icon48.png (icon48.png) + content/branding/icon64.png (icon64.png) + content/branding/icon16.png (../default16.png) + content/branding/icon32.png (../default32.png) + content/branding/aboutDialog.css (aboutDialog.css) diff --git a/application/palemoon/branding/unstable/content/moz.build b/application/palemoon/branding/unstable/content/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/branding/unstable/content/moz.build +++ b/application/palemoon/branding/unstable/content/moz.build @@ -4,5 +4,4 @@ # 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']
\ No newline at end of file diff --git a/application/palemoon/branding/unstable/firefox.icns b/application/palemoon/branding/unstable/firefox.icns Binary files differindex 117ddb195..3df606a01 100644 --- a/application/palemoon/branding/unstable/firefox.icns +++ b/application/palemoon/branding/unstable/firefox.icns diff --git a/application/palemoon/branding/unstable/locales/jar.mn b/application/palemoon/branding/unstable/locales/jar.mn index 88aa07434..9de6cfc83 100644 --- a/application/palemoon/branding/unstable/locales/jar.mn +++ b/application/palemoon/branding/unstable/locales/jar.mn @@ -7,6 +7,6 @@ @AB_CD@.jar: % locale branding @AB_CD@ %locale/branding/ # Unofficial branding only exists in en-US - locale/branding/brand.dtd (en-US/brand.dtd) - locale/branding/brand.properties (en-US/brand.properties) - locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) + locale/branding/brand.dtd (en-US/brand.dtd) + locale/branding/brand.properties (en-US/brand.properties) + locale/branding/browserconfig.properties (../../shared/locales/browserconfig.properties) diff --git a/application/palemoon/components/BrowserComponents.manifest b/application/palemoon/components/BrowserComponents.manifest index 1e4bff59a..0ff14d066 100644 --- a/application/palemoon/components/BrowserComponents.manifest +++ b/application/palemoon/components/BrowserComponents.manifest @@ -1,3 +1,21 @@ +# nsAboutRedirector.js +component {8cc51368-6aa0-43e8-b762-bde9b9fd828c} nsAboutRedirector.js +# Each entry here should be coupled with an entry in nsAboutRedirector.js +contract @mozilla.org/network/protocol/about;1?what=certerror {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=downloads {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=feeds {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=home {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=newtab {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=palemoon {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=permissions {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=privatebrowsing {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=rights {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=sessionrestore {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +#ifdef MOZ_SERVICES_SYNC +contract @mozilla.org/network/protocol/about;1?what=sync-progress {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=sync-tabs {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +#endif + # nsBrowserContentHandler.js component {5d0ce354-df01-421a-83fb-7ead0990c24e} nsBrowserContentHandler.js application={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} contract @mozilla.org/browser/clh;1 {5d0ce354-df01-421a-83fb-7ead0990c24e} application={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} diff --git a/application/palemoon/components/about/AboutRedirector.cpp b/application/palemoon/components/about/AboutRedirector.cpp deleted file mode 100644 index fbcad6094..000000000 --- a/application/palemoon/components/about/AboutRedirector.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// See also: docshell/base/nsAboutRedirector.cpp - -#include "AboutRedirector.h" -#include "nsNetUtil.h" -#include "nsIScriptSecurityManager.h" -#include "mozilla/ArrayUtils.h" - -namespace mozilla { -namespace browser { - -NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule) - -struct RedirEntry { - const char* id; - const char* url; - uint32_t flags; -}; - -/* - Entries which do not have URI_SAFE_FOR_UNTRUSTED_CONTENT will run with chrome - privileges. This is potentially dangerous. Please use - URI_SAFE_FOR_UNTRUSTED_CONTENT in the third argument to each map item below - unless your about: page really needs chrome privileges. Security review is - required before adding new map entries without - URI_SAFE_FOR_UNTRUSTED_CONTENT. -*/ -static RedirEntry kRedirMap[] = { - { - "certerror", "chrome://browser/content/certerror/aboutCertError.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT - }, - { - "downloads", "chrome://browser/content/downloads/contentAreaDownloadsView.xul", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "feeds", "chrome://browser/content/feeds/subscribe.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT - }, - { - "home", "chrome://browser/content/abouthome/aboutHome.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::MAKE_LINKABLE | - nsIAboutModule::ALLOW_SCRIPT - }, - { - "newtab", "chrome://browser/content/newtab/newTab.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "palemoon", "chrome://browser/content/palemoon.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT - }, - { - "permissions", "chrome://browser/content/permissions/aboutPermissions.xul", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "rights", "chrome://global/content/aboutRights.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::MAKE_LINKABLE | - nsIAboutModule::ALLOW_SCRIPT - }, - { - "robots", "chrome://browser/content/aboutRobots.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT - }, - { - "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, -#ifdef MOZ_SERVICES_SYNC - { - "sync-progress", "chrome://browser/content/sync/progress.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "sync-tabs", "chrome://browser/content/sync/aboutSyncTabs.xul", - nsIAboutModule::ALLOW_SCRIPT - }, -#endif -}; -static const int kRedirTotal = ArrayLength(kRedirMap); - -static nsAutoCString -GetAboutModuleName(nsIURI *aURI) -{ - nsAutoCString path; - aURI->GetPath(path); - - int32_t f = path.FindChar('#'); - if (f >= 0) - path.SetLength(f); - - f = path.FindChar('?'); - if (f >= 0) - path.SetLength(f); - - ToLowerCase(path); - return path; -} - -NS_IMETHODIMP -AboutRedirector::NewChannel(nsIURI* aURI, - nsILoadInfo* aLoadInfo, - nsIChannel** result) -{ - NS_ENSURE_ARG_POINTER(aURI); - NS_ASSERTION(result, "must not be null"); - - nsAutoCString path = GetAboutModuleName(aURI); - - nsresult rv; - nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv); - NS_ENSURE_SUCCESS(rv, rv); - - for (int i = 0; i < kRedirTotal; i++) { - if (!strcmp(path.get(), kRedirMap[i].id)) { - nsCOMPtr<nsIChannel> tempChannel; - nsCOMPtr<nsIURI> tempURI; - rv = NS_NewURI(getter_AddRefs(tempURI), - nsDependentCString(kRedirMap[i].url)); - NS_ENSURE_SUCCESS(rv, rv); - rv = NS_NewChannelInternal(getter_AddRefs(tempChannel), - tempURI, - aLoadInfo); - NS_ENSURE_SUCCESS(rv, rv); - - tempChannel->SetOriginalURI(aURI); - - NS_ADDREF(*result = tempChannel); - return rv; - } - } - - return NS_ERROR_ILLEGAL_VALUE; -} - -NS_IMETHODIMP -AboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result) -{ - NS_ENSURE_ARG_POINTER(aURI); - - nsAutoCString name = GetAboutModuleName(aURI); - - for (int i = 0; i < kRedirTotal; i++) { - if (name.Equals(kRedirMap[i].id)) { - *result = kRedirMap[i].flags; - return NS_OK; - } - } - - return NS_ERROR_ILLEGAL_VALUE; -} - -nsresult -AboutRedirector::Create(nsISupports *aOuter, REFNSIID aIID, void **result) -{ - AboutRedirector* about = new AboutRedirector(); - if (about == nullptr) - return NS_ERROR_OUT_OF_MEMORY; - NS_ADDREF(about); - nsresult rv = about->QueryInterface(aIID, result); - NS_RELEASE(about); - return rv; -} - -} // namespace browser -} // namespace mozilla diff --git a/application/palemoon/components/about/AboutRedirector.h b/application/palemoon/components/about/AboutRedirector.h deleted file mode 100644 index 8feeb7491..000000000 --- a/application/palemoon/components/about/AboutRedirector.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef AboutRedirector_h__ -#define AboutRedirector_h__ - -#include "nsIAboutModule.h" - -namespace mozilla { -namespace browser { - -class AboutRedirector : public nsIAboutModule -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIABOUTMODULE - - AboutRedirector() {} - - static nsresult - Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); - -protected: - virtual ~AboutRedirector() {} -}; - -} // namespace browser -} // namespace mozilla - -#endif // AboutRedirector_h__ diff --git a/application/palemoon/base/content/abouthome/aboutHome.css b/application/palemoon/components/abouthome/aboutHome.css index 73c686202..2b062e8e7 100644 --- a/application/palemoon/base/content/abouthome/aboutHome.css +++ b/application/palemoon/components/abouthome/aboutHome.css @@ -262,9 +262,11 @@ body[narrow] #restorePreviousSession { content: url("chrome://browser/content/abouthome/addons.png"); } +%ifdef MOZ_SERVICES_SYNC #sync::before { content: url("chrome://browser/content/abouthome/sync.png"); } +%endif #settings::before { content: url("chrome://browser/content/abouthome/settings.png"); @@ -320,9 +322,11 @@ body[narrow] #restorePreviousSession::before { content: url("chrome://browser/content/abouthome/addons@2x.png"); } +%ifdef MOZ_SERVICES_SYNC #sync::before { content: url("chrome://browser/content/abouthome/sync@2x.png"); } +%endif #settings::before { content: url("chrome://browser/content/abouthome/settings@2x.png"); diff --git a/application/palemoon/base/content/abouthome/aboutHome.js b/application/palemoon/components/abouthome/aboutHome.js index 6ff8eee98..6ff8eee98 100644 --- a/application/palemoon/base/content/abouthome/aboutHome.js +++ b/application/palemoon/components/abouthome/aboutHome.js diff --git a/application/palemoon/base/content/abouthome/aboutHome.xhtml b/application/palemoon/components/abouthome/aboutHome.xhtml index cb3fa634a..d72ec492e 100644 --- a/application/palemoon/base/content/abouthome/aboutHome.xhtml +++ b/application/palemoon/components/abouthome/aboutHome.xhtml @@ -51,7 +51,9 @@ <button class="launchButton" id="bookmarks">&abouthome.bookmarksButton.label;</button> <button class="launchButton" id="history">&abouthome.historyButton.label;</button> <button class="launchButton" id="addons">&abouthome.addonsButton.label;</button> +#ifdef MOZ_SERVICES_SYNC <button class="launchButton" id="sync">&abouthome.syncButton.label;</button> +#endif <button class="launchButton" id="settings">&abouthome.settingsButton.label;</button> <div id="restorePreviousSessionSeparator"/> <button class="launchButton" id="restorePreviousSession">&historyRestoreLastSession.label;</button> diff --git a/application/palemoon/base/content/abouthome/addons.png b/application/palemoon/components/abouthome/addons.png Binary files differindex 41519ce49..41519ce49 100644 --- a/application/palemoon/base/content/abouthome/addons.png +++ b/application/palemoon/components/abouthome/addons.png diff --git a/application/palemoon/base/content/abouthome/addons@2x.png b/application/palemoon/components/abouthome/addons@2x.png Binary files differindex d4d04ee8c..d4d04ee8c 100644 --- a/application/palemoon/base/content/abouthome/addons@2x.png +++ b/application/palemoon/components/abouthome/addons@2x.png diff --git a/application/palemoon/base/content/abouthome/bookmarks.png b/application/palemoon/components/abouthome/bookmarks.png Binary files differindex 5c7e194a6..5c7e194a6 100644 --- a/application/palemoon/base/content/abouthome/bookmarks.png +++ b/application/palemoon/components/abouthome/bookmarks.png diff --git a/application/palemoon/base/content/abouthome/bookmarks@2x.png b/application/palemoon/components/abouthome/bookmarks@2x.png Binary files differindex 7ede00744..7ede00744 100644 --- a/application/palemoon/base/content/abouthome/bookmarks@2x.png +++ b/application/palemoon/components/abouthome/bookmarks@2x.png diff --git a/application/palemoon/base/content/abouthome/downloads.png b/application/palemoon/components/abouthome/downloads.png Binary files differindex 3d4d10e7a..3d4d10e7a 100644 --- a/application/palemoon/base/content/abouthome/downloads.png +++ b/application/palemoon/components/abouthome/downloads.png diff --git a/application/palemoon/base/content/abouthome/downloads@2x.png b/application/palemoon/components/abouthome/downloads@2x.png Binary files differindex d384a22c6..d384a22c6 100644 --- a/application/palemoon/base/content/abouthome/downloads@2x.png +++ b/application/palemoon/components/abouthome/downloads@2x.png diff --git a/application/palemoon/base/content/abouthome/history.png b/application/palemoon/components/abouthome/history.png Binary files differindex ae742b1aa..ae742b1aa 100644 --- a/application/palemoon/base/content/abouthome/history.png +++ b/application/palemoon/components/abouthome/history.png diff --git a/application/palemoon/base/content/abouthome/history@2x.png b/application/palemoon/components/abouthome/history@2x.png Binary files differindex 696902e7c..696902e7c 100644 --- a/application/palemoon/base/content/abouthome/history@2x.png +++ b/application/palemoon/components/abouthome/history@2x.png diff --git a/application/palemoon/components/abouthome/jar.mn b/application/palemoon/components/abouthome/jar.mn new file mode 100644 index 000000000..e1ae4ac42 --- /dev/null +++ b/application/palemoon/components/abouthome/jar.mn @@ -0,0 +1,33 @@ +# 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/abouthome/aboutHome.xhtml + content/browser/abouthome/aboutHome.js +* content/browser/abouthome/aboutHome.css + content/browser/abouthome/noise.png + content/browser/abouthome/snippet1.png + content/browser/abouthome/snippet2.png + content/browser/abouthome/downloads.png + content/browser/abouthome/bookmarks.png + content/browser/abouthome/history.png + content/browser/abouthome/addons.png +#ifdef MOZ_SERVICES_SYNC + content/browser/abouthome/sync.png +#endif + content/browser/abouthome/settings.png + content/browser/abouthome/restore.png + content/browser/abouthome/restore-large.png + content/browser/abouthome/snippet1@2x.png + content/browser/abouthome/snippet2@2x.png + content/browser/abouthome/downloads@2x.png + content/browser/abouthome/bookmarks@2x.png + content/browser/abouthome/history@2x.png + content/browser/abouthome/addons@2x.png +#ifdef MOZ_SERVICES_SYNC + content/browser/abouthome/sync@2x.png +#endif + content/browser/abouthome/settings@2x.png + content/browser/abouthome/restore@2x.png + content/browser/abouthome/restore-large@2x.png
\ No newline at end of file diff --git a/application/basilisk/components/contextualidentity/moz.build b/application/palemoon/components/abouthome/moz.build index aac3a838c..2d64d506c 100644 --- a/application/basilisk/components/contextualidentity/moz.build +++ b/application/palemoon/components/abouthome/moz.build @@ -1,7 +1,8 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# -*- 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/base/content/abouthome/noise.png b/application/palemoon/components/abouthome/noise.png Binary files differindex 3467cf4d4..3467cf4d4 100644 --- a/application/palemoon/base/content/abouthome/noise.png +++ b/application/palemoon/components/abouthome/noise.png diff --git a/application/palemoon/base/content/abouthome/restore-large.png b/application/palemoon/components/abouthome/restore-large.png Binary files differindex ef593e6e1..ef593e6e1 100644 --- a/application/palemoon/base/content/abouthome/restore-large.png +++ b/application/palemoon/components/abouthome/restore-large.png diff --git a/application/palemoon/base/content/abouthome/restore-large@2x.png b/application/palemoon/components/abouthome/restore-large@2x.png Binary files differindex d5c71d0b0..d5c71d0b0 100644 --- a/application/palemoon/base/content/abouthome/restore-large@2x.png +++ b/application/palemoon/components/abouthome/restore-large@2x.png diff --git a/application/palemoon/base/content/abouthome/restore.png b/application/palemoon/components/abouthome/restore.png Binary files differindex 5c3d6f437..5c3d6f437 100644 --- a/application/palemoon/base/content/abouthome/restore.png +++ b/application/palemoon/components/abouthome/restore.png diff --git a/application/palemoon/base/content/abouthome/restore@2x.png b/application/palemoon/components/abouthome/restore@2x.png Binary files differindex 5acb63052..5acb63052 100644 --- a/application/palemoon/base/content/abouthome/restore@2x.png +++ b/application/palemoon/components/abouthome/restore@2x.png diff --git a/application/palemoon/base/content/abouthome/settings.png b/application/palemoon/components/abouthome/settings.png Binary files differindex 4b0c30990..4b0c30990 100644 --- a/application/palemoon/base/content/abouthome/settings.png +++ b/application/palemoon/components/abouthome/settings.png diff --git a/application/palemoon/base/content/abouthome/settings@2x.png b/application/palemoon/components/abouthome/settings@2x.png Binary files differindex c77cb9a92..c77cb9a92 100644 --- a/application/palemoon/base/content/abouthome/settings@2x.png +++ b/application/palemoon/components/abouthome/settings@2x.png diff --git a/application/palemoon/base/content/abouthome/snippet1.png b/application/palemoon/components/abouthome/snippet1.png Binary files differindex ce2ec55c2..ce2ec55c2 100644 --- a/application/palemoon/base/content/abouthome/snippet1.png +++ b/application/palemoon/components/abouthome/snippet1.png diff --git a/application/palemoon/base/content/abouthome/snippet1@2x.png b/application/palemoon/components/abouthome/snippet1@2x.png Binary files differindex f57cd0a82..f57cd0a82 100644 --- a/application/palemoon/base/content/abouthome/snippet1@2x.png +++ b/application/palemoon/components/abouthome/snippet1@2x.png diff --git a/application/palemoon/base/content/abouthome/snippet2.png b/application/palemoon/components/abouthome/snippet2.png Binary files differindex e0724fb6d..e0724fb6d 100644 --- a/application/palemoon/base/content/abouthome/snippet2.png +++ b/application/palemoon/components/abouthome/snippet2.png diff --git a/application/palemoon/base/content/abouthome/snippet2@2x.png b/application/palemoon/components/abouthome/snippet2@2x.png Binary files differindex 40577f52f..40577f52f 100644 --- a/application/palemoon/base/content/abouthome/snippet2@2x.png +++ b/application/palemoon/components/abouthome/snippet2@2x.png diff --git a/application/palemoon/base/content/abouthome/sync.png b/application/palemoon/components/abouthome/sync.png Binary files differindex 11e40cc93..11e40cc93 100644 --- a/application/palemoon/base/content/abouthome/sync.png +++ b/application/palemoon/components/abouthome/sync.png diff --git a/application/palemoon/base/content/abouthome/sync@2x.png b/application/palemoon/components/abouthome/sync@2x.png Binary files differindex 6354f5bf9..6354f5bf9 100644 --- a/application/palemoon/base/content/abouthome/sync@2x.png +++ b/application/palemoon/components/abouthome/sync@2x.png diff --git a/application/palemoon/components/build/moz.build b/application/palemoon/components/build/moz.build index c85723e16..ea1f77163 100644 --- a/application/palemoon/components/build/moz.build +++ b/application/palemoon/components/build/moz.build @@ -4,18 +4,13 @@ # 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/. -EXPORTS += [ - 'nsBrowserCompsCID.h', -] +EXPORTS += ['nsBrowserCompsCID.h'] -SOURCES += [ - 'nsModule.cpp', -] +SOURCES += ['nsModule.cpp'] XPCOMBinaryComponent('browsercomps') LOCAL_INCLUDES += [ - '../about', '../dirprovider', '../feeds', '../shell', diff --git a/application/palemoon/components/build/nsBrowserCompsCID.h b/application/palemoon/components/build/nsBrowserCompsCID.h index 23670ae80..bbaa9ab8a 100644 --- a/application/palemoon/components/build/nsBrowserCompsCID.h +++ b/application/palemoon/components/build/nsBrowserCompsCID.h @@ -26,10 +26,6 @@ #define NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID \ { 0x136e2c4d, 0xc5a4, 0x477c, { 0xb1, 0x31, 0xd9, 0x3d, 0x7d, 0x70, 0x4f, 0x64 } } -// 7e4bb6ad-2fc4-4dc6-89ef-23e8e5ccf980 -#define NS_BROWSER_ABOUT_REDIRECTOR_CID \ -{ 0x7e4bb6ad, 0x2fc4, 0x4dc6, { 0x89, 0xef, 0x23, 0xe8, 0xe5, 0xcc, 0xf9, 0x80 } } - // {6DEB193C-F87D-4078-BC78-5E64655B4D62} #define NS_BROWSERDIRECTORYPROVIDER_CID \ { 0x6deb193c, 0xf87d, 0x4078, { 0xbc, 0x78, 0x5e, 0x64, 0x65, 0x5b, 0x4d, 0x62 } } diff --git a/application/palemoon/components/build/nsModule.cpp b/application/palemoon/components/build/nsModule.cpp index 304280ca9..f98fc08d7 100644 --- a/application/palemoon/components/build/nsModule.cpp +++ b/application/palemoon/components/build/nsModule.cpp @@ -18,8 +18,6 @@ #include "rdf.h" #include "nsFeedSniffer.h" -#include "AboutRedirector.h" -#include "nsIAboutModule.h" #include "nsNetCID.h" @@ -45,7 +43,6 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID); NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID); #endif NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID); -NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID); #ifdef XP_MACOSX NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID); #endif @@ -58,7 +55,6 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = { { &kNS_SHELLSERVICE_CID, false, nullptr, nsGNOMEShellServiceConstructor }, #endif { &kNS_FEEDSNIFFER_CID, false, nullptr, nsFeedSnifferConstructor }, - { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, nullptr, AboutRedirector::Create }, #ifdef XP_MACOSX { &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor }, #endif @@ -73,22 +69,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = { { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID }, #endif { NS_FEEDSNIFFER_CONTRACTID, &kNS_FEEDSNIFFER_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "certerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "socialerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "feeds", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "privatebrowsing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "rights", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "palemoon", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "robots", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, -#ifdef MOZ_SERVICES_SYNC - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-tabs", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-progress", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, -#endif - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "newtab", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "permissions", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "downloads", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, #ifdef XP_MACOSX { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID }, #endif diff --git a/application/palemoon/components/certerror/jar.mn b/application/palemoon/components/certerror/jar.mn index 64aecae92..08e071027 100644 --- a/application/palemoon/components/certerror/jar.mn +++ b/application/palemoon/components/certerror/jar.mn @@ -3,5 +3,5 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/certerror/aboutCertError.xhtml (content/aboutCertError.xhtml) - content/browser/certerror/aboutCertError.css (content/aboutCertError.css) + content/browser/certerror/aboutCertError.xhtml (content/aboutCertError.xhtml) + content/browser/certerror/aboutCertError.css (content/aboutCertError.css) diff --git a/application/palemoon/components/certerror/moz.build b/application/palemoon/components/certerror/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/components/certerror/moz.build +++ b/application/palemoon/components/certerror/moz.build @@ -4,5 +4,4 @@ # 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']
\ No newline at end of file diff --git a/application/palemoon/components/dirprovider/moz.build b/application/palemoon/components/dirprovider/moz.build index e51e63449..b01c4a3bc 100644 --- a/application/palemoon/components/dirprovider/moz.build +++ b/application/palemoon/components/dirprovider/moz.build @@ -4,16 +4,10 @@ # 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/. -EXPORTS.mozilla.browser += [ - 'DirectoryProvider.h', -] +EXPORTS.mozilla.browser += ['DirectoryProvider.h'] -SOURCES += [ - 'DirectoryProvider.cpp', -] +SOURCES += ['DirectoryProvider.cpp'] FINAL_LIBRARY = 'browsercomps' -LOCAL_INCLUDES += [ - '../build' -] +LOCAL_INCLUDES += ['../build'] diff --git a/application/palemoon/components/distribution.js b/application/palemoon/components/distribution.js index d3300604e..121e55b1b 100644 --- a/application/palemoon/components/distribution.js +++ b/application/palemoon/components/distribution.js @@ -38,13 +38,7 @@ DistributionCustomizer.prototype = { }, get _locale() { - let locale; - try { - locale = this._prefs.getCharPref("general.useragent.locale"); - } - catch (e) { - locale = "en-US"; - } + let locale = this._prefs.getCharPref("general.useragent.locale", "en-US"); this.__defineGetter__("_locale", function() locale); return this._locale; }, @@ -221,11 +215,7 @@ DistributionCustomizer.prototype = { this._ini.getString("Global", "id") + ".bookmarksProcessed"; } - let bmProcessed = false; - try { - bmProcessed = this._prefs.getBoolPref(bmProcessedPref); - } - catch (e) {} + let bmProcessed = this._prefs.getBoolPref(bmProcessedPref, false); if (!bmProcessed) { if (sections["BookmarksMenu"]) diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm index bd5d55a73..efe31ce05 100644 --- a/application/palemoon/components/downloads/DownloadsCommon.jsm +++ b/application/palemoon/components/downloads/DownloadsCommon.jsm @@ -21,15 +21,9 @@ this.EXPORTED_SYMBOLS = [ * * DownloadsData * Retrieves the list of past and completed downloads from the underlying - * Download Manager data, and provides asynchronous notifications allowing + * Downloads API data, and provides asynchronous notifications allowing * to build a consistent view of the available data. * - * DownloadsDataItem - * Represents a single item in the list of downloads. This object either wraps - * an existing nsIDownload from the Download Manager, or provides the same - * information read directly from the downloads database, with the possibility - * of querying the nsIDownload lazily, for performance reasons. - * * DownloadsIndicatorData * This object registers itself with DownloadsData as a view, and transforms the * notifications it receives into overall status data, that is then broadcast to @@ -57,6 +51,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "DownloadUIHelper", "resource://gre/modules/DownloadUIHelper.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils", "resource://gre/modules/DownloadUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", + "resource://gre/modules/FileUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm") XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", @@ -94,11 +90,6 @@ const kDownloadsStringsRequiringPluralForm = { otherDownloads2: true }; -XPCOMUtils.defineLazyGetter(this, "DownloadsLocalFileCtor", function () { - return Components.Constructor("@mozilla.org/file/local;1", - "nsILocalFile", "initWithPath"); -}); - const kPartialDownloadSuffix = ".part"; const kPrefBranch = Services.prefs.getBranch("browser.download."); @@ -382,17 +373,27 @@ this.DownloadsCommon = { }, /** - * Given an iterable collection of DownloadDataItems, generates and returns + * Helper function required because the Downloads Panel and the Downloads View + * don't share the controller yet. + */ + removeAndFinalizeDownload(download) { + Downloads.getList(Downloads.ALL) + .then(list => list.remove(download)) + .then(() => download.finalize(true)) + .catch(Cu.reportError); + }, + + /** + * Given an iterable collection of Download objects, generates and returns * statistics about that collection. * - * @param aDataItems An iterable collection of DownloadDataItems. + * @param downloads An iterable collection of Download objects. * * @return Object whose properties are the generated statistics. Currently, * we return the following properties: * * numActive : The total number of downloads. * numPaused : The total number of paused downloads. - * numScanning : The total number of downloads being scanned. * numDownloading : The total number of downloads being downloaded. * totalSize : The total size of all downloads once completed. * totalTransferred: The total amount of transferred data for these @@ -402,55 +403,48 @@ this.DownloadsCommon = { * complete. * percentComplete : The percentage of bytes successfully downloaded. */ - summarizeDownloads: function DC_summarizeDownloads(aDataItems) - { + summarizeDownloads(downloads) { let summary = { numActive: 0, numPaused: 0, - numScanning: 0, numDownloading: 0, totalSize: 0, totalTransferred: 0, // slowestSpeed is Infinity so that we can use Math.min to // find the slowest speed. We'll set this to 0 afterwards if // it's still at Infinity by the time we're done iterating all - // dataItems. + // download. slowestSpeed: Infinity, rawTimeLeft: -1, percentComplete: -1 } - for (let dataItem of aDataItems) { + for (let download of downloads) { summary.numActive++; - switch (dataItem.state) { - case nsIDM.DOWNLOAD_PAUSED: - summary.numPaused++; - break; - case nsIDM.DOWNLOAD_SCANNING: - summary.numScanning++; - break; - case nsIDM.DOWNLOAD_DOWNLOADING: - summary.numDownloading++; - if (dataItem.maxBytes > 0 && dataItem.speed > 0) { - let sizeLeft = dataItem.maxBytes - dataItem.currBytes; - summary.rawTimeLeft = Math.max(summary.rawTimeLeft, - sizeLeft / dataItem.speed); - summary.slowestSpeed = Math.min(summary.slowestSpeed, - dataItem.speed); - } - break; + + if (!download.stopped) { + summary.numDownloading++; + if (download.hasProgress && download.speed > 0) { + let sizeLeft = download.totalBytes - download.currentBytes; + summary.rawTimeLeft = Math.max(summary.rawTimeLeft, + sizeLeft / download.speed); + summary.slowestSpeed = Math.min(summary.slowestSpeed, + download.speed); + } + } else if (download.canceled && download.hasPartialData) { + summary.numPaused++; } // Only add to total values if we actually know the download size. - if (dataItem.maxBytes > 0 && - dataItem.state != nsIDM.DOWNLOAD_CANCELED && - dataItem.state != nsIDM.DOWNLOAD_FAILED) { - summary.totalSize += dataItem.maxBytes; - summary.totalTransferred += dataItem.currBytes; + if (download.succeeded) { + summary.totalSize += download.target.size; + summary.totalTransferred += download.target.size; + } else if (download.hasProgress) { + summary.totalSize += download.totalBytes; + summary.totalTransferred += download.currentBytes; } } - if (summary.numActive != 0 && summary.totalSize != 0 && - summary.numActive != summary.numScanning) { + if (summary.totalSize != 0) { summary.percentComplete = (summary.totalTransferred / summary.totalSize) * 100; } @@ -501,7 +495,7 @@ this.DownloadsCommon = { /** * Opens a downloaded file. - * If you've a dataItem, you should call dataItem.openLocalFile. + * * @param aFile * the downloaded file to be opened. * @param aMimeInfo @@ -574,7 +568,6 @@ this.DownloadsCommon = { /** * Show a downloaded file in the system file manager. - * If you have a dataItem, use dataItem.showLocalFile. * * @param aFile * a downloaded file. @@ -651,19 +644,12 @@ XPCOMUtils.defineLazyGetter(DownloadsCommon, "useJSTransfer", function () { function DownloadsDataCtor(aPrivate) { this._isPrivate = aPrivate; - // This Object contains all the available DownloadsDataItem objects, indexed by - // their globally unique identifier. The identifiers of downloads that have - // been removed from the Download Manager data are still present, however the - // associated objects are replaced with the value "null". This is required to - // prevent race conditions when populating the list asynchronously. - this.dataItems = {}; + // Contains all the available Download objects and their integer state. + this.oldDownloadStates = new Map(); // Array of view objects that should be notified when the available download // data changes. this._views = []; - - // Maps Download objects to DownloadDataItem objects. - this._downloadToDataItemMap = new Map(); } DownloadsDataCtor.prototype = { @@ -690,12 +676,19 @@ DownloadsDataCtor.prototype = { }, /** + * Iterator for all the available Download objects. This is empty until the + * data has been loaded using the JavaScript API for downloads. + */ + get downloads() this.oldDownloadStates.keys(), + + /** * True if there are finished downloads that can be removed from the list. */ get canRemoveFinished() { - for (let [, dataItem] of Iterator(this.dataItems)) { - if (dataItem && !dataItem.inProgress) { + for (let download of this.downloads) { + // Stopped, paused, and failed downloads with partial data are removed. + if (download.stopped && !(download.canceled && download.hasPartialData)) { return true; } } @@ -716,103 +709,87 @@ DownloadsDataCtor.prototype = { ////////////////////////////////////////////////////////////////////////////// //// Integration with the asynchronous Downloads back-end - onDownloadAdded: function (aDownload) - { - let dataItem = new DownloadsDataItem(aDownload); - this._downloadToDataItemMap.set(aDownload, dataItem); - this.dataItems[dataItem.downloadGuid] = dataItem; - - for (let view of this._views) { - view.onDataItemAdded(dataItem, true); - } - - this._updateDataItemState(dataItem); - }, - - onDownloadChanged: function (aDownload) - { - let dataItem = this._downloadToDataItemMap.get(aDownload); - if (!dataItem) { - Cu.reportError("Download doesn't exist."); - return; - } + onDownloadAdded(download) { + // Download objects do not store the end time of downloads, as the Downloads + // API does not need to persist this information for all platforms. Once a + // download terminates on a Desktop browser, it becomes a history download, + // for which the end time is stored differently, as a Places annotation. + download.endTime = Date.now(); - this._updateDataItemState(dataItem); - }, + this.oldDownloadStates.set(download, + DownloadsCommon.stateOfDownload(download)); - onDownloadRemoved: function (aDownload) - { - let dataItem = this._downloadToDataItemMap.get(aDownload); - if (!dataItem) { - Cu.reportError("Download doesn't exist."); - return; - } - - this._downloadToDataItemMap.delete(aDownload); - this.dataItems[dataItem.downloadGuid] = null; for (let view of this._views) { - view.onDataItemRemoved(dataItem); - } - }, - - /** - * Updates the given data item and sends related notifications. - */ - _updateDataItemState: function (aDataItem) - { - let oldState = aDataItem.state; - let wasInProgress = aDataItem.inProgress; - let wasDone = aDataItem.done; - - aDataItem.updateFromJSDownload(); - - if (wasInProgress && !aDataItem.inProgress) { - aDataItem.endTime = Date.now(); - } + view.onDownloadAdded(download, true); + } + }, + + onDownloadChanged(download) { + let oldState = this.oldDownloadStates.get(download); + let newState = DownloadsCommon.stateOfDownload(download); + this.oldDownloadStates.set(download, newState); + + if (oldState != newState) { + if (download.succeeded || + (download.canceled && !download.hasPartialData) || + download.error) { + // Store the end time that may be displayed by the views. + download.endTime = Date.now(); + + // This state transition code should actually be located in a Downloads + // API module (bug 941009). Moreover, the fact that state is stored as + // annotations should be ideally hidden behind methods of + // nsIDownloadHistory (bug 830415). + if (!this._isPrivate) { + try { + let downloadMetaData = { + state: DownloadsCommon.stateOfDownload(download), + endTime: download.endTime, + }; + if (download.succeeded) { + downloadMetaData.fileSize = download.target.size; + } + + PlacesUtils.annotations.setPageAnnotation( + NetUtil.newURI(download.source.url), + "downloads/metaData", + JSON.stringify(downloadMetaData), 0, + PlacesUtils.annotations.EXPIRE_WITH_HISTORY); + } catch (ex) { + Cu.reportError(ex); + } + } + } - if (oldState != aDataItem.state) { for (let view of this._views) { try { - view.getViewItem(aDataItem).onStateChange(oldState); + view.onDownloadStateChanged(download); } catch (ex) { Cu.reportError(ex); } } - // This state transition code should actually be located in a Downloads - // API module (bug 941009). Moreover, the fact that state is stored as - // annotations should be ideally hidden behind methods of - // nsIDownloadHistory (bug 830415). - if (!this._isPrivate && !aDataItem.inProgress) { - try { - let downloadMetaData = { state: aDataItem.state, - endTime: aDataItem.endTime }; - if (aDataItem.done) { - downloadMetaData.fileSize = aDataItem.maxBytes; - } - - // RRR: Annotation service throws here. commented out for now. - /*PlacesUtils.annotations.setPageAnnotation( - NetUtil.newURI(aDataItem.uri), "downloads/metaData", - JSON.stringify(downloadMetaData), 0, - PlacesUtils.annotations.EXPIRE_WITH_HISTORY);*/ - } catch (ex) { - Cu.reportError(ex); - } + if (download.succeeded || + (download.error && download.error.becauseBlocked)) { + this._notifyDownloadEvent("finish"); } } - if (!aDataItem.newDownloadNotified) { - aDataItem.newDownloadNotified = true; + if (!download.newDownloadNotified) { + download.newDownloadNotified = true; this._notifyDownloadEvent("start"); } - if (!wasDone && aDataItem.done) { - this._notifyDownloadEvent("finish"); + for (let view of this._views) { + view.onDownloadChanged(download); } + }, + + onDownloadRemoved(download) { + this.oldDownloadStates.delete(download); for (let view of this._views) { - view.getViewItem(aDataItem).onProgressChange(); + view.onDownloadRemoved(download); } }, @@ -864,19 +841,9 @@ DownloadsDataCtor.prototype = { //let loadedItemsArray = [dataItem // for each (dataItem in this.dataItems) // if (dataItem)]; - - let loadedItemsArray = []; - - for each (let dataItem in this.dataItems) { - if (dataItem) { - loadedItemsArray.push(dataItem); - } - } - - loadedItemsArray.sort(function(a, b) b.startTime - a.startTime); - loadedItemsArray.forEach( - function (dataItem) aView.onDataItemAdded(dataItem, false) - ); + let downloadsArray = [...this.downloads]; + downloadsArray.sort((a, b) => b.startTime - a.startTime); + downloadsArray.forEach(download => aView.onDownloadAdded(download, false)); // Notify the view that all data is available unless loading is in progress. if (!this._pendingStatement) { @@ -1328,410 +1295,6 @@ XPCOMUtils.defineLazyGetter(this, "DownloadsData", function() { }); //////////////////////////////////////////////////////////////////////////////// -//// DownloadsDataItem - -/** - * Represents a single item in the list of downloads. This object either wraps - * an existing nsIDownload from the Download Manager, or provides the same - * information read directly from the downloads database, with the possibility - * of querying the nsIDownload lazily, for performance reasons. - * - * @param aSource - * Object containing the data with which the item should be initialized. - * This should implement either nsIDownload or mozIStorageRow. If the - * JavaScript API for downloads is enabled, this is a Download object. - */ -function DownloadsDataItem(aSource) -{ - this._initFromJSDownload(aSource); -} - -DownloadsDataItem.prototype = { - /** - * The JavaScript API does not need identifiers for Download objects, so they - * are generated sequentially for the corresponding DownloadDataItem. - */ - get _autoIncrementId() ++DownloadsDataItem.prototype.__lastId, - __lastId: 0, - - /** - * Initializes this object from the JavaScript API for downloads. - * - * The endTime property is initialized to the current date and time. - * - * @param aDownload - * The Download object with the current state. - */ - _initFromJSDownload: function (aDownload) - { - this._download = aDownload; - - this.downloadGuid = "id:" + this._autoIncrementId; - this.file = aDownload.target.path; - this.target = OS.Path.basename(aDownload.target.path); - this.uri = aDownload.source.url; - this.endTime = Date.now(); - - this.updateFromJSDownload(); - }, - - /** - * Updates this object from the JavaScript API for downloads. - */ - updateFromJSDownload: function () - { - // Collapse state using the correct priority. - if (this._download.succeeded) { - this.state = nsIDM.DOWNLOAD_FINISHED; - } else if (this._download.error && - this._download.error.becauseBlockedByParentalControls) { - this.state = nsIDM.DOWNLOAD_BLOCKED_PARENTAL; - } else if (this._download.error) { - this.state = nsIDM.DOWNLOAD_FAILED; - } else if (this._download.canceled && this._download.hasPartialData) { - this.state = nsIDM.DOWNLOAD_PAUSED; - } else if (this._download.canceled) { - this.state = nsIDM.DOWNLOAD_CANCELED; - } else if (this._download.stopped) { - this.state = nsIDM.DOWNLOAD_NOTSTARTED; - } else { - this.state = nsIDM.DOWNLOAD_DOWNLOADING; - } - - this.referrer = this._download.source.referrer; - this.startTime = this._download.startTime; - this.currBytes = this._download.currentBytes; - this.resumable = this._download.hasPartialData; - this.speed = this._download.speed; - - if (this._download.succeeded) { - // If the download succeeded, show the final size if available, otherwise - // use the last known number of bytes transferred. The final size on disk - // will be available when bug 941063 is resolved. - this.maxBytes = this._download.hasProgress ? - this._download.totalBytes : - this._download.currentBytes; - this.percentComplete = 100; - } else if (this._download.hasProgress) { - // If the final size and progress are known, use them. - this.maxBytes = this._download.totalBytes; - this.percentComplete = this._download.progress; - } else { - // The download final size and progress percentage is unknown. - this.maxBytes = -1; - this.percentComplete = -1; - } - }, - - /** - * Initializes this object from a download object of the Download Manager. - * - * The endTime property is initialized to the current date and time. - * - * @param aDownload - * The nsIDownload with the current state. - */ - _initFromDownload: function DDI_initFromDownload(aDownload) - { - this._download = aDownload; - - // Fetch all the download properties eagerly. - this.downloadGuid = aDownload.guid; - this.file = aDownload.target.spec; - this.target = aDownload.displayName; - this.uri = aDownload.source.spec; - this.referrer = aDownload.referrer && aDownload.referrer.spec; - this.state = aDownload.state; - this.startTime = Math.round(aDownload.startTime / 1000); - this.endTime = Date.now(); - this.currBytes = aDownload.amountTransferred; - this.maxBytes = aDownload.size; - this.resumable = aDownload.resumable; - this.speed = aDownload.speed; - this.percentComplete = aDownload.percentComplete; - }, - - /** - * Initializes this object from a data row in the downloads database, without - * querying the associated nsIDownload object, to improve performance when - * loading the list of downloads asynchronously. - * - * When this object is initialized in this way, accessing the "download" - * property loads the underlying nsIDownload object synchronously, and should - * be avoided unless the object is really required. - * - * @param aStorageRow - * The mozIStorageRow from the downloads database. - */ - _initFromDataRow: function DDI_initFromDataRow(aStorageRow) - { - // Get the download properties from the data row. - this._download = null; - this.downloadGuid = aStorageRow.getResultByName("guid"); - this.file = aStorageRow.getResultByName("target"); - this.target = aStorageRow.getResultByName("name"); - this.uri = aStorageRow.getResultByName("source"); - this.referrer = aStorageRow.getResultByName("referrer"); - this.state = aStorageRow.getResultByName("state"); - this.startTime = Math.round(aStorageRow.getResultByName("startTime") / 1000); - this.endTime = Math.round(aStorageRow.getResultByName("endTime") / 1000); - this.currBytes = aStorageRow.getResultByName("currBytes"); - this.maxBytes = aStorageRow.getResultByName("maxBytes"); - - // Now we have to determine if the download is resumable, but don't want to - // access the underlying download object unnecessarily. The only case where - // the property is relevant is when we are currently downloading data, and - // in this case the download object is already loaded in memory or will be - // loaded very soon in any case. In all the other cases, including a paused - // download, we assume that the download is resumable. The property will be - // updated as soon as the underlying download state changes. - - // We'll start by assuming we're resumable, and then if we're downloading, - // update resumable property in case we were wrong. - this.resumable = true; - - if (this.state == nsIDM.DOWNLOAD_DOWNLOADING) { - this.getDownload(function(aDownload) { - this.resumable = aDownload.resumable; - }.bind(this)); - } - - // Compute the other properties without accessing the download object. - this.speed = 0; - this.percentComplete = this.maxBytes <= 0 - ? -1 - : Math.round(this.currBytes / this.maxBytes * 100); - }, - - /** - * Asynchronous getter for the download object corresponding to this data item. - * - * @param aCallback - * A callback function which will be called when the download object is - * available. It should accept one argument which will be the download - * object. - */ - getDownload: function DDI_getDownload(aCallback) { - if (this._download) { - // Return the download object asynchronously to the caller - let download = this._download; - Services.tm.mainThread.dispatch(function () aCallback(download), - Ci.nsIThread.DISPATCH_NORMAL); - } else { - Services.downloads.getDownloadByGUID(this.downloadGuid, - function(aStatus, aResult) { - if (!Components.isSuccessCode(aStatus)) { - Cu.reportError( - new Components.Exception("Cannot retrieve download for GUID: " + - this.downloadGuid)); - } else { - this._download = aResult; - aCallback(aResult); - } - }.bind(this)); - } - }, - - /** - * Indicates whether the download is proceeding normally, and not finished - * yet. This includes paused downloads. When this property is true, the - * "progress" property represents the current progress of the download. - */ - get inProgress() - { - return [ - nsIDM.DOWNLOAD_NOTSTARTED, - nsIDM.DOWNLOAD_QUEUED, - nsIDM.DOWNLOAD_DOWNLOADING, - nsIDM.DOWNLOAD_PAUSED, - nsIDM.DOWNLOAD_SCANNING, - ].indexOf(this.state) != -1; - }, - - /** - * This is true during the initial phases of a download, before the actual - * download of data bytes starts. - */ - get starting() - { - return this.state == nsIDM.DOWNLOAD_NOTSTARTED || - this.state == nsIDM.DOWNLOAD_QUEUED; - }, - - /** - * Indicates whether the download is paused. - */ - get paused() - { - return this.state == nsIDM.DOWNLOAD_PAUSED; - }, - - /** - * Indicates whether the download is in a final state, either because it - * completed successfully or because it was blocked. - */ - get done() - { - return [ - nsIDM.DOWNLOAD_FINISHED, - nsIDM.DOWNLOAD_BLOCKED_PARENTAL, - nsIDM.DOWNLOAD_BLOCKED_POLICY, - nsIDM.DOWNLOAD_DIRTY, - ].indexOf(this.state) != -1; - }, - - /** - * Indicates whether the download is finished and can be opened. - */ - get openable() - { - return this.state == nsIDM.DOWNLOAD_FINISHED; - }, - - /** - * Indicates whether the download stopped because of an error, and can be - * resumed manually. - */ - get canRetry() - { - return this.state == nsIDM.DOWNLOAD_CANCELED || - this.state == nsIDM.DOWNLOAD_FAILED; - }, - - /** - * Returns the nsILocalFile for the download target. - * - * @throws if the native path is not valid. This can happen if the same - * profile is used on different platforms, for example if a native - * Windows path is stored and then the item is accessed on a Mac. - */ - get localFile() - { - return this._getFile(this.file); - }, - - /** - * Returns the nsILocalFile for the partially downloaded target. - * - * @throws if the native path is not valid. This can happen if the same - * profile is used on different platforms, for example if a native - * Windows path is stored and then the item is accessed on a Mac. - */ - get partFile() - { - return this._getFile(this.file + kPartialDownloadSuffix); - }, - - /** - * Returns an nsILocalFile for aFilename. aFilename might be a file URL or - * a native path. - * - * @param aFilename the filename of the file to retrieve. - * @return an nsILocalFile for the file. - * @throws if the native path is not valid. This can happen if the same - * profile is used on different platforms, for example if a native - * Windows path is stored and then the item is accessed on a Mac. - * @note This function makes no guarantees about the file's existence - - * callers should check that the returned file exists. - */ - _getFile: function DDI__getFile(aFilename) - { - // The download database may contain targets stored as file URLs or native - // paths. This can still be true for previously stored items, even if new - // items are stored using their file URL. See also bug 239948 comment 12. - if (aFilename.startsWith("file:")) { - // Assume the file URL we obtained from the downloads database or from the - // "spec" property of the target has the UTF-8 charset. - let fileUrl = NetUtil.newURI(aFilename).QueryInterface(Ci.nsIFileURL); - return fileUrl.file.clone().QueryInterface(Ci.nsILocalFile); - } else { - // The downloads database contains a native path. Try to create a local - // file, though this may throw an exception if the path is invalid. - return new DownloadsLocalFileCtor(aFilename); - } - }, - - /** - * Open the target file for this download. - * - * @param aOwnerWindow - * The window with which the required action is associated. - * @throws if the file cannot be opened. - */ - openLocalFile: function DDI_openLocalFile(aOwnerWindow) { - this._download.launch().then(null, Cu.reportError); - return; - }, - - /** - * Show the downloaded file in the system file manager. - */ - showLocalFile: function DDI_showLocalFile() { - DownloadsCommon.showDownloadedFile(this.localFile); - }, - - /** - * Resumes the download if paused, pauses it if active. - * @throws if the download is not resumable or if has already done. - */ - togglePauseResume: function DDI_togglePauseResume() { - if (this._download.stopped) { - this._download.start(); - } else { - this._download.cancel(); - } - return; - }, - - /** - * Attempts to retry the download. - * @throws if we cannot. - */ - retry: function DDI_retry() { - this._download.start(); - return; - }, - - /** - * Support function that deletes the local file for a download. This is - * used in cases where the Download Manager service doesn't delete the file - * from disk when cancelling. See bug 732924. - */ - _ensureLocalFileRemoved: function DDI__ensureLocalFileRemoved() - { - try { - let localFile = this.localFile; - if (localFile.exists()) { - localFile.remove(false); - } - } catch (ex) { } - }, - - /** - * Cancels the download. - * @throws if the download is already done. - */ - cancel: function() { - this._download.cancel(); - this._download.removePartialData().then(null, Cu.reportError); - return; - }, - - /** - * Remove the download. - */ - remove: function DDI_remove() { - let promiseList = this._download.source.isPrivate - ? Downloads.getList(Downloads.PUBLIC) - : Downloads.getList(Downloads.PRIVATE); - promiseList.then(list => list.remove(this._download)) - .then(() => this._download.finalize(true)) - .then(null, Cu.reportError); - return; - } -}; - -//////////////////////////////////////////////////////////////////////////////// //// DownloadsViewPrototype /** @@ -1858,9 +1421,9 @@ const DownloadsViewPrototype = { * Called when a new download data item is available, either during the * asynchronous data load or when a new download is started. * - * @param aDataItem - * DownloadsDataItem object that was just added. - * @param aNewest + * @param download + * Download object that was just added. + * @param newest * When true, indicates that this item is the most recent and should be * added in the topmost position. This happens when a new download is * started. When false, indicates that the item is the least recent @@ -1869,37 +1432,46 @@ const DownloadsViewPrototype = { * * @note Subclasses should override this. */ - onDataItemAdded: function DVP_onDataItemAdded(aDataItem, aNewest) - { + onDownloadAdded(download, newest) { throw Components.results.NS_ERROR_NOT_IMPLEMENTED; }, /** - * Called when a data item is removed, ensures that the widget associated with - * the view item is removed from the user interface. + * Called when the overall state of a Download has changed. In particular, + * this is called only once when the download succeeds or is blocked + * permanently, and is never called if only the current progress changed. * - * @param aDataItem - * DownloadsDataItem object that is being removed. + * The onDownloadChanged notification will always be sent afterwards. * * @note Subclasses should override this. */ - onDataItemRemoved: function DVP_onDataItemRemoved(aDataItem) - { + onDownloadStateChanged(download) { throw Components.results.NS_ERROR_NOT_IMPLEMENTED; }, /** - * Returns the view item associated with the provided data item for this view. + * Called every time any state property of a Download may have changed, + * including progress properties. * - * @param aDataItem - * DownloadsDataItem object for which the view item is requested. + * Note that progress notification changes are throttled at the Downloads.jsm + * API level, and there is no throttling mechanism in the front-end. + * + * @note Subclasses should override this. + */ + onDownloadChanged(download) { + throw Components.results.NS_ERROR_NOT_IMPLEMENTED; + }, + + /** + * Called when a data item is removed, ensures that the widget associated with + * the view item is removed from the user interface. * - * @return Object that can be used to notify item status events. + * @param download + * Download object that is being removed. * * @note Subclasses should override this. */ - getViewItem: function DID_getViewItem(aDataItem) - { + onDownloadRemoved(download) { throw Components.results.NS_ERROR_NOT_IMPLEMENTED; }, @@ -1963,9 +1535,6 @@ DownloadsIndicatorDataCtor.prototype = { ////////////////////////////////////////////////////////////////////////////// //// Callback functions from DownloadsData - /** - * Called after data loading finished. - */ onDataLoadCompleted: function DID_onDataLoadCompleted() { DownloadsViewPrototype.onDataLoadCompleted.call(this); @@ -1982,69 +1551,28 @@ DownloadsIndicatorDataCtor.prototype = { this._itemCount = 0; }, - /** - * Called when a new download data item is available, either during the - * asynchronous data load or when a new download is started. - * - * @param aDataItem - * DownloadsDataItem object that was just added. - * @param aNewest - * When true, indicates that this item is the most recent and should be - * added in the topmost position. This happens when a new download is - * started. When false, indicates that the item is the least recent - * with regard to the items that have been already added. The latter - * generally happens during the asynchronous data load. - */ - onDataItemAdded: function DID_onDataItemAdded(aDataItem, aNewest) - { + onDownloadAdded(download, newest) { this._itemCount++; this._updateViews(); }, - /** - * Called when a data item is removed, ensures that the widget associated with - * the view item is removed from the user interface. - * - * @param aDataItem - * DownloadsDataItem object that is being removed. - */ - onDataItemRemoved: function DID_onDataItemRemoved(aDataItem) - { - this._itemCount--; - this._updateViews(); - }, + onDownloadStateChanged(download) { + if (download.succeeded || download.error) { + this.attention = true; + } - /** - * Returns the view item associated with the provided data item for this view. - * - * @param aDataItem - * DownloadsDataItem object for which the view item is requested. - * - * @return Object that can be used to notify item status events. - */ - getViewItem: function DID_getViewItem(aDataItem) - { - let data = this._isPrivate ? PrivateDownloadsIndicatorData - : DownloadsIndicatorData; - return Object.freeze({ - onStateChange: function DIVI_onStateChange(aOldState) - { - if (aDataItem.state == nsIDM.DOWNLOAD_FINISHED || - aDataItem.state == nsIDM.DOWNLOAD_FAILED) { - data.attention = true; - } + // Since the state of a download changed, reset the estimated time left. + this._lastRawTimeLeft = -1; + this._lastTimeLeft = -1; + }, - // Since the state of a download changed, reset the estimated time left. - data._lastRawTimeLeft = -1; - data._lastTimeLeft = -1; + onDownloadChanged(download) { + this._updateViews(); + }, - data._updateViews(); - }, - onProgressChange: function DIVI_onProgressChange() - { - data._updateViews(); - } - }); + onDownloadRemoved(download) { + this._itemCount--; + this._updateViews(); }, ////////////////////////////////////////////////////////////////////////////// @@ -2135,18 +1663,17 @@ DownloadsIndicatorDataCtor.prototype = { _lastTimeLeft: -1, /** - * A generator function for the dataItems that this summary is currently + * A generator function for the Download objects this summary is currently * interested in. This generator is passed off to summarizeDownloads in order - * to generate statistics about the dataItems we care about - in this case, - * it's all dataItems for active downloads. - */ - _activeDataItems: function DID_activeDataItems() - { - let dataItems = this._isPrivate ? PrivateDownloadsData.dataItems - : DownloadsData.dataItems; - for each (let dataItem in dataItems) { - if (dataItem && dataItem.inProgress) { - yield dataItem; + * to generate statistics about the downloads we care about - in this case, + * it's all active downloads. + */ + * _activeDownloads() { + let downloads = this._isPrivate ? PrivateDownloadsData.downloads + : DownloadsData.downloads; + for (let download of downloads) { + if (!download.stopped || (download.canceled && download.hasPartialData)) { + yield download; } } }, @@ -2157,7 +1684,7 @@ DownloadsIndicatorDataCtor.prototype = { _refreshProperties: function DID_refreshProperties() { let summary = - DownloadsCommon.summarizeDownloads(this._activeDataItems()); + DownloadsCommon.summarizeDownloads(this._activeDownloads()); // Determine if the indicator should be shown or get attention. this._hasDownloads = (this._itemCount > 0); @@ -2218,7 +1745,7 @@ function DownloadsSummaryData(aIsPrivate, aNumToExclude) { // completely separated from one another. this._loading = false; - this._dataItems = []; + this._downloads = []; // Floating point value indicating the last number of seconds estimated until // the longest download will finish. We need to store this value so that we @@ -2258,9 +1785,9 @@ DownloadsSummaryData.prototype = { DownloadsViewPrototype.removeView.call(this, aView); if (this._views.length == 0) { - // Clear out our collection of DownloadDataItems. If we ever have + // Clear out our collection of Download objects. If we ever have // another view registered with us, this will get re-populated. - this._dataItems = []; + this._downloads = []; } }, @@ -2280,40 +1807,30 @@ DownloadsSummaryData.prototype = { this._dataItems = []; }, - onDataItemAdded: function DSD_onDataItemAdded(aDataItem, aNewest) - { - if (aNewest) { - this._dataItems.unshift(aDataItem); + onDownloadAdded(download, newest) { + if (newest) { + this._downloads.unshift(download); } else { - this._dataItems.push(aDataItem); + this._downloads.push(download); } this._updateViews(); }, - onDataItemRemoved: function DSD_onDataItemRemoved(aDataItem) - { - let itemIndex = this._dataItems.indexOf(aDataItem); - this._dataItems.splice(itemIndex, 1); + onDownloadStateChanged() { + // Since the state of a download changed, reset the estimated time left. + this._lastRawTimeLeft = -1; + this._lastTimeLeft = -1; + }, + + onDownloadChanged() { this._updateViews(); }, - getViewItem: function DSD_getViewItem(aDataItem) - { - let self = this; - return Object.freeze({ - onStateChange: function DIVI_onStateChange(aOldState) - { - // Since the state of a download changed, reset the estimated time left. - self._lastRawTimeLeft = -1; - self._lastTimeLeft = -1; - self._updateViews(); - }, - onProgressChange: function DIVI_onProgressChange() - { - self._updateViews(); - } - }); + onDownloadRemoved(download) { + let itemIndex = this._downloads.indexOf(download); + this._downloads.splice(itemIndex, 1); + this._updateViews(); }, ////////////////////////////////////////////////////////////////////////////// @@ -2351,17 +1868,16 @@ DownloadsSummaryData.prototype = { //// Property updating based on current download status /** - * A generator function for the dataItems that this summary is currently + * A generator function for the Download objects this summary is currently * interested in. This generator is passed off to summarizeDownloads in order - * to generate statistics about the dataItems we care about - in this case, - * it's the dataItems in this._dataItems after the first few to exclude, + * to generate statistics about the downloads we care about - in this case, + * it's the downloads in this._downloads after the first few to exclude, * which was set when constructing this DownloadsSummaryData instance. */ - _dataItemsForSummary: function DSD_dataItemsForSummary() - { - if (this._dataItems.length > 0) { - for (let i = this._numToExclude; i < this._dataItems.length; ++i) { - yield this._dataItems[i]; + * _downloadsForSummary() { + if (this._downloads.length > 0) { + for (let i = this._numToExclude; i < this._downloads.length; ++i) { + yield this._downloads[i]; } } }, @@ -2373,7 +1889,7 @@ DownloadsSummaryData.prototype = { { // Pre-load summary with default values. let summary = - DownloadsCommon.summarizeDownloads(this._dataItemsForSummary()); + DownloadsCommon.summarizeDownloads(this._downloadsForSummary()); this._description = DownloadsCommon.strings .otherDownloads2(summary.numActive); diff --git a/application/palemoon/components/downloads/DownloadsViewUI.jsm b/application/palemoon/components/downloads/DownloadsViewUI.jsm new file mode 100644 index 000000000..ede593e22 --- /dev/null +++ b/application/palemoon/components/downloads/DownloadsViewUI.jsm @@ -0,0 +1,250 @@ +/* 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/. */ + +/* + * This module is imported by code that uses the "download.xml" binding, and + * provides prototypes for objects that handle input and display information. + */ + +"use strict"; + +this.EXPORTED_SYMBOLS = [ + "DownloadsViewUI", +]; + +const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils", + "resource://gre/modules/DownloadUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", + "resource:///modules/DownloadsCommon.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "OS", + "resource://gre/modules/osfile.jsm"); + +this.DownloadsViewUI = {}; + +/** + * A download element shell is responsible for handling the commands and the + * displayed data for a single element that uses the "download.xml" binding. + * + * The information to display is obtained through the associated Download object + * from the JavaScript API for downloads, and commands are executed using a + * combination of Download methods and DownloadsCommon.jsm helper functions. + * + * Specialized versions of this shell must be defined, and they are required to + * implement the "download" property or getter. Currently these objects are the + * HistoryDownloadElementShell and the DownloadsViewItem for the panel. The + * history view may use a HistoryDownload object in place of a Download object. + */ +this.DownloadsViewUI.DownloadElementShell = function () {} + +this.DownloadsViewUI.DownloadElementShell.prototype = { + /** + * The richlistitem for the download, initialized by the derived object. + */ + element: null, + + /** + * URI string for the file type icon displayed in the download element. + */ + get image() { + if (!this.download.target.path) { + // Old history downloads may not have a target path. + return "moz-icon://.unknown?size=32"; + } + + // When a download that was previously in progress finishes successfully, it + // means that the target file now exists and we can extract its specific + // icon, for example from a Windows executable. To ensure that the icon is + // reloaded, however, we must change the URI used by the XUL image element, + // for example by adding a query parameter. This only works if we add one of + // the parameters explicitly supported by the nsIMozIconURI interface. + return "moz-icon://" + this.download.target.path + "?size=32" + + (this.download.succeeded ? "&state=normal" : ""); + }, + + /** + * The user-facing label for the download. This is normally the leaf name of + * the download target file. In case this is a very old history download for + * which the target file is unknown, the download source URI is displayed. + */ + get displayName() { + if (!this.download.target.path) { + return this.download.source.url; + } + return OS.Path.basename(this.download.target.path); + }, + + get extendedDisplayName() { + let s = DownloadsCommon.strings; + let referrer = this.download.source.referrer || + this.download.source.url; + let [displayHost, fullHost] = DownloadUtils.getURIHost(referrer); + return s.statusSeparator(this.displayName, displayHost); + }, + + get extendedDisplayNameTip() { + let s = DownloadsCommon.strings; + let referrer = this.download.source.referrer || + this.download.source.url; + let [displayHost, fullHost] = DownloadUtils.getURIHost(referrer); + return s.statusSeparator(this.displayName, fullHost); + }, + + /** + * The progress element for the download, or undefined in case the XBL binding + * has not been applied yet. + */ + get _progressElement() { + if (!this.__progressElement) { + // If the element is not available now, we will try again the next time. + this.__progressElement = + this.element.ownerDocument.getAnonymousElementByAttribute( + this.element, "anonid", + "progressmeter"); + } + return this.__progressElement; + }, + + /** + * Processes a major state change in the user interface, then proceeds with + * the normal progress update. This function is not called for every progress + * update in order to improve performance. + */ + _updateState() { + this.element.setAttribute("displayName", this.displayName); + this.element.setAttribute("extendedDisplayName", this.extendedDisplayName); + this.element.setAttribute("extendedDisplayNameTip", this.extendedDisplayNameTip); + this.element.setAttribute("image", this.image); + this.element.setAttribute("state", + DownloadsCommon.stateOfDownload(this.download)); + + // Since state changed, reset the time left estimation. + this.lastEstimatedSecondsLeft = Infinity; + + this._updateProgress(); + }, + + /** + * Updates the elements that change regularly for in-progress downloads, + * namely the progress bar and the status line. + */ + _updateProgress() { + if (this.download.succeeded) { + // We only need to add or remove this attribute for succeeded downloads. + if (this.download.target.exists) { + this.element.setAttribute("exists", "true"); + } else { + this.element.removeAttribute("exists"); + } + } + + // The progress bar is only displayed for in-progress downloads. + if (this.download.hasProgress) { + this.element.setAttribute("progressmode", "normal"); + this.element.setAttribute("progress", this.download.progress); + } else { + this.element.setAttribute("progressmode", "undetermined"); + } + + // Dispatch the ValueChange event for accessibility, if possible. + if (this._progressElement) { + let event = this.element.ownerDocument.createEvent("Events"); + event.initEvent("ValueChange", true, true); + this._progressElement.dispatchEvent(event); + } + + let status = this.statusTextAndTip; + this.element.setAttribute("status", status.text); + this.element.setAttribute("statusTip", status.tip); + }, + + lastEstimatedSecondsLeft: Infinity, + + /** + * Returns the text for the status line and the associated tooltip. These are + * returned by a single property because they are computed together. The + * result may be overridden by derived objects. + */ + get statusTextAndTip() this.rawStatusTextAndTip, + + /** + * Derived objects may call this to get the status text. + */ + get rawStatusTextAndTip() { + const nsIDM = Ci.nsIDownloadManager; + let s = DownloadsCommon.strings; + + let text = ""; + let tip = ""; + + if (!this.download.stopped) { + let totalBytes = this.download.hasProgress ? this.download.totalBytes + : -1; + // By default, extended status information including the individual + // download rate is displayed in the tooltip. The history view overrides + // the getter and displays the datails in the main area instead. + [text] = DownloadUtils.getDownloadStatusNoRate( + this.download.currentBytes, + totalBytes, + this.download.speed, + this.lastEstimatedSecondsLeft); + let newEstimatedSecondsLeft; + [tip, newEstimatedSecondsLeft] = DownloadUtils.getDownloadStatus( + this.download.currentBytes, + totalBytes, + this.download.speed, + this.lastEstimatedSecondsLeft); + this.lastEstimatedSecondsLeft = newEstimatedSecondsLeft; + } else if (this.download.canceled && this.download.hasPartialData) { + let totalBytes = this.download.hasProgress ? this.download.totalBytes + : -1; + let transfer = DownloadUtils.getTransferTotal(this.download.currentBytes, + totalBytes); + + // We use the same XUL label to display both the state and the amount + // transferred, for example "Paused - 1.1 MB". + text = s.statusSeparatorBeforeNumber(s.statePaused, transfer); + } else if (!this.download.succeeded && !this.download.canceled && + !this.download.error) { + text = s.stateStarting; + } else { + let stateLabel; + + if (this.download.succeeded) { + // For completed downloads, show the file size (e.g. "1.5 MB"). + if (this.download.target.size !== undefined) { + let [size, unit] = + DownloadUtils.convertByteUnits(this.download.target.size); + stateLabel = s.sizeWithUnits(size, unit); + } else { + // History downloads may not have a size defined. + stateLabel = s.sizeUnknown; + } + } else if (this.download.canceled) { + stateLabel = s.stateCanceled; + } else if (this.download.error.becauseBlockedByParentalControls) { + stateLabel = s.stateBlockedParentalControls; + } else if (this.download.error.becauseBlockedByReputationCheck) { + stateLabel = s.stateDirty; + } else { + stateLabel = s.stateFailed; + } + + let referrer = this.download.source.referrer || this.download.source.url; + let [displayHost, fullHost] = DownloadUtils.getURIHost(referrer); + + let date = new Date(this.download.endTime); + let [displayDate, fullDate] = DownloadUtils.getReadableDates(date); + + let firstPart = s.statusSeparator(stateLabel, displayHost); + text = s.statusSeparator(firstPart, displayDate); + tip = s.statusSeparator(fullHost, fullDate); + } + + return { text, tip: tip || text }; + }, +}; diff --git a/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js b/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js index 054f0405f..4830f2128 100644 --- a/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js +++ b/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js @@ -2,30 +2,32 @@ * 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/. */ -/** - * THE PLACES VIEW IMPLEMENTED IN THIS FILE HAS A VERY PARTICULAR USE CASE. - * IT IS HIGHLY RECOMMENDED NOT TO EXTEND IT FOR ANY OTHER USE CASES OR RELY - * ON IT AS AN API. - */ - -var Cu = Components.utils; -var Ci = Components.interfaces; -var Cc = Components.classes; +var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/NetUtil.jsm"); -Cu.import("resource://gre/modules/DownloadUtils.jsm"); -Cu.import("resource:///modules/DownloadsCommon.jsm"); -Cu.import("resource://gre/modules/PlacesUtils.jsm"); -Cu.import("resource://gre/modules/osfile.jsm"); - -XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", - "resource://gre/modules/PrivateBrowsingUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow", - "resource:///modules/RecentWindow.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils", + "resource://gre/modules/DownloadUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", + "resource:///modules/DownloadsCommon.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "DownloadsViewUI", + "resource:///modules/DownloadsViewUI.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", "resource://gre/modules/FileUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", + "resource://gre/modules/NetUtil.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "OS", + "resource://gre/modules/osfile.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", + "resource://gre/modules/PlacesUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Promise", + "resource://gre/modules/Promise.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow", + "resource:///modules/RecentWindow.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Services", + "resource://gre/modules/Services.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Task", + "resource://gre/modules/Task.jsm"); const nsIDM = Ci.nsIDownloadManager; @@ -38,549 +40,268 @@ const DOWNLOAD_VIEW_SUPPORTED_COMMANDS = "downloadsCmd_open", "downloadsCmd_show", "downloadsCmd_retry", "downloadsCmd_openReferrer", "downloadsCmd_clearDownloads"]; -const NOT_AVAILABLE = Number.MAX_VALUE; - /** - * A download element shell is responsible for handling the commands and the - * displayed data for a single download view element. The download element - * could represent either a past download (for which we get data from places) or - * a "session" download (using a data-item object. See DownloadsCommon.jsm), or both. - * - * Once initialized with either a data item or a places node, the created richlistitem - * can be accessed through the |element| getter, and can then be inserted/removed from - * a richlistbox. - * - * The shell doesn't take care of inserting the item, or removing it when it's no longer - * valid. That's the caller (a DownloadsPlacesView object) responsibility. + * Represents a download from the browser history. It implements part of the + * interface of the Download object. * - * The caller is also responsible for "passing over" notification from both the - * download-view and the places-result-observer, in the following manner: - * - The DownloadsPlacesView object implements getViewItem of the download-view - * pseudo interface. It returns this object (therefore we implement - * onStateChangea and onProgressChange here). - * - The DownloadsPlacesView object adds itself as a places result observer and - * calls this object's placesNodeIconChanged, placesNodeTitleChanged and - * placeNodeAnnotationChanged from its callbacks. - * - * @param [optional] aDataItem - * The data item of a the session download. Required if aPlacesNode is not set - * @param [optional] aPlacesNode - * The places node for a past download. Required if aDataItem is not set. - * @param [optional] aAnnotations - * Map containing annotations values, to speed up the initial loading. + * @param aPlacesNode + * The Places node from which the history download should be initialized. */ -function DownloadElementShell(aDataItem, aPlacesNode, aAnnotations) { - this._element = document.createElement("richlistitem"); - this._element._shell = this; - - this._element.classList.add("download"); - this._element.classList.add("download-state"); - - if (aAnnotations) - this._annotations = aAnnotations; - if (aDataItem) - this.dataItem = aDataItem; - if (aPlacesNode) - this.placesNode = aPlacesNode; +function HistoryDownload(aPlacesNode) { + // TODO (bug 829201): history downloads should get the referrer from Places. + this.source = { + url: aPlacesNode.uri, + }; + this.target = { + path: undefined, + exists: false, + size: undefined, + }; + + // In case this download cannot obtain its end time from the Places metadata, + // use the time from the Places node, that is the start time of the download. + this.endTime = aPlacesNode.time / 1000; } -DownloadElementShell.prototype = { - // The richlistitem for the download - get element() this._element, - +HistoryDownload.prototype = { /** - * Manages the "active" state of the shell. By default all the shells - * without a dataItem are inactive, thus their UI is not updated. They must - * be activated when entering the visible area. Session downloads are - * always active since they always have a dataItem. + * Pushes information from Places metadata into this object. */ - ensureActive: function DES_ensureActive() { - if (!this._active) { - this._active = true; - this._element.setAttribute("active", true); - this._updateUI(); - } - }, - get active() !!this._active, - - // The data item for the download - _dataItem: null, - get dataItem() this._dataItem, - - set dataItem(aValue) { - if (this._dataItem != aValue) { - if (!aValue && !this._placesNode) - throw new Error("Should always have either a dataItem or a placesNode"); - - this._dataItem = aValue; - if (!this.active) - this.ensureActive(); - else - this._updateUI(); + updateFromMetaData(metaData) { + try { + this.target.path = Cc["@mozilla.org/network/protocol;1?name=file"] + .getService(Ci.nsIFileProtocolHandler) + .getFileFromURLSpec(metaData.targetFileSpec).path; + } catch (ex) { + this.target.path = undefined; } - return aValue; - }, - - _placesNode: null, - get placesNode() this._placesNode, - set placesNode(aValue) { - if (this._placesNode != aValue) { - if (!aValue && !this._dataItem) - throw new Error("Should always have either a dataItem or a placesNode"); - - // Preserve the annotations map if this is the first loading and we got - // cached values. - if (this._placesNode || !this._annotations) { - this._annotations = new Map(); - } - - this._placesNode = aValue; - // We don't need to update the UI if we had a data item, because - // the places information isn't used in this case. - if (!this._dataItem && this.active) - this._updateUI(); + if ("state" in metaData) { + this.succeeded = metaData.state == nsIDM.DOWNLOAD_FINISHED; + this.error = metaData.state == nsIDM.DOWNLOAD_FAILED + ? { message: "History download failed." } + : metaData.state == nsIDM.DOWNLOAD_BLOCKED_PARENTAL + ? { becauseBlockedByParentalControls: true } + : metaData.state == nsIDM.DOWNLOAD_DIRTY + ? { becauseBlockedByReputationCheck: true } + : null; + this.canceled = metaData.state == nsIDM.DOWNLOAD_CANCELED || + metaData.state == nsIDM.DOWNLOAD_PAUSED; + this.endTime = metaData.endTime; + + // Normal history downloads are assumed to exist until the user interface + // is refreshed, at which point these values may be updated. + this.target.exists = true; + this.target.size = metaData.fileSize; + } else { + // Metadata might be missing from a download that has started but hasn't + // stopped already. Normally, this state is overridden with the one from + // the corresponding in-progress session download. But if the browser is + // terminated abruptly and additionally the file with information about + // in-progress downloads is lost, we may end up using this state. We use + // the failed state to allow the download to be restarted. + // + // On the other hand, if the download is missing the target file + // annotation as well, it is just a very old one, and we can assume it + // succeeded. + this.succeeded = !this.target.path; + this.error = this.target.path ? { message: "Unstarted download." } : null; + this.canceled = false; + + // These properties may be updated if the user interface is refreshed. + this.target.exists = false; + this.target.size = undefined; } - return aValue; - }, - - // The download uri (as a string) - get downloadURI() { - if (this._dataItem) - return this._dataItem.uri; - if (this._placesNode) - return this._placesNode.uri; - throw new Error("Unexpected download element state"); }, - get _downloadURIObj() { - if (!("__downloadURIObj" in this)) - this.__downloadURIObj = NetUtil.newURI(this.downloadURI); - return this.__downloadURIObj; - }, - - _getIcon: function DES__getIcon() { - let metaData = this.getDownloadMetaData(); - if ("filePath" in metaData) - return "moz-icon://" + metaData.filePath + "?size=32"; - - if (this._placesNode) { - // Try to extract an extension from the uri. - let ext = this._downloadURIObj.QueryInterface(Ci.nsIURL).fileExtension; - if (ext) - return "moz-icon://." + ext + "?size=32"; - return this._placesNode.icon || "moz-icon://.unknown?size=32"; - } - if (this._dataItem) - throw new Error("Session-download items should always have a target file uri"); + /** + * History downloads are never in progress. + */ + stopped: true, - throw new Error("Unexpected download element state"); - }, + /** + * No percentage indication is shown for history downloads. + */ + hasProgress: false, - // Helper for getting a places annotation set for the download. - _getAnnotation: function DES__getAnnotation(aAnnotation, aDefaultValue) { - let value; - if (this._annotations.has(aAnnotation)) - value = this._annotations.get(aAnnotation); + /** + * History downloads cannot be restarted using their partial data, even if + * they are indicated as paused in their Places metadata. The only way is to + * use the information from a persisted session download, that will be shown + * instead of the history download. In case this session download is not + * available, we show the history download as canceled, not paused. + */ + hasPartialData: false, - // If the value is cached, or we know it doesn't exist, avoid a database - // lookup. - if (value === undefined) { - try { - value = PlacesUtils.annotations.getPageAnnotation( - this._downloadURIObj, aAnnotation); - } - catch(ex) { - value = NOT_AVAILABLE; - } - } + /** + * This method mimicks the "start" method of session downloads, and is called + * when the user retries a history download. + * + * At present, we always ask the user for a new target path when retrying a + * history download. In the future we may consider reusing the known target + * path if the folder still exists and the file name is not already used, + * except when the user preferences indicate that the target path should be + * requested every time a new download is started. + */ + start() { + let browserWin = RecentWindow.getMostRecentBrowserWindow(); + let initiatingDoc = browserWin ? browserWin.document : document; - if (value === NOT_AVAILABLE) { - if (aDefaultValue === undefined) { - throw new Error("Could not get required annotation '" + aAnnotation + - "' for download with url '" + this.downloadURI + "'"); - } - value = aDefaultValue; - } + // Do not suggest a file name if we don't know the original target. + let leafName = this.target.path ? OS.Path.basename(this.target.path) : null; + DownloadURL(this.source.url, leafName, initiatingDoc); - this._annotations.set(aAnnotation, value); - return value; + return Promise.resolve(); }, - _fetchTargetFileInfo: function DES__fetchTargetFileInfo(aUpdateMetaDataAndStatusUI = false) { - if (this._targetFileInfoFetched) - throw new Error("_fetchTargetFileInfo should not be called if the information was already fetched"); - if (!this.active) - throw new Error("Trying to _fetchTargetFileInfo on an inactive download shell"); - - let path = this.getDownloadMetaData().filePath; - - // In previous version, the target file annotations were not set, - // so we cannot tell where is the file. - if (path === undefined) { - this._targetFileInfoFetched = true; - this._targetFileExists = false; - if (aUpdateMetaDataAndStatusUI) { - this._metaData = null; - this._updateDownloadStatusUI(); - } - // Here we don't need to update the download commands, - // as the state is unknown as it was. - return; + /** + * This method mimicks the "refresh" method of session downloads, except that + * it cannot notify that the data changed to the Downloads View. + */ + refresh: Task.async(function* () { + try { + this.target.size = (yield OS.File.stat(this.target.path)).size; + this.target.exists = true; + } catch (ex) { + // We keep the known file size from the metadata, if any. + this.target.exists = false; } + }), +}; - OS.File.stat(path).then( - function onSuccess(fileInfo) { - this._targetFileInfoFetched = true; - this._targetFileExists = true; - this._targetFileSize = fileInfo.size; - if (aUpdateMetaDataAndStatusUI) { - this._metaData = null; - this._updateDownloadStatusUI(); - } - if (this._element.selected) - goUpdateDownloadCommands(); - }.bind(this), - - function onFailure(reason) { - if (reason instanceof OS.File.Error && reason.becauseNoSuchFile) { - this._targetFileInfoFetched = true; - this._targetFileExists = false; - } - else { - Cu.reportError("Could not fetch info for target file (reason: " + - reason + ")"); - } +/** + * A download element shell is responsible for handling the commands and the + * displayed data for a single download view element. + * + * The shell may contain a session download, a history download, or both. When + * both a history and a session download are present, the session download gets + * priority and its information is displayed. + * + * On construction, a new richlistitem is created, and can be accessed through + * the |element| getter. The shell doesn't insert the item in a richlistbox, the + * caller must do it and remove the element when it's no longer needed. + * + * The caller is also responsible for forwarding status notifications for + * session downloads, calling the onStateChanged and onChanged methods. + * + * @param [optional] aSessionDownload + * The session download, required if aHistoryDownload is not set. + * @param [optional] aHistoryDownload + * The history download, required if aSessionDownload is not set. + */ +function HistoryDownloadElementShell(aSessionDownload, aHistoryDownload) { + this.element = document.createElement("richlistitem"); + this.element._shell = this; - if (aUpdateMetaDataAndStatusUI) { - this._metaData = null; - this._updateDownloadStatusUI(); - } + this.element.classList.add("download"); + this.element.classList.add("download-state"); - if (this._element.selected) - goUpdateDownloadCommands(); - }.bind(this) - ); - }, + if (aSessionDownload) { + this.sessionDownload = aSessionDownload; + } + if (aHistoryDownload) { + this.historyDownload = aHistoryDownload; + } +} - _getAnnotatedMetaData: function DES__getAnnotatedMetaData() - JSON.parse(this._getAnnotation(DOWNLOAD_META_DATA_ANNO)), +HistoryDownloadElementShell.prototype = { + __proto__: DownloadsViewUI.DownloadElementShell.prototype, - _extractFilePathAndNameFromFileURI: - function DES__extractFilePathAndNameFromFileURI(aFileURI) { - let file = Cc["@mozilla.org/network/protocol;1?name=file"] - .getService(Ci.nsIFileProtocolHandler) - .getFileFromURLSpec(aFileURI); - return [file.path, file.leafName]; + /** + * Manages the "active" state of the shell. By default all the shells without + * a session download are inactive, thus their UI is not updated. They must + * be activated when entering the visible area. Session downloads are always + * active. + */ + ensureActive: function DES_ensureActive() { + if (!this._active) { + this._active = true; + this.element.setAttribute("active", true); + this._updateUI(); + } }, + get active() !!this._active, /** - * Retrieve the meta data object for the download. The following fields - * may be set. - * - * - state - any download state defined in nsIDownloadManager. If this field - * is not set, the download state is unknown. - * - endTime: the end time of the download. - * - filePath: the downloaded file path on the file system, when it - * was downloaded. The file may not exist. This is set for session - * downloads that have a local file set, and for history downloads done - * after the landing of bug 591289. - * - fileName: the downloaded file name on the file system. Set if filePath - * is set. - * - displayName: the user-facing label for the download. This is always - * set. If available, it's set to the downloaded file name. If not, - * the places title for the download uri is used. As a last resort, - * we fallback to the download uri. - * - fileSize (only set for downloads which completed successfully): - * the downloaded file size. For downloads done after the landing of - * bug 826991, this value is "static" - that is, it does not necessarily - * mean that the file is in place and has this size. + * Overrides the base getter to return the Download or HistoryDownload object + * for displaying information and executing commands in the user interface. */ - getDownloadMetaData: function DES_getDownloadMetaData() { - if (!this._metaData) { - if (this._dataItem) { - let s = DownloadsCommon.strings; - let referrer = this._dataItem.referrer || this._dataItem.uri; - let [displayHost, fullHost] = DownloadUtils.getURIHost(referrer); - this._metaData = { - state: this._dataItem.state, - endTime: this._dataItem.endTime, - fileName: this._dataItem.target, - displayName: this._dataItem.target, - extendedDisplayName: s.statusSeparator(this._dataItem.target, displayHost), - extendedDisplayNameTip: s.statusSeparator(this._dataItem.target, fullHost) - }; - if (this._dataItem.done) - this._metaData.fileSize = this._dataItem.maxBytes; - if (this._dataItem.localFile) - this._metaData.filePath = this._dataItem.localFile.path; + get download() this._sessionDownload || this._historyDownload, + + _sessionDownload: null, + get sessionDownload() this._sessionDownload, + set sessionDownload(aValue) { + if (this._sessionDownload != aValue) { + if (!aValue && !this._historyDownload) { + throw new Error("Should always have either a Download or a HistoryDownload"); } - else { - try { - this._metaData = this._getAnnotatedMetaData(); - } - catch(ex) { - this._metaData = { }; - if (this._targetFileInfoFetched && this._targetFileExists) { - this._metaData.state = this._targetFileSize > 0 ? - nsIDM.DOWNLOAD_FINISHED : nsIDM.DOWNLOAD_FAILED; - this._metaData.fileSize = this._targetFileSize; - } - // This is actually the start-time, but it's the best we can get. - this._metaData.endTime = this._placesNode.time / 1000; - } + this._sessionDownload = aValue; - try { - let targetFileURI = this._getAnnotation(DESTINATION_FILE_URI_ANNO); - [this._metaData.filePath, this._metaData.fileName] = - this._extractFilePathAndNameFromFileURI(targetFileURI); - this._metaData.displayName = this._metaData.fileName; - } - catch(ex) { - this._metaData.displayName = this._placesNode.title || this.downloadURI; - } - } + this.ensureActive(); + this._updateUI(); } - return this._metaData; + return aValue; }, - // The status text for the download - _getStatusText: function DES__getStatusText() { - let s = DownloadsCommon.strings; - if (this._dataItem && this._dataItem.inProgress) { - if (this._dataItem.paused) { - let transfer = - DownloadUtils.getTransferTotal(this._dataItem.currBytes, - this._dataItem.maxBytes); - - // We use the same XUL label to display both the state and the amount - // transferred, for example "Paused - 1.1 MB". - return s.statusSeparatorBeforeNumber(s.statePaused, transfer); - } - if (this._dataItem.state == nsIDM.DOWNLOAD_DOWNLOADING) { - let [status, newEstimatedSecondsLeft] = - DownloadUtils.getDownloadStatus(this.dataItem.currBytes, - this.dataItem.maxBytes, - this.dataItem.speed, - this._lastEstimatedSecondsLeft || Infinity); - this._lastEstimatedSecondsLeft = newEstimatedSecondsLeft; - return status; - } - if (this._dataItem.starting) { - return s.stateStarting; - } - if (this._dataItem.state == nsIDM.DOWNLOAD_SCANNING) { - return s.stateScanning; + _historyDownload: null, + get historyDownload() this._historyDownload, + set historyDownload(aValue) { + if (this._historyDownload != aValue) { + if (!aValue && !this._sessionDownload) { + throw new Error("Should always have either a Download or a HistoryDownload"); } - throw new Error("_getStatusText called with a bogus download state"); - } + this._historyDownload = aValue; - // This is a not-in-progress or history download. - let stateLabel = ""; - let state = this.getDownloadMetaData().state; - switch (state) { - case nsIDM.DOWNLOAD_FAILED: - stateLabel = s.stateFailed; - break; - case nsIDM.DOWNLOAD_CANCELED: - stateLabel = s.stateCanceled; - break; - case nsIDM.DOWNLOAD_BLOCKED_PARENTAL: - stateLabel = s.stateBlockedParentalControls; - break; - case nsIDM.DOWNLOAD_BLOCKED_POLICY: - stateLabel = s.stateBlockedPolicy; - break; - case nsIDM.DOWNLOAD_DIRTY: - stateLabel = s.stateDirty; - break; - case nsIDM.DOWNLOAD_FINISHED:{ - // For completed downloads, show the file size (e.g. "1.5 MB") - let metaData = this.getDownloadMetaData(); - if ("fileSize" in metaData) { - let [size, unit] = DownloadUtils.convertByteUnits(metaData.fileSize); - stateLabel = s.sizeWithUnits(size, unit); - break; - } - // Fallback to default unknown state. + // We don't need to update the UI if we had a session data item, because + // the places information isn't used in this case. + if (!this._sessionDownload) { + this._updateUI(); } - default: - stateLabel = s.sizeUnknown; - break; - } - - // TODO (bug 829201): history downloads should get the referrer from Places. - let referrer = this._dataItem && this._dataItem.referrer || - this.downloadURI; - let [displayHost, fullHost] = DownloadUtils.getURIHost(referrer); - - let date = new Date(this.getDownloadMetaData().endTime); - let [displayDate, fullDate] = DownloadUtils.getReadableDates(date); - - // We use the same XUL label to display the state, the host name, and the - // end time. - let firstPart = s.statusSeparator(stateLabel, displayHost); - return s.statusSeparator(firstPart, displayDate); - }, - - // The progressmeter element for the download - get _progressElement() { - if (!("__progressElement" in this)) { - this.__progressElement = - document.getAnonymousElementByAttribute(this._element, "anonid", - "progressmeter"); } - return this.__progressElement; + return aValue; }, - // Updates the download state attribute (and by that hide/unhide the - // appropriate buttons and context menu items), the status text label, - // and the progress meter. - _updateDownloadStatusUI: function DES__updateDownloadStatusUI() { - if (!this.active) - throw new Error("_updateDownloadStatusUI called for an inactive item."); - - let state = this.getDownloadMetaData().state; - if (state !== undefined) - this._element.setAttribute("state", state); - - this._element.setAttribute("status", this._getStatusText()); - - // For past-downloads, we're done. For session-downloads, we may also need - // to update the progress-meter. - if (!this._dataItem) + _updateUI() { + // There is nothing to do if the item has always been invisible. + if (!this.active) { return; - - // Copied from updateProgress in downloads.js. - if (this._dataItem.starting) { - // Before the download starts, the progress meter has its initial value. - this._element.setAttribute("progressmode", "normal"); - this._element.setAttribute("progress", "0"); - } - else if (this._dataItem.state == nsIDM.DOWNLOAD_SCANNING || - this._dataItem.percentComplete == -1) { - // We might not know the progress of a running download, and we don't know - // the remaining time during the malware scanning phase. - this._element.setAttribute("progressmode", "undetermined"); } - else { - // This is a running download of which we know the progress. - this._element.setAttribute("progressmode", "normal"); - this._element.setAttribute("progress", this._dataItem.percentComplete); - } - - // Dispatch the ValueChange event for accessibility, if possible. - if (this._progressElement) { - let event = document.createEvent("Events"); - event.initEvent("ValueChange", true, true); - this._progressElement.dispatchEvent(event); - } - }, - - _updateDisplayNameAndIcon: function DES__updateDisplayNameAndIcon() { - let metaData = this.getDownloadMetaData(); - this._element.setAttribute("displayName", metaData.displayName); - if ("extendedDisplayName" in metaData) - this._element.setAttribute("extendedDisplayName", metaData.extendedDisplayName); - if ("extendedDisplayNameTip" in metaData) - this._element.setAttribute("extendedDisplayNameTip", metaData.extendedDisplayNameTip); - this._element.setAttribute("image", this._getIcon()); - }, - - _updateUI: function DES__updateUI() { - if (!this.active) - throw new Error("Trying to _updateUI on an inactive download shell"); - - this._metaData = null; - this._targetFileInfoFetched = false; - this._updateDisplayNameAndIcon(); + // Since the state changed, we may need to check the target file again. + this._targetFileChecked = false; - // For history downloads done in past releases, the downloads/metaData - // annotation is not set, and therefore we cannot tell the download - // state without the target file information. - if (this._dataItem || this.getDownloadMetaData().state !== undefined) - this._updateDownloadStatusUI(); - else - this._fetchTargetFileInfo(true); + this._updateState(); }, - placesNodeIconChanged: function DES_placesNodeIconChanged() { - if (!this._dataItem) - this._element.setAttribute("image", this._getIcon()); - }, + get statusTextAndTip() { + let status = this.rawStatusTextAndTip; - placesNodeTitleChanged: function DES_placesNodeTitleChanged() { - // If there's a file path, we use the leaf name for the title. - if (!this._dataItem && this.active && !this.getDownloadMetaData().filePath) { - this._metaData = null; - this._updateDisplayNameAndIcon(); + // The base object would show extended progress information in the tooltip, + // but we move this to the main view and never display a tooltip. + if (!this.download.stopped) { + status.text = status.tip; } - }, + status.tip = ""; - placesNodeAnnotationChanged: function DES_placesNodeAnnotationChanged(aAnnoName) { - this._annotations.delete(aAnnoName); - if (!this._dataItem && this.active) { - if (aAnnoName == DOWNLOAD_META_DATA_ANNO) { - let metaData = this.getDownloadMetaData(); - let annotatedMetaData = this._getAnnotatedMetaData(); - metaData.endTime = annotatedMetaData.endTime; - if ("fileSize" in annotatedMetaData) - metaData.fileSize = annotatedMetaData.fileSize; - else - delete metaData.fileSize; - - if (metaData.state != annotatedMetaData.state) { - metaData.state = annotatedMetaData.state; - if (this._element.selected) - goUpdateDownloadCommands(); - } - - this._updateDownloadStatusUI(); - } - else if (aAnnoName == DESTINATION_FILE_URI_ANNO) { - let metaData = this.getDownloadMetaData(); - let targetFileURI = this._getAnnotation(DESTINATION_FILE_URI_ANNO); - [metaData.filePath, metaData.fileName] = - this._extractFilePathAndNameFromFileURI(targetFileURI); - metaData.displayName = metaData.fileName; - this._updateDisplayNameAndIcon(); - - if (this._targetFileInfoFetched) { - // This will also update the download commands if necessary. - this._targetFileInfoFetched = false; - this._fetchTargetFileInfo(); - } - } - } + return status; }, - /* DownloadView */ - onStateChange: function DES_onStateChange(aOldState) { - let metaData = this.getDownloadMetaData(); - metaData.state = this.dataItem.state; - if (aOldState != nsIDM.DOWNLOAD_FINISHED && aOldState != metaData.state) { - // See comment in DVI_onStateChange in downloads.js (the panel-view) - this._element.setAttribute("image", this._getIcon() + "&state=normal"); - metaData.fileSize = this._dataItem.maxBytes; - if (this._targetFileInfoFetched) { - this._targetFileInfoFetched = false; - this._fetchTargetFileInfo(); - } - } + onStateChanged() { + this.element.setAttribute("image", this.image); + this.element.setAttribute("state", + DownloadsCommon.stateOfDownload(this.download)); - this._updateDownloadStatusUI(); - if (this._element.selected) + if (this.element.selected) { goUpdateDownloadCommands(); - else + } else { goUpdateCommand("downloadsCmd_clearDownloads"); + } }, - /* DownloadView */ - onProgressChange: function DES_onProgressChange() { - this._updateDownloadStatusUI(); + onChanged() { + this._updateProgress(); }, /* nsIController */ @@ -589,109 +310,79 @@ DownloadElementShell.prototype = { if (!this.active && aCommand != "cmd_delete") return false; switch (aCommand) { - case "downloadsCmd_open": { - // We cannot open a session download file unless it's done ("openable"). - // If it's finished, we need to make sure the file was not removed, - // as we do for past downloads. - if (this._dataItem && !this._dataItem.openable) - return false; - - if (this._targetFileInfoFetched) - return this._targetFileExists; - - // If the target file information is not yet fetched, - // temporarily assume that the file is in place. - return this.getDownloadMetaData().state == nsIDM.DOWNLOAD_FINISHED; - } - case "downloadsCmd_show": { + case "downloadsCmd_open": + // This property is false if the download did not succeed. + return this.download.target.exists; + case "downloadsCmd_show": // TODO: Bug 827010 - Handle part-file asynchronously. - if (this._dataItem && - this._dataItem.partFile && this._dataItem.partFile.exists()) - return true; - - if (this._targetFileInfoFetched) - return this._targetFileExists; + if (this._sessionDownload && this.download.target.partFilePath) { + let partFile = new FileUtils.File(this.download.target.partFilePath); + if (partFile.exists()) { + return true; + } + } - // If the target file information is not yet fetched, - // temporarily assume that the file is in place. - return this.getDownloadMetaData().state == nsIDM.DOWNLOAD_FINISHED; - } + // This property is false if the download did not succeed. + return this.download.target.exists; case "downloadsCmd_pauseResume": - return this._dataItem && this._dataItem.inProgress && this._dataItem.resumable; + return this.download.hasPartialData && !this.download.error; case "downloadsCmd_retry": - // An history download can always be retried. - return !this._dataItem || this._dataItem.canRetry; + return this.download.canceled || this.download.error; case "downloadsCmd_openReferrer": - return this._dataItem && !!this._dataItem.referrer; + return !!this.download.source.referrer; case "cmd_delete": - // The behavior in this case is somewhat unexpected, so we disallow that. - if (this._placesNode && this._dataItem && this._dataItem.inProgress) - return false; - return true; + // We don't want in-progress downloads to be removed accidentally. + return this.download.stopped; case "downloadsCmd_cancel": - return this._dataItem != null; + return !!this._sessionDownload; } return false; }, - _retryAsHistoryDownload: function DES__retryAsHistoryDownload() { - // In future we may try to download into the same original target uri, when - // we have it. Though that requires verifying the path is still valid and - // may surprise the user if he wants to be requested every time. - let browserWin = RecentWindow.getMostRecentBrowserWindow(); - let initiatingDoc = browserWin ? browserWin.document : document; - DownloadURL(this.downloadURI, this.getDownloadMetaData().fileName, - initiatingDoc); - }, - /* nsIController */ doCommand: function DES_doCommand(aCommand) { switch (aCommand) { case "downloadsCmd_open": { - let file = this._dataItem ? - this.dataItem.localFile : - new FileUtils.File(this.getDownloadMetaData().filePath); - + let file = new FileUtils.File(this.download.target.path); DownloadsCommon.openDownloadedFile(file, null, window); break; } case "downloadsCmd_show": { - if (this._dataItem) { - this._dataItem.showLocalFile(); - } - else { - let file = new FileUtils.File(this.getDownloadMetaData().filePath); - DownloadsCommon.showDownloadedFile(file); - } + let file = new FileUtils.File(this.download.target.path); + DownloadsCommon.showDownloadedFile(file); break; } case "downloadsCmd_openReferrer": { - openURL(this._dataItem.referrer); + openURL(this.download.source.referrer); break; } case "downloadsCmd_cancel": { - this._dataItem.cancel(); + this.download.cancel().catch(() => {}); + this.download.removePartialData().catch(Cu.reportError); break; } case "cmd_delete": { - if (this._dataItem) - Downloads.getList(Downloads.ALL) - .then(list => list.remove(this._dataItem._download)) - .then(() => this._dataItem._download.finalize(true)) - .catch(Cu.reportError); - if (this._placesNode) - PlacesUtils.bhistory.removePage(this._downloadURIObj); + if (this._sessionDownload) { + DownloadsCommon.removeAndFinalizeDownload(this.download); + } + if (this._historyDownload) { + let uri = NetUtil.newURI(this.download.source.url); + PlacesUtils.bhistory.removePage(uri); + } break; - } + } case "downloadsCmd_retry": { - if (this._dataItem) - this._dataItem.retry(); - else - this._retryAsHistoryDownload(); + // Errors when retrying are already reported as download failures. + this.download.start().catch(() => {}); break; } case "downloadsCmd_pauseResume": { - this._dataItem.togglePauseResume(); + // This command is only enabled for session downloads. + if (this.download.stopped) { + this.download.start(); + } else { + this.download.cancel(); + } break; } } @@ -704,8 +395,8 @@ DownloadElementShell.prototype = { if (!aTerm) return true; aTerm = aTerm.toLowerCase(); - return this.getDownloadMetaData().displayName.toLowerCase().includes(aTerm) || - this.downloadURI.toLowerCase().includes(aTerm); + return this.displayName.toLowerCase().contains(aTerm) || + this.download.source.url.toLowerCase().contains(aTerm); }, // Handles return keypress on the element (the keypress listener is @@ -732,30 +423,57 @@ DownloadElementShell.prototype = { } return ""; } - let command = getDefaultCommandForState(this.getDownloadMetaData().state); + let state = DownloadsCommon.stateOfDownload(this.download); + let command = getDefaultCommandForState(state); if (command && this.isCommandEnabled(command)) this.doCommand(command); }, /** - * At the first time an item is selected, we don't yet have - * the target file information. Thus the call to goUpdateDownloadCommands - * in DPV_onSelect would result in best-guess enabled/disabled result. - * That way we let the user perform command immediately. However, once - * we have the target file information, we can update the commands - * appropriately (_fetchTargetFileInfo() calls goUpdateDownloadCommands). + * This method is called by the outer download view, after the controller + * commands have already been updated. In case we did not check for the + * existence of the target file already, we can do it now and then update + * the commands as needed. */ onSelect: function DES_onSelect() { if (!this.active) return; - if (!this._targetFileInfoFetched) - this._fetchTargetFileInfo(); - } + + // If this is a history download for which no target file information is + // available, we cannot retrieve information about the target file. + if (!this.download.target.path) { + return; + } + + // Start checking for existence. This may be done twice if onSelect is + // called again before the information is collected. + if (!this._targetFileChecked) { + this._checkTargetFileOnSelect().catch(Cu.reportError); + } + }, + + _checkTargetFileOnSelect: Task.async(function* () { + try { + yield this.download.refresh(); + } finally { + // Do not try to check for existence again if this failed once. + this._targetFileChecked = true; + } + + // Update the commands only if the element is still selected. + if (this.element.selected) { + goUpdateDownloadCommands(); + } + + // Ensure the interface has been updated based on the new values. We need to + // do this because history downloads can't trigger update notifications. + this._updateProgress(); + }), }; /** * A Downloads Places View is a places view designed to show a places query - * for history downloads alongside the current "session"-downloads. + * for history downloads alongside the session downloads. * * As we don't use the places controller, some methods implemented by other * places views are not implemented by this view. @@ -774,7 +492,7 @@ function DownloadsPlacesView(aRichListBox, aActive = true) { this._downloadElementsShellsForURI = new Map(); // Map download data items to their element shells. - this._viewItemsForDataItems = new WeakMap(); + this._viewItemsForDownloads = new WeakMap(); // Points to the last session download element. We keep track of this // in order to keep all session downloads above past downloads. @@ -817,44 +535,83 @@ DownloadsPlacesView.prototype = { return this._active; }, - _forEachDownloadElementShellForURI: - function DPV__forEachDownloadElementShellForURI(aURI, aCallback) { - if (this._downloadElementsShellsForURI.has(aURI)) { - let downloadElementShells = this._downloadElementsShellsForURI.get(aURI); - for (let des of downloadElementShells) { - aCallback(des); + /** + * This cache exists in order to optimize the load of the Downloads View, when + * Places annotations for history downloads must be read. In fact, annotations + * are stored in a single table, and reading all of them at once is much more + * efficient than an individual query. + * + * When this property is first requested, it reads the annotations for all the + * history downloads and stores them indefinitely. + * + * The historical annotations are not expected to change for the duration of + * the session, except in the case where a session download is running for the + * same URI as a history download. To ensure we don't use stale data, URIs + * corresponding to session downloads are permanently removed from the cache. + * This is a very small mumber compared to history downloads. + * + * This property returns a Map from each download source URI found in Places + * annotations to an object with the format: + * + * { targetFileSpec, state, endTime, fileSize, ... } + * + * The targetFileSpec property is the value of "downloads/destinationFileURI", + * while the other properties are taken from "downloads/metaData". Any of the + * properties may be missing from the object. + */ + get _cachedPlacesMetaData() { + if (!this.__cachedPlacesMetaData) { + this.__cachedPlacesMetaData = new Map(); + + // Read the metadata annotations first, but ignore invalid JSON. + for (let result of PlacesUtils.annotations.getAnnotationsWithName( + DOWNLOAD_META_DATA_ANNO)) { + try { + this.__cachedPlacesMetaData.set(result.uri.spec, + JSON.parse(result.annotationValue)); + } catch (ex) {} } - } - }, - _getAnnotationsFor: function DPV_getAnnotationsFor(aURI) { - if (!this._cachedAnnotations) { - this._cachedAnnotations = new Map(); - for (let name of [ DESTINATION_FILE_URI_ANNO, - DOWNLOAD_META_DATA_ANNO ]) { - let results = PlacesUtils.annotations.getAnnotationsWithName(name); - for (let result of results) { - let url = result.uri.spec; - if (!this._cachedAnnotations.has(url)) - this._cachedAnnotations.set(url, new Map()); - let m = this._cachedAnnotations.get(url); - m.set(result.annotationName, result.annotationValue); + // Add the target file annotations to the metadata. + for (let result of PlacesUtils.annotations.getAnnotationsWithName( + DESTINATION_FILE_URI_ANNO)) { + let metaData = this.__cachedPlacesMetaData.get(result.uri.spec); + if (!metaData) { + metaData = {}; + this.__cachedPlacesMetaData.set(result.uri.spec, metaData); } + metaData.targetFileSpec = result.annotationValue; } } - let annotations = this._cachedAnnotations.get(aURI); - if (!annotations) { - // There are no annotations for this entry, that means it is quite old. - // Make up a fake annotations entry with default values. - annotations = new Map(); - annotations.set(DESTINATION_FILE_URI_ANNO, NOT_AVAILABLE); - } - // The meta-data annotation has been added recently, so it's likely missing. - if (!annotations.has(DOWNLOAD_META_DATA_ANNO)) { - annotations.set(DOWNLOAD_META_DATA_ANNO, NOT_AVAILABLE); - } - return annotations; + return this.__cachedPlacesMetaData; + }, + __cachedPlacesMetaData: null, + + /** + * Reads current metadata from Places annotations for the specified URI, and + * returns an object with the format: + * + * { targetFileSpec, state, endTime, fileSize, ... } + * + * The targetFileSpec property is the value of "downloads/destinationFileURI", + * while the other properties are taken from "downloads/metaData". Any of the + * properties may be missing from the object. + */ + _getPlacesMetaDataFor(spec) { + let metaData = {}; + + try { + let uri = NetUtil.newURI(spec); + try { + metaData = JSON.parse(PlacesUtils.annotations.getPageAnnotation( + uri, DOWNLOAD_META_DATA_ANNO)); + } catch (ex) {} + metaData.targetFileSpec = PlacesUtils.annotations.getPageAnnotation( + uri, DESTINATION_FILE_URI_ANNO); + } catch (ex) {} + + return metaData; }, /** @@ -869,14 +626,12 @@ DownloadsPlacesView.prototype = { * alongside the other session downloads. If we don't, then we go ahead * and create a new element for the download. * - * @param aDataItem - * The data item of a session download. Set to null for history - * downloads data. + * @param [optional] sessionDownload + * A Download object, or null for history downloads. * @param [optional] aPlacesNode - * The places node for a history download. Required if there's no data - * item. + * The Places node for a history download, or null for session downloads. * @param [optional] aNewest - * @see onDataItemAdded. Ignored for history downloads. + * @see onDownloadAdded. Ignored for history downloads. * @param [optional] aDocumentFragment * To speed up the appending of multiple elements to the end of the * list which are coming in a single batch (i.e. invalidateContainer), @@ -884,16 +639,28 @@ DownloadsPlacesView.prototype = { * be appended. It's the caller's job to ensure the fragment is merged * to the richlistbox at the end. */ - _addDownloadData: - function DPV_addDownloadData(aDataItem, aPlacesNode, aNewest = false, + _addDownloadData(sessionDownload, aPlacesNode, aNewest = false, aDocumentFragment = null) { - let downloadURI = aPlacesNode ? aPlacesNode.uri : aDataItem.uri; + let downloadURI = aPlacesNode ? aPlacesNode.uri + : sessionDownload.source.url; let shellsForURI = this._downloadElementsShellsForURI.get(downloadURI); if (!shellsForURI) { shellsForURI = new Set(); this._downloadElementsShellsForURI.set(downloadURI, shellsForURI); } + // When a session download is attached to a shell, we ensure not to keep + // stale metadata around for the corresponding history download. This + // prevents stale state from being used if the view is rebuilt. + // + // Note that we will eagerly load the data in the cache at this point, even + // if we have seen no history download. The case where no history download + // will appear at all is rare enough in normal usage, so we can apply this + // simpler solution rather than keeping a list of cache items to ignore. + if (sessionDownload) { + this._cachedPlacesMetaData.delete(sessionDownload.source.url); + } + let newOrUpdatedShell = null; // Trivial: if there are no shells for this download URI, we always @@ -911,44 +678,64 @@ DownloadsPlacesView.prototype = { // item). // // Note: If a cancelled session download is already in the list, and the - // download is retired, onDataItemAdded is called again for the same + // download is retried, onDownloadAdded is called again for the same // data item. Thus, we also check that we make sure we don't have a view item // already. if (!shouldCreateShell && - aDataItem && this.getViewItem(aDataItem) == null) { + sessionDownload && !this._viewItemsForDownloads.has(sessionDownload)) { // If there's a past-download-only shell for this download-uri with no // associated data item, use it for the new data item. Otherwise, go ahead // and create another shell. shouldCreateShell = true; for (let shell of shellsForURI) { - if (!shell.dataItem) { + if (!shell.sessionDownload) { shouldCreateShell = false; - shell.dataItem = aDataItem; + shell.sessionDownload = sessionDownload; newOrUpdatedShell = shell; - this._viewItemsForDataItems.set(aDataItem, shell); + this._viewItemsForDownloads.set(sessionDownload, shell); break; } } } if (shouldCreateShell) { - // Bug 836271: The annotations for a url should be cached only when the - // places node is available, i.e. when we know we we'd be notified for - // annotation changes. - // Otherwise we may cache NOT_AVILABLE values first for a given session - // download, and later use these NOT_AVILABLE values when a history - // download for the same URL is added. - let cachedAnnotations = aPlacesNode ? this._getAnnotationsFor(downloadURI) : null; - let shell = new DownloadElementShell(aDataItem, aPlacesNode, cachedAnnotations); + // If we are adding a new history download here, it means there is no + // associated session download, thus we must read the Places metadata, + // because it will not be obscured by the session download. + let historyDownload = null; + if (aPlacesNode) { + let metaData = this._cachedPlacesMetaData.get(aPlacesNode.uri) || + this._getPlacesMetaDataFor(aPlacesNode.uri); + historyDownload = new HistoryDownload(aPlacesNode); + historyDownload.updateFromMetaData(metaData); + } + let shell = new HistoryDownloadElementShell(sessionDownload, + historyDownload); + shell.element._placesNode = aPlacesNode; newOrUpdatedShell = shell; shellsForURI.add(shell); - if (aDataItem) - this._viewItemsForDataItems.set(aDataItem, shell); + if (sessionDownload) { + this._viewItemsForDownloads.set(sessionDownload, shell); + } } else if (aPlacesNode) { + // We are updating information for a history download for which we have + // at least one download element shell already. There are two cases: + // 1) There are one or more download element shells for this source URI, + // each with an associated session download. We update the Places node + // because we may need it later, but we don't need to read the Places + // metadata until the last session download is removed. + // 2) Occasionally, we may receive a duplicate notification for a history + // download with no associated session download. We have exactly one + // download element shell in this case, but the metdata cannot have + // changed, just the reference to the Places node object is different. + // So, we update all the node references and keep the metadata intact. for (let shell of shellsForURI) { - if (shell.placesNode != aPlacesNode) - shell.placesNode = aPlacesNode; + if (!shell.historyDownload) { + // Create the element to host the metadata when needed. + shell.historyDownload = new HistoryDownload(aPlacesNode); + } + shell.element._placesNode = aPlacesNode; } } @@ -963,8 +750,7 @@ DownloadsPlacesView.prototype = { // the top of the richlistbox, along with other session downloads. // More generally, if a new download is added, should be made visible. this._richlistbox.ensureElementIsVisible(newOrUpdatedShell.element); - } - else if (aDataItem) { + } else if (sessionDownload) { let before = this._lastSessionDownloadElement ? this._lastSessionDownloadElement.nextSibling : this._richlistbox.firstChild; this._richlistbox.insertBefore(newOrUpdatedShell.element, before); @@ -1015,8 +801,8 @@ DownloadsPlacesView.prototype = { let shellsForURI = this._downloadElementsShellsForURI.get(downloadURI); if (shellsForURI) { for (let shell of shellsForURI) { - if (shell.dataItem) { - shell.placesNode = null; + if (shell.sessionDownload) { + shell.historyDownload = null; } else { this._removeElement(shell.element); @@ -1028,13 +814,13 @@ DownloadsPlacesView.prototype = { } }, - _removeSessionDownloadFromView: - function DPV__removeSessionDownloadFromView(aDataItem) { - let shells = this._downloadElementsShellsForURI.get(aDataItem.uri); + _removeSessionDownloadFromView(download) { + let shells = this._downloadElementsShellsForURI + .get(download.source.url); if (shells.size == 0) throw new Error("Should have had at leaat one shell for this uri"); - let shell = this.getViewItem(aDataItem); + let shell = this._viewItemsForDownloads.get(download); if (!shells.has(shell)) throw new Error("Missing download element shell in shells list for url"); @@ -1042,14 +828,22 @@ DownloadsPlacesView.prototype = { // view item for this this particular data item go away. // If there's only one item for this download uri, we should only // keep it if it is associated with a history download. - if (shells.size > 1 || !shell.placesNode) { + if (shells.size > 1 || !shell.historyDownload) { this._removeElement(shell.element); shells.delete(shell); if (shells.size == 0) - this._downloadElementsShellsForURI.delete(aDataItem.uri); + this._downloadElementsShellsForURI.delete(download.source.url); } else { - shell.dataItem = null; + // We have one download element shell containing both a session download + // and a history download, and we are now removing the session download. + // Previously, we did not use the Places metadata because it was obscured + // by the session download. Since this is no longer the case, we have to + // read the latest metadata before removing the session download. + let url = shell.historyDownload.source.url; + let metaData = this._getPlacesMetaDataFor(url); + shell.historyDownload.updateFromMetaData(metaData); + shell.sessionDownload = null; // Move it below the session-download items; if (this._lastSessionDownloadElement == shell.element) { this._lastSessionDownloadElement = shell.element.previousSibling; @@ -1157,13 +951,9 @@ DownloadsPlacesView.prototype = { }, get selectedNodes() { - let placesNodes = []; - let selectedElements = this._richlistbox.selectedItems; - for (let elt of selectedElements) { - if (elt._shell.placesNode) - placesNodes.push(elt._shell.placesNode); - } - return placesNodes; + return [for (element of this._richlistbox.selectedItems) + if (element._placesNode) + element._placesNode]; }, get selectedNode() { @@ -1193,8 +983,9 @@ DownloadsPlacesView.prototype = { // Loop backwards since _removeHistoryDownloadFromView may removeChild(). for (let i = this._richlistbox.childNodes.length - 1; i >= 0; --i) { let element = this._richlistbox.childNodes[i]; - if (element._shell.placesNode) - this._removeHistoryDownloadFromView(element._shell.placesNode); + if (element._placesNode) { + this._removeHistoryDownloadFromView(element._placesNode); + } } } finally { @@ -1254,24 +1045,9 @@ DownloadsPlacesView.prototype = { this._removeHistoryDownloadFromView(aPlacesNode); }, - nodeIconChanged: function DPV_nodeIconChanged(aNode) { - this._forEachDownloadElementShellForURI(aNode.uri, function(aDownloadElementShell) { - aDownloadElementShell.placesNodeIconChanged(); - }); - }, - - nodeAnnotationChanged: function DPV_nodeAnnotationChanged(aNode, aAnnoName) { - this._forEachDownloadElementShellForURI(aNode.uri, function(aDownloadElementShell) { - aDownloadElementShell.placesNodeAnnotationChanged(aAnnoName); - }); - }, - - nodeTitleChanged: function DPV_nodeTitleChanged(aNode, aNewTitle) { - this._forEachDownloadElementShellForURI(aNode.uri, function(aDownloadElementShell) { - aDownloadElementShell.placesNodeTitleChanged(); - }); - }, - + nodeAnnotationChanged() {}, + nodeIconChanged() {}, + nodeTitleChanged() {}, nodeKeywordChanged: function() {}, nodeDateAddedChanged: function() {}, nodeLastModifiedChanged: function() {}, @@ -1334,16 +1110,21 @@ DownloadsPlacesView.prototype = { this._ensureInitialSelection(); }, - onDataItemAdded: function DPV_onDataItemAdded(aDataItem, aNewest) { - this._addDownloadData(aDataItem, null, aNewest); + onDownloadAdded(download, newest) { + this._addDownloadData(download, null, newest); }, - onDataItemRemoved: function DPV_onDataItemRemoved(aDataItem) { - this._removeSessionDownloadFromView(aDataItem); + onDownloadStateChanged(download) { + this._viewItemsForDownloads.get(download).onStateChanged(); }, - getViewItem: function(aDataItem) - this._viewItemsForDataItems.get(aDataItem, null), + onDownloadChanged(download) { + this._viewItemsForDownloads.get(download).onChanged(); + }, + + onDownloadRemoved(download) { + this._removeSessionDownloadFromView(download); + }, supportsCommand: function DPV_supportsCommand(aCommand) { if (DOWNLOAD_VIEW_SUPPORTED_COMMANDS.indexOf(aCommand) != -1) { @@ -1386,8 +1167,11 @@ DownloadsPlacesView.prototype = { // Because history downloads are always removable and are listed after the // session downloads, check from bottom to top. for (let elt = this._richlistbox.lastChild; elt; elt = elt.previousSibling) { - if (elt._shell.placesNode || !elt._shell.dataItem.inProgress) + // Stopped, paused, and failed downloads with partial data are removed. + let download = elt._shell.download; + if (download.stopped && !(download.canceled && download.hasPartialData)) { return true; + } } return false; }, @@ -1395,10 +1179,11 @@ DownloadsPlacesView.prototype = { _copySelectedDownloadsToClipboard: function DPV__copySelectedDownloadsToClipboard() { let urls = [for (element of this._richlistbox.selectedItems) - element._shell.downloadURI]; + element._shell.download.source.url]; - Cc["@mozilla.org/widget/clipboardhelper;1"]. - getService(Ci.nsIClipboardHelper).copyString(urls.join("\n")); + Cc["@mozilla.org/widget/clipboardhelper;1"] + .getService(Ci.nsIClipboardHelper) + .copyString(urls.join("\n"), document); }, _getURLFromClipboardData: function DPV__getURLFromClipboardData() { @@ -1486,15 +1271,13 @@ DownloadsPlacesView.prototype = { // Set the state attribute so that only the appropriate items are displayed. let contextMenu = document.getElementById("downloadsContextMenu"); - let state = element._shell.getDownloadMetaData().state; - if (state !== undefined) - contextMenu.setAttribute("state", state); - else - contextMenu.removeAttribute("state"); - - if (state == nsIDM.DOWNLOAD_DOWNLOADING) { - // The resumable property of a download may change at any time, so - // ensure we update the related command now. + let download = element._shell.download; + contextMenu.setAttribute("state", + DownloadsCommon.stateOfDownload(download)); + + if (!download.stopped) { + // The hasPartialData property of a download may change at any time after + // it has started, so ensure we update the related command now. goUpdateCommand("downloadsCmd_pauseResume"); } return true; @@ -1555,10 +1338,13 @@ DownloadsPlacesView.prototype = { if (!selectedItem) return; - let metaData = selectedItem._shell.getDownloadMetaData(); - if (!("filePath" in metaData)) + let targetPath = selectedItem._shell.download.target.path; + if (!targetPath) { return; - let file = new FileUtils.File(metaData.filePath); + } + + // We must check for existence synchronously because this is a DOM event. + let file = new FileUtils.File(targetPath); if (!file.exists()) return; diff --git a/application/palemoon/components/downloads/content/downloads.js b/application/palemoon/components/downloads/content/downloads.js index 833d7d72f..ee1c6902e 100644 --- a/application/palemoon/components/downloads/content/downloads.js +++ b/application/palemoon/components/downloads/content/downloads.js @@ -4,6 +4,23 @@ * 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/. */ +var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); + +XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", + "resource:///modules/DownloadsCommon.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "DownloadsViewUI", + "resource:///modules/DownloadsViewUI.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", + "resource://gre/modules/FileUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", + "resource://gre/modules/NetUtil.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", + "resource://gre/modules/PlacesUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Services", + "resource://gre/modules/Services.jsm"); + /** * Handles the Downloads panel user interface for each browser window. * @@ -65,22 +82,6 @@ "use strict"; //////////////////////////////////////////////////////////////////////////////// -//// Globals - -XPCOMUtils.defineLazyModuleGetter(this, "DownloadUtils", - "resource://gre/modules/DownloadUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", - "resource:///modules/DownloadsCommon.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "OS", - "resource://gre/modules/osfile.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", - "resource://gre/modules/PrivateBrowsingUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", - "resource://gre/modules/PlacesUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", - "resource://gre/modules/NetUtil.jsm"); - -//////////////////////////////////////////////////////////////////////////////// //// DownloadsPanel /** @@ -570,8 +571,8 @@ const DownloadsPanel = { // still exist, and update the allowed items interactions accordingly. We // do these checks on a background thread, and don't prevent the panel to // be displayed while these checks are being performed. - for each (let viewItem in DownloadsView._viewItems) { - viewItem.verifyTargetExists(); + for (let viewItem of DownloadsView._visibleViewItems.values()) { + viewItem.download.refresh().catch(Cu.reportError); } if (aAnchor) { @@ -703,19 +704,19 @@ const DownloadsView = { loading: false, /** - * Ordered array of all DownloadsDataItem objects. We need to keep this array - * because only a limited number of items are shown at once, and if an item - * that is currently visible is removed from the list, we might need to take - * another item from the array and make it appear at the bottom. + * Ordered array of all Download objects. We need to keep this array because + * only a limited number of items are shown at once, and if an item that is + * currently visible is removed from the list, we might need to take another + * item from the array and make it appear at the bottom. */ - _dataItems: [], + _downloads: [], /** - * Object containing the available DownloadsViewItem objects, indexed by their - * numeric download identifier. There is a limited number of view items in - * the panel at any given time. + * Associates the visible Download objects with their corresponding + * DownloadsViewItem object. There is a limited number of view items in the + * panel at any given time. */ - _viewItems: {}, + _visibleViewItems: new Map(), /** * Called when the number of items in the list changes. @@ -723,8 +724,8 @@ const DownloadsView = { _itemCountChanged: function DV_itemCountChanged() { DownloadsCommon.log("The downloads item count has changed - we are tracking", - this._dataItems.length, "downloads in total."); - let count = this._dataItems.length; + this._downloads.length, "downloads in total."); + let count = this._downloads.length; let hiddenCount = count - this.kItemCountLimit; if (count > 0) { @@ -813,8 +814,8 @@ const DownloadsView = { * Called when a new download data item is available, either during the * asynchronous data load or when a new download is started. * - * @param aDataItem - * DownloadsDataItem object that was just added. + * @param aDownload + * Download object that was just added. * @param aNewest * When true, indicates that this item is the most recent and should be * added in the topmost position. This happens when a new download is @@ -822,28 +823,27 @@ const DownloadsView = { * and should be appended. The latter generally happens during the * asynchronous data load. */ - onDataItemAdded: function DV_onDataItemAdded(aDataItem, aNewest) - { + onDownloadAdded(download, aNewest) { DownloadsCommon.log("A new download data item was added - aNewest =", aNewest); if (aNewest) { - this._dataItems.unshift(aDataItem); + this._downloads.unshift(download); } else { - this._dataItems.push(aDataItem); + this._downloads.push(download); } - let itemsNowOverflow = this._dataItems.length > this.kItemCountLimit; + let itemsNowOverflow = this._downloads.length > this.kItemCountLimit; if (aNewest || !itemsNowOverflow) { // The newly added item is visible in the panel and we must add the // corresponding element. This is either because it is the first item, or // because it was added at the bottom but the list still doesn't overflow. - this._addViewItem(aDataItem, aNewest); + this._addViewItem(download, aNewest); } if (aNewest && itemsNowOverflow) { // If the list overflows, remove the last item from the panel to make room // for the new one that we just added at the top. - this._removeViewItem(this._dataItems[this.kItemCountLimit]); + this._removeViewItem(this._downloads[this.kItemCountLimit]); } // For better performance during batch loads, don't update the count for @@ -853,26 +853,39 @@ const DownloadsView = { } }, + onDownloadStateChanged(download) { + let viewItem = this._visibleViewItems.get(download); + if (viewItem) { + viewItem.onStateChanged(); + } + }, + + onDownloadChanged(download) { + let viewItem = this._visibleViewItems.get(download); + if (viewItem) { + viewItem.onChanged(); + } + }, + /** * Called when a data item is removed. Ensures that the widget associated * with the view item is removed from the user interface. * - * @param aDataItem - * DownloadsDataItem object that is being removed. + * @param download + * Download object that is being removed. */ - onDataItemRemoved: function DV_onDataItemRemoved(aDataItem) - { + onDownloadRemoved(download) { DownloadsCommon.log("A download data item was removed."); - let itemIndex = this._dataItems.indexOf(aDataItem); - this._dataItems.splice(itemIndex, 1); + let itemIndex = this._downloads.indexOf(download); + this._downloads.splice(itemIndex, 1); if (itemIndex < this.kItemCountLimit) { // The item to remove is visible in the panel. - this._removeViewItem(aDataItem); - if (this._dataItems.length >= this.kItemCountLimit) { + this._removeViewItem(download); + if (this._downloads.length >= this.kItemCountLimit) { // Reinsert the next item into the panel. - this._addViewItem(this._dataItems[this.kItemCountLimit - 1], false); + this._addViewItem(this._downloads[this.kItemCountLimit - 1], false); } } @@ -880,43 +893,29 @@ const DownloadsView = { }, /** - * Returns the view item associated with the provided data item for this view. - * - * @param aDataItem - * DownloadsDataItem object for which the view item is requested. - * - * @return Object that can be used to notify item status events. + * Associates each richlistitem for a download with its corresponding + * DownloadsViewItemController object. */ - getViewItem: function DV_getViewItem(aDataItem) - { - // If the item is visible, just return it, otherwise return a mock object - // that doesn't react to notifications. - if (aDataItem.downloadGuid in this._viewItems) { - return this._viewItems[aDataItem.downloadGuid]; - } - return this._invisibleViewItem; - }, + _controllersForElements: new Map(), - /** - * Mock DownloadsDataItem object that doesn't react to notifications. - */ - _invisibleViewItem: Object.freeze({ - onStateChange: function () { }, - onProgressChange: function () { } - }), + controllerForElement(element) { + return this._controllersForElements.get(element); + }, /** * Creates a new view item associated with the specified data item, and adds * it to the top or the bottom of the list. */ - _addViewItem: function DV_addViewItem(aDataItem, aNewest) + _addViewItem(download, aNewest) { DownloadsCommon.log("Adding a new DownloadsViewItem to the downloads list.", "aNewest =", aNewest); let element = document.createElement("richlistitem"); - let viewItem = new DownloadsViewItem(aDataItem, element); - this._viewItems[aDataItem.downloadGuid] = viewItem; + let viewItem = new DownloadsViewItem(download, element); + this._visibleViewItems.set(download, viewItem); + let viewItemController = new DownloadsViewItemController(download); + this._controllersForElements.set(element, viewItemController); if (aNewest) { this.richListBox.insertBefore(element, this.richListBox.firstChild); } else { @@ -927,17 +926,17 @@ const DownloadsView = { /** * Removes the view item associated with the specified data item. */ - _removeViewItem: function DV_removeViewItem(aDataItem) - { + _removeViewItem(download) { DownloadsCommon.log("Removing a DownloadsViewItem from the downloads list."); - let element = this.getViewItem(aDataItem)._element; + let element = this._visibleViewItems.get(download).element; let previousSelectedIndex = this.richListBox.selectedIndex; this.richListBox.removeChild(element); if (previousSelectedIndex != -1) { this.richListBox.selectedIndex = Math.min(previousSelectedIndex, this.richListBox.itemCount - 1); } - delete this._viewItems[aDataItem.downloadGuid]; + this._visibleViewItems.delete(download); + this._controllersForElements.delete(element); }, ////////////////////////////////////////////////////////////////////////////// @@ -959,7 +958,7 @@ const DownloadsView = { while (target.nodeName != "richlistitem") { target = target.parentNode; } - new DownloadsViewItemController(target).doCommand(aCommand); + DownloadsView.controllerForElement(target).doCommand(aCommand); }, onDownloadClick: function DV_onDownloadClick(aEvent) @@ -1038,8 +1037,9 @@ const DownloadsView = { return; } - let controller = new DownloadsViewItemController(element); - let localFile = controller.dataItem.localFile; + // We must check for existence synchronously because this is a DOM event. + let localFile = new FileUtils.File(DownloadsView.controllerForElement(element) + .download.target.path); if (!localFile.exists()) { return; } @@ -1065,259 +1065,39 @@ XPCOMUtils.defineConstant(this, "DownloadsView", DownloadsView); * Builds and updates a single item in the downloads list widget, responding to * changes in the download state and real-time data. * - * @param aDataItem - * DownloadsDataItem to be associated with the view item. + * @param download + * Download object to be associated with the view item. * @param aElement * XUL element corresponding to the single download item in the view. */ -function DownloadsViewItem(aDataItem, aElement) -{ - this._element = aElement; - this.dataItem = aDataItem; - - this.lastEstimatedSecondsLeft = Infinity; - - // Set the URI that represents the correct icon for the target file. As soon - // as bug 239948 comment 12 is handled, the "file" property will be always a - // file URL rather than a file name. At that point we should remove the "//" - // (double slash) from the icon URI specification (see test_moz_icon_uri.js). - this.image = "moz-icon://" + this.dataItem.file + "?size=32"; - - let s = DownloadsCommon.strings; - let [displayHost, fullHost] = - DownloadUtils.getURIHost(this.dataItem.referrer || this.dataItem.uri); - - let attributes = { - "type": "download", - "class": "download-state", - "id": "downloadsItem_" + this.dataItem.downloadGuid, - "downloadGuid": this.dataItem.downloadGuid, - "state": this.dataItem.state, - "progress": this.dataItem.inProgress ? this.dataItem.percentComplete : 100, - "displayName": this.dataItem.target, - "extendedDisplayName": s.statusSeparator(this.dataItem.target, displayHost), - "extendedDisplayNameTip": s.statusSeparator(this.dataItem.target, fullHost), - "image": this.image - }; - - for (let attributeName in attributes) { - this._element.setAttribute(attributeName, attributes[attributeName]); - } +function DownloadsViewItem(download, aElement) { + this.download = download; + + this.element = aElement; + this.element._shell = this; - // Initialize more complex attributes. - this._updateProgress(); - this._updateStatusLine(); - this.verifyTargetExists(); + this.element.setAttribute("type", "download"); + this.element.classList.add("download-state"); + + this._updateState(); } DownloadsViewItem.prototype = { - /** - * The DownloadDataItem associated with this view item. - */ - dataItem: null, + __proto__: DownloadsViewUI.DownloadElementShell.prototype, /** * The XUL element corresponding to the associated richlistbox item. */ _element: null, - /** - * The inner XUL element for the progress bar, or null if not available. - */ - _progressElement: null, - - ////////////////////////////////////////////////////////////////////////////// - //// Callback functions from DownloadsData - - /** - * Called when the download state might have changed. Sometimes the state of - * the download might be the same as before, if the data layer received - * multiple events for the same download. - */ - onStateChange: function DVI_onStateChange(aOldState) - { - // If a download just finished successfully, it means that the target file - // now exists and we can extract its specific icon. To ensure that the icon - // is reloaded, we must change the URI used by the XUL image element, for - // example by adding a query parameter. Since this URI has a "moz-icon" - // scheme, this only works if we add one of the parameters explicitly - // supported by the nsIMozIconURI interface. - if (aOldState != Ci.nsIDownloadManager.DOWNLOAD_FINISHED && - aOldState != this.dataItem.state) { - this._element.setAttribute("image", this.image + "&state=normal"); - - // We assume the existence of the target of a download that just completed - // successfully, without checking the condition in the background. If the - // panel is already open, this will take effect immediately. If the panel - // is opened later, a new background existence check will be performed. - this._element.setAttribute("exists", "true"); - } - - // Update the user interface after switching states. - this._element.setAttribute("state", this.dataItem.state); - this._updateProgress(); - this._updateStatusLine(); + onStateChanged() { + this.element.setAttribute("image", this.image); + this.element.setAttribute("state", + DownloadsCommon.stateOfDownload(this.download)); }, - /** - * Called when the download progress has changed. - */ - onProgressChange: function DVI_onProgressChange() { + onChanged() { this._updateProgress(); - this._updateStatusLine(); - }, - - ////////////////////////////////////////////////////////////////////////////// - //// Functions for updating the user interface - - /** - * Updates the progress bar. - */ - _updateProgress: function DVI_updateProgress() { - if (this.dataItem.starting) { - // Before the download starts, the progress meter has its initial value. - this._element.setAttribute("progressmode", "normal"); - this._element.setAttribute("progress", "0"); - } else if (this.dataItem.state == Ci.nsIDownloadManager.DOWNLOAD_SCANNING || - this.dataItem.percentComplete == -1) { - // We might not know the progress of a running download, and we don't know - // the remaining time during the malware scanning phase. - this._element.setAttribute("progressmode", "undetermined"); - } else { - // This is a running download of which we know the progress. - this._element.setAttribute("progressmode", "normal"); - this._element.setAttribute("progress", this.dataItem.percentComplete); - } - - // Find the progress element as soon as the download binding is accessible. - if (!this._progressElement) { - this._progressElement = - document.getAnonymousElementByAttribute(this._element, "anonid", - "progressmeter"); - } - - // Dispatch the ValueChange event for accessibility, if possible. - if (this._progressElement) { - let event = document.createEvent("Events"); - event.initEvent("ValueChange", true, true); - this._progressElement.dispatchEvent(event); - } - }, - - /** - * Updates the main status line, including bytes transferred, bytes total, - * download rate, and time remaining. - */ - _updateStatusLine: function DVI_updateStatusLine() { - const nsIDM = Ci.nsIDownloadManager; - - let status = ""; - let statusTip = ""; - - if (this.dataItem.paused) { - let transfer = DownloadUtils.getTransferTotal(this.dataItem.currBytes, - this.dataItem.maxBytes); - - // We use the same XUL label to display both the state and the amount - // transferred, for example "Paused - 1.1 MB". - status = DownloadsCommon.strings.statusSeparatorBeforeNumber( - DownloadsCommon.strings.statePaused, - transfer); - } else if (this.dataItem.state == nsIDM.DOWNLOAD_DOWNLOADING) { - // We don't show the rate for each download in order to reduce clutter. - // The remaining time per download is likely enough information for the - // panel. - [status] = - DownloadUtils.getDownloadStatusNoRate(this.dataItem.currBytes, - this.dataItem.maxBytes, - this.dataItem.speed, - this.lastEstimatedSecondsLeft); - - // We are, however, OK with displaying the rate in the tooltip. - let newEstimatedSecondsLeft; - [statusTip, newEstimatedSecondsLeft] = - DownloadUtils.getDownloadStatus(this.dataItem.currBytes, - this.dataItem.maxBytes, - this.dataItem.speed, - this.lastEstimatedSecondsLeft); - this.lastEstimatedSecondsLeft = newEstimatedSecondsLeft; - } else if (this.dataItem.starting) { - status = DownloadsCommon.strings.stateStarting; - } else if (this.dataItem.state == nsIDM.DOWNLOAD_SCANNING) { - status = DownloadsCommon.strings.stateScanning; - } else if (!this.dataItem.inProgress) { - let stateLabel = function () { - let s = DownloadsCommon.strings; - switch (this.dataItem.state) { - case nsIDM.DOWNLOAD_FAILED: return s.stateFailed; - case nsIDM.DOWNLOAD_CANCELED: return s.stateCanceled; - case nsIDM.DOWNLOAD_BLOCKED_PARENTAL: return s.stateBlockedParentalControls; - case nsIDM.DOWNLOAD_BLOCKED_POLICY: return s.stateBlockedPolicy; - case nsIDM.DOWNLOAD_DIRTY: return s.stateDirty; - case nsIDM.DOWNLOAD_FINISHED: return this._fileSizeText; - } - return null; - }.apply(this); - - let [displayHost, fullHost] = - DownloadUtils.getURIHost(this.dataItem.referrer || this.dataItem.uri); - - let end = new Date(this.dataItem.endTime); - let [displayDate, fullDate] = DownloadUtils.getReadableDates(end); - - // We use the same XUL label to display the state, the host name, and the - // end time, for example "Canceled - 222.net - 11:15" or "1.1 MB - - // website2.com - Yesterday". We show the full host and the complete date - // in the tooltip. - let firstPart = DownloadsCommon.strings.statusSeparator(stateLabel, - displayHost); - status = DownloadsCommon.strings.statusSeparator(firstPart, displayDate); - statusTip = DownloadsCommon.strings.statusSeparator(fullHost, fullDate); - } - - this._element.setAttribute("status", status); - this._element.setAttribute("statusTip", statusTip || status); - }, - - /** - * Localized string representing the total size of completed downloads, for - * example "1.5 MB" or "Unknown size". - */ - get _fileSizeText() - { - // Display the file size, but show "Unknown" for negative sizes. - let fileSize = this.dataItem.maxBytes; - if (fileSize < 0) { - return DownloadsCommon.strings.sizeUnknown; - } - let [size, unit] = DownloadUtils.convertByteUnits(fileSize); - return DownloadsCommon.strings.sizeWithUnits(size, unit); - }, - - ////////////////////////////////////////////////////////////////////////////// - //// Functions called by the panel - - /** - * Starts checking whether the target file of a finished download is still - * available on disk, and sets an attribute that controls how the item is - * presented visually. - * - * The existence check is executed on a background thread. - */ - verifyTargetExists: function DVI_verifyTargetExists() { - // We don't need to check if the download is not finished successfully. - if (!this.dataItem.openable) { - return; - } - - OS.File.exists(this.dataItem.localFile.path).then( - function DVI_RTE_onSuccess(aExists) { - if (aExists) { - this._element.setAttribute("exists", "true"); - } else { - this._element.removeAttribute("exists"); - } - }.bind(this), Cu.reportError); }, }; @@ -1372,8 +1152,8 @@ const DownloadsViewController = { // Other commands are selection-specific. let element = DownloadsView.richListBox.selectedItem; - return element && - new DownloadsViewItemController(element).isCommandEnabled(aCommand); + return element && DownloadsView.controllerForElement(element) + .isCommandEnabled(aCommand); }, doCommand: function DVC_doCommand(aCommand) @@ -1388,7 +1168,7 @@ const DownloadsViewController = { let element = DownloadsView.richListBox.selectedItem; if (element) { // The doCommand function also checks if the command is enabled. - new DownloadsViewItemController(element).doCommand(aCommand); + DownloadsView.controllerForElement(element).doCommand(aCommand); } }, @@ -1428,36 +1208,41 @@ XPCOMUtils.defineConstant(this, "DownloadsViewController", DownloadsViewControll * Handles all the user interaction events, in particular the "commands", * related to a single item in the downloads list widgets. */ -function DownloadsViewItemController(aElement) { - let downloadGuid = aElement.getAttribute("downloadGuid"); - this.dataItem = DownloadsCommon.getData(window).dataItems[downloadGuid]; +function DownloadsViewItemController(download) { + this.download = download; } DownloadsViewItemController.prototype = { - ////////////////////////////////////////////////////////////////////////////// - //// Command dispatching - - /** - * The DownloadDataItem controlled by this object. - */ - dataItem: null, - isCommandEnabled: function DVIC_isCommandEnabled(aCommand) { switch (aCommand) { case "downloadsCmd_open": { - return this.dataItem.openable && this.dataItem.localFile.exists(); + if (!this.download.succeeded) { + return false; + } + + let file = new FileUtils.File(this.download.target.path); + return file.exists(); } case "downloadsCmd_show": { - return this.dataItem.localFile.exists() || - this.dataItem.partFile.exists(); + let file = new FileUtils.File(this.download.target.path); + if (file.exists()) { + return true; + } + + if (!this.download.target.partFilePath) { + return false; + } + + let partFile = new FileUtils.File(this.download.target.partFilePath); + return partFile.exists(); } case "downloadsCmd_pauseResume": - return this.dataItem.inProgress && this.dataItem.resumable; + return this.download.hasPartialData && !this.download.error; case "downloadsCmd_retry": - return this.dataItem.canRetry; + return this.download.canceled || this.download.error; case "downloadsCmd_openReferrer": - return !!this.dataItem.referrer; + return !!this.download.source.referrer; case "cmd_delete": case "downloadsCmd_cancel": case "downloadsCmd_copyLocation": @@ -1485,21 +1270,21 @@ DownloadsViewItemController.prototype = { commands: { cmd_delete: function DVIC_cmd_delete() { - Downloads.getList(Downloads.ALL) - .then(list => list.remove(this.dataItem._download)) - .then(() => this.dataItem._download.finalize(true)) - .catch(Cu.reportError); - PlacesUtils.bhistory.removePage(NetUtil.newURI(this.dataItem.uri)); + DownloadsCommon.removeAndFinalizeDownload(this.download); + PlacesUtils.bhistory.removePage( + NetUtil.newURI(this.download.source.url)); }, downloadsCmd_cancel: function DVIC_downloadsCmd_cancel() { - this.dataItem.cancel(); + this.download.cancel().catch(() => {}); + this.download.removePartialData().catch(Cu.reportError); }, downloadsCmd_open: function DVIC_downloadsCmd_open() { - this.dataItem.openLocalFile(window); + this.download.launch().catch(Cu.reportError); + // We explicitly close the panel here to give the user the feedback that // their click has been received, and we're handling the action. // Otherwise, we'd have to wait for the file-type handler to execute @@ -1510,7 +1295,8 @@ DownloadsViewItemController.prototype = { downloadsCmd_show: function DVIC_downloadsCmd_show() { - this.dataItem.showLocalFile(); + let file = new FileUtils.File(this.download.target.path); + DownloadsCommon.showDownloadedFile(file); // We explicitly close the panel here to give the user the feedback that // their click has been received, and we're handling the action. @@ -1522,24 +1308,28 @@ DownloadsViewItemController.prototype = { downloadsCmd_pauseResume: function DVIC_downloadsCmd_pauseResume() { - this.dataItem.togglePauseResume(); + if (this.download.stopped) { + this.download.start(); + } else { + this.download.cancel(); + } }, downloadsCmd_retry: function DVIC_downloadsCmd_retry() { - this.dataItem.retry(); + this.download.start().catch(() => {}); }, downloadsCmd_openReferrer: function DVIC_downloadsCmd_openReferrer() { - openURL(this.dataItem.referrer); + openURL(this.download.source.referrer); }, downloadsCmd_copyLocation: function DVIC_downloadsCmd_copyLocation() { let clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"] .getService(Ci.nsIClipboardHelper); - clipboard.copyString(this.dataItem.uri, document); + clipboard.copyString(this.download.source.url, document); }, downloadsCmd_doDefault: function DVIC_downloadsCmd_doDefault() @@ -1548,7 +1338,7 @@ DownloadsViewItemController.prototype = { // Determine the default command for the current item. let defaultCommand = function () { - switch (this.dataItem.state) { + switch (DownloadsCommon.stateOfDownload(this.download)) { case nsIDM.DOWNLOAD_NOTSTARTED: return "downloadsCmd_cancel"; case nsIDM.DOWNLOAD_FINISHED: return "downloadsCmd_open"; case nsIDM.DOWNLOAD_FAILED: return "downloadsCmd_retry"; diff --git a/application/palemoon/components/downloads/content/downloadsOverlay.xul b/application/palemoon/components/downloads/content/downloadsOverlay.xul index 2a4fe9099..ca35ee3cf 100644 --- a/application/palemoon/components/downloads/content/downloadsOverlay.xul +++ b/application/palemoon/components/downloads/content/downloadsOverlay.xul @@ -35,7 +35,7 @@ oncommand="goDoCommand('downloadsCmd_clearList')"/> </commandset> - <popupset> + <popupset id="mainPopupSet"> <!-- The panel has level="top" to ensure that it is never hidden by the taskbar on Windows. See bug 672365. For accessibility to screen readers, we use a label on the panel instead of the anchor because the diff --git a/application/palemoon/components/downloads/jar.mn b/application/palemoon/components/downloads/jar.mn index 8f8c66dd7..8c0b51902 100644 --- a/application/palemoon/components/downloads/jar.mn +++ b/application/palemoon/components/downloads/jar.mn @@ -3,16 +3,16 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/downloads/download.xml (content/download.xml) - content/browser/downloads/download.css (content/download.css) - content/browser/downloads/downloads.css (content/downloads.css) -* content/browser/downloads/downloads.js (content/downloads.js) -* content/browser/downloads/downloadsOverlay.xul (content/downloadsOverlay.xul) - content/browser/downloads/indicator.js (content/indicator.js) - content/browser/downloads/indicatorOverlay.xul (content/indicatorOverlay.xul) -* content/browser/downloads/allDownloadsViewOverlay.xul (content/allDownloadsViewOverlay.xul) - content/browser/downloads/allDownloadsViewOverlay.js (content/allDownloadsViewOverlay.js) - content/browser/downloads/allDownloadsViewOverlay.css (content/allDownloadsViewOverlay.css) -* content/browser/downloads/contentAreaDownloadsView.xul (content/contentAreaDownloadsView.xul) - content/browser/downloads/contentAreaDownloadsView.js (content/contentAreaDownloadsView.js) - content/browser/downloads/contentAreaDownloadsView.css (content/contentAreaDownloadsView.css) +* content/browser/downloads/download.xml (content/download.xml) + content/browser/downloads/download.css (content/download.css) + content/browser/downloads/downloads.css (content/downloads.css) +* content/browser/downloads/downloads.js (content/downloads.js) +* content/browser/downloads/downloadsOverlay.xul (content/downloadsOverlay.xul) + content/browser/downloads/indicator.js (content/indicator.js) + content/browser/downloads/indicatorOverlay.xul (content/indicatorOverlay.xul) +* content/browser/downloads/allDownloadsViewOverlay.xul (content/allDownloadsViewOverlay.xul) + content/browser/downloads/allDownloadsViewOverlay.js (content/allDownloadsViewOverlay.js) + content/browser/downloads/allDownloadsViewOverlay.css (content/allDownloadsViewOverlay.css) +* content/browser/downloads/contentAreaDownloadsView.xul (content/contentAreaDownloadsView.xul) + content/browser/downloads/contentAreaDownloadsView.js (content/contentAreaDownloadsView.js) + content/browser/downloads/contentAreaDownloadsView.css (content/contentAreaDownloadsView.css) diff --git a/application/palemoon/components/downloads/moz.build b/application/palemoon/components/downloads/moz.build index 61d8c0f62..abfaab7df 100644 --- a/application/palemoon/components/downloads/moz.build +++ b/application/palemoon/components/downloads/moz.build @@ -15,6 +15,7 @@ EXTRA_COMPONENTS += [ EXTRA_JS_MODULES += [ 'DownloadsLogger.jsm', 'DownloadsTaskbar.jsm', + 'DownloadsViewUI.jsm', ] EXTRA_PP_JS_MODULES += [ diff --git a/application/palemoon/components/feeds/FeedWriter.js b/application/palemoon/components/feeds/FeedWriter.js index 2ae31dffa..facde5815 100644 --- a/application/palemoon/components/feeds/FeedWriter.js +++ b/application/palemoon/components/feeds/FeedWriter.js @@ -18,12 +18,7 @@ function LOG(str) { var prefB = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefBranch); - var shouldLog = false; - try { - shouldLog = prefB.getBoolPref("feeds.log"); - } - catch (ex) { - } + var shouldLog = prefB.getBoolPref("feeds.log", false); if (shouldLog) dump("*** Feeds: " + str + "\n"); @@ -692,21 +687,6 @@ FeedWriter.prototype = { }, /** - * Get moz-icon url for a file - * @param file - * A nsIFile object for which the moz-icon:// is returned - * @returns moz-icon url of the given file as a string - */ - _getFileIconURL: function FW__getFileIconURL(file) { - var ios = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - var fph = ios.getProtocolHandler("file") - .QueryInterface(Ci.nsIFileProtocolHandler); - var urlSpec = fph.getURLSpecFromFile(file); - return "moz-icon://" + urlSpec + "?size=16"; - }, - - /** * Helper method to set the selected application and system default * reader menuitems details from a file object * @param aMenuItem @@ -717,7 +697,10 @@ FeedWriter.prototype = { _initMenuItemWithFile: function(aMenuItem, aFile) { this._contentSandbox.menuitem = aMenuItem; this._contentSandbox.label = this._getFileDisplayName(aFile); - this._contentSandbox.image = this._getFileIconURL(aFile); + // For security reasons, access to moz-icon:file://... URIs is + // no longer allowed (indirect file system access from content). + // We use a dummy application instead to get a generic icon. + this._contentSandbox.image = "moz-icon://dummy.exe?size=16"; var codeStr = "menuitem.setAttribute('label', label); " + "menuitem.setAttribute('image', image);" Cu.evalInSandbox(codeStr, this._contentSandbox); @@ -886,11 +869,7 @@ FeedWriter.prototype = { Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefBranch); - var handler = "bookmarks"; - try { - handler = prefs.getCharPref(getPrefReaderForType(feedType)); - } - catch (ex) { } + var handler = prefs.getCharPref(getPrefReaderForType(feedType), "bookmarks"); switch (handler) { case "web": { @@ -1088,11 +1067,7 @@ FeedWriter.prototype = { .addEventListener("command", this, false); // first-run ui - var showFirstRunUI = true; - try { - showFirstRunUI = prefs.getBoolPref(PREF_SHOW_FIRST_RUN_UI); - } - catch (ex) { } + var showFirstRunUI = prefs.getBoolPref(PREF_SHOW_FIRST_RUN_UI, true); if (showFirstRunUI) { var textfeedinfo1, textfeedinfo2; switch (feedType) { diff --git a/application/palemoon/components/feeds/WebContentConverter.js b/application/palemoon/components/feeds/WebContentConverter.js index 674c8f363..42e2edee0 100644 --- a/application/palemoon/components/feeds/WebContentConverter.js +++ b/application/palemoon/components/feeds/WebContentConverter.js @@ -63,7 +63,7 @@ const PREF_SELECTED_WEB = "browser.feeds.handlers.webservice"; const PREF_SELECTED_ACTION = "browser.feeds.handler"; const PREF_SELECTED_READER = "browser.feeds.handler.default"; const PREF_HANDLER_EXTERNAL_PREFIX = "network.protocol-handler.external"; -const PREF_ALLOW_DIFFERENT_HOST = "goanna.handlerService.allowRegisterFromDifferentHost"; +const PREF_ALLOW_DIFFERENT_HOST = "gecko.handlerService.allowRegisterFromDifferentHost"; const STRING_BUNDLE_URI = "chrome://browser/locale/feeds/subscribe.properties"; @@ -436,13 +436,8 @@ WebContentConverterRegistrar.prototype = { // check if it is in the black list var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); - var allowed; - try { - allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol); - } - catch (e) { - allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default"); - } + var allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol, + pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default")); if (!allowed) { // XXX this should be a "security exception" according to spec throw("Not allowed to register a protocol handler for " + aProtocol); diff --git a/application/palemoon/components/feeds/jar.mn b/application/palemoon/components/feeds/jar.mn index 2fae7efae..f8896f877 100644 --- a/application/palemoon/components/feeds/jar.mn +++ b/application/palemoon/components/feeds/jar.mn @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/feeds/subscribe.xhtml (content/subscribe.xhtml) - content/browser/feeds/subscribe.js (content/subscribe.js) - content/browser/feeds/subscribe.xml (content/subscribe.xml) - content/browser/feeds/subscribe.css (content/subscribe.css) + content/browser/feeds/subscribe.xhtml (content/subscribe.xhtml) + content/browser/feeds/subscribe.js (content/subscribe.js) + content/browser/feeds/subscribe.xml (content/subscribe.xml) + content/browser/feeds/subscribe.css (content/subscribe.css) diff --git a/application/palemoon/components/feeds/moz.build b/application/palemoon/components/feeds/moz.build index 7ae9141aa..736920a73 100644 --- a/application/palemoon/components/feeds/moz.build +++ b/application/palemoon/components/feeds/moz.build @@ -13,9 +13,7 @@ XPIDL_SOURCES += [ XPIDL_MODULE = 'browser-feeds' -SOURCES += [ - 'nsFeedSniffer.cpp', -] +SOURCES += ['nsFeedSniffer.cpp'] EXTRA_COMPONENTS += [ 'BrowserFeeds.manifest', @@ -32,6 +30,4 @@ FINAL_LIBRARY = 'browsercomps' for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'): DEFINES[var] = CONFIG[var] -LOCAL_INCLUDES += [ - '../build', -] +LOCAL_INCLUDES += ['../build'] diff --git a/application/palemoon/components/fuel/fuelApplication.js b/application/palemoon/components/fuel/fuelApplication.js index 017813143..bc3a091ea 100644 --- a/application/palemoon/components/fuel/fuelApplication.js +++ b/application/palemoon/components/fuel/fuelApplication.js @@ -6,6 +6,8 @@ const Ci = Components.interfaces; const Cc = Components.classes; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); +XPCOMUtils.defineLazyModuleGetter(this, "Deprecated", + "resource://gre/modules/Deprecated.jsm"); const APPLICATION_CID = Components.ID("fe74cf80-aa2d-11db-abbd-0800200c9a66"); const APPLICATION_CONTRACTID = "@mozilla.org/fuel/application;1"; @@ -734,6 +736,8 @@ var ApplicationFactory = { //================================================= // Application constructor function Application() { + Deprecated.warning("FUEL is deprecated, you should use the standard Toolkit API instead.", + "https://github.com/MoonchildProductions/UXP/issues/1083"); this.initToolkitHelpers(); } diff --git a/application/palemoon/components/fuel/moz.build b/application/palemoon/components/fuel/moz.build index e78eda088..5c468f27d 100644 --- a/application/palemoon/components/fuel/moz.build +++ b/application/palemoon/components/fuel/moz.build @@ -4,17 +4,11 @@ # 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/. -XPIDL_SOURCES += [ - 'fuelIApplication.idl', -] +XPIDL_SOURCES += ['fuelIApplication.idl'] XPIDL_MODULE = 'fuel' -EXTRA_COMPONENTS += [ - 'fuelApplication.manifest', -] +EXTRA_COMPONENTS += ['fuelApplication.manifest'] -EXTRA_PP_COMPONENTS += [ - 'fuelApplication.js', -] +EXTRA_PP_COMPONENTS += ['fuelApplication.js'] diff --git a/application/palemoon/components/moz.build b/application/palemoon/components/moz.build index 397bf5142..48d4552ba 100644 --- a/application/palemoon/components/moz.build +++ b/application/palemoon/components/moz.build @@ -5,12 +5,14 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. DIRS += [ - 'about', + 'abouthome', 'certerror', 'dirprovider', 'downloads', 'feeds', 'fuel', + 'newtab', + 'pageinfo', 'places', 'permissions', 'preferences', @@ -18,10 +20,11 @@ DIRS += [ 'search', 'sessionstore', 'shell', + 'statusbar', ] -if CONFIG['MOZ_BROWSER_STATUSBAR']: - DIRS += ['statusbar'] +if CONFIG['MOZ_SERVICES_SYNC']: + DIRS += ['sync'] DIRS += ['build'] @@ -32,9 +35,9 @@ XPIDL_SOURCES += [ XPIDL_MODULE = 'browsercompsbase' -EXTRA_COMPONENTS += [ 'BrowserComponents.manifest' ] - EXTRA_PP_COMPONENTS += [ + 'BrowserComponents.manifest', + 'nsAboutRedirector.js', 'nsBrowserContentHandler.js', 'nsBrowserGlue.js', ] diff --git a/application/palemoon/base/content/newtab/cells.js b/application/palemoon/components/newtab/cells.js index 47d4ef52d..47d4ef52d 100644 --- a/application/palemoon/base/content/newtab/cells.js +++ b/application/palemoon/components/newtab/cells.js diff --git a/application/palemoon/base/content/newtab/drag.js b/application/palemoon/components/newtab/drag.js index e3928ebd0..e3928ebd0 100644 --- a/application/palemoon/base/content/newtab/drag.js +++ b/application/palemoon/components/newtab/drag.js diff --git a/application/palemoon/base/content/newtab/dragDataHelper.js b/application/palemoon/components/newtab/dragDataHelper.js index 675ff2671..675ff2671 100644 --- a/application/palemoon/base/content/newtab/dragDataHelper.js +++ b/application/palemoon/components/newtab/dragDataHelper.js diff --git a/application/palemoon/base/content/newtab/drop.js b/application/palemoon/components/newtab/drop.js index 748652455..748652455 100644 --- a/application/palemoon/base/content/newtab/drop.js +++ b/application/palemoon/components/newtab/drop.js diff --git a/application/palemoon/base/content/newtab/dropPreview.js b/application/palemoon/components/newtab/dropPreview.js index fd7587a35..fd7587a35 100644 --- a/application/palemoon/base/content/newtab/dropPreview.js +++ b/application/palemoon/components/newtab/dropPreview.js diff --git a/application/palemoon/base/content/newtab/dropTargetShim.js b/application/palemoon/components/newtab/dropTargetShim.js index 57a97fa00..57a97fa00 100644 --- a/application/palemoon/base/content/newtab/dropTargetShim.js +++ b/application/palemoon/components/newtab/dropTargetShim.js diff --git a/application/palemoon/base/content/newtab/grid.js b/application/palemoon/components/newtab/grid.js index db3d319c3..e63ea54a6 100644 --- a/application/palemoon/base/content/newtab/grid.js +++ b/application/palemoon/components/newtab/grid.js @@ -130,13 +130,9 @@ var gGrid = { // 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; - } } } diff --git a/application/basilisk/components/syncedtabs/jar.mn b/application/palemoon/components/newtab/jar.mn index ba2b105a1..2d6291422 100644 --- a/application/basilisk/components/syncedtabs/jar.mn +++ b/application/palemoon/components/newtab/jar.mn @@ -3,5 +3,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/syncedtabs/sidebar.xhtml - content/browser/syncedtabs/sidebar.js + content/browser/newtab/newTab.xhtml +* content/browser/newtab/newTab.js + content/browser/newtab/newTab.css
\ No newline at end of file diff --git a/application/palemoon/components/about/moz.build b/application/palemoon/components/newtab/moz.build index 95a8451ba..2d64d506c 100644 --- a/application/palemoon/components/about/moz.build +++ b/application/palemoon/components/newtab/moz.build @@ -4,16 +4,5 @@ # 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/. -EXPORTS.mozilla.browser += [ - 'AboutRedirector.h', -] +JAR_MANIFESTS += ['jar.mn'] -SOURCES += [ - 'AboutRedirector.cpp', -] - -FINAL_LIBRARY = 'browsercomps' - -LOCAL_INCLUDES += [ - '../build', -] diff --git a/application/palemoon/base/content/newtab/newTab.css b/application/palemoon/components/newtab/newTab.css index fe745d2fd..3c7cfa102 100644 --- a/application/palemoon/base/content/newtab/newTab.css +++ b/application/palemoon/components/newtab/newTab.css @@ -301,7 +301,6 @@ input[type=button] { 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; diff --git a/application/palemoon/base/content/newtab/newTab.js b/application/palemoon/components/newtab/newTab.js index 0022f21bb..0022f21bb 100644 --- a/application/palemoon/base/content/newtab/newTab.js +++ b/application/palemoon/components/newtab/newTab.js diff --git a/application/palemoon/base/content/newtab/newTab.xhtml b/application/palemoon/components/newtab/newTab.xhtml index de000e723..de000e723 100644 --- a/application/palemoon/base/content/newtab/newTab.xhtml +++ b/application/palemoon/components/newtab/newTab.xhtml diff --git a/application/palemoon/base/content/newtab/page.js b/application/palemoon/components/newtab/page.js index 7117d4527..34387fd44 100644 --- a/application/palemoon/base/content/newtab/page.js +++ b/application/palemoon/components/newtab/page.js @@ -47,11 +47,6 @@ var gPage = { let enabled = gAllPages.enabled; this._updateAttributes(enabled); - // 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(); @@ -166,16 +161,6 @@ var gPage = { */ _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); - } }, /** @@ -250,43 +235,10 @@ var gPage = { }, 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"); - }, + aEvent.stopPropagation(); + } }; diff --git a/application/palemoon/base/content/newtab/search.js b/application/palemoon/components/newtab/search.js index 8bc959eee..8bc959eee 100644 --- a/application/palemoon/base/content/newtab/search.js +++ b/application/palemoon/components/newtab/search.js diff --git a/application/palemoon/base/content/newtab/sites.js b/application/palemoon/components/newtab/sites.js index a368146bb..cb5675238 100644 --- a/application/palemoon/base/content/newtab/sites.js +++ b/application/palemoon/components/newtab/sites.js @@ -136,15 +136,6 @@ Site.prototype = { 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 */ @@ -155,11 +146,8 @@ Site.prototype = { 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); } }, @@ -337,7 +325,7 @@ Site.prototype = { } else if (!pinned && target.classList.contains("newtab-control-pin")) { if (this.pin()) { - // suggested link has changed - update rest of the pages + // link has changed - update rest of the pages gAllPages.update(gPage); } action = "pin"; diff --git a/application/palemoon/base/content/newtab/transformations.js b/application/palemoon/components/newtab/transformations.js index f7db0ad84..f7db0ad84 100644 --- a/application/palemoon/base/content/newtab/transformations.js +++ b/application/palemoon/components/newtab/transformations.js diff --git a/application/palemoon/base/content/newtab/undo.js b/application/palemoon/components/newtab/undo.js index b856914d2..b856914d2 100644 --- a/application/palemoon/base/content/newtab/undo.js +++ b/application/palemoon/components/newtab/undo.js diff --git a/application/palemoon/base/content/newtab/updater.js b/application/palemoon/components/newtab/updater.js index 2bab74d70..2bab74d70 100644 --- a/application/palemoon/base/content/newtab/updater.js +++ b/application/palemoon/components/newtab/updater.js diff --git a/application/palemoon/components/nsAboutRedirector.js b/application/palemoon/components/nsAboutRedirector.js new file mode 100644 index 000000000..4d99a78f5 --- /dev/null +++ b/application/palemoon/components/nsAboutRedirector.js @@ -0,0 +1,114 @@ +/* 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/. */ + +var Ci = Components.interfaces; +var Cr = Components.results; +var Cu = Components.utils; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); + +// See: netwerk/protocol/about/nsIAboutModule.idl +const URI_SAFE_FOR_UNTRUSTED_CONTENT = Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT; +const ALLOW_SCRIPT = Ci.nsIAboutModule.ALLOW_SCRIPT; +const HIDE_FROM_ABOUTABOUT = Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT; +const MAKE_LINKABLE = Ci.nsIAboutModule.MAKE_LINKABLE; + +function AboutRedirector() {} +AboutRedirector.prototype = { + classDescription: "Browser about: Redirector", + classID: Components.ID("{8cc51368-6aa0-43e8-b762-bde9b9fd828c}"), + QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]), + + // Each entry in the map has the key as the part after the "about:" and the + // value as a record with url and flags entries. Note that each addition here + // should be coupled with a corresponding addition in BrowserComponents.manifest. + _redirMap: { + "certerror": { + url: "chrome://browser/content/certerror/aboutCertError.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT | HIDE_FROM_ABOUTABOUT) + }, + "downloads": { + url: "chrome://browser/content/downloads/contentAreaDownloadsView.xul", + flags: ALLOW_SCRIPT + }, + "feeds": { + url: "chrome://browser/content/feeds/subscribe.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT | HIDE_FROM_ABOUTABOUT) + }, + "home": { + url: "chrome://browser/content/abouthome/aboutHome.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | MAKE_LINKABLE | ALLOW_SCRIPT) + }, + "newtab": { + url: "chrome://browser/content/newtab/newTab.xhtml", + flags: ALLOW_SCRIPT + }, + "palemoon": { + url: "chrome://browser/content/palemoon.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | HIDE_FROM_ABOUTABOUT) + }, + "permissions": { + url: "chrome://browser/content/permissions/aboutPermissions.xul", + flags: ALLOW_SCRIPT + }, + "privatebrowsing": { + url: "chrome://browser/content/aboutPrivateBrowsing.xhtml", + flags: ALLOW_SCRIPT + }, + "rights": { + url: "chrome://global/content/aboutRights.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | MAKE_LINKABLE | ALLOW_SCRIPT) + }, + "sessionrestore": { + url: "chrome://browser/content/aboutSessionRestore.xhtml", + flags: ALLOW_SCRIPT + }, +#ifdef MOZ_SERVICES_SYNC + "sync-progress": { + url: "chrome://browser/content/sync/progress.xhtml", + flags: ALLOW_SCRIPT + }, + "sync-tabs": { + url: "chrome://browser/content/sync/aboutSyncTabs.xul", + flags: ALLOW_SCRIPT + }, +#endif + }, + + /** + * Gets the module name from the given URI. + */ + _getModuleName: function AboutRedirector__getModuleName(aURI) { + // Strip out the first ? or #, and anything following it + let name = (/[^?#]+/.exec(aURI.path))[0]; + return name.toLowerCase(); + }, + + getURIFlags: function(aURI) { + let name = this._getModuleName(aURI); + if (!(name in this._redirMap)) + throw Cr.NS_ERROR_ILLEGAL_VALUE; + return this._redirMap[name].flags; + }, + + newChannel: function(aURI, aLoadInfo) { + let name = this._getModuleName(aURI); + if (!(name in this._redirMap)) + throw Cr.NS_ERROR_ILLEGAL_VALUE; + + let newURI = Services.io.newURI(this._redirMap[name].url, null, null); + let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo); + channel.originalURI = aURI; + + if (this._redirMap[name].flags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) { + let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aURI); + channel.owner = principal; + } + + return channel; + } +}; + +var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutRedirector]); diff --git a/application/palemoon/components/nsBrowserContentHandler.js b/application/palemoon/components/nsBrowserContentHandler.js index 6a75b40f2..e7f1414c2 100644 --- a/application/palemoon/components/nsBrowserContentHandler.js +++ b/application/palemoon/components/nsBrowserContentHandler.js @@ -100,20 +100,14 @@ const OVERRIDE_NEW_BUILD_ID = 3; * OVERRIDE_NONE otherwise. */ function needHomepageOverride(prefb) { - var savedmstone = null; - try { - savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone"); - } catch (e) {} + var savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone", ""); if (savedmstone == "ignore") return OVERRIDE_NONE; var mstone = Services.appinfo.platformVersion; - var savedBuildID = null; - try { - savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID"); - } catch (e) {} + var savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID", ""); var buildID = Services.appinfo.platformBuildID; @@ -550,10 +544,7 @@ nsBrowserContentHandler.prototype = { // URL if we do end up showing an overridePage. This makes it possible // to have the overridePage's content vary depending on the version we're // upgrading from. - let old_mstone = "unknown"; - try { - old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone"); - } catch (ex) {} + let old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone", "unknown"); let override = needHomepageOverride(prefb); if (override != OVERRIDE_NONE) { switch (override) { diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 720d1165c..01a133833 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -152,6 +152,9 @@ BrowserGlue.prototype = { // nsIObserver implementation observe: function BG_observe(subject, topic, data) { switch (topic) { + case "notifications-open-settings": + this._openPermissions(subject); + break; case "prefservice:after-app-defaults": this._onAppDefaults(); break; @@ -322,6 +325,7 @@ BrowserGlue.prototype = { // initialization (called on application startup) _init: function BG__init() { let os = Services.obs; + os.addObserver(this, "notifications-open-settings", false); os.addObserver(this, "prefservice:after-app-defaults", false); os.addObserver(this, "final-ui-startup", false); os.addObserver(this, "browser-delayed-startup-finished", false); @@ -354,6 +358,7 @@ BrowserGlue.prototype = { // cleanup (called on application shutdown) _dispose: function BG__dispose() { let os = Services.obs; + os.removeObserver(this, "notifications-open-settings"); os.removeObserver(this, "prefservice:after-app-defaults"); os.removeObserver(this, "final-ui-startup"); os.removeObserver(this, "sessionstore-windows-restored"); @@ -547,14 +552,6 @@ BrowserGlue.prototype = { this._showPlacesLockedNotificationBox(); } - // If there are plugins installed that are outdated, and the user hasn't - // been warned about them yet, open the plugins update page. - // Pale Moon: disable this functionality, people are already notified - // if they visit a page with an outdated plugin, and they can check - // properly from the plugins page as well. -// if (Services.prefs.getBoolPref(PREF_PLUGINS_NOTIFYUSER)) -// this._showPluginUpdatePage(); - // For any add-ons that were installed disabled and can be enabled offer // them to the user. let changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED); @@ -993,14 +990,8 @@ BrowserGlue.prototype = { // An import operation is about to run. // Don't try to recreate smart bookmarks if autoExportHTML is true or // smart bookmarks are disabled. - var autoExportHTML = false; - try { - autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML"); - } catch(ex) {} - var smartBookmarksVersion = 0; - try { - smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion"); - } catch(ex) {} + var autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML", false); + var smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion", 0); if (!autoExportHTML && smartBookmarksVersion != -1) Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0); @@ -1484,6 +1475,16 @@ BrowserGlue.prototype = { } }, + _openPermissions: function(aPrincipal) { + var win = this.getMostRecentBrowserWindow(); + var url = "about:permissions"; + try { + url = url + "?filter=" + aPrincipal.URI.host; + } + catch (e) {} + win.openUILinkIn(url, "tab"); + }, + _hasSystemAlertsService: function() { try { return !!Cc["@mozilla.org/system-alerts-service;1"].getService( @@ -1549,10 +1550,7 @@ BrowserGlue.prototype = { const MAX_RESULTS = 10; // Get current smart bookmarks version. If not set, create them. - let smartBookmarksCurrentVersion = 0; - try { - smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF); - } catch(ex) {} + let smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF, 0); // If version is current or smart bookmarks are disabled, just bail out. if (smartBookmarksCurrentVersion == -1 || diff --git a/application/palemoon/base/content/pageinfo/feeds.js b/application/palemoon/components/pageinfo/feeds.js index 468d8c19d..468d8c19d 100644 --- a/application/palemoon/base/content/pageinfo/feeds.js +++ b/application/palemoon/components/pageinfo/feeds.js diff --git a/application/palemoon/base/content/pageinfo/feeds.xml b/application/palemoon/components/pageinfo/feeds.xml index 782c05a73..782c05a73 100644 --- a/application/palemoon/base/content/pageinfo/feeds.xml +++ b/application/palemoon/components/pageinfo/feeds.xml diff --git a/application/palemoon/components/pageinfo/jar.mn b/application/palemoon/components/pageinfo/jar.mn new file mode 100644 index 000000000..229f99168 --- /dev/null +++ b/application/palemoon/components/pageinfo/jar.mn @@ -0,0 +1,13 @@ +# 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/pageinfo/pageInfo.xul + content/browser/pageinfo/pageInfo.js + content/browser/pageinfo/pageInfo.css + content/browser/pageinfo/pageInfo.xml + content/browser/pageinfo/feeds.js + content/browser/pageinfo/feeds.xml + content/browser/pageinfo/permissions.js + content/browser/pageinfo/security.js
\ No newline at end of file diff --git a/application/basilisk/components/webextensions/moz.build b/application/palemoon/components/pageinfo/moz.build index 116e90415..2d64d506c 100644 --- a/application/basilisk/components/webextensions/moz.build +++ b/application/palemoon/components/pageinfo/moz.build @@ -1,4 +1,4 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# -*- 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 @@ -6,9 +6,3 @@ JAR_MANIFESTS += ['jar.mn'] -EXTRA_COMPONENTS += [ - 'extensions-browser.manifest', -] - -DIRS += ['schemas'] - diff --git a/application/palemoon/base/content/pageinfo/pageInfo.css b/application/palemoon/components/pageinfo/pageInfo.css index 622b56bb5..622b56bb5 100644 --- a/application/palemoon/base/content/pageinfo/pageInfo.css +++ b/application/palemoon/components/pageinfo/pageInfo.css diff --git a/application/palemoon/base/content/pageinfo/pageInfo.js b/application/palemoon/components/pageinfo/pageInfo.js index 600174ad9..600174ad9 100644 --- a/application/palemoon/base/content/pageinfo/pageInfo.js +++ b/application/palemoon/components/pageinfo/pageInfo.js diff --git a/application/palemoon/base/content/pageinfo/pageInfo.xml b/application/palemoon/components/pageinfo/pageInfo.xml index 20d330046..20d330046 100644 --- a/application/palemoon/base/content/pageinfo/pageInfo.xml +++ b/application/palemoon/components/pageinfo/pageInfo.xml diff --git a/application/palemoon/base/content/pageinfo/pageInfo.xul b/application/palemoon/components/pageinfo/pageInfo.xul index e3a61d31e..c7c486ab9 100644 --- a/application/palemoon/base/content/pageinfo/pageInfo.xul +++ b/application/palemoon/components/pageinfo/pageInfo.xul @@ -501,7 +501,7 @@ </deck> #ifdef XP_MACOSX -#include ../browserMountPoints.inc +#include ../../base/content/browserMountPoints.inc #endif </window> diff --git a/application/palemoon/base/content/pageinfo/permissions.js b/application/palemoon/components/pageinfo/permissions.js index 4f8382f66..4f8382f66 100644 --- a/application/palemoon/base/content/pageinfo/permissions.js +++ b/application/palemoon/components/pageinfo/permissions.js diff --git a/application/palemoon/base/content/pageinfo/security.js b/application/palemoon/components/pageinfo/security.js index e791ab92a..e791ab92a 100644 --- a/application/palemoon/base/content/pageinfo/security.js +++ b/application/palemoon/components/pageinfo/security.js diff --git a/application/palemoon/components/permissions/aboutPermissions.js b/application/palemoon/components/permissions/aboutPermissions.js index 6a02daa29..421b65a0e 100644 --- a/application/palemoon/components/permissions/aboutPermissions.js +++ b/application/palemoon/components/permissions/aboutPermissions.js @@ -516,6 +516,14 @@ var AboutPermissions = { Services.obs.notifyObservers(null, "browser-permissions-preinit", null); this._initPart2(); + + // Process about:permissions?filter=<string> + // About URIs don't support query params, so do this manually + var loc = document.location.href; + var matches = /[?&]filter\=([^&]+)/i.exec(loc); + if (matches) { + this.sitesFilter.value = decodeURIComponent(matches[1]); + } }, sitesReload: function() { diff --git a/application/palemoon/components/permissions/jar.mn b/application/palemoon/components/permissions/jar.mn index 53fb2b41e..c78893837 100644 --- a/application/palemoon/components/permissions/jar.mn +++ b/application/palemoon/components/permissions/jar.mn @@ -3,7 +3,7 @@ # 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 + 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 index a4c26de89..3bbe67297 100644 --- a/application/palemoon/components/permissions/moz.build +++ b/application/palemoon/components/permissions/moz.build @@ -4,5 +4,4 @@ # 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 f62535613..e3a9e1322 100644 --- a/application/palemoon/components/places/PlacesUIUtils.jsm +++ b/application/palemoon/components/places/PlacesUIUtils.jsm @@ -146,14 +146,21 @@ this.PlacesUIUtils = { * annotations are synced from the old one. * @see this._copyableAnnotations for the list of copyable annotations. */ - _getFolderCopyTransaction: - function PUIU__getFolderCopyTransaction(aData, aContainer, aIndex) - { - function getChildItemsTransactions(aChildren) - { + _getFolderCopyTransaction(aData, aContainer, aIndex) { + function getChildItemsTransactions(aRoot) { let transactions = []; let index = aIndex; - aChildren.forEach(function (node, i) { + for (let i = 0; i < aRoot.childCount; ++i) { + let child = aRoot.getChild(i); + // Temporary hacks until we switch to PlacesTransactions.jsm. + let isLivemark = + PlacesUtils.annotations.itemHasAnnotation(child.itemId, + PlacesUtils.LMANNO_FEEDURI); + let [node] = PlacesUtils.unwrapNodes( + PlacesUtils.wrapNode(child, PlacesUtils.TYPE_X_MOZ_PLACE, isLivemark), + PlacesUtils.TYPE_X_MOZ_PLACE + ); + // Make sure that items are given the correct index, this will be // passed by the transaction manager to the backend for the insertion. // Insertion behaves differently for DEFAULT_INDEX (append). @@ -184,19 +191,21 @@ this.PlacesUIUtils = { else { throw new Error("Unexpected item under a bookmarks folder"); } - }); + } return transactions; } - if (aContainer == PlacesUtils.tagsFolderId) { // Copying a tag folder. + if (aContainer == PlacesUtils.tagsFolderId) { // Copying into a tag folder. let transactions = []; - if (aData.children) { - aData.children.forEach(function(aChild) { + if (!aData.livemark && aData.type == PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER) { + let {root} = PlacesUtils.getFolderContents(aData.id, false, false); + let urls = PlacesUtils.getURLsForContainerNode(root); + root.containerOpen = false; + for (let { uri } of urls) { transactions.push( - new PlacesTagURITransaction(PlacesUtils._uri(aChild.uri), - [aData.title]) + new PlacesTagURITransaction(NetUtil.newURI(uri), [aData.title]) ); - }); + } } return new PlacesAggregatedTransaction("addTags", transactions); } @@ -205,7 +214,10 @@ this.PlacesUIUtils = { return this._getLivemarkCopyTransaction(aData, aContainer, aIndex); } - let transactions = getChildItemsTransactions(aData.children); + let {root} = PlacesUtils.getFolderContents(aData.id, false, false); + let transactions = getChildItemsTransactions(root); + root.containerOpen = false; + if (aData.dateAdded) { transactions.push( new PlacesEditItemDateAddedTransaction(null, aData.dateAdded) @@ -1158,11 +1170,8 @@ this.PlacesUIUtils = { * @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; + function PUIU_getImageURLForResolution(aWindow, aURL, aWidth, aHeight) { + return aURL; } }; diff --git a/application/palemoon/components/places/content/bookmarkProperties.js b/application/palemoon/components/places/content/bookmarkProperties.js index 685ef57d2..e1d1077ab 100644 --- a/application/palemoon/components/places/content/bookmarkProperties.js +++ b/application/palemoon/components/places/content/bookmarkProperties.js @@ -382,6 +382,11 @@ var BookmarkPropertiesPanel = { .addEventListener("input", this, false); } } + + // Ensure the Name Picker textbox is focused on load + var namePickerElem = document.getElementById('editBMPanel_namePicker'); + namePickerElem.focus(); + namePickerElem.select(); }), // nsIDOMEventListener diff --git a/application/palemoon/components/places/content/browserPlacesViews.js b/application/palemoon/components/places/content/browserPlacesViews.js index eec7274a4..8b90dd280 100644 --- a/application/palemoon/components/places/content/browserPlacesViews.js +++ b/application/palemoon/components/places/content/browserPlacesViews.js @@ -109,8 +109,15 @@ PlacesViewBase.prototype = { get selectedNode() { if (this._contextMenuShown) { - let popup = document.popupNode; - return popup._placesNode || popup.parentNode._placesNode || null; + let anchor = this._contextMenuShown.triggerNode; + if (!anchor) + return null; + + if (anchor._placesNode) + return this._rootElt == anchor ? null : anchor._placesNode; + + anchor = anchor.parentNode; + return this._rootElt == anchor ? null : (anchor._placesNode || null); } return null; }, @@ -176,13 +183,13 @@ PlacesViewBase.prototype = { }, buildContextMenu: function PVB_buildContextMenu(aPopup) { - this._contextMenuShown = true; + this._contextMenuShown = aPopup; window.updateCommands("places"); return this.controller.buildContextMenu(aPopup); }, destroyContextMenu: function PVB_destroyContextMenu(aPopup) { - this._contextMenuShown = false; + this._contextMenuShown = null; }, _cleanPopup: function PVB_cleanPopup(aPopup, aDelay) { diff --git a/application/palemoon/components/places/content/controller.js b/application/palemoon/components/places/content/controller.js index 7f27e8347..f4e272e2f 100644 --- a/application/palemoon/components/places/content/controller.js +++ b/application/palemoon/components/places/content/controller.js @@ -334,20 +334,6 @@ PlacesController.prototype = { }, /** - * Determines whether or not the root node for the view is selected - */ - rootNodeIsSelected: function PC_rootNodeIsSelected() { - var nodes = this._view.selectedNodes; - var root = this._view.result.root; - for (var i = 0; i < nodes.length; ++i) { - if (nodes[i] == root) - return true; - } - - return false; - }, - - /** * Looks at the data on the clipboard to see if it is paste-able. * Paste-able data is: * - in a format that the view can receive @@ -400,7 +386,7 @@ PlacesController.prototype = { * Gathers information about the selected nodes according to the following * rules: * "link" node is a URI - * "bookmark" node is a bookamrk + * "bookmark" node is a bookmark * "livemarkChild" node is a child of a livemark * "tagChild" node is a child of a tag * "folder" node is a folder @@ -414,15 +400,10 @@ PlacesController.prototype = { * node are set on its corresponding object as properties. * Notes: * 1) This can be slow, so don't call it anywhere performance critical! - * 2) A single-object array corresponding the root node is returned if - * there's no selection. */ _buildSelectionMetadata: function PC__buildSelectionMetadata() { var metadata = []; - var root = this._view.result.root; var nodes = this._view.selectedNodes; - if (nodes.length == 0) - nodes.push(root); // See the second note above for (var i = 0; i < nodes.length; i++) { var nodeData = {}; @@ -463,7 +444,11 @@ PlacesController.prototype = { if (parentNode) { if (PlacesUtils.nodeIsTagQuery(parentNode)) nodeData["tagChild"] = true; - else if (this.hasCachedLivemarkInfo(parentNode)) + } + } else { + var parentNode = node.parent; + if (parentNode) { + if (this.hasCachedLivemarkInfo(parentNode)) nodeData["livemarkChild"] = true; } } @@ -501,10 +486,23 @@ PlacesController.prototype = { */ _shouldShowMenuItem: function PC__shouldShowMenuItem(aMenuItem, aMetaData) { var selectiontype = aMenuItem.getAttribute("selectiontype"); - if (selectiontype == "multiple" && aMetaData.length == 1) + if (!selectiontype) { + selectiontype = "single|multiple"; + } + var selectionTypes = selectiontype.split("|"); + if (selectionTypes.indexOf("any") != -1) { + return true; + } + var count = aMetaData.length; + if (count > 1 && selectionTypes.indexOf("multiple") == -1) return false; - if (selectiontype == "single" && aMetaData.length != 1) + if (count == 1 && selectionTypes.indexOf("single") == -1) return false; + // NB: if there is no selection, we show the item if (and only if) + // the selectiontype includes 'none' - the metadata list will be + // empty so none of the other criteria will apply anyway. + if (count == 0) + return selectionTypes.indexOf("none") != -1; var forceHideAttr = aMenuItem.getAttribute("forcehideselection"); if (forceHideAttr) { @@ -551,9 +549,11 @@ PlacesController.prototype = { * 1) The "selectiontype" attribute may be set on a menu-item to "single" * if the menu-item should be visible only if there is a single node * selected, or to "multiple" if the menu-item should be visible only if - * multiple nodes are selected. If the attribute is not set or if it is - * set to an invalid value, the menu-item may be visible for both types of - * selection. + * multiple nodes are selected, or to "none" if the menuitems should be + * visible for if there are no selected nodes, or to a |-separated + * combination of these. + * If the attribute is not set or set to an invalid value, the menu-item + * may be visible irrespective of the selection. * 2) The "selection" attribute may be set on a menu-item to the various * meta-data rules for which it may be visible. The rules should be * separated with the | character. @@ -584,7 +584,7 @@ PlacesController.prototype = { var separator = null; var visibleItemsBeforeSep = false; - var anyVisible = false; + var usableItemCount = 0; for (var i = 0; i < aPopup.childNodes.length; ++i) { var item = aPopup.childNodes[i]; if (item.localName != "menuseparator") { @@ -598,12 +598,13 @@ PlacesController.prototype = { (!/tree/i.test(this._view.localName) || ip); var hideIfPrivate = item.getAttribute("hideifprivatebrowsing") == "true" && PrivateBrowsingUtils.isWindowPrivate(window); - item.hidden = hideIfNoIP || hideIfPrivate || hideParentFolderItem || - !this._shouldShowMenuItem(item, metadata); + var shouldHideItem = hideIfNoIP || hideIfPrivate || hideParentFolderItem || + !this._shouldShowMenuItem(item, metadata); + item.hidden = item.disabled = shouldHideItem; if (!item.hidden) { visibleItemsBeforeSep = true; - anyVisible = true; + usableItemCount++; // Show the separator above the menu-item if any if (separator) { @@ -627,21 +628,21 @@ PlacesController.prototype = { } // Set Open Folder/Links In Tabs items enabled state if they're visible - if (anyVisible) { + if (usableItemCount > 0) { var openContainerInTabsItem = document.getElementById("placesContext_openContainer:tabs"); - if (!openContainerInTabsItem.hidden && this._view.selectedNode && - PlacesUtils.nodeIsContainer(this._view.selectedNode)) { - openContainerInTabsItem.disabled = - !PlacesUtils.hasChildURIs(this._view.selectedNode); - } - else { - // see selectiontype rule in the overlay - var openLinksInTabsItem = document.getElementById("placesContext_openLinks:tabs"); - openLinksInTabsItem.disabled = openLinksInTabsItem.hidden; + if (!openContainerInTabsItem.hidden) { + var containerToUse = this._view.selectedNode || this._view.result.root; + if (PlacesUtils.nodeIsContainer(containerToUse)) { + if (!PlacesUtils.hasChildURIs(containerToUse, true)) { + openContainerInTabsItem.disabled = true; + // Ensure that we don't display the menu if nothing is enabled: + usableItemCount--; + } + } } } - return anyVisible; + return usableItemCount > 0; }, /** @@ -707,10 +708,15 @@ PlacesController.prototype = { */ openSelectionInTabs: function PC_openLinksInTabs(aEvent) { var node = this._view.selectedNode; + var nodes = this._view.selectedNodes; + // In the case of no selection, open the root node: + if (!node && !nodes.length) { + node = this._view.result.root; + } if (node && PlacesUtils.nodeIsContainer(node)) - PlacesUIUtils.openContainerNodeInTabs(this._view.selectedNode, aEvent, this._view); + PlacesUIUtils.openContainerNodeInTabs(node, aEvent, this._view); else - PlacesUIUtils.openURINodesInTabs(this._view.selectedNodes, aEvent, this._view); + PlacesUIUtils.openURINodesInTabs(nodes, aEvent, this._view); }, /** @@ -1287,15 +1293,15 @@ PlacesController.prototype = { if (!didSuppressNotifications) result.suppressNotifications = true; - function addData(type, index, overrideURI) { - let wrapNode = PlacesUtils.wrapNode(node, type, overrideURI, doCopy); + function addData(type, index, feedURI) { + let wrapNode = PlacesUtils.wrapNode(node, type, feedURI); dt.mozSetDataAt(type, wrapNode, index); } - function addURIData(index, overrideURI) { - addData(PlacesUtils.TYPE_X_MOZ_URL, index, overrideURI); - addData(PlacesUtils.TYPE_UNICODE, index, overrideURI); - addData(PlacesUtils.TYPE_HTML, index, overrideURI); + function addURIData(index, feedURI) { + addData(PlacesUtils.TYPE_X_MOZ_URL, index, feedURI); + addData(PlacesUtils.TYPE_UNICODE, index, feedURI); + addData(PlacesUtils.TYPE_HTML, index, feedURI); } try { @@ -1387,12 +1393,11 @@ PlacesController.prototype = { copiedFolders.push(node); let livemarkInfo = this.getCachedLivemarkInfo(node); - let overrideURI = livemarkInfo ? livemarkInfo.feedURI.spec : null; - let resolveShortcuts = !PlacesControllerDragHelper.canMoveNode(node); + let feedURI = livemarkInfo && livemarkInfo.feedURI.spec; contents.forEach(function (content) { content.entries.push( - PlacesUtils.wrapNode(node, content.type, overrideURI, resolveShortcuts) + PlacesUtils.wrapNode(node, content.type, feedURI) ); }); }, this); diff --git a/application/palemoon/components/places/content/places.js b/application/palemoon/components/places/content/places.js index a94193823..40dbcb9b8 100644 --- a/application/palemoon/components/places/content/places.js +++ b/application/palemoon/components/places/content/places.js @@ -491,7 +491,7 @@ var PlacesOrganizer = { Task.spawn(function() { try { - yield BookmarkJSONUtils.importFromFile(aFile, true); + yield BookmarkJSONUtils.importFromFile(aFile.path, true); } catch(ex) { PlacesOrganizer._showErrorAlert(PlacesUIUtils.getString("bookmarksRestoreParseError")); } @@ -519,7 +519,7 @@ var PlacesOrganizer = { let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); let fpCallback = function fpCallback_done(aResult) { if (aResult != Ci.nsIFilePicker.returnCancel) { - BookmarkJSONUtils.exportToFile(fp.file); + BookmarkJSONUtils.exportToFile(fp.file.path); } }; diff --git a/application/palemoon/components/places/content/placesOverlay.xul b/application/palemoon/components/places/content/placesOverlay.xul index dd4d50f01..59115a57f 100644 --- a/application/palemoon/components/places/content/placesOverlay.xul +++ b/application/palemoon/components/places/content/placesOverlay.xul @@ -149,20 +149,20 @@ command="placesCmd_new:bookmark" label="&cmd.new_bookmark.label;" accesskey="&cmd.new_bookmark.accesskey;" - selection="any" + selectiontype="any" hideifnoinsertionpoint="true"/> <menuitem id="placesContext_new:folder" command="placesCmd_new:folder" label="&cmd.new_folder.label;" accesskey="&cmd.context_new_folder.accesskey;" - selection="any" + selectiontype="any" hideifnoinsertionpoint="true"/> <menuitem id="placesContext_new:separator" command="placesCmd_new:separator" label="&cmd.new_separator.label;" accesskey="&cmd.new_separator.accesskey;" closemenu="single" - selection="any" + selectiontype="any" hideifnoinsertionpoint="true"/> <menuseparator id="placesContext_newSeparator"/> <menuitem id="placesContext_createBookmark" @@ -182,14 +182,13 @@ command="placesCmd_copy" label="©Cmd.label;" closemenu="single" - accesskey="©Cmd.accesskey;" - selection="any"/> + accesskey="©Cmd.accesskey;"/> <menuitem id="placesContext_paste" command="placesCmd_paste" label="&pasteCmd.label;" closemenu="single" accesskey="&pasteCmd.accesskey;" - selection="any" + selectiontype="any" hideifnoinsertionpoint="true"/> <menuseparator id="placesContext_editSeparator"/> <menuitem id="placesContext_delete" @@ -204,7 +203,7 @@ accesskey="&cmd.delete.accesskey;" closemenu="single" selection="link" - forcehideselection="bookmark"/> + forcehideselection="bookmark|livemarkChild"/> <menuitem id="placesContext_deleteHost" command="placesCmd_deleteDataHost" label="&cmd.deleteDomainData.label;" @@ -213,7 +212,7 @@ selection="link|host" selectiontype="single" hideifprivatebrowsing="true" - forcehideselection="bookmark"/> + forcehideselection="bookmark|livemarkChild"/> <menuseparator id="placesContext_deleteSeparator"/> <menuitem id="placesContext_reload" command="placesCmd_reload" diff --git a/application/palemoon/components/places/content/sidebarUtils.js b/application/palemoon/components/places/content/sidebarUtils.js index 8ffb70348..06ed53753 100644 --- a/application/palemoon/components/places/content/sidebarUtils.js +++ b/application/palemoon/components/places/content/sidebarUtils.js @@ -40,7 +40,7 @@ var SidebarUtils = { var openInTabs = isContainer && (aEvent.button == 1 || (aEvent.button == 0 && modifKey)) && - PlacesUtils.hasChildURIs(tbo.view.nodeForTreeIndex(cell.row)); + PlacesUtils.hasChildURIs(tbo.view.nodeForTreeIndex(cell.row), true); if (aEvent.button == 0 && isContainer && !openInTabs) { tbo.view.toggleOpenState(cell.row); diff --git a/application/palemoon/components/places/jar.mn b/application/palemoon/components/places/jar.mn index 44ae61fd3..41222e156 100644 --- a/application/palemoon/components/places/jar.mn +++ b/application/palemoon/components/places/jar.mn @@ -6,29 +6,29 @@ browser.jar: % overlay chrome://browser/content/places/places.xul chrome://browser/content/places/downloadsViewOverlay.xul # Provide another URI for the bookmarkProperties dialog so we can persist the # attributes separately - content/browser/places/bookmarkProperties2.xul (content/bookmarkProperties.xul) -* content/browser/places/places.xul (content/places.xul) -* content/browser/places/places.js (content/places.js) - content/browser/places/places.css (content/places.css) - content/browser/places/organizer.css (content/organizer.css) - content/browser/places/bookmarkProperties.xul (content/bookmarkProperties.xul) - content/browser/places/bookmarkProperties.js (content/bookmarkProperties.js) - content/browser/places/placesOverlay.xul (content/placesOverlay.xul) -* content/browser/places/menu.xml (content/menu.xml) - content/browser/places/tree.xml (content/tree.xml) - content/browser/places/controller.js (content/controller.js) - content/browser/places/treeView.js (content/treeView.js) -* content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js) + content/browser/places/bookmarkProperties2.xul (content/bookmarkProperties.xul) +* content/browser/places/places.xul (content/places.xul) +* content/browser/places/places.js (content/places.js) + content/browser/places/places.css (content/places.css) + content/browser/places/organizer.css (content/organizer.css) + content/browser/places/bookmarkProperties.xul (content/bookmarkProperties.xul) + content/browser/places/bookmarkProperties.js (content/bookmarkProperties.js) + content/browser/places/placesOverlay.xul (content/placesOverlay.xul) +* content/browser/places/menu.xml (content/menu.xml) + content/browser/places/tree.xml (content/tree.xml) + content/browser/places/controller.js (content/controller.js) + content/browser/places/treeView.js (content/treeView.js) +* content/browser/places/browserPlacesViews.js (content/browserPlacesViews.js) # keep the Places version of the history sidebar at history/history-panel.xul # to prevent having to worry about between versions of the browser -* content/browser/history/history-panel.xul (content/history-panel.xul) - content/browser/places/history-panel.js (content/history-panel.js) +* content/browser/history/history-panel.xul (content/history-panel.xul) + content/browser/places/history-panel.js (content/history-panel.js) # ditto for the bookmarks sidebar - content/browser/bookmarks/bookmarksPanel.xul (content/bookmarksPanel.xul) - content/browser/bookmarks/bookmarksPanel.js (content/bookmarksPanel.js) -* content/browser/bookmarks/sidebarUtils.js (content/sidebarUtils.js) - content/browser/places/moveBookmarks.xul (content/moveBookmarks.xul) - content/browser/places/moveBookmarks.js (content/moveBookmarks.js) - content/browser/places/editBookmarkOverlay.xul (content/editBookmarkOverlay.xul) - content/browser/places/editBookmarkOverlay.js (content/editBookmarkOverlay.js) -* content/browser/places/downloadsViewOverlay.xul (content/downloadsViewOverlay.xul) + content/browser/bookmarks/bookmarksPanel.xul (content/bookmarksPanel.xul) + content/browser/bookmarks/bookmarksPanel.js (content/bookmarksPanel.js) +* content/browser/bookmarks/sidebarUtils.js (content/sidebarUtils.js) + content/browser/places/moveBookmarks.xul (content/moveBookmarks.xul) + content/browser/places/moveBookmarks.js (content/moveBookmarks.js) + content/browser/places/editBookmarkOverlay.xul (content/editBookmarkOverlay.xul) + content/browser/places/editBookmarkOverlay.js (content/editBookmarkOverlay.js) +* content/browser/places/downloadsViewOverlay.xul (content/downloadsViewOverlay.xul) diff --git a/application/palemoon/components/places/moz.build b/application/palemoon/components/places/moz.build index 2e35e1951..f8b0d125d 100644 --- a/application/palemoon/components/places/moz.build +++ b/application/palemoon/components/places/moz.build @@ -7,4 +7,3 @@ JAR_MANIFESTS += ['jar.mn'] EXTRA_JS_MODULES += [ 'PlacesUIUtils.jsm' ] - diff --git a/application/palemoon/components/preferences/advanced.js b/application/palemoon/components/preferences/advanced.js index 0803496fe..aab58b386 100644 --- a/application/palemoon/components/preferences/advanced.js +++ b/application/palemoon/components/preferences/advanced.js @@ -455,7 +455,7 @@ var gAdvancedPane = { var list = document.getElementById("offlineAppsList"); var item = list.selectedItem; var origin = item.getAttribute("origin"); - var principal = BrowserUtils.principalFromOrigin(origin); + var principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin); var prompts = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); @@ -474,7 +474,7 @@ var gAdvancedPane = { // get the permission var pm = Components.classes["@mozilla.org/permissionmanager;1"] .getService(Components.interfaces.nsIPermissionManager); - var perm = pm.getPermissionObject(principal, "offline-app"); + var perm = pm.getPermissionObject(principal, "offline-app", true); if (perm) { // clear offline cache entries try { diff --git a/application/palemoon/components/preferences/advanced.xul b/application/palemoon/components/preferences/advanced.xul index 3bd5becb3..e5f3bb160 100644 --- a/application/palemoon/components/preferences/advanced.xul +++ b/application/palemoon/components/preferences/advanced.xul @@ -27,10 +27,7 @@ <!--XXX button prefs --> <!-- General tab --> -<!-- Pale Moon: remove accessibility features, they confuse people anyway --> -<!-- <preference id="accessibility.browsewithcaret" name="accessibility.browsewithcaret" type="bool"/> --> <preference id="accessibility.typeaheadfind" name="accessibility.typeaheadfind" type="bool"/> -<!-- <preference id="accessibility.blockautorefresh" name="accessibility.blockautorefresh" type="bool"/> --> <preference id="general.autoScroll" name="general.autoScroll" type="bool"/> <preference id="general.smoothScroll" name="general.smoothScroll" type="bool"/> @@ -51,8 +48,8 @@ type="bool"/> #endif <preference id="pref.general.compatmode" name="general.useragent.compatMode" type="int"/> - - <!-- Data Choices tab --> + + <preference id="pref.general.captiveportal" name="network.captive-portal-service.enabled" type="bool"/> <!-- Network tab --> <preference id="browser.cache.disk.capacity" name="browser.cache.disk.capacity" type="int"/> @@ -109,6 +106,8 @@ <preference id="general.smoothScroll.scrollbars" name="general.smoothScroll.scrollbars" type="bool"/> <preference id="general.smoothScroll.scrollbars.durationMinMS" name="general.smoothScroll.scrollbars.durationMinMS" type="int"/> <preference id="general.smoothScroll.scrollbars.durationMaxMS" name="general.smoothScroll.scrollbars.durationMaxMS" type="int"/> + + <preference id="mousewheel.default.delta_multiplier_y" name="mousewheel.default.delta_multiplier_y" type="int"/> </preferences> #ifdef HAVE_SHELL_SERVICE @@ -136,22 +135,13 @@ <tabpanel id="generalPanel" orient="vertical"> <!-- Accessibility --> -<!-- Pale Moon: remove accessibility features, they confuse people anyway --> <groupbox id="accessibilityGroup" align="start"> <caption label="&accessibility.label;"/> -<!-- <checkbox id="useCursorNavigation" - label="&useCursorNavigation.label;" - accesskey="&useCursorNavigation.accesskey;" - preference="accessibility.browsewithcaret"/> --> <checkbox id="searchStartTyping" label="&searchStartTyping.label;" accesskey="&searchStartTyping.accesskey;" preference="accessibility.typeaheadfind"/> -<!-- <checkbox id="blockAutoRefresh" - label="&blockAutoRefresh.label;" - accesskey="&blockAutoRefresh.accesskey;" - preference="accessibility.blockautorefresh"/> --> </groupbox> <!-- Browsing --> @@ -193,6 +183,7 @@ </hbox> </groupbox> #endif + <!-- User Agent compatibility --> <groupbox id="UACompatGroup" orient="vertical"> <caption label="&UACompatGroup.label;"/> <hbox align="center"> @@ -206,6 +197,15 @@ </menulist> </hbox> </groupbox> + + <!-- Captive portal detection --> + <groupbox id="captivePortalGroup" orient="vertical"> + <caption label="&captivePortalGroup.label;"/> + <checkbox id="captivePortalDetect" + label="&captivePortalDetect.label;" + preference="pref.general.captiveportal"/> + </groupbox> + </tabpanel> <!-- Network --> @@ -447,6 +447,13 @@ preference="general.smoothScroll.scrollbars.durationMaxMS"/> <label flex="1">ms.</label> </hbox> + + <hbox align="center"> + <label value="&smoothscroll.overall.yspeed.label;"/> + <textbox type="number" size="3" min="1" max="999" + preference="mousewheel.default.delta_multiplier_y"/> + <label flex="1">%.</label> + </hbox> </groupbox> </tabpanel> <!-- end Smooth scrolling tab --> diff --git a/application/palemoon/components/preferences/connection.js b/application/palemoon/components/preferences/connection.js index c1dd1bb6d..da038c925 100644 --- a/application/palemoon/components/preferences/connection.js +++ b/application/palemoon/components/preferences/connection.js @@ -63,7 +63,7 @@ var gConnectionsDialog = { autologinProxyPref.disabled = proxyTypePref.value == 0; var noProxiesPref = document.getElementById("network.proxy.no_proxies_on"); - noProxiesPref.disabled = proxyTypePref.value != 1; + noProxiesPref.disabled = proxyTypePref.value == 0; var autoconfigURLPref = document.getElementById("network.proxy.autoconfig_url"); autoconfigURLPref.disabled = proxyTypePref.value != 2; diff --git a/application/palemoon/components/preferences/connection.xul b/application/palemoon/components/preferences/connection.xul index 491bf4878..e6079dd54 100644 --- a/application/palemoon/components/preferences/connection.xul +++ b/application/palemoon/components/preferences/connection.xul @@ -138,9 +138,6 @@ <radio id="networkProxySOCKSVersion5" value="5" label="&socks5.label;" accesskey="&socks5.accesskey;"/> </radiogroup> </row> - <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/> - <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/> - <label value="&noproxyExplain.label;" control="networkProxyNone"/> </rows> </grid> <radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/> @@ -154,6 +151,9 @@ </hbox> </radiogroup> <separator class="thin"/> + <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/> + <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/> + <label value="&noproxyExplain.label;" control="networkProxyNone"/> <checkbox id="autologinProxy" preference="signon.autologin.proxy" label="&autologinproxy.label;" accesskey="&autologinproxy.accesskey;" tooltiptext="&autologinproxy.tooltip;"/> diff --git a/application/palemoon/components/preferences/jar.mn b/application/palemoon/components/preferences/jar.mn index 2e2949306..6e143dea3 100644 --- a/application/palemoon/components/preferences/jar.mn +++ b/application/palemoon/components/preferences/jar.mn @@ -3,41 +3,42 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/preferences/advanced.xul -* content/browser/preferences/advanced.js - content/browser/preferences/applications.xul -* content/browser/preferences/applications.js - content/browser/preferences/applicationManager.xul -* content/browser/preferences/applicationManager.js -* content/browser/preferences/colors.xul -* content/browser/preferences/cookies.xul -* content/browser/preferences/cookies.js - content/browser/preferences/content.xul - content/browser/preferences/content.js -* content/browser/preferences/connection.xul - content/browser/preferences/connection.js -* content/browser/preferences/fonts.xul - content/browser/preferences/fonts.js - content/browser/preferences/handlers.xml - content/browser/preferences/handlers.css -* content/browser/preferences/languages.xul - content/browser/preferences/languages.js -* content/browser/preferences/main.xul - content/browser/preferences/main.js - content/browser/preferences/permissions.xul -* content/browser/preferences/permissions.js -* content/browser/preferences/preferences.xul - content/browser/preferences/privacy.xul - content/browser/preferences/privacy.js - content/browser/preferences/sanitize.xul - content/browser/preferences/sanitize.js - content/browser/preferences/security.xul - content/browser/preferences/security.js - content/browser/preferences/selectBookmark.xul - content/browser/preferences/selectBookmark.js +* content/browser/preferences/advanced.xul +* content/browser/preferences/advanced.js + content/browser/preferences/applications.xul +* content/browser/preferences/applications.js + content/browser/preferences/applicationManager.xul +* content/browser/preferences/applicationManager.js +* content/browser/preferences/colors.xul +* content/browser/preferences/cookies.xul +* content/browser/preferences/cookies.js + content/browser/preferences/content.xul + content/browser/preferences/content.js +* content/browser/preferences/connection.xul + content/browser/preferences/connection.js +* content/browser/preferences/fonts.xul + content/browser/preferences/fonts.js + content/browser/preferences/handlers.xml + content/browser/preferences/handlers.css +* content/browser/preferences/languages.xul + content/browser/preferences/languages.js +* content/browser/preferences/main.xul + content/browser/preferences/main.js + content/browser/preferences/newtaburl.js + content/browser/preferences/permissions.xul +* content/browser/preferences/permissions.js +* content/browser/preferences/preferences.xul + content/browser/preferences/privacy.xul + content/browser/preferences/privacy.js + content/browser/preferences/sanitize.xul + content/browser/preferences/sanitize.js + content/browser/preferences/security.xul + content/browser/preferences/security.js + content/browser/preferences/selectBookmark.xul + content/browser/preferences/selectBookmark.js #ifdef MOZ_SERVICES_SYNC - content/browser/preferences/sync.xul - content/browser/preferences/sync.js + content/browser/preferences/sync.xul + content/browser/preferences/sync.js #endif -* content/browser/preferences/tabs.xul -* content/browser/preferences/tabs.js +* content/browser/preferences/tabs.xul +* content/browser/preferences/tabs.js diff --git a/application/palemoon/components/preferences/main.xul b/application/palemoon/components/preferences/main.xul index 7634056eb..bb51947b0 100644 --- a/application/palemoon/components/preferences/main.xul +++ b/application/palemoon/components/preferences/main.xul @@ -96,6 +96,7 @@ type="autocomplete" autocompletesearch="history" onsyncfrompreference="return gMainPane.syncFromHomePref();" onsynctopreference="return gMainPane.syncToHomePref(this.value);" + oninput="gNewtabUrl.writeNewtabUrl(null, this.value);" placeholder="&abouthome.pageTitle;" preference="browser.startup.homepage"/> </hbox> @@ -103,15 +104,15 @@ <button label="" accesskey="&useCurrentPage.accesskey;" label1="&useCurrentPage.label;" label2="&useMultiple.label;" - oncommand="gMainPane.setHomePageToCurrent();" + oncommand="gMainPane.setHomePageToCurrent(); gNewtabUrl.writeNewtabUrl();" id="useCurrent" preference="pref.browser.homepage.disable_button.current_page"/> <button label="&chooseBookmark.label;" accesskey="&chooseBookmark.accesskey;" - oncommand="gMainPane.setHomePageToBookmark();" + oncommand="gMainPane.setHomePageToBookmark(); gNewtabUrl.writeNewtabUrl();" id="useBookmark" preference="pref.browser.homepage.disable_button.bookmark_page"/> <button label="&restoreDefault.label;" accesskey="&restoreDefault.accesskey;" - oncommand="gMainPane.restoreDefaultHomePage();" + oncommand="gMainPane.restoreDefaultHomePage(); gNewtabUrl.writeNewtabUrl();" id="restoreDefaultHomePage" preference="pref.browser.homepage.disable_button.restore_default"/> </hbox> diff --git a/application/palemoon/components/preferences/newtaburl.js b/application/palemoon/components/preferences/newtaburl.js new file mode 100644 index 000000000..3c82df846 --- /dev/null +++ b/application/palemoon/components/preferences/newtaburl.js @@ -0,0 +1,102 @@ +/* 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/. */
+
+var gNewtabUrl = {
+ /**
+ * Writes browser.newtab.url with the appropriate value.
+ * If the choice is "my home page", get and sanitize
+ * the browser home page URL to make it suitable for newtab use.
+ *
+ * Called from prefwindow ondialogaccept in preferences.xul,
+ * newtabPage oncommand in tabs.xul, browserHomePage oninput,
+ * useCurrent, useBookmark and restoreDefaultHomePage oncommand
+ * in main.xul to consider instantApply.
+ */
+ writeNewtabUrl: function(newtabUrlChoice, browserHomepageUrl) {
+ try {
+ if (newtabUrlChoice) {
+ if (Services.prefs.getBoolPref("browser.preferences.instantApply")) {
+ newtabUrlChoice = parseInt(newtabUrlChoice);
+ } else {
+ return;
+ }
+ } else {
+ if (this.newtabUrlChoiceIsSet) {
+ newtabUrlChoice = Services.prefs.getIntPref("browser.newtab.choice");
+ } else {
+ newtabUrlChoice = this.getNewtabChoice();
+ }
+ }
+ if (browserHomepageUrl || browserHomepageUrl == "") {
+ if (Services.prefs.getBoolPref("browser.preferences.instantApply")) {
+ if (browserHomepageUrl == "") {
+ browserHomepageUrl = "about:home";
+ }
+ } else {
+ return;
+ }
+ } else {
+ browserHomepageUrl = Services.prefs.getComplexValue("browser.startup.homepage",
+ Components.interfaces.nsIPrefLocalizedString).data;
+ }
+ let newtabUrlPref = Services.prefs.getCharPref("browser.newtab.url");
+ switch (newtabUrlChoice) {
+ case 1:
+ newtabUrlPref = "about:logopage";
+ break;
+ case 2:
+ newtabUrlPref = Services.prefs.getDefaultBranch("browser.")
+ .getComplexValue("startup.homepage",
+ Components.interfaces.nsIPrefLocalizedString).data;
+ break;
+ case 3:
+ // If url is a pipe-delimited set of pages, just take the first one.
+ let newtabUrlSanitizedPref=browserHomepageUrl.split("|")[0];
+ // XXX: do we need extra sanitation here, e.g. for invalid URLs?
+ Services.prefs.setCharPref("browser.newtab.myhome", newtabUrlSanitizedPref);
+ newtabUrlPref = newtabUrlSanitizedPref;
+ break;
+ case 4:
+ newtabUrlPref = "about:newtab";
+ break;
+ default:
+ // In case of any other value it's a custom URL, consider instantApply.
+ if (this.newtabPageCustom) {
+ newtabUrlPref = this.newtabPageCustom;
+ }
+ }
+ Services.prefs.setCharPref("browser.newtab.url",newtabUrlPref);
+ } catch(e) { console.error(e); }
+ },
+
+ /**
+ * Determines the value of browser.newtab.choice based
+ * on the value of browser.newtab.url
+ *
+ * @returns the value of browser.newtab.choice
+ */
+ getNewtabChoice: function() {
+ let newtabUrlPref = Services.prefs.getCharPref("browser.newtab.url");
+ let browserHomepageUrl = Services.prefs.getComplexValue("browser.startup.homepage",
+ Components.interfaces.nsIPrefLocalizedString).data;
+ let newtabUrlSanitizedPref = browserHomepageUrl.split("|")[0];
+ let defaultStartupHomepage = Services.prefs.getDefaultBranch("browser.")
+ .getComplexValue("startup.homepage",
+ Components.interfaces.nsIPrefLocalizedString).data;
+ switch (newtabUrlPref) {
+ case "about:logopage":
+ return 1;
+ case defaultStartupHomepage:
+ return 2;
+ case newtabUrlSanitizedPref:
+ return 3;
+ case "about:newtab":
+ return 4;
+ default: // Custom URL entered.
+ // We need this to consider instantApply.
+ this.newtabPageCustom = newtabUrlPref;
+ return 0;
+ }
+ }
+};
diff --git a/application/palemoon/components/preferences/preferences.xul b/application/palemoon/components/preferences/preferences.xul index 2f00b960a..a1d9c8cf7 100644 --- a/application/palemoon/components/preferences/preferences.xul +++ b/application/palemoon/components/preferences/preferences.xul @@ -56,10 +56,10 @@ #endif #endif onunload="if (typeof gSecurityPane != 'undefined') gSecurityPane.syncAddonSecurityLevel();" - ondialogaccept="if (typeof gTabsPane != 'undefined') gTabsPane.writeNewtabUrl(); - return true;"> + ondialogaccept="gNewtabUrl.writeNewtabUrl();"> <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/> + <script type="application/javascript" src="chrome://browser/content/preferences/newtaburl.js"/> <stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/> <stringbundle id="bundlePreferences" diff --git a/application/palemoon/components/preferences/privacy.js b/application/palemoon/components/preferences/privacy.js index 05c2f9b8a..e2a871acc 100644 --- a/application/palemoon/components/preferences/privacy.js +++ b/application/palemoon/components/preferences/privacy.js @@ -298,36 +298,6 @@ var gPrivacyPane = { // HISTORY - /** - * Read the location bar enabled and suggestion prefs - * @return Int value for suggestion menulist - */ - readSuggestionPref: function PPP_readSuggestionPref() - { - let getVal = function(aPref) - document.getElementById("browser.urlbar." + aPref).value; - - // Suggest nothing if autocomplete is not enabled - if (!getVal("autocomplete.enabled")) - return -1; - - // Bottom 2 bits of default.behavior specify history/bookmark - return getVal("default.behavior") & 3; - }, - - /** - * Update browser.urlbar.autocomplete.enabled when a - * browser.urlbar.suggest.* pref is changed from the ui. - */ - writeSuggestionPref: function PPP_writeSuggestionPref() { - let getVal = (aPref) => { - return document.getElementById("browser.urlbar.suggest." + aPref).value; - } - // autocomplete.enabled is true if any of the suggestions is true - let enabled = ["history", "bookmark", "openpage"].map(getVal).some(v => v); - Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", enabled); - }, - /* * Preferences: * diff --git a/application/palemoon/components/preferences/privacy.xul b/application/palemoon/components/preferences/privacy.xul index bdb227c63..d2f8106d1 100644 --- a/application/palemoon/components/preferences/privacy.xul +++ b/application/palemoon/components/preferences/privacy.xul @@ -254,15 +254,12 @@ <vbox id="tabPrefsBox" align="start" flex="1"> <checkbox id="historySuggestion" label="&locbar.history.label;" - onsyncfrompreference="return gPrivacyPane.writeSuggestionPref();" accesskey="&locbar.history.accesskey;" preference="browser.urlbar.suggest.history"/> <checkbox id="bookmarkSuggestion" label="&locbar.bookmarks.label;" - onsyncfrompreference="return gPrivacyPane.writeSuggestionPref();" accesskey="&locbar.bookmarks.accesskey;" preference="browser.urlbar.suggest.bookmark"/> <checkbox id="openpageSuggestion" label="&locbar.openpage.label;" - onsyncfrompreference="return gPrivacyPane.writeSuggestionPref();" accesskey="&locbar.openpage.accesskey;" preference="browser.urlbar.suggest.openpage"/> </vbox> diff --git a/application/palemoon/components/preferences/security.xul b/application/palemoon/components/preferences/security.xul index d3d321b16..bc1625275 100644 --- a/application/palemoon/components/preferences/security.xul +++ b/application/palemoon/components/preferences/security.xul @@ -43,13 +43,22 @@ <!-- Security Protocols --> - <preference id="network.stricttransportsecurity.preloadlist" - name="network.stricttransportsecurity.preloadlist" + <preference id="network.stricttransportsecurity.enabled" + name="network.stricttransportsecurity.enabled" type="bool"/> <preference id="security.cert_pinning.enforcement_level" name="security.cert_pinning.enforcement_level" type="int"/> + <!-- Opportunistic Encryption --> + + <preference id="network.http.upgrade-insecure-requests" + name="network.http.upgrade-insecure-requests" + type="bool"/> + <preference id="network.http.altsvc.oe" + name="network.http.altsvc.oe" + type="bool"/> + <!-- XSS Filter --> <!-- <preference id="security.xssfilter.enable" name="security.xssfilter.enable" type="bool"/> @@ -137,13 +146,23 @@ <checkbox id="enableHSTS" label="&enableHSTS.label;" accesskey="&enableHSTS.accesskey;" - preference="network.stricttransportsecurity.preloadlist" /> + preference="network.stricttransportsecurity.enabled" /> <checkbox id="enableHPKP" label="&enableHPKP.label;" accesskey="&enableHPKP.accesskey;" oncommand="gSecurityPane.updateHPKPPref();"/> </vbox> </groupbox> + + <groupbox id="OpportunisticEncryption"> + <caption label="&OpEnc.label;"/> + <checkbox id="enableUIROpEnc" + label="&enableUIROpEnc.label;" + preference="network.http.upgrade-insecure-requests" /> + <checkbox id="enableAltSvcOpEnc" + label="&enableAltSvcOpEnc.label;" + preference="network.http.altsvc.oe" /> + </groupbox> <!-- XSS Filter --> <!-- diff --git a/application/palemoon/components/preferences/tabs.js b/application/palemoon/components/preferences/tabs.js index f0ad8490c..b09cb60df 100644 --- a/application/palemoon/components/preferences/tabs.js +++ b/application/palemoon/components/preferences/tabs.js @@ -78,80 +78,13 @@ var gTabsPane = { /** * Determines the value of the New Tab display drop-down based * on the value of browser.newtab.url. - * - * @returns the appropriate value of browser.newtab.choice */ readNewtabUrl: function() { - let newtabUrlPref = document.getElementById("browser.newtab.url"); - let newtabUrlSanitizedPref = document.getElementById("browser.newtab.myhome"); let newtabUrlChoice = document.getElementById("browser.newtab.choice"); - switch (newtabUrlPref.value) { - case "about:logopage": - newtabUrlChoice.value = 1; - break; - case "http://start.palemoon.org/": - newtabUrlChoice.value = 2; - break; - case newtabUrlSanitizedPref.value: - newtabUrlChoice.value = 3; - break; - case "about:newtab": - newtabUrlChoice.value = 4; - break; - default: // Custom URL entered. - document.getElementById("newtabPageCustom").hidden = false; - newtabUrlChoice.value = 0; - // We need this to consider instantApply. - this.newtabPageCustom = newtabUrlPref.value; + newtabUrlChoice.value = gNewtabUrl.getNewtabChoice(); + if (newtabUrlChoice.value == 0) { + document.getElementById("newtabPageCustom").hidden = false; } - }, - - /** - * Writes browser.newtab.url with the appropriate value. - * if the choice is "my home page", get and sanitize the browser home page - * URL to make it suitable for newtab use. - * - * Called from prefwindow's ondialogaccept handler and - * from browser.newtab.choice's oncommand to consider instantApply. - */ - writeNewtabUrl: function(newtabUrlChoice) { - try { - if (newtabUrlChoice) { - if (Services.prefs.getBoolPref("browser.preferences.instantApply")) { - newtabUrlChoice = parseInt(newtabUrlChoice); - } else { - return; - } - } else { - newtabUrlChoice = Services.prefs.getIntPref("browser.newtab.choice"); - } - let browserHomepageUrl = Services.prefs.getComplexValue("browser.startup.homepage", - Components.interfaces.nsIPrefLocalizedString).data; - let newtabUrlPref = Services.prefs.getCharPref("browser.newtab.url"); - switch (newtabUrlChoice) { - case 1: - newtabUrlPref = "about:logopage"; - break; - case 2: - newtabUrlPref = "http://start.palemoon.org/"; - break; - case 3: - // If url is a pipe-delimited set of pages, just take the first one. - let newtabUrlSanitizedPref=browserHomepageUrl.split("|")[0]; - // XXX: do we need extra sanitation here, e.g. for invalid URLs? - Services.prefs.setCharPref("browser.newtab.myhome", newtabUrlSanitizedPref); - newtabUrlPref = newtabUrlSanitizedPref; - break; - case 4: - newtabUrlPref = "about:newtab"; - break; - default: - // In case of any other value it's a custom URL, consider instantApply. - if (this.newtabPageCustom) { - newtabUrlPref = this.newtabPageCustom; - } - } - Services.prefs.setCharPref("browser.newtab.url",newtabUrlPref); - } catch(e) { console.error(e); } + gNewtabUrl.newtabUrlChoiceIsSet = true; } }; diff --git a/application/palemoon/components/preferences/tabs.xul b/application/palemoon/components/preferences/tabs.xul index f5b44b776..64529d60d 100644 --- a/application/palemoon/components/preferences/tabs.xul +++ b/application/palemoon/components/preferences/tabs.xul @@ -85,7 +85,7 @@ <menulist id="newtabPage" preference="browser.newtab.choice" - oncommand="gTabsPane.writeNewtabUrl(event.target.value);"> + oncommand="gNewtabUrl.writeNewtabUrl(event.target.value);"> <menupopup> <menuitem label="&newtabPage.custom.label;" value="0" id="newtabPageCustom" hidden="true" /> <menuitem label="&newtabPage.blank.label;" value="1" /> diff --git a/application/palemoon/components/privatebrowsing/jar.mn b/application/palemoon/components/privatebrowsing/jar.mn index a01b7f0d3..75e985c13 100644 --- a/application/palemoon/components/privatebrowsing/jar.mn +++ b/application/palemoon/components/privatebrowsing/jar.mn @@ -3,4 +3,4 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/aboutPrivateBrowsing.xhtml (content/aboutPrivateBrowsing.xhtml) +* content/browser/aboutPrivateBrowsing.xhtml (content/aboutPrivateBrowsing.xhtml) diff --git a/application/palemoon/components/search/content/search.xml b/application/palemoon/components/search/content/search.xml index 4532f5720..0c33b1527 100644 --- a/application/palemoon/components/search/content/search.xml +++ b/application/palemoon/components/search/content/search.xml @@ -283,11 +283,6 @@ <parameter name="element"/> <parameter name="uri"/> <body><![CDATA[ - if (uri) { - let size = Math.round(16 * window.devicePixelRatio); - if (!uri.includes("#")) - uri += "#-moz-resolution=" + size + "," + size; - } element.setAttribute("src", uri); ]]></body> </method> diff --git a/application/palemoon/components/search/jar.mn b/application/palemoon/components/search/jar.mn index 88a33a98c..e6c42f97d 100644 --- a/application/palemoon/components/search/jar.mn +++ b/application/palemoon/components/search/jar.mn @@ -3,7 +3,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/search/search.xml (content/search.xml) - content/browser/search/searchbarBindings.css (content/searchbarBindings.css) - content/browser/search/engineManager.xul (content/engineManager.xul) - content/browser/search/engineManager.js (content/engineManager.js) +* content/browser/search/search.xml (content/search.xml) + content/browser/search/searchbarBindings.css (content/searchbarBindings.css) + content/browser/search/engineManager.xul (content/engineManager.xul) + content/browser/search/engineManager.js (content/engineManager.js) diff --git a/application/palemoon/components/search/moz.build b/application/palemoon/components/search/moz.build index 35f6d454a..c97072bba 100644 --- a/application/palemoon/components/search/moz.build +++ b/application/palemoon/components/search/moz.build @@ -4,5 +4,4 @@ # 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']
\ No newline at end of file diff --git a/application/palemoon/components/sessionstore/SessionStore.jsm b/application/palemoon/components/sessionstore/SessionStore.jsm index c5e55321c..e19a578f4 100644 --- a/application/palemoon/components/sessionstore/SessionStore.jsm +++ b/application/palemoon/components/sessionstore/SessionStore.jsm @@ -2739,7 +2739,9 @@ var SessionStoreInternal = { for (var t = 0; t < newTabCount; t++) { tabs.push(t < openTabCount ? tabbrowser.tabs[t] : - tabbrowser.addTab("about:blank", {skipAnimation: true})); + tabbrowser.addTab("about:blank", + {skipAnimation: true, + skipBackgroundNotify: true})); // when resuming at startup: add additionally requested pages to the end if (!aOverwriteTabs && root._firstTabs) { tabbrowser.moveTabTo(tabs[t], t); @@ -4684,7 +4686,8 @@ var TabAttributes = { // 'image' should not be accessed directly but handled by using the // gBrowser.getIcon()/setIcon() methods. // 'pending' is used internal by sessionstore and managed accordingly. - _skipAttrs: new Set(["image", "pending"]), + // 'skipbackgroundnotify' is used internal by tabbrowser.xml. + _skipAttrs: new Set(["image", "pending", "skipbackgroundnotify"]), persist: function (name) { if (this._attrs.has(name) || this._skipAttrs.has(name)) { diff --git a/application/palemoon/components/sessionstore/jar.mn b/application/palemoon/components/sessionstore/jar.mn index 529692e7e..825b00fbb 100644 --- a/application/palemoon/components/sessionstore/jar.mn +++ b/application/palemoon/components/sessionstore/jar.mn @@ -3,6 +3,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/aboutSessionRestore.xhtml (content/aboutSessionRestore.xhtml) -* content/browser/aboutSessionRestore.js (content/aboutSessionRestore.js) - content/browser/content-sessionStore.js (content/content-sessionStore.js) +* content/browser/aboutSessionRestore.xhtml (content/aboutSessionRestore.xhtml) +* content/browser/aboutSessionRestore.js (content/aboutSessionRestore.js) + content/browser/content-sessionStore.js (content/content-sessionStore.js) diff --git a/application/palemoon/components/sessionstore/moz.build b/application/palemoon/components/sessionstore/moz.build index 8b38aeba5..84278dafa 100644 --- a/application/palemoon/components/sessionstore/moz.build +++ b/application/palemoon/components/sessionstore/moz.build @@ -26,6 +26,4 @@ EXTRA_JS_MODULES.sessionstore = [ 'XPathGenerator.jsm', ] -EXTRA_PP_JS_MODULES.sessionstore += [ - 'SessionStore.jsm', -]
\ No newline at end of file +EXTRA_PP_JS_MODULES.sessionstore += ['SessionStore.jsm']
\ No newline at end of file diff --git a/application/palemoon/components/shell/jar.mn b/application/palemoon/components/shell/jar.mn index 1f33b5d56..0864e1b30 100644 --- a/application/palemoon/components/shell/jar.mn +++ b/application/palemoon/components/shell/jar.mn @@ -3,5 +3,5 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -* content/browser/setDesktopBackground.xul (content/setDesktopBackground.xul) - content/browser/setDesktopBackground.js (content/setDesktopBackground.js) +* content/browser/setDesktopBackground.xul (content/setDesktopBackground.xul) + content/browser/setDesktopBackground.js (content/setDesktopBackground.js) diff --git a/application/palemoon/components/shell/moz.build b/application/palemoon/components/shell/moz.build index 94ec88571..16bffd7d9 100644 --- a/application/palemoon/components/shell/moz.build +++ b/application/palemoon/components/shell/moz.build @@ -6,37 +6,23 @@ JAR_MANIFESTS += ['jar.mn'] -XPIDL_SOURCES += [ - 'nsIShellService.idl', -] +XPIDL_SOURCES += ['nsIShellService.idl'] if CONFIG['OS_ARCH'] == 'WINNT': - XPIDL_SOURCES += [ - 'nsIWindowsShellService.idl', - ] + XPIDL_SOURCES += ['nsIWindowsShellService.idl'] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': - XPIDL_SOURCES += [ - 'nsIMacShellService.idl', - ] + XPIDL_SOURCES += ['nsIMacShellService.idl'] elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: - XPIDL_SOURCES += [ - 'nsIGNOMEShellService.idl', - ] + XPIDL_SOURCES += ['nsIGNOMEShellService.idl'] XPIDL_MODULE = 'shellservice' if CONFIG['OS_ARCH'] == 'WINNT': - SOURCES += [ - 'nsWindowsShellService.cpp', - ] + SOURCES += ['nsWindowsShellService.cpp'] elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa': - SOURCES += [ - 'nsMacShellService.cpp', - ] + SOURCES += ['nsMacShellService.cpp'] elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']: - SOURCES += [ - 'nsGNOMEShellService.cpp', - ] + SOURCES += ['nsGNOMEShellService.cpp'] if SOURCES: FINAL_LIBRARY = 'browsercomps' @@ -46,9 +32,7 @@ EXTRA_COMPONENTS += [ 'nsSetDefaultBrowser.manifest', ] -EXTRA_JS_MODULES += [ - 'ShellService.jsm', -] +EXTRA_JS_MODULES += ['ShellService.jsm'] for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION'): DEFINES[var] = '"%s"' % CONFIG[var] diff --git a/application/palemoon/components/statusbar/Status.jsm b/application/palemoon/components/statusbar/Status.jsm index d888c7d94..dbdd1fc49 100644 --- a/application/palemoon/components/statusbar/Status.jsm +++ b/application/palemoon/components/statusbar/Status.jsm @@ -35,7 +35,7 @@ S4EStatusService.prototype = _defaultStatus: { val: "", type: "" }, _isFullScreen: false, - _isFullScreenVideo: false, + _isVideo: false, _statusText: { val: "", type: "" }, _noUpdate: false, @@ -120,6 +120,57 @@ S4EStatusService.prototype = }, buildBinding: function() { + + // Object.prototype.watch() shim, based on Eli Grey's polyfill + // object.watch + if (!this._window.XULBrowserWindow.watch) { + Object.defineProperty(this._window.XULBrowserWindow, "watch", { + enumerable: false, + configurable: true, + writable: false, + value: function (prop, handler) { + var oldval = this[prop], + newval = oldval, + getter = function () { + return newval; + }, + setter = function (val) { + oldval = newval; + return newval = handler.call(this, prop, oldval, val); + } + ; + + try { + if (delete this[prop]) { // can't watch constants + Object.defineProperty(this, prop, { + get: getter, + set: setter, + enumerable: true, + configurable: true + }); + } + } catch(e) { + // This fails fatally on non-configurable props, so just + // ignore errors if it does. + } + } + }); + } + + // object.unwatch + if (!this._window.XULBrowserWindow.unwatch) { + Object.defineProperty(this._window.XULBrowserWindow, "unwatch", { + enumerable: false, + configurable: true, + writable: false, + value: function (prop) { + var val = this[prop]; + delete this[prop]; // remove accessors + this[prop] = val; + } + }); + } + let XULBWPropHandler = function(prop, oldval, newval) { CU.reportError("Attempt to modify XULBrowserWindow." + prop); return oldval; @@ -139,21 +190,6 @@ S4EStatusService.prototype = this._window.XULBrowserWindow[prop] = this[prop].bind(this); this._window.XULBrowserWindow.watch(prop, XULBWPropHandler); }, this); - - let XULBWHandler = function(prop, oldval, newval) { - if(!newval) - { - return newval; - } - CU.reportError("XULBrowserWindow changed. Updating S4E bindings."); - this._window.setTimeout(function(self) - { - self.buildBinding(); - }, 0, this); - return newval; - }; - - this._window.watch("XULBrowserWindow", XULBWHandler); }, destroy: function() @@ -222,18 +258,10 @@ S4EStatusService.prototype = } }, - updateFullScreen: function() + setFullScreenState: function(isFullScreen, isVideo) { - this._isFullScreen = this._window.fullScreen; - this._isFullScreenVideo = false; - if(this._isFullScreen) - { - let fsEl = this._window.content.document.mozFullScreenElement; - if(fsEl && (fsEl.nodeName == "VIDEO" || fsEl.getElementsByTagName("VIDEO").length > 0)) - { - this._isFullScreenVideo = true; - } - } + this._isFullScreen = isFullScreen; + this._isVideo = isFullScreen && isVideo; this.clearStatusField(); this.updateStatusField(true); @@ -305,7 +333,7 @@ S4EStatusService.prototype = let label = null; - if(this._isFullScreen && this._service.advancedStatusDetectFullScreen) + if(this._isFullScreen) { switch(location) { @@ -330,7 +358,7 @@ S4EStatusService.prototype = break; case 3: // Popup default: - if(this._isFullScreenVideo && this._service.advancedStatusDetectVideo) + if(this._isVideo) { return; } diff --git a/application/palemoon/components/statusbar/Status4Evar.jsm b/application/palemoon/components/statusbar/Status4Evar.jsm index 055306a88..6400f2e2a 100644 --- a/application/palemoon/components/statusbar/Status4Evar.jsm +++ b/application/palemoon/components/statusbar/Status4Evar.jsm @@ -31,7 +31,7 @@ function Status4Evar(window, gBrowser, toolbox) this.statusService = new S4EStatusService(this._window, s4e_service, this.getters); this.progressMeter = new S4EProgressService(gBrowser, s4e_service, this.getters, this.statusService); this.downloadStatus = new S4EDownloadService(this._window, gBrowser, s4e_service, this.getters); - this.sizeModeService = new SizeModeService(this._window, this); + this.sizeModeService = new SizeModeService(this._window, gBrowser, this); this._window.addEventListener("unload", this, false); } @@ -232,20 +232,31 @@ S4EWindowGetters.prototype = } }; -function SizeModeService(window, s4e) +function SizeModeService(window, gBrowser, s4e) { this._window = window; + this._gBrowser = gBrowser; this._s4e = s4e; + this._mm = this._window.messageManager; this.lastFullScreen = this._window.fullScreen; this.lastwindowState = this._window.windowState; + + if(s4e_service.advancedStatusDetectFullScreen) + { + this._mm.addMessageListener("status4evar@caligonstudios.com:video-detect-answer", this) + this._mm.loadFrameScript("resource:///modules/statusbar/content-thunk.js", true); + } + this._window.addEventListener("sizemodechange", this, false); } SizeModeService.prototype = { _window: null, + _gBrowser: null, _s4e: null, + _mm: null, lastFullScreen: null, lastwindowState: null, @@ -254,7 +265,13 @@ SizeModeService.prototype = { this._window.removeEventListener("sizemodechange", this, false); - ["_window", "_s4e"].forEach(function(prop) + if(s4e_service.advancedStatusDetectFullScreen) + { + this._mm.removeDelayedFrameScript("resource:///modules/statusbar/content-thunk.js"); + this._mm.removeMessageListener("status4evar@caligonstudios.com:video-detect-answer", this); + } + + ["_window", "_gBrowser", "_s4e", "_mm"].forEach(function(prop) { delete this[prop]; }, this); @@ -262,10 +279,18 @@ SizeModeService.prototype = handleEvent: function(e) { - if(this._window.fullScreen != this.lastFullScreen) + if(this._window.fullScreen != this.lastFullScreen && s4e_service.advancedStatusDetectFullScreen) { this.lastFullScreen = this._window.fullScreen; - this._s4e.statusService.updateFullScreen(); + + if(this.lastFullScreen && s4e_service.advancedStatusDetectVideo) + { + this._gBrowser.selectedBrowser.messageManager.sendAsyncMessage("status4evar@caligonstudios.com:video-detect"); + } + else + { + this._s4e.statusService.setFullScreenState(this.lastFullScreen, false); + } } if(this._window.windowState != this.lastwindowState) @@ -275,5 +300,13 @@ SizeModeService.prototype = } }, - QueryInterface: XPCOMUtils.generateQI([ CI.nsIDOMEventListener ]) + receiveMessage: function(message) + { + if(message.name == "status4evar@caligonstudios.com:video-detect-answer") + { + this._s4e.statusService.setFullScreenState(this.lastFullScreen, message.data.isVideo); + } + }, + + QueryInterface: XPCOMUtils.generateQI([ CI.nsIDOMEventListener, CI.nsIMessageListener ]) }; diff --git a/application/palemoon/components/statusbar/content-thunk.js b/application/palemoon/components/statusbar/content-thunk.js new file mode 100644 index 000000000..fe1fbabad --- /dev/null +++ b/application/palemoon/components/statusbar/content-thunk.js @@ -0,0 +1,23 @@ +/* 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/. */ + +function handleVideoDetect(message) +{ + let isVideo = false; + + let fsEl = content.document.mozFullScreenElement; + if(fsEl) + { + isVideo = ( + fsEl.nodeName == "VIDEO" + || (fsEl.nodeName == "IFRAME" && fsEl.contentDocument && fsEl.contentDocument.getElementsByTagName("VIDEO").length > 0) + || fsEl.getElementsByTagName("VIDEO").length > 0 + ); + } + + sendAsyncMessage("status4evar@caligonstudios.com:video-detect-answer", {isVideo: isVideo}); +} + +addMessageListener("status4evar@caligonstudios.com:video-detect", handleVideoDetect); + diff --git a/application/palemoon/components/statusbar/jar.mn b/application/palemoon/components/statusbar/jar.mn index db7f278c7..b5a8d09b2 100644 --- a/application/palemoon/components/statusbar/jar.mn +++ b/application/palemoon/components/statusbar/jar.mn @@ -3,13 +3,13 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: -% overlay chrome://browser/content/browser.xul chrome://browser/content/statusbar/overlay.xul -% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/statusbar/overlay.css - content/browser/statusbar/overlay.js (content/overlay.js) - content/browser/statusbar/prefs.js (content/prefs.js) - content/browser/statusbar/prefs.xml (content/prefs.xml) - content/browser/statusbar/tabbrowser.xml (content/tabbrowser.xml) - content/browser/statusbar/overlay.xul (content/overlay.xul) - content/browser/statusbar/prefs.xul (content/prefs.xul) - content/browser/statusbar/overlay.css (content/overlay.css) - content/browser/statusbar/prefs.css (content/prefs.css)
\ No newline at end of file +% overlay chrome://browser/content/browser.xul chrome://browser/content/statusbar/overlay.xul +% style chrome://global/content/customizeToolbar.xul chrome://browser/skin/statusbar/overlay.css + content/browser/statusbar/overlay.js (content/overlay.js) + content/browser/statusbar/prefs.js (content/prefs.js) + content/browser/statusbar/prefs.xml (content/prefs.xml) + content/browser/statusbar/tabbrowser.xml (content/tabbrowser.xml) + content/browser/statusbar/overlay.xul (content/overlay.xul) + content/browser/statusbar/prefs.xul (content/prefs.xul) + content/browser/statusbar/overlay.css (content/overlay.css) + content/browser/statusbar/prefs.css (content/prefs.css)
\ No newline at end of file diff --git a/application/palemoon/components/statusbar/moz.build b/application/palemoon/components/statusbar/moz.build index ba8cfef86..0f7f597a5 100644 --- a/application/palemoon/components/statusbar/moz.build +++ b/application/palemoon/components/statusbar/moz.build @@ -16,6 +16,7 @@ EXTRA_COMPONENTS += [ ] EXTRA_JS_MODULES.statusbar = [ + 'content-thunk.js', 'Downloads.jsm', 'Progress.jsm', 'Status.jsm', diff --git a/application/basilisk/base/content/sync/aboutSyncTabs-bindings.xml b/application/palemoon/components/sync/aboutSyncTabs-bindings.xml index e6108209a..e6108209a 100644 --- a/application/basilisk/base/content/sync/aboutSyncTabs-bindings.xml +++ b/application/palemoon/components/sync/aboutSyncTabs-bindings.xml diff --git a/application/basilisk/base/content/sync/aboutSyncTabs.css b/application/palemoon/components/sync/aboutSyncTabs.css index 5a353175b..5a353175b 100644 --- a/application/basilisk/base/content/sync/aboutSyncTabs.css +++ b/application/palemoon/components/sync/aboutSyncTabs.css diff --git a/application/palemoon/base/content/sync/aboutSyncTabs.js b/application/palemoon/components/sync/aboutSyncTabs.js index 410494b5b..410494b5b 100644 --- a/application/palemoon/base/content/sync/aboutSyncTabs.js +++ b/application/palemoon/components/sync/aboutSyncTabs.js diff --git a/application/basilisk/base/content/sync/aboutSyncTabs.xul b/application/palemoon/components/sync/aboutSyncTabs.xul index a4aa0032f..a4aa0032f 100644 --- a/application/basilisk/base/content/sync/aboutSyncTabs.xul +++ b/application/palemoon/components/sync/aboutSyncTabs.xul diff --git a/application/basilisk/base/content/sync/addDevice.js b/application/palemoon/components/sync/addDevice.js index 0390d4397..0390d4397 100644 --- a/application/basilisk/base/content/sync/addDevice.js +++ b/application/palemoon/components/sync/addDevice.js diff --git a/application/basilisk/base/content/sync/addDevice.xul b/application/palemoon/components/sync/addDevice.xul index 83c3b7b3c..f2371aad0 100644 --- a/application/basilisk/base/content/sync/addDevice.xul +++ b/application/palemoon/components/sync/addDevice.xul @@ -43,7 +43,7 @@ &pairDevice.dialog.description.label; <label class="text-link" value="&addDevice.showMeHow.label;" - href="https://services.mozilla.com/sync/help/add-device"/> + href="http://www.palemoon.org/sync/help/easy-setup.shtml"/> </description> <separator class="groove-thin"/> <description> diff --git a/application/basilisk/base/content/sync/genericChange.js b/application/palemoon/components/sync/genericChange.js index 51a74f1b1..df6639178 100644 --- a/application/basilisk/base/content/sync/genericChange.js +++ b/application/palemoon/components/sync/genericChange.js @@ -32,6 +32,7 @@ var Change = { onLoad: function Change_onLoad() { /* Load labels */ let introText = document.getElementById("introText"); + let introText2 = document.getElementById("introText2"); let warningText = document.getElementById("warningText"); // load some other elements & info from the window @@ -69,7 +70,6 @@ var Change = { else { document.getElementById("generatePassphraseButton").hidden = false; document.getElementById("passphraseBackupButtons").hidden = false; - this._passphraseBox.setAttribute("readonly", "true"); let pp = Weave.Service.identity.syncKey; if (Weave.Utils.isPassphrase(pp)) pp = Weave.Utils.hyphenatePassphrase(pp); @@ -120,7 +120,7 @@ var Change = { _updateStatus: function Change__updateStatus(str, state) { this._updateStatusWithString(this._str(str), state); }, - + _updateStatusWithString: function Change__updateStatusWithString(string, state) { this._statusRow.hidden = false; this._status.value = string; @@ -141,10 +141,11 @@ var Change = { case "UpdatePassphrase": case "ResetPassphrase": return this.doChangePassphrase(); + break; case "ChangePassword": return this.doChangePassword(); + break; } - return undefined; }, doGeneratePassphrase: function () { @@ -212,10 +213,10 @@ var Change = { [valid, errorString] = gSyncUtils.validatePassword(this._firstBox, this._secondBox); } else { - if (!this._updatingPassphrase) - return; - - valid = this._passphraseBox.value != ""; + //Pale Moon: Enforce minimum length of 8 for allowed custom passphrase + //and don't restrict it to "out of sync" situations only. People who + //go to this page generally know what they are doing ;) + valid = this._passphraseBox.value.length >= 8; } if (errorString == "") diff --git a/application/basilisk/base/content/sync/genericChange.xul b/application/palemoon/components/sync/genericChange.xul index db74a1b31..3c0b2cd6c 100644 --- a/application/basilisk/base/content/sync/genericChange.xul +++ b/application/palemoon/components/sync/genericChange.xul @@ -67,7 +67,7 @@ <label id="generatePassphraseButton" hidden="true" value="&syncGenerateNewKey.label;" - class="text-link" + class="text-link inline-link" onclick="event.stopPropagation(); Change.doGeneratePassphrase();"/> </hbox> @@ -105,7 +105,7 @@ <description> &existingRecoveryKey.description; <label class="text-link" - href="https://services.mozilla.com/sync/help/manual-setup"> + href="http://www.palemoon.org/sync/help/recoverykey.shtml"> &addDevice.showMeHow.label; </label> </description> diff --git a/application/palemoon/components/sync/jar.mn b/application/palemoon/components/sync/jar.mn new file mode 100644 index 000000000..3782038cd --- /dev/null +++ b/application/palemoon/components/sync/jar.mn @@ -0,0 +1,22 @@ +# 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/sync/aboutSyncTabs.xul + content/browser/sync/aboutSyncTabs.js + content/browser/sync/aboutSyncTabs.css + content/browser/sync/aboutSyncTabs-bindings.xml + content/browser/sync/setup.xul + content/browser/sync/addDevice.js + content/browser/sync/addDevice.xul + content/browser/sync/setup.js + content/browser/sync/genericChange.xul + content/browser/sync/genericChange.js + content/browser/sync/key.xhtml + content/browser/sync/notification.xml + content/browser/sync/quota.xul + content/browser/sync/quota.js + content/browser/sync/utils.js + content/browser/sync/progress.js + content/browser/sync/progress.xhtml
\ No newline at end of file diff --git a/application/basilisk/base/content/sync/key.xhtml b/application/palemoon/components/sync/key.xhtml index 1363132e7..92abf0ee6 100644 --- a/application/basilisk/base/content/sync/key.xhtml +++ b/application/palemoon/components/sync/key.xhtml @@ -44,7 +44,7 @@ <p><em>&syncKey.keepItSafe1.description;</em>&syncKey.keepItSafe2.description;<em>&syncKey.keepItSafe3.description;</em>&syncKey.keepItSafe4a.description;</p> </div> -<p>&syncKey.findOutMore1.label;<a href="https://services.mozilla.com">https://services.mozilla.com</a>&syncKey.findOutMore2.label;</p> +<p>&syncKey.findOutMore1.label;<a href="http://www.palemoon.org/sync/">http://www.palemoon.org/sync/</a>&syncKey.findOutMore2.label;</p> <footer> &syncKey.footer1.label;<a id="tosLink" href="termsURL">termsURL</a>&syncKey.footer2.label;<a id="ppLink" href="privacyURL">privacyURL</a>&syncKey.footer3.label; diff --git a/application/palemoon/components/sync/moz.build b/application/palemoon/components/sync/moz.build new file mode 100644 index 000000000..2d64d506c --- /dev/null +++ b/application/palemoon/components/sync/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/sync/notification.xml b/application/palemoon/components/sync/notification.xml new file mode 100644 index 000000000..8ac881e08 --- /dev/null +++ b/application/palemoon/components/sync/notification.xml @@ -0,0 +1,129 @@ +<?xml version="1.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/. --> + +<!DOCTYPE bindings [ +<!ENTITY % notificationDTD SYSTEM "chrome://global/locale/notification.dtd"> +%notificationDTD; +]> + +<bindings id="notificationBindings" + xmlns="http://www.mozilla.org/xbl" + xmlns:xbl="http://www.mozilla.org/xbl" + xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> + + <binding id="notificationbox" extends="chrome://global/content/bindings/notification.xml#notificationbox"> + <content> + <xul:vbox xbl:inherits="hidden=notificationshidden"> + <xul:spacer/> + <children includes="notification"/> + </xul:vbox> + <children/> + </content> + + <implementation> + <constructor><![CDATA[ + let temp = {}; + Cu.import("resource://services-common/observers.js", temp); + temp.Observers.add("weave:notification:added", this.onNotificationAdded, this); + temp.Observers.add("weave:notification:removed", this.onNotificationRemoved, this); + + for each (var notification in Weave.Notifications.notifications) + this._appendNotification(notification); + ]]></constructor> + + <destructor><![CDATA[ + let temp = {}; + Cu.import("resource://services-common/observers.js", temp); + temp.Observers.remove("weave:notification:added", this.onNotificationAdded, this); + temp.Observers.remove("weave:notification:removed", this.onNotificationRemoved, this); + ]]></destructor> + + <method name="onNotificationAdded"> + <parameter name="subject"/> + <parameter name="data"/> + <body><![CDATA[ + this._appendNotification(subject); + ]]></body> + </method> + + <method name="onNotificationRemoved"> + <parameter name="subject"/> + <parameter name="data"/> + <body><![CDATA[ + // If the view of the notification hasn't been removed yet, remove it. + var notifications = this.allNotifications; + for each (var notification in notifications) { + if (notification.notification == subject) { + notification.close(); + break; + } + } + ]]></body> + </method> + + <method name="_appendNotification"> + <parameter name="notification"/> + <body><![CDATA[ + var node = this.appendNotification(notification.description, + notification.title, + notification.iconURL, + notification.priority, + notification.buttons); + node.notification = notification; + ]]></body> + </method> + + </implementation> + </binding> + + <binding id="notification" extends="chrome://global/content/bindings/notification.xml#notification"> + <content> + <xul:hbox class="notification-inner outset" flex="1" xbl:inherits="type"> + <xul:toolbarbutton ondblclick="event.stopPropagation();" + class="messageCloseButton close-icon tabbable" + xbl:inherits="hidden=hideclose" + tooltiptext="&closeNotification.tooltip;" + oncommand="document.getBindingParent(this).close()"/> + <xul:hbox anonid="details" align="center" flex="1"> + <xul:image anonid="messageImage" class="messageImage" xbl:inherits="src=image,type"/> + <xul:description anonid="messageText" class="messageText" xbl:inherits="xbl:text=label"/> + + <!-- The children are the buttons defined by the notification. --> + <xul:hbox oncommand="document.getBindingParent(this)._doButtonCommand(event);"> + <children/> + </xul:hbox> + </xul:hbox> + </xul:hbox> + </content> + <implementation> + <!-- Note: this used to be a field, but for some reason it kept getting + - reset to its default value for TabNotification elements. + - As a property, that doesn't happen, even though the property stores + - its value in a JS property |_notification| that is not defined + - in XBL as a field or property. Maybe this is wrong, but it works. + --> + <property name="notification" + onget="return this._notification" + onset="this._notification = val; return val;"/> + <method name="close"> + <body><![CDATA[ + Weave.Notifications.remove(this.notification); + + // We should be able to call the base class's close method here + // to remove the notification element from the notification box, + // but we can't because of bug 373652, so instead we copied its code + // and execute it below. + var control = this.control; + if (control) + control.removeNotification(this); + else + this.hidden = true; + ]]></body> + </method> + </implementation> + </binding> + +</bindings> diff --git a/application/palemoon/components/sync/progress.js b/application/palemoon/components/sync/progress.js new file mode 100644 index 000000000..101160fa8 --- /dev/null +++ b/application/palemoon/components/sync/progress.js @@ -0,0 +1,71 @@ +/* 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/. */ + +const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://services-sync/main.js"); + +var gProgressBar; +var gCounter = 0; + +function onLoad(event) { + Services.obs.addObserver(onEngineSync, "weave:engine:sync:finish", false); + Services.obs.addObserver(onEngineSync, "weave:engine:sync:error", false); + Services.obs.addObserver(onServiceSync, "weave:service:sync:finish", false); + Services.obs.addObserver(onServiceSync, "weave:service:sync:error", false); + + gProgressBar = document.getElementById('uploadProgressBar'); + + if (Services.prefs.getPrefType("services.sync.firstSync") != Ci.nsIPrefBranch.PREF_INVALID) { + gProgressBar.hidden = false; + } + else { + gProgressBar.hidden = true; + } +} + +function onUnload(event) { + cleanUpObservers(); +} + +function cleanUpObservers() { + try { + Services.obs.removeObserver(onEngineSync, "weave:engine:sync:finish"); + Services.obs.removeObserver(onEngineSync, "weave:engine:sync:error"); + Services.obs.removeObserver(onServiceSync, "weave:service:sync:finish"); + Services.obs.removeObserver(onServiceSync, "weave:service:sync:error"); + } + catch (e) { + // may be double called by unload & exit. Ignore. + } +} + +function onEngineSync(subject, topic, data) { + // The Clients engine syncs first. At this point we don't necessarily know + // yet how many engines will be enabled, so we'll ignore the Clients engine + // and evaluate how many engines are enabled when the first "real" engine + // syncs. + if (data == "clients") { + return; + } + + if (!gCounter && + Services.prefs.getPrefType("services.sync.firstSync") != Ci.nsIPrefBranch.PREF_INVALID) { + gProgressBar.max = Weave.Service.engineManager.getEnabled().length; + } + + gCounter += 1; + gProgressBar.setAttribute("value", gCounter); +} + +function onServiceSync(subject, topic, data) { + // To address the case where 0 engines are synced, we will fill the + // progress bar so the user knows that the sync has finished. + gProgressBar.setAttribute("value", gProgressBar.max); + cleanUpObservers(); +} + +function closeTab() { + window.close(); +} diff --git a/application/palemoon/components/sync/progress.xhtml b/application/palemoon/components/sync/progress.xhtml new file mode 100644 index 000000000..d403cb20d --- /dev/null +++ b/application/palemoon/components/sync/progress.xhtml @@ -0,0 +1,55 @@ +<?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 % htmlDTD + PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "DTD/xhtml1-strict.dtd"> + %htmlDTD; + <!ENTITY % syncProgressDTD + SYSTEM "chrome://browser/locale/syncProgress.dtd"> + %syncProgressDTD; + <!ENTITY % syncSetupDTD + SYSTEM "chrome://browser/locale/syncSetup.dtd"> + %syncSetupDTD; + <!ENTITY % globalDTD + SYSTEM "chrome://global/locale/global.dtd"> + %globalDTD; +]> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title>&syncProgress.pageTitle;</title> + + <link rel="stylesheet" type="text/css" media="all" + href="chrome://browser/skin/syncProgress.css"/> + + <link rel="icon" type="image/png" id="favicon" + href="chrome://browser/skin/sync-16.png"/> + + <script type="text/javascript;version=1.8" + src="chrome://browser/content/sync/progress.js"/> + </head> + <body onload="onLoad(event)" onunload="onUnload(event)" dir="&locale.dir;"> + <title>&setup.successPage.title;</title> + <div id="floatingBox" class="main-content"> + <div id="title"> + <h1>&setup.successPage.title;</h1> + </div> + <div id="successLogo"> + <img id="brandSyncLogo" src="chrome://browser/skin/sync-128.png" alt="&syncProgress.logoAltText;" /> + </div> + <div id="loadingText"> + <p id="blurb">&syncProgress.textBlurb; </p> + </div> + <div id="progressBar"> + <progress id="uploadProgressBar" value="0"/> + </div> + <div id="bottomRow"> + <button id="closeButton" onclick="closeTab()">&syncProgress.closeButton; </button> + </div> + </div> + </body> +</html> diff --git a/application/palemoon/components/sync/quota.js b/application/palemoon/components/sync/quota.js new file mode 100644 index 000000000..b416a44cc --- /dev/null +++ b/application/palemoon/components/sync/quota.js @@ -0,0 +1,247 @@ +/* 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/. */ + +const Ci = Components.interfaces; +const Cc = Components.classes; +const Cr = Components.results; +const Cu = Components.utils; + +Cu.import("resource://services-sync/main.js"); +Cu.import("resource://gre/modules/DownloadUtils.jsm"); + +var gSyncQuota = { + + init: function init() { + this.bundle = document.getElementById("quotaStrings"); + let caption = document.getElementById("treeCaption"); + caption.firstChild.nodeValue = this.bundle.getString("quota.treeCaption.label"); + + gUsageTreeView.init(); + this.tree = document.getElementById("usageTree"); + this.tree.view = gUsageTreeView; + + this.loadData(); + }, + + loadData: function loadData() { + this._usage_req = Weave.Service.getStorageInfo(Weave.INFO_COLLECTION_USAGE, + function (error, usage) { + delete gSyncQuota._usage_req; + // displayUsageData handles null values, so no need to check 'error'. + gUsageTreeView.displayUsageData(usage); + }); + + let usageLabel = document.getElementById("usageLabel"); + let bundle = this.bundle; + + this._quota_req = Weave.Service.getStorageInfo(Weave.INFO_QUOTA, + function (error, quota) { + delete gSyncQuota._quota_req; + + if (error) { + usageLabel.value = bundle.getString("quota.usageError.label"); + return; + } + let used = gSyncQuota.convertKB(quota[0]); + if (!quota[1]) { + // No quota on the server. + usageLabel.value = bundle.getFormattedString( + "quota.usageNoQuota.label", used); + return; + } + let percent = Math.round(100 * quota[0] / quota[1]); + let total = gSyncQuota.convertKB(quota[1]); + usageLabel.value = bundle.getFormattedString( + "quota.usagePercentage.label", [percent].concat(used).concat(total)); + }); + }, + + onCancel: function onCancel() { + if (this._usage_req) { + this._usage_req.abort(); + } + if (this._quota_req) { + this._quota_req.abort(); + } + return true; + }, + + onAccept: function onAccept() { + let engines = gUsageTreeView.getEnginesToDisable(); + for each (let engine in engines) { + Weave.Service.engineManager.get(engine).enabled = false; + } + if (engines.length) { + // The 'Weave' object will disappear once the window closes. + let Service = Weave.Service; + Weave.Utils.nextTick(function() { Service.sync(); }); + } + return this.onCancel(); + }, + + convertKB: function convertKB(value) { + return DownloadUtils.convertByteUnits(value * 1024); + } + +}; + +var gUsageTreeView = { + + _ignored: {keys: true, + meta: true, + clients: true}, + + /* + * Internal data structures underlaying the tree. + */ + _collections: [], + _byname: {}, + + init: function init() { + let retrievingLabel = gSyncQuota.bundle.getString("quota.retrieving.label"); + for each (let engine in Weave.Service.engineManager.getEnabled()) { + if (this._ignored[engine.name]) + continue; + + // Some engines use the same pref, which means they can only be turned on + // and off together. We need to combine them here as well. + let existing = this._byname[engine.prefName]; + if (existing) { + existing.engines.push(engine.name); + continue; + } + + let obj = {name: engine.prefName, + title: this._collectionTitle(engine), + engines: [engine.name], + enabled: true, + sizeLabel: retrievingLabel}; + this._collections.push(obj); + this._byname[engine.prefName] = obj; + } + }, + + _collectionTitle: function _collectionTitle(engine) { + try { + return gSyncQuota.bundle.getString( + "collection." + engine.prefName + ".label"); + } catch (ex) { + return engine.Name; + } + }, + + /* + * Process the quota information as returned by info/collection_usage. + */ + displayUsageData: function displayUsageData(data) { + for each (let coll in this._collections) { + coll.size = 0; + // If we couldn't retrieve any data, just blank out the label. + if (!data) { + coll.sizeLabel = ""; + continue; + } + + for each (let engineName in coll.engines) + coll.size += data[engineName] || 0; + let sizeLabel = ""; + sizeLabel = gSyncQuota.bundle.getFormattedString( + "quota.sizeValueUnit.label", gSyncQuota.convertKB(coll.size)); + coll.sizeLabel = sizeLabel; + } + let sizeColumn = this.treeBox.columns.getNamedColumn("size"); + this.treeBox.invalidateColumn(sizeColumn); + }, + + /* + * Handle click events on the tree. + */ + onTreeClick: function onTreeClick(event) { + if (event.button == 2) + return; + + let cell = this.treeBox.getCellAt(event.clientX, event.clientY); + if (cell.col && cell.col.id == "enabled") + this.toggle(cell.row); + }, + + /* + * Toggle enabled state of an engine. + */ + toggle: function toggle(row) { + // Update the tree + let collection = this._collections[row]; + collection.enabled = !collection.enabled; + this.treeBox.invalidateRow(row); + }, + + /* + * Return a list of engines (or rather their pref names) that should be + * disabled. + */ + getEnginesToDisable: function getEnginesToDisable() { + // 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 + + get rowCount() { + return this._collections.length; + }, + + getRowProperties: function(index) { return ""; }, + getCellProperties: function(row, col) { return ""; }, + getColumnProperties: function(col) { return ""; }, + isContainer: function(index) { return false; }, + isContainerOpen: function(index) { return false; }, + isContainerEmpty: function(index) { return false; }, + isSeparator: function(index) { return false; }, + isSorted: function() { return false; }, + canDrop: function(index, orientation, dataTransfer) { return false; }, + drop: function(row, orientation, dataTransfer) {}, + getParentIndex: function(rowIndex) {}, + hasNextSibling: function(rowIndex, afterIndex) { return false; }, + getLevel: function(index) { return 0; }, + getImageSrc: function(row, col) {}, + + getCellValue: function(row, col) { + return this._collections[row].enabled; + }, + + getCellText: function getCellText(row, col) { + let collection = this._collections[row]; + switch (col.id) { + case "collection": + return collection.title; + case "size": + return collection.sizeLabel; + default: + return ""; + } + }, + + setTree: function setTree(tree) { + this.treeBox = tree; + }, + + toggleOpenState: function(index) {}, + cycleHeader: function(col) {}, + selectionChanged: function() {}, + cycleCell: function(row, col) {}, + isEditable: function(row, col) { return false; }, + isSelectable: function (row, col) { return false; }, + setCellValue: function(row, col, value) {}, + setCellText: function(row, col, value) {}, + performAction: function(action) {}, + performActionOnRow: function(action, row) {}, + performActionOnCell: function(action, row, col) {} + +}; diff --git a/application/palemoon/components/sync/quota.xul b/application/palemoon/components/sync/quota.xul new file mode 100644 index 000000000..99e6ed78b --- /dev/null +++ b/application/palemoon/components/sync/quota.xul @@ -0,0 +1,65 @@ +<?xml version="1.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/. --> + +<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> +<?xml-stylesheet href="chrome://browser/skin/syncQuota.css"?> + +<!DOCTYPE dialog [ +<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> +<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd"> +<!ENTITY % syncQuotaDTD SYSTEM "chrome://browser/locale/syncQuota.dtd"> +%brandDTD; +%syncBrandDTD; +%syncQuotaDTD; +]> +<dialog id="quotaDialog" + windowtype="Sync:ViewQuota" + persist="screenX screenY width height" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:html="http://www.w3.org/1999/xhtml" + onload="gSyncQuota.init()" + buttons="accept,cancel" + title=""a.dialogTitle.label;" + ondialogcancel="return gSyncQuota.onCancel();" + ondialogaccept="return gSyncQuota.onAccept();"> + + <script type="application/javascript" + src="chrome://browser/content/sync/quota.js"/> + + <stringbundleset id="stringbundleset"> + <stringbundle id="quotaStrings" + src="chrome://browser/locale/syncQuota.properties"/> + </stringbundleset> + + <vbox flex="1"> + <label id="usageLabel" + value=""a.retrievingInfo.label;"/> + <separator/> + <tree id="usageTree" + seltype="single" + hidecolumnpicker="true" + onclick="gUsageTreeView.onTreeClick(event);" + flex="1"> + <treecols> + <treecol id="enabled" + type="checkbox" + fixed="true"/> + <splitter class="tree-splitter"/> + <treecol id="collection" + label=""a.typeColumn.label;" + flex="1"/> + <splitter class="tree-splitter"/> + <treecol id="size" + label=""a.sizeColumn.label;" + flex="1"/> + </treecols> + <treechildren flex="1"/> + </tree> + <separator/> + <description id="treeCaption"> </description> + </vbox> + +</dialog> diff --git a/application/basilisk/base/content/sync/setup.js b/application/palemoon/components/sync/setup.js index f9dae1bd4..e8d67a5f6 100644 --- a/application/basilisk/base/content/sync/setup.js +++ b/application/palemoon/components/sync/setup.js @@ -1,4 +1,3 @@ -// -*- indent-tabs-mode: nil; js-indent-level: 2 -*- /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -51,9 +50,7 @@ var gSyncSetup = { server: false }, - get _remoteSites() { - return [Weave.Service.serverURL, RECAPTCHA_DOMAIN]; - }, + get _remoteSites() [Weave.Service.serverURL, RECAPTCHA_DOMAIN], get _usingMainServers() { if (this._settingUpNew) @@ -72,7 +69,7 @@ var gSyncSetup = { let self = this; let addRem = function(add) { obs.forEach(function([topic, func]) { - // XXXzpao This should use Services.obs.* but Weave's Obs does nice handling + //XXXzpao This should use Services.obs.* but Weave's Obs does nice handling // of `this`. Fix in a followup. (bug 583347) if (add) Weave.Svc.Obs.add(topic, self[func], self); @@ -81,7 +78,7 @@ var gSyncSetup = { }); }; addRem(true); - window.addEventListener("unload", () => addRem(false), false); + window.addEventListener("unload", function() addRem(false), false); window.setTimeout(function () { // Force Service to be loaded so that engines are registered. @@ -123,14 +120,14 @@ var gSyncSetup = { startNewAccountSetup: function () { if (!Weave.Utils.ensureMPUnlocked()) - return; + return false; this._settingUpNew = true; this.wizard.pageIndex = NEW_ACCOUNT_START_PAGE; }, useExistingAccount: function () { if (!Weave.Utils.ensureMPUnlocked()) - return; + return false; this._settingUpNew = false; if (this.wizardType == "pair") { // We're already pairing, so there's no point in pairing again. @@ -512,6 +509,7 @@ var gSyncSetup = { onWizardBack: function () { switch (this.wizard.pageIndex) { case NEW_ACCOUNT_START_PAGE: + case EXISTING_ACCOUNT_LOGIN_PAGE: this.wizard.pageIndex = INTRO_PAGE; return false; case EXISTING_ACCOUNT_CONNECT_PAGE: @@ -552,12 +550,19 @@ var gSyncSetup = { for (let i = 0;i < prefs.length;i++) { Weave.Svc.Prefs.set(prefs[i], isChecked(prefs[i])); } + + // XXX: Addons syncing is currently not operational; + // Make doubly-sure to always disable addons syncing pref + Weave.Svc.Prefs.set("engine.addons", false); + this._handleNoScript(false); if (Weave.Svc.Prefs.get("firstSync", "") == "notReady") Weave.Svc.Prefs.reset("firstSync"); Weave.Service.persistLogin(); Weave.Svc.Obs.notify("weave:service:setup-complete"); + + gSyncUtils.openFirstSyncProgressPage(); } Weave.Utils.nextTick(Weave.Service.sync, Weave.Service); window.close(); @@ -797,6 +802,7 @@ var gSyncSetup = { let el = document.getElementById("server"); let valid = false; let feedback = document.getElementById("serverFeedbackRow"); + let str = ""; if (el.value) { valid = this._validateServer(el); let str = valid ? "" : "serverInvalid.label"; @@ -932,7 +938,12 @@ var gSyncSetup = { let addonsEngine = Weave.Service.engineManager.get("addons"); if (addonsEngine.enabled) { let ids = addonsEngine._store.getAllIDs(); - let blessedcount = Object.keys(ids).filter(id => ids[id]).length; + let blessedcount = 0; + for each (let i in ids) { + if (i) { + blessedcount++; + } + } // bug 600141 does not apply, as this does not have to support existing strings document.getElementById("addonCount").value = PluralForm.get(blessedcount, @@ -956,7 +967,7 @@ var gSyncSetup = { box.appendChild(node); } - for (let name of Weave.Service.clientsEngine.stats.names) { + for each (let name in Weave.Service.clientsEngine.stats.names) { // Don't list the current client if (name == Weave.Service.clientsEngine.localName) continue; @@ -998,7 +1009,7 @@ var gSyncSetup = { if (string) { try { str = this._stringBundle.GetStringFromName(string); - } catch (e) {} + } catch(e) {} if (!str) str = Weave.Utils.getErrorString(string); @@ -1027,7 +1038,7 @@ var gSyncSetup = { // If we didn't find a captcha, assume it's not needed and don't show it. let responseStatus = request.QueryInterface(Ci.nsIHttpChannel).responseStatus; setVisibility(this.captchaBrowser, responseStatus != 404); - // XXX TODO we should really log any responseStatus other than 200 + //XXX TODO we should really log any responseStatus other than 200 }, onProgressChange: function() {}, onStatusChange: function() {}, diff --git a/application/basilisk/base/content/sync/setup.xul b/application/palemoon/components/sync/setup.xul index 11c085931..cf2cc77e4 100644 --- a/application/basilisk/base/content/sync/setup.xul +++ b/application/palemoon/components/sync/setup.xul @@ -43,7 +43,7 @@ &pairDevice.dialog.description.label; <label class="text-link" value="&addDevice.showMeHow.label;" - href="https://services.mozilla.com/sync/help/add-device"/> + href="http://www.palemoon.org/sync/help/easy-setup.shtml"/> </description> <separator class="groove-thin"/> <description> @@ -183,12 +183,12 @@ onclick="document.getElementById('tos').focus(); document.getElementById('tos').click()"> &setup.tosAgree1.label; - <label class="text-link" + <label class="text-link inline-link" onclick="event.stopPropagation();gSyncUtils.openToS();"> &setup.tosLink.label; </label> &setup.tosAgree2.label; - <label class="text-link" + <label class="text-link inline-link" onclick="event.stopPropagation();gSyncUtils.openPrivacyPolicy();"> &setup.ppLink.label; </label> @@ -221,7 +221,7 @@ &pairDevice.setup.description.label; <label class="text-link" value="&addDevice.showMeHow.label;" - href="https://services.mozilla.com/sync/help/easy-setup"/> + href="http://www.palemoon.org/sync/help/easy-setup.shtml"/> </description> <label value="&addDevice.setup.enterCode.label;" control="easySetupPIN1"/> @@ -340,7 +340,7 @@ <description> &existingRecoveryKey.description; <label class="text-link" - href="https://services.mozilla.com/sync/help/manual-setup"> + href="http://www.palemoon.org/sync/help/recoverykey.shtml"> &addDevice.showMeHow.label; </label> <spacer id="passphraseHelpSpacer"/> @@ -359,7 +359,7 @@ <grid> <columns> <column/> - <column flex="1" style="margin-inline-end: 2px"/> + <column flex="1" style="-moz-margin-end: 2px"/> </columns> <rows> <row align="center"> @@ -375,7 +375,8 @@ <checkbox label="&engine.addons.label;" accesskey="&engine.addons.accesskey;" id="engine.addons" - checked="true"/> + checked="false" + hidden="true"/> <checkbox label="&engine.bookmarks.label;" accesskey="&engine.bookmarks.accesskey;" id="engine.bookmarks" diff --git a/application/basilisk/base/content/sync/utils.js b/application/palemoon/components/sync/utils.js index 92981f7b4..d41ecf18a 100644 --- a/application/basilisk/base/content/sync/utils.js +++ b/application/palemoon/components/sync/utils.js @@ -14,13 +14,6 @@ var gSyncUtils = { return this.bundle = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties"); }, - get fxAccountsEnabled() { - let service = Components.classes["@mozilla.org/weave/service;1"] - .getService(Components.interfaces.nsISupports) - .wrappedJSObject; - return service.fxAccountsEnabled; - }, - // opens in a new window if we're in a modal prefwindow world, in a new tab otherwise _openLink: function (url) { let thisDocEl = document.documentElement, @@ -77,22 +70,16 @@ var gSyncUtils = { this._openLink(Weave.Service.pwResetURL); }, - get tosURL() { - let root = this.fxAccountsEnabled ? "fxa." : ""; - return Weave.Svc.Prefs.get(root + "termsURL"); - }, - openToS: function () { - this._openLink(this.tosURL); + this._openLink(Weave.Svc.Prefs.get("termsURL")); }, - get privacyPolicyURL() { - let root = this.fxAccountsEnabled ? "fxa." : ""; - return Weave.Svc.Prefs.get(root + "privacyURL"); + openPrivacyPolicy: function () { + this._openLink(Weave.Svc.Prefs.get("privacyURL")); }, - openPrivacyPolicy: function () { - this._openLink(this.privacyPolicyURL); + openFirstSyncProgressPage: function () { + this._openLink("about:sync-progress"); }, /** @@ -134,7 +121,7 @@ var gSyncUtils = { /** * Print passphrase backup document. - * + * * @param elid : ID of the form element containing the passphrase. */ passphrasePrint: function(elid) { @@ -162,7 +149,7 @@ var gSyncUtils = { /** * Save passphrase backup document to disk as HTML file. - * + * * @param elid : ID of the form element containing the passphrase. */ passphraseSave: function(elid) { @@ -200,7 +187,7 @@ var gSyncUtils = { * * @param el1 : the first textbox element in the form * @param el2 : the second textbox element, if omitted it's an update form - * + * * returns [valid, errorString] */ validatePassword: function (el1, el2) { diff --git a/application/palemoon/config/version.txt b/application/palemoon/config/version.txt index 4f88287f0..7ce3ee6a8 100644 --- a/application/palemoon/config/version.txt +++ b/application/palemoon/config/version.txt @@ -1 +1 @@ -28.0.0b5
\ No newline at end of file +28.8.0a1
\ No newline at end of file diff --git a/application/palemoon/configure.in b/application/palemoon/configure.in index 0dbb0d8bc..70ddf6621 100644 --- a/application/palemoon/configure.in +++ b/application/palemoon/configure.in @@ -15,15 +15,23 @@ AC_SUBST(MOZ_PHOENIX_EXTENSIONS) dnl Optional parts of the build. dnl ======================================================== -dnl = Disable the status bar code +dnl = Disable Sync dnl ======================================================== -MOZ_ARG_DISABLE_BOOL(browser-statusbar, -[ --disable-browser-statusbar Disable Browser Status bar], - MOZ_BROWSER_STATUSBAR=, - MOZ_BROWSER_STATUSBAR=1) +MOZ_ARG_DISABLE_BOOL(sync, +[ --disable-sync Disable Sync], + MOZ_SERVICES_SYNC=, + MOZ_SERVICES_SYNC=1) -if test -n "$MOZ_BROWSER_STATUSBAR"; then - AC_DEFINE(MOZ_BROWSER_STATUSBAR) +dnl ======================================================== +dnl = Disable Lightweight Themes +dnl ======================================================== +MOZ_ARG_DISABLE_BOOL(personas, +[ --disable-personas Disable lightweight theme support], + MOZ_PERSONAS=, + MOZ_PERSONAS=1) + +if test -n "$MOZ_PERSONAS"; then + AC_DEFINE(MOZ_PERSONAS) fi -AC_SUBST(MOZ_BROWSER_STATUSBAR) +AC_SUBST(MOZ_PERSONAS)
\ No newline at end of file diff --git a/application/palemoon/confvars.sh b/application/palemoon/confvars.sh index 830523778..ee8e38412 100644 --- a/application/palemoon/confvars.sh +++ b/application/palemoon/confvars.sh @@ -43,8 +43,8 @@ MC_PALEMOON=1 # Firefox-like browsers MOZ_PHOENIX=1 -# Browser Feature: Status bar Component -MOZ_BROWSER_STATUSBAR=1 +# Lightweight Themes +MOZ_PERSONAS=1 # Browser Feature: Profile Migration Component MOZ_PROFILE_MIGRATOR= @@ -53,9 +53,9 @@ MOZ_PROFILE_MIGRATOR= # MAR_CHANNEL_ID must not contained the follow 3 characters: ",\t" # ACCEPTED_MAR_CHANNEL_IDS should usually be the same as MAR_CHANNEL_ID # If more than one ID is needed, then you should use a comma seperated list. -MOZ_UPDATER=1 -MAR_CHANNEL_ID=palemoon-release -ACCEPTED_MAR_CHANNEL_IDS=palemoon-release +MOZ_UPDATER= +MAR_CHANNEL_ID=unofficial +ACCEPTED_MAR_CHANNEL_IDS=unofficial,unstable,release # Platform Feature: Developer Tools # XXX: Devtools are disabled until they can be made to work with Pale Moon @@ -99,7 +99,6 @@ if test "$OS_ARCH" = "WINNT" -o \ fi # Short-circuit a few services to be removed -MOZ_MAINTENANCE_SERVICE= MOZ_SERVICES_HEALTHREPORT= MOZ_ADDON_SIGNING=0 MOZ_REQUIRE_SIGNING=0 diff --git a/application/palemoon/fonts/TwemojiMozilla.ttf b/application/palemoon/fonts/TwemojiMozilla.ttf Binary files differindex 8139089f1..c47cbbf11 100644 --- a/application/palemoon/fonts/TwemojiMozilla.ttf +++ b/application/palemoon/fonts/TwemojiMozilla.ttf diff --git a/application/palemoon/fonts/moz.build b/application/palemoon/fonts/moz.build index 02c027c46..8840a87f8 100644 --- a/application/palemoon/fonts/moz.build +++ b/application/palemoon/fonts/moz.build @@ -6,6 +6,4 @@ if CONFIG['OS_ARCH'] in ('WINNT', 'Linux'): DIST_SUBDIR = '' - FINAL_TARGET_FILES.fonts += [ - 'TwemojiMozilla.ttf' - ] + FINAL_TARGET_FILES.fonts += ['TwemojiMozilla.ttf'] diff --git a/application/palemoon/installer/Makefile.in b/application/palemoon/installer/Makefile.in index 3f009c51c..a0c38f282 100644 --- a/application/palemoon/installer/Makefile.in +++ b/application/palemoon/installer/Makefile.in @@ -113,19 +113,19 @@ include $(topsrcdir)/toolkit/mozapps/installer/packager.mk ifeq (bundle, $(MOZ_FS_LAYOUT)) BINPATH = $(_BINPATH) -DEFINES += -DAPPNAME=$(_APPNAME) +DEFINES += -DAPPNAME='$(_APPNAME)' else # Every other platform just winds up in dist/bin BINPATH = bin endif -DEFINES += -DBINPATH=$(BINPATH) +DEFINES += -DBINPATH='$(BINPATH)' ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) RESPATH = $(_APPNAME)/Contents/Resources else RESPATH = $(BINPATH) endif -DEFINES += -DRESPATH=$(RESPATH) +DEFINES += -DRESPATH='$(RESPATH)' AB = $(firstword $(subst -, ,$(AB_CD))) DEFINES += -DAB=$(AB) @@ -173,7 +173,7 @@ endif package-compare:: $(MOZ_PKG_MANIFEST) ifdef MOZ_PKG_MANIFEST_P - cd $(DIST); find $(PKGCOMP_FIND_OPTS) $(FINDPATH) -type f | sort > bin-list.txt + cd $(DIST); find $(PKGCOMP_FIND_OPTS) '$(FINDPATH)' -type f | sort > bin-list.txt grep '^$(BINPATH)' $(MOZ_PKG_MANIFEST) | sed -e 's/^\///' | sort > $(DIST)/pack-list.txt -diff -u $(DIST)/pack-list.txt $(DIST)/bin-list.txt rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt diff --git a/application/palemoon/installer/package-manifest.in b/application/palemoon/installer/package-manifest.in index e63af4013..e24b605e8 100644 --- a/application/palemoon/installer/package-manifest.in +++ b/application/palemoon/installer/package-manifest.in @@ -59,8 +59,8 @@ #ifdef XP_WIN32 @BINPATH@/uninstall/helper.exe #endif -#ifdef MOZ_UPDATER @RESPATH@/update.locale +#ifdef MOZ_UPDATER @RESPATH@/updater.ini #endif @@ -141,13 +141,6 @@ @RESPATH@/run-mozilla.sh #endif #endif -#ifdef XP_WIN -#ifdef _AMD64_ -@BINPATH@/@DLL_PREFIX@qipcap64@DLL_SUFFIX@ -#else -@BINPATH@/@DLL_PREFIX@qipcap@DLL_SUFFIX@ -#endif -#endif ; [Components] @RESPATH@/components/* @@ -213,11 +206,6 @@ #endif #ifdef MOZ_DEVTOOLS -; [Webide Files] -@RESPATH@/browser/chrome/webide@JAREXT@ -@RESPATH@/browser/chrome/webide.manifest -@RESPATH@/browser/@PREF_DIR@/webide-prefs.js - ; DevTools @RESPATH@/browser/chrome/devtools@JAREXT@ @RESPATH@/browser/chrome/devtools.manifest @@ -238,6 +226,7 @@ ; [Default Preferences] ; All the pref files must be part of base to prevent migration bugs +@RESPATH@/browser/defaults/permissions @RESPATH@/browser/@PREF_DIR@/palemoon.js @RESPATH@/browser/@PREF_DIR@/palemoon-branding.js @RESPATH@/greprefs.js @@ -248,8 +237,10 @@ ; gre location for now. @RESPATH@/defaults/pref/channel-prefs.js +#ifdef MOZ_SERVICES_SYNC ; Services (gre) prefs @RESPATH@/defaults/pref/services-sync.js +#endif ; [Layout Engine Resources] ; Style Sheets, Graphics and other Resources used by the layout engine. @@ -305,6 +296,13 @@ #ifndef MOZ_SYSTEM_NSS #if defined(XP_LINUX) && !defined(ANDROID) @BINPATH@/@DLL_PREFIX@freeblpriv3@DLL_SUFFIX@ +#elif defined(XP_SOLARIS) && defined(SPARC64) +@BINPATH@/@DLL_PREFIX@freebl_64fpu_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl_64int_3@DLL_SUFFIX@ +#elif defined(XP_SOLARIS) && defined(SPARC) +@BINPATH@/@DLL_PREFIX@freebl_32fpu_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl_32int64_3@DLL_SUFFIX@ +@BINPATH@/@DLL_PREFIX@freebl3@DLL_SUFFIX@ #else @BINPATH@/@DLL_PREFIX@freebl3@DLL_SUFFIX@ #endif @@ -323,13 +321,6 @@ @RESPATH@/chrome/pippki@JAREXT@ @RESPATH@/chrome/pippki.manifest -; for Solaris SPARC -#ifdef SOLARIS -bin/libfreebl_32fpu_3.so -bin/libfreebl_32int_3.so -bin/libfreebl_32int64_3.so -#endif - ; [Updater] ; #ifdef MOZ_UPDATER diff --git a/application/palemoon/installer/windows/Makefile.in b/application/palemoon/installer/windows/Makefile.in index 7ba70d912..d2be8aec2 100644 --- a/application/palemoon/installer/windows/Makefile.in +++ b/application/palemoon/installer/windows/Makefile.in @@ -14,12 +14,6 @@ INSTALLER_FILES = \ nsis/shared.nsh \ $(NULL) -ifdef MOZ_MAINTENANCE_SERVICE -INSTALLER_FILES += \ - nsis/maintenanceservice_installer.nsi \ - $(NULL) -endif - BRANDING_FILES = \ branding.nsi \ appname.bmp \ @@ -58,17 +52,6 @@ uninstaller:: --preprocess-locale $(topsrcdir) \ $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR) -# For building the maintenanceservice installer -ifdef MOZ_MAINTENANCE_SERVICE -maintenanceservice_installer:: - $(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR) - $(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \ - $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi) - $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \ - --preprocess-locale $(topsrcdir) \ - $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR) -endif - $(CONFIG_DIR)/setup.exe:: $(RM) -r $(CONFIG_DIR) $(MKDIR) $(CONFIG_DIR) @@ -79,10 +62,6 @@ $(CONFIG_DIR)/setup.exe:: $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \ --preprocess-locale $(topsrcdir) \ $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR) - $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \ - --preprocess-single-file $(topsrcdir) \ - $(PPL_LOCALE_ARGS) $(CONFIG_DIR) \ - nsisstrings.properties nsisstrings.nlf GARBARGE_DIRS += instgen diff --git a/application/palemoon/installer/windows/nsis/defines.nsi.in b/application/palemoon/installer/windows/nsis/defines.nsi.in index 97422c4f6..1764b10c4 100644 --- a/application/palemoon/installer/windows/nsis/defines.nsi.in +++ b/application/palemoon/installer/windows/nsis/defines.nsi.in @@ -3,23 +3,6 @@ # 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/. -# Defining FunnelcakeVersion will append the value of StubURLVersionAppend to -# StubURLVersion, append the value of URLManualDownloadAppend to -# URLManualDownload, and append the value of URLStubDownloadAppend to -# URLStubDownload. The value of FunnelcakeVersion should not be defined when it -# is not used and when it is defined its value should never be empty. -# !define FunnelcakeVersion "999" - -!ifdef FunnelcakeVersion -!define URLManualDownloadAppend "&f=${FunnelcakeVersion}" -!define URLStubDownloadAppend "-f${FunnelcakeVersion}" -!define StubURLVersionAppend "-${FunnelcakeVersion}" -!else -!define URLManualDownloadAppend "" -!define URLStubDownloadAppend "" -!define StubURLVersionAppend "" -!endif - # These defines should match application.ini settings !define AppName "Pale Moon" !define AppVersion "@APP_VERSION@" @@ -68,10 +51,6 @@ !define MinSupportedCPU "SSE2" -#ifdef MOZ_MAINTENANCE_SERVICE -!define MOZ_MAINTENANCE_SERVICE -#endif - # File details shared by both the installer and uninstaller VIProductVersion "1.0.0.0" VIAddVersionKey "ProductName" "${BrandShortName}" @@ -84,13 +63,3 @@ VIAddVersionKey "FileVersion" "${AppVersion}" VIAddVersionKey "ProductVersion" "${AppVersion}" # Comments is not used but left below commented out for future reference # VIAddVersionKey "Comments" "Comments" - -# Control positions in Dialog Units so they are placed correctly with -# non-default DPI settings -!define OPTIONS_ITEM_EDGE_DU 90u -!define OPTIONS_ITEM_WIDTH_DU 356u -!define OPTIONS_SUBITEM_EDGE_DU 119u -!define OPTIONS_SUBITEM_WIDTH_DU 327u -!define INSTALL_BLURB_TOP_DU 78u -!define APPNAME_BMP_EDGE_DU 19u -!define APPNAME_BMP_TOP_DU 12u diff --git a/application/palemoon/installer/windows/nsis/installer.nsi b/application/palemoon/installer/windows/nsis/installer.nsi index 276b94f74..9f61c9cbb 100644 --- a/application/palemoon/installer/windows/nsis/installer.nsi +++ b/application/palemoon/installer/windows/nsis/installer.nsi @@ -34,7 +34,6 @@ RequestExecutionLevel user Var TmpVal Var InstallType Var AddStartMenuSC -Var AddTaskbarSC Var AddQuickLaunchSC Var AddDesktopSC Var InstallMaintenanceService @@ -92,7 +91,6 @@ VIAddVersionKey "OriginalFilename" "setup.exe" !insertmacro InitHashAppModelId !insertmacro IsHandlerForInstallDir !insertmacro IsPinnedToTaskBar -!insertmacro IsUserAdmin !insertmacro LogDesktopShortcut !insertmacro LogQuickLaunchShortcut !insertmacro LogStartMenuShortcut @@ -165,11 +163,6 @@ Page custom preOptions leaveOptions !define MUI_DIRECTORYPAGE_VERIFYONLEAVE !insertmacro MUI_PAGE_DIRECTORY -; Custom Components Page -!ifdef MOZ_MAINTENANCE_SERVICE -Page custom preComponents leaveComponents -!endif - ; Custom Shortcuts Page Page custom preShortcuts leaveShortcuts @@ -396,12 +389,10 @@ Section "-Application" APP_IDX ; If we are writing to HKLM and create either the desktop or start menu ; shortcuts set IconsVisible to 1 otherwise to 0. - ; Taskbar shortcuts imply having a start menu shortcut. ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo" ${If} $AddDesktopSC == 1 ${OrIf} $AddStartMenuSC == 1 - ${OrIf} $AddTaskbarSC == 1 WriteRegDWORD HKLM "$0" "IconsVisible" 1 ${Else} WriteRegDWORD HKLM "$0" "IconsVisible" 0 @@ -415,53 +406,16 @@ Section "-Application" APP_IDX ; If we create either the desktop or start menu shortcuts, then ; set IconsVisible to 1 otherwise to 0. - ; Taskbar shortcuts imply having a start menu shortcut. ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 StrCpy $0 "Software\Clients\StartMenuInternet\$R9\InstallInfo" ${If} $AddDesktopSC == 1 ${OrIf} $AddStartMenuSC == 1 - ${OrIf} $AddTaskbarSC == 1 WriteRegDWORD HKCU "$0" "IconsVisible" 1 ${Else} WriteRegDWORD HKCU "$0" "IconsVisible" 0 ${EndIf} ${EndIf} -!ifdef MOZ_MAINTENANCE_SERVICE - ; If the maintenance service page was displayed then a value was already - ; explicitly selected for installing the maintenance service and - ; and so InstallMaintenanceService will already be 0 or 1. - ; If the maintenance service page was not displayed then - ; InstallMaintenanceService will be equal to "". - ${If} $InstallMaintenanceService == "" - Call IsUserAdmin - Pop $R0 - ${If} $R0 == "true" - ; Only proceed if we have HKLM write access - ${AndIf} $TmpVal == "HKLM" - ; On Windows < XP SP3 we do not install the maintenance service. - ${If} ${IsWinXP} - ${AndIf} ${AtMostServicePack} 2 - StrCpy $InstallMaintenanceService "0" - ${Else} - ; The user is an admin, so we should default to installing the service. - StrCpy $InstallMaintenanceService "1" - ${EndIf} - ${Else} - ; The user is not admin, so we can't install the service. - StrCpy $InstallMaintenanceService "0" - ${EndIf} - ${EndIf} - - ${If} $InstallMaintenanceService == "1" - ; The user wants to install the maintenance service, so execute - ; the pre-packaged maintenance service installer. - ; This option can only be turned on if the user is an admin so there - ; is no need to use ExecShell w/ verb runas to enforce elevated. - nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\"" - ${EndIf} -!endif - ; These need special handling on uninstall since they may be overwritten by ; an install into a different location. StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}" @@ -578,13 +532,6 @@ Section "-Application" APP_IDX ${EndIf} ${EndUnless} ${EndIf} - -!ifdef MOZ_MAINTENANCE_SERVICE - ${If} $TmpVal == "HKLM" - ; Add the registry keys for allowed certificates. - ${AddMaintCertKeys} - ${EndIf} -!endif SectionEnd ; Cleanup operations to perform at the end of the installation. @@ -948,59 +895,6 @@ Function leaveShortcuts ${EndIf} FunctionEnd -!ifdef MOZ_MAINTENANCE_SERVICE -Function preComponents - ; If the service already exists, don't show this page - ServicesHelper::IsInstalled "MozillaMaintenance" - Pop $R9 - ${If} $R9 == 1 - ; The service already exists so don't show this page. - Abort - ${EndIf} - - ; On Windows < XP SP3 we do not install the maintenance service. - ${If} ${IsWinXP} - ${AndIf} ${AtMostServicePack} 2 - Abort - ${EndIf} - - ; Don't show the custom components page if the - ; user is not an admin - Call IsUserAdmin - Pop $R9 - ${If} $R9 != "true" - Abort - ${EndIf} - - ; Only show the maintenance service page if we have write access to HKLM - ClearErrors - WriteRegStr HKLM "Software\Mozilla" \ - "${BrandShortName}InstallerTest" "Write Test" - ${If} ${Errors} - ClearErrors - Abort - ${Else} - DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" - ${EndIf} - - StrCpy $PageName "Components" - ${CheckCustomCommon} - !insertmacro MUI_HEADER_TEXT "$(COMPONENTS_PAGE_TITLE)" "$(COMPONENTS_PAGE_SUBTITLE)" - !insertmacro MUI_INSTALLOPTIONS_DISPLAY "components.ini" -FunctionEnd - -Function leaveComponents - ${MUI_INSTALLOPTIONS_READ} $0 "components.ini" "Settings" "State" - ${If} $0 != 0 - Abort - ${EndIf} - ${MUI_INSTALLOPTIONS_READ} $InstallMaintenanceService "components.ini" "Field 2" "State" - ${If} $InstallType == ${INSTALLTYPE_CUSTOM} - Call CheckExistingInstall - ${EndIf} -FunctionEnd -!endif - Function preSummary StrCpy $PageName "Summary" ; Setup the summary.ini file for the Custom Summary Page @@ -1180,7 +1074,6 @@ Function .onInit !insertmacro InitInstallOptionsFile "options.ini" !insertmacro InitInstallOptionsFile "shortcuts.ini" - !insertmacro InitInstallOptionsFile "components.ini" !insertmacro InitInstallOptionsFile "summary.ini" WriteINIStr "$PLUGINSDIR\options.ini" "Settings" NumFields "5" @@ -1255,36 +1148,6 @@ Function .onInit WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" Bottom "50" WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" State "1" - ; Don't offer to install the quick launch shortcut on Windows 7 - ${Unless} ${AtLeastWin7} - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Type "checkbox" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Text "$(ICONS_QUICKLAUNCH)" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Left "0" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Right "-1" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Top "60" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Bottom "70" - WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" State "1" - ${EndUnless} - - ; Setup the components.ini file for the Components Page - WriteINIStr "$PLUGINSDIR\components.ini" "Settings" NumFields "2" - - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Type "label" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Text "$(OPTIONAL_COMPONENTS_DESC)" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Left "0" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Right "-1" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Top "5" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Bottom "25" - - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Type "checkbox" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Text "$(MAINTENANCE_SERVICE_CHECKBOX_DESC)" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Left "0" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Right "-1" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Top "27" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Bottom "37" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" State "1" - WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Flags "GROUP" - ; There must always be a core directory. ${GetSize} "$EXEDIR\core\" "/S=0K" $R5 $R7 $R8 SectionSetSize ${APP_IDX} $R5 diff --git a/application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi b/application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi deleted file mode 100644 index 1f73bac6a..000000000 --- a/application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi +++ /dev/null @@ -1,332 +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/. - -; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs -!verbose 3 - -; 7-Zip provides better compression than the lzma from NSIS so we add the files -; uncompressed and use 7-Zip to create a SFX archive of it -SetDatablockOptimize on -SetCompress off -CRCCheck on - -RequestExecutionLevel admin - -; The commands inside this ifdef require NSIS 3.0a2 or greater so the ifdef can -; be removed after we require NSIS 3.0a2 or greater. -!ifdef NSIS_PACKEDVERSION - Unicode true - ManifestSupportedOS all - ManifestDPIAware true -!endif - -!addplugindir ./ - -; Variables -Var TempMaintServiceName -Var BrandFullNameDA -Var BrandFullName - -; Other included files may depend upon these includes! -; The following includes are provided by NSIS. -!include FileFunc.nsh -!include LogicLib.nsh -!include MUI.nsh -!include WinMessages.nsh -!include WinVer.nsh -!include WordFunc.nsh - -!insertmacro GetOptions -!insertmacro GetParameters -!insertmacro GetSize - -; The test slaves use this fallback key to run tests. -; And anyone that wants to run tests themselves should already have -; this installed. -!define FallbackKey \ - "SOFTWARE\Mozilla\MaintenanceService\3932ecacee736d366d6436db0f55bce4" - -!define CompanyName "Mozilla Corporation" -!define BrandFullNameInternal "" - -; The following includes are custom. -!include defines.nsi -; We keep defines.nsi defined so that we get other things like -; the version number, but we redefine BrandFullName -!define MaintFullName "Mozilla Maintenance Service" -!undef BrandFullName -!define BrandFullName "${MaintFullName}" - -!include common.nsh -!include locales.nsi - -VIAddVersionKey "FileDescription" "${MaintFullName} Installer" -VIAddVersionKey "OriginalFilename" "maintenanceservice_installer.exe" - -Name "${MaintFullName}" -OutFile "maintenanceservice_installer.exe" - -; Get installation folder from registry if available -InstallDirRegKey HKLM "Software\Mozilla\MaintenanceService" "" - -SetOverwrite on - -; serviceinstall.cpp also uses this key, in case the path is changed, update -; there too. -!define MaintUninstallKey \ - "Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService" - -; Always install into the 32-bit location even if we have a 64-bit build. -; This is because we use only 1 service for all Basilisk channels. -; Allow either x86 and x64 builds to exist at this location, depending on -; what is the latest build. -InstallDir "$PROGRAMFILES32\${MaintFullName}\" -ShowUnInstDetails nevershow - -################################################################################ -# Modern User Interface - MUI - -!define MUI_ICON setup.ico -!define MUI_UNICON setup.ico -!define MUI_WELCOMEPAGE_TITLE_3LINES -!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp - -;Interface Settings -!define MUI_ABORTWARNING - -; Uninstaller Pages -!insertmacro MUI_UNPAGE_CONFIRM -!insertmacro MUI_UNPAGE_INSTFILES - -################################################################################ -# Language - -!insertmacro MOZ_MUI_LANGUAGE 'baseLocale' -!verbose push -!verbose 3 -!include "overrideLocale.nsh" -!include "customLocale.nsh" -!verbose pop - -; Set this after the locale files to override it if it is in the locale -; using " " for BrandingText will hide the "Nullsoft Install System..." branding -BrandingText " " - -Function .onInit - ; Remove the current exe directory from the search order. - ; This only effects LoadLibrary calls and not implicitly loaded DLLs. - System::Call 'kernel32::SetDllDirectoryW(w "")' - - SetSilent silent - - ${Unless} ${AtLeastWin7} - Abort - ${EndUnless} -FunctionEnd - -Function un.onInit - ; Remove the current exe directory from the search order. - ; This only effects LoadLibrary calls and not implicitly loaded DLLs. - System::Call 'kernel32::SetDllDirectoryW(w "")' - -; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be -; removed after we require NSIS 3.0a2 or greater. -!ifndef NSIS_PACKEDVERSION - ${If} ${AtLeastWinVista} - System::Call 'user32::SetProcessDPIAware()' - ${EndIf} -!endif - - StrCpy $BrandFullNameDA "${MaintFullName}" - StrCpy $BrandFullName "${MaintFullName}" -FunctionEnd - -Section "MaintenanceService" - AllowSkipFiles off - - CreateDirectory $INSTDIR - SetOutPath $INSTDIR - - ; If the service already exists, then it will be stopped when upgrading it - ; via the maintenanceservice_tmp.exe command executed below. - ; The maintenanceservice_tmp.exe command will rename the file to - ; maintenanceservice.exe if maintenanceservice_tmp.exe is newer. - ; If the service does not exist yet, we install it and drop the file on - ; disk as maintenanceservice.exe directly. - StrCpy $TempMaintServiceName "maintenanceservice.exe" - IfFileExists "$INSTDIR\maintenanceservice.exe" 0 skipAlreadyExists - StrCpy $TempMaintServiceName "maintenanceservice_tmp.exe" - skipAlreadyExists: - - ; We always write out a copy and then decide whether to install it or - ; not via calling its 'install' cmdline which works by version comparison. - CopyFiles "$EXEDIR\maintenanceservice.exe" "$INSTDIR\$TempMaintServiceName" - - ; The updater.ini file is only used when performing an install or upgrade, - ; and only if that install or upgrade is successful. If an old updater.ini - ; happened to be copied into the maintenance service installation directory - ; but the service was not newer, the updater.ini file would be unused. - ; It is used to fill the description of the service on success. - CopyFiles "$EXEDIR\updater.ini" "$INSTDIR\updater.ini" - - ; Install the application maintenance service. - ; If a service already exists, the command line parameter will stop the - ; service and only install itself if it is newer than the already installed - ; service. If successful it will remove the old maintenanceservice.exe - ; and replace it with maintenanceservice_tmp.exe. - ClearErrors - ${GetParameters} $0 - ${GetOptions} "$0" "/Upgrade" $0 - ${If} ${Errors} - ExecWait '"$INSTDIR\$TempMaintServiceName" install' - ${Else} - ; The upgrade cmdline is the same as install except - ; It will fail if the service isn't already installed. - ExecWait '"$INSTDIR\$TempMaintServiceName" upgrade' - ${EndIf} - - WriteUninstaller "$INSTDIR\Uninstall.exe" - WriteRegStr HKLM "${MaintUninstallKey}" "DisplayName" "${MaintFullName}" - WriteRegStr HKLM "${MaintUninstallKey}" "UninstallString" \ - '"$INSTDIR\uninstall.exe"' - WriteRegStr HKLM "${MaintUninstallKey}" "DisplayIcon" \ - "$INSTDIR\Uninstall.exe,0" - WriteRegStr HKLM "${MaintUninstallKey}" "DisplayVersion" "${AppVersion}" - WriteRegStr HKLM "${MaintUninstallKey}" "Publisher" "Mozilla" - WriteRegStr HKLM "${MaintUninstallKey}" "Comments" "${BrandFullName}" - WriteRegDWORD HKLM "${MaintUninstallKey}" "NoModify" 1 - ${GetSize} "$INSTDIR" "/S=0K" $R2 $R3 $R4 - WriteRegDWORD HKLM "${MaintUninstallKey}" "EstimatedSize" $R2 - - ; Write out that a maintenance service was attempted. - ; We do this because on upgrades we will check this value and we only - ; want to install once on the first upgrade to maintenance service. - ; Also write out that we are currently installed, preferences will check - ; this value to determine if we should show the service update pref. - ; Since the Maintenance service can be installed either x86 or x64, - ; always use the 64-bit registry for checking if an attempt was made. - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1 - WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1 - DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled" - - ; Included here for debug purposes only. - ; These keys are used to bypass the installation dir is a valid installation - ; check from the service so that tests can be run. - ; WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation" - ; WriteRegStr HKLM "${FallbackKey}\0" "issuer" "DigiCert SHA2 Assured ID Code Signing CA" - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} -SectionEnd - -; By renaming before deleting we improve things slightly in case -; there is a file in use error. In this case a new install can happen. -Function un.RenameDelete - Pop $9 - ; If the .moz-delete file already exists previously, delete it - ; If it doesn't exist, the call is ignored. - ; We don't need to pass /REBOOTOK here since it was already marked that way - ; if it exists. - Delete "$9.moz-delete" - Rename "$9" "$9.moz-delete" - ${If} ${Errors} - Delete /REBOOTOK "$9" - ${Else} - Delete /REBOOTOK "$9.moz-delete" - ${EndIf} - ClearErrors -FunctionEnd - -Section "Uninstall" - ; Delete the service so that no updates will be attempted - ExecWait '"$INSTDIR\maintenanceservice.exe" uninstall' - - Push "$INSTDIR\updater.ini" - Call un.RenameDelete - Push "$INSTDIR\maintenanceservice.exe" - Call un.RenameDelete - Push "$INSTDIR\maintenanceservice_tmp.exe" - Call un.RenameDelete - Push "$INSTDIR\maintenanceservice.old" - Call un.RenameDelete - Push "$INSTDIR\Uninstall.exe" - Call un.RenameDelete - Push "$INSTDIR\update\updater.ini" - Call un.RenameDelete - Push "$INSTDIR\update\updater.exe" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-1.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-2.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-3.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-4.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-5.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-6.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-7.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-8.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-9.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-10.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-install.log" - Call un.RenameDelete - Push "$INSTDIR\logs\maintenanceservice-uninstall.log" - Call un.RenameDelete - SetShellVarContext all - Push "$APPDATA\Mozilla\logs\maintenanceservice.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-1.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-2.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-3.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-4.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-5.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-6.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-7.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-8.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-9.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-10.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-install.log" - Call un.RenameDelete - Push "$APPDATA\Mozilla\logs\maintenanceservice-uninstall.log" - Call un.RenameDelete - RMDir /REBOOTOK "$APPDATA\Mozilla\logs" - RMDir /REBOOTOK "$APPDATA\Mozilla" - RMDir /REBOOTOK "$INSTDIR\logs" - RMDir /REBOOTOK "$INSTDIR\update" - RMDir /REBOOTOK "$INSTDIR" - - DeleteRegKey HKLM "${MaintUninstallKey}" - - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "Installed" - DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled" - DeleteRegKey HKLM "${FallbackKey}\" - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} -SectionEnd diff --git a/application/palemoon/installer/windows/nsis/shared.nsh b/application/palemoon/installer/windows/nsis/shared.nsh index 294e3e6fc..385a411a3 100644 --- a/application/palemoon/installer/windows/nsis/shared.nsh +++ b/application/palemoon/installer/windows/nsis/shared.nsh @@ -124,51 +124,6 @@ ${FixDistributionsINI} RmDir /r /REBOOTOK "$INSTDIR\${TO_BE_DELETED}" - -!ifdef MOZ_MAINTENANCE_SERVICE - Call IsUserAdmin - Pop $R0 - ${If} $R0 == "true" - ; Only proceed if we have HKLM write access - ${AndIf} $TmpVal == "HKLM" - ; On Windows 2000 we do not install the maintenance service. - ${AndIf} ${AtLeastWinXP} - ; We check to see if the maintenance service install was already attempted. - ; Since the Maintenance service can be installed either x86 or x64, - ; always use the 64-bit registry for checking if an attempt was made. - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - ReadRegDWORD $5 HKLM "Software\Mozilla\MaintenanceService" "Attempted" - ClearErrors - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} - - ; Add the registry keys for allowed certificates. - ${AddMaintCertKeys} - - ; If the maintenance service is already installed, do nothing. - ; The maintenance service will launch: - ; maintenanceservice_installer.exe /Upgrade to upgrade the maintenance - ; service if necessary. If the update was done from updater.exe without - ; the service (i.e. service is failing), updater.exe will do the update of - ; the service. The reasons we do not do it here is because we don't want - ; to have to prompt for limited user accounts when the service isn't used - ; and we currently call the PostUpdate twice, once for the user and once - ; for the SYSTEM account. Also, this would stop the maintenance service - ; and we need a return result back to the service when run that way. - ${If} $5 == "" - ; An install of maintenance service was never attempted. - ; We know we are an Admin and that we have write access into HKLM - ; based on the above checks, so attempt to just run the EXE. - ; In the worst case, in case there is some edge case with the - ; IsAdmin check and the permissions check, the maintenance service - ; will just fail to be attempted to be installed. - nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\"" - ${EndIf} - ${EndIf} -!endif !macroend !define PostUpdate "!insertmacro PostUpdate" @@ -367,11 +322,9 @@ WriteRegStr SHCTX "$0\.xhtml" "" "PaleMoonHTML" ${EndIf} - ${AddAssociationIfNoneExist} ".pdf" ${AddAssociationIfNoneExist} ".oga" ${AddAssociationIfNoneExist} ".ogg" ${AddAssociationIfNoneExist} ".ogv" - ${AddAssociationIfNoneExist} ".pdf" ${AddAssociationIfNoneExist} ".webm" ; An empty string is used for the 5th param because PaleMoonHTML is not a @@ -718,54 +671,6 @@ !macroend !define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers" -!ifdef MOZ_MAINTENANCE_SERVICE -; Adds maintenance service certificate keys for the install dir. -; For the cert to work, it must also be signed by a trusted cert for the user. -!macro AddMaintCertKeys - Push $R0 - ; Allow main Mozilla cert information for updates - ; This call will push the needed key on the stack - ServicesHelper::PathToUniqueRegistryPath "$INSTDIR" - Pop $R0 - ${If} $R0 != "" - ; More than one certificate can be specified in a different subfolder - ; for example: $R0\1, but each individual binary can be signed - ; with at most one certificate. A fallback certificate can only be used - ; if the binary is replaced with a different certificate. - ; We always use the 64bit registry for certs. - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - - ; PrefetchProcessName was originally used to experiment with deleting - ; Windows prefetch as a speed optimization. It is no longer used though. - DeleteRegValue HKLM "$R0" "prefetchProcessName" - - ; Setting the Attempted value will ensure that a new Maintenance Service - ; install will never be attempted again after this from updates. The value - ; is used only to see if updates should attempt new service installs. - WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1 - - ; These values associate the allowed certificates for the current - ; installation. - WriteRegStr HKLM "$R0\0" "name" "${CERTIFICATE_NAME}" - WriteRegStr HKLM "$R0\0" "issuer" "${CERTIFICATE_ISSUER}" - ; These values associate the allowed certificates for the previous - ; installation, so that we can update from it cleanly using the - ; old updater.exe (which will still have this signature). - WriteRegStr HKLM "$R0\1" "name" "${CERTIFICATE_NAME_PREVIOUS}" - WriteRegStr HKLM "$R0\1" "issuer" "${CERTIFICATE_ISSUER_PREVIOUS}" - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} - ClearErrors - ${EndIf} - ; Restore the previously used value back - Pop $R0 -!macroend -!define AddMaintCertKeys "!insertmacro AddMaintCertKeys" -!endif - ; Removes various registry entries for reasons noted below (does not use SHCTX). !macro RemoveDeprecatedKeys StrCpy $0 "SOFTWARE\Classes" @@ -935,24 +840,17 @@ ClearErrors WriteIniStr "$0" "TASKBAR" "Migrated" "true" ${If} ${AtLeastWin7} - ; If we didn't run the stub installer, AddTaskbarSC will be empty. - ; We determine whether to pin based on whether we're the default - ; browser, or if we're on win8 or later, we always pin. - ${If} $AddTaskbarSC == "" - ; No need to check the default on Win8 and later - ${If} ${AtMostWin2008R2} - ; Check if the PaleMoon is the http handler for this user - SetShellVarContext current ; Set SHCTX to the current user - ${IsHandlerForInstallDir} "http" $R9 - ${If} $TmpVal == "HKLM" - SetShellVarContext all ; Set SHCTX to all users - ${EndIf} - ${EndIf} - ${If} "$R9" == "true" - ${OrIf} ${AtLeastWin8} - ${PinToTaskBar} + ; No need to check the default on Win8 and later + ${If} ${AtMostWin2008R2} + ; Check if the Pale Moon is the http handler for this user + SetShellVarContext current ; Set SHCTX to the current user + ${IsHandlerForInstallDir} "http" $R9 + ${If} $TmpVal == "HKLM" + SetShellVarContext all ; Set SHCTX to all users ${EndIf} - ${ElseIf} $AddTaskbarSC == "1" + ${EndIf} + ${If} "$R9" == "true" + ${OrIf} ${AtLeastWin8} ${PinToTaskBar} ${EndIf} ${EndIf} diff --git a/application/palemoon/installer/windows/nsis/uninstaller.nsi b/application/palemoon/installer/windows/nsis/uninstaller.nsi index 333fd33d6..44b7c060b 100644 --- a/application/palemoon/installer/windows/nsis/uninstaller.nsi +++ b/application/palemoon/installer/windows/nsis/uninstaller.nsi @@ -76,7 +76,6 @@ VIAddVersionKey "OriginalFilename" "helper.exe" !insertmacro InitHashAppModelId !insertmacro IsHandlerForInstallDir !insertmacro IsPinnedToTaskBar -!insertmacro IsUserAdmin !insertmacro LogDesktopShortcut !insertmacro LogQuickLaunchShortcut !insertmacro LogStartMenuShortcut @@ -168,56 +167,6 @@ UninstPage custom un.preConfirm ChangeUI IDD_VERIFY "${NSISDIR}\Contrib\UIs\default.exe" ################################################################################ -# Helper Functions - -; This function is used to uninstall the maintenance service if the -; application currently being uninstalled is the last application to use the -; maintenance service. -Function un.UninstallServiceIfNotUsed - ; $0 will store if a subkey exists - ; $1 will store the first subkey if it exists or an empty string if it doesn't - ; Backup the old values - Push $0 - Push $1 - - ; The maintenance service always uses the 64-bit registry on x64 systems - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - - ; Figure out the number of subkeys - StrCpy $0 0 - ${Do} - EnumRegKey $1 HKLM "Software\Mozilla\MaintenanceService" $0 - ${If} "$1" == "" - ${ExitDo} - ${EndIf} - IntOp $0 $0 + 1 - ${Loop} - - ; Restore back the registry view - ${If} ${RunningX64} - SetRegView lastUsed - ${EndIf} - ${If} $0 == 0 - ; Get the path of the maintenance service uninstaller - ReadRegStr $1 HKLM ${MaintUninstallKey} "UninstallString" - - ; If the uninstall string does not exist, skip executing it - StrCmp $1 "" doneUninstall - - ; $1 is already a quoted string pointing to the install path - ; so we're already protected against paths with spaces - nsExec::Exec "$1 /S" -doneUninstall: - ${EndIf} - - ; Restore the old value of $1 and $0 - Pop $1 - Pop $0 -FunctionEnd - -################################################################################ # Install Sections ; Empty section required for the installer to compile as an uninstaller Section "" @@ -297,7 +246,6 @@ Section "Uninstall" ${un.RegCleanFileHandler} ".oga" "PaleMoonHTML" ${un.RegCleanFileHandler} ".ogg" "PaleMoonHTML" ${un.RegCleanFileHandler} ".ogv" "PaleMoonHTML" - ${un.RegCleanFileHandler} ".pdf" "PaleMoonHTML" ${un.RegCleanFileHandler} ".webm" "PaleMoonHTML" ${EndIf} @@ -450,24 +398,6 @@ Section "Uninstall" ; uninstalls of PaleMoon-release with reinstalls of PaleMoon-release, for example. WriteRegStr HKCU "Software\Mozilla\PaleMoon" "Uninstalled-${UpdateChannel}" "True" -!ifdef MOZ_MAINTENANCE_SERVICE - ; Get the path the allowed cert is at and remove it - ; Keep this block of code last since it modfies the reg view - ServicesHelper::PathToUniqueRegistryPath "$INSTDIR" - Pop $MaintCertKey - ${If} $MaintCertKey != "" - ; Always use the 64bit registry for certs on 64bit systems. - ${If} ${RunningX64} - SetRegView 64 - ${EndIf} - DeleteRegKey HKLM "$MaintCertKey" - ${If} ${RunningX64} - SetRegView lastused - ${EndIf} - ${EndIf} - Call un.UninstallServiceIfNotUsed -!endif - ${un.IsFirewallSvcRunning} Pop $0 ${If} "$0" == "true" diff --git a/application/palemoon/locales/Makefile.in b/application/palemoon/locales/Makefile.in index c81329a9a..897fa0bca 100644 --- a/application/palemoon/locales/Makefile.in +++ b/application/palemoon/locales/Makefile.in @@ -121,7 +121,9 @@ searchplugins: $(addprefix $(FINAL_TARGET)/searchplugins/,$(SEARCHPLUGINS)) libs-%: $(NSINSTALL) -D $(DIST)/install @$(MAKE) -C ../../../toolkit/locales libs-$* +ifdef MOZ_SERVICES_SYNC @$(MAKE) -C ../../../services/sync/locales AB_CD=$* XPI_NAME=locale-$* +endif @$(MAKE) -C ../../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$* @$(MAKE) -C ../../../intl/locales AB_CD=$* XPI_NAME=locale-$* ifdef MOZ_DEVTOOLS @@ -196,10 +198,10 @@ endif ident: @printf "fx_revision " @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \ - $(STAGEDIST)/application.ini App SourceStamp + '$(STAGEDIST)'/application.ini App SourceStamp @printf "buildid " @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \ - $(STAGEDIST)/application.ini App BuildID + '$(STAGEDIST)'/application.ini App BuildID merge-%: ifdef LOCALE_MERGEDIR diff --git a/application/palemoon/locales/en-US/chrome/browser-region/region.properties b/application/palemoon/locales/en-US/chrome/browser-region/region.properties index ad6c1342f..8782ae46f 100644 --- a/application/palemoon/locales/en-US/chrome/browser-region/region.properties +++ b/application/palemoon/locales/en-US/chrome/browser-region/region.properties @@ -14,29 +14,25 @@ browser.search.order.4=Ecosia # This is the default set of web based feed handlers shown in the reader # selection UI browser.contentHandlers.types.0.title=My Yahoo! -browser.contentHandlers.types.0.uri=http://add.my.yahoo.com/rss?url=%s +browser.contentHandlers.types.0.uri=https://add.my.yahoo.com/rss?url=%s # increment this number when anything gets changed in the list below. This will # cause Firefox to re-read these prefs and inject any new handlers into the # profile database. Note that "new" is defined as "has a different URL"; this # means that it's not possible to update the name of existing handler, so # don't make any spelling errors here. -goanna.handlerService.defaultHandlersVersion=3 - -# The default set of protocol handlers for webcal: -goanna.handlerService.schemes.webcal.0.name=30 Boxes -goanna.handlerService.schemes.webcal.0.uriTemplate=http://30boxes.com/external/widget?refer=ff&url=%s +gecko.handlerService.defaultHandlersVersion=5 # The default set of protocol handlers for mailto: -goanna.handlerService.schemes.mailto.0.name=Yahoo! Mail -goanna.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s -goanna.handlerService.schemes.mailto.1.name=Gmail -goanna.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s +gecko.handlerService.schemes.mailto.0.name=Yahoo! Mail +gecko.handlerService.schemes.mailto.0.uriTemplate=https://compose.mail.yahoo.com/?To=%s +gecko.handlerService.schemes.mailto.1.name=Gmail +gecko.handlerService.schemes.mailto.1.uriTemplate=https://mail.google.com/mail/?extsrc=mailto&url=%s # The default set of protocol handlers for irc: -goanna.handlerService.schemes.irc.0.name=Mibbit -goanna.handlerService.schemes.irc.0.uriTemplate=https://www.mibbit.com/?url=%s +gecko.handlerService.schemes.irc.0.name=Mibbit +gecko.handlerService.schemes.irc.0.uriTemplate=https://www.mibbit.com/?url=%s # The default set of protocol handlers for ircs: -goanna.handlerService.schemes.ircs.0.name=Mibbit -goanna.handlerService.schemes.ircs.0.uriTemplate=https://www.mibbit.com/?url=%s +gecko.handlerService.schemes.ircs.0.name=Mibbit +gecko.handlerService.schemes.ircs.0.uriTemplate=https://www.mibbit.com/?url=%s diff --git a/application/palemoon/locales/en-US/chrome/browser/aboutHome.dtd b/application/palemoon/locales/en-US/chrome/browser/aboutHome.dtd index 03ffe629d..d3bd85fc8 100644 --- a/application/palemoon/locales/en-US/chrome/browser/aboutHome.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/aboutHome.dtd @@ -4,8 +4,10 @@ <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> %brandDTD; +#ifdef MOZ_SERVICES_SYNC <!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd"> %syncBrandDTD; +#endif <!-- These strings are used in the about:home page --> @@ -19,4 +21,6 @@ <!ENTITY abouthome.addonsButton.label "Add-ons"> <!ENTITY abouthome.appsButton.label "Marketplace"> <!ENTITY abouthome.downloadsButton.label "Downloads"> +#ifdef MOZ_SERVICES_SYNC <!ENTITY abouthome.syncButton.label "&syncBrand.shortName.label;"> +#endif
\ No newline at end of file diff --git a/application/palemoon/locales/en-US/chrome/browser/aboutRobots.dtd b/application/palemoon/locales/en-US/chrome/browser/aboutRobots.dtd deleted file mode 100644 index 139603d8d..000000000 --- a/application/palemoon/locales/en-US/chrome/browser/aboutRobots.dtd +++ /dev/null @@ -1,29 +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/. --> - -<!-- These strings are used in the about:robots page, which ties in with the - robots theme used in the Firefox 3 Beta 2/3 first run pages. - They're just meant to be fun and whimsical, with references to some geeky - but well-known robots in movies and books. Be creative with translations! --> - -<!-- Nonsense line from the movie "The Day The Earth Stood Still". No translation needed. --> -<!ENTITY robots.pagetitle "Gort! Klaatu barada nikto!"> -<!-- Movie: Logan's Run... Box (cybog): "Welcome Humans! I am ready for you." --> -<!ENTITY robots.errorTitleText "Welcome Humans!"> -<!-- Movie: The Day The Earth Stood Still. Spoken by Klaatu. --> -<!ENTITY robots.errorShortDescText "We have come to visit you in peace and with goodwill!"> -<!-- Various books by Isaac Asimov. http://en.wikipedia.org/wiki/Three_Laws_of_Robotics --> -<!ENTITY robots.errorLongDesc1 "Robots may not injure a human being or, through inaction, allow a human being to come to harm."> -<!-- Movie: Blade Runner. Batty: "I've seen things you people wouldn't believe..." --> -<!ENTITY robots.errorLongDesc2 "Robots have seen things you people wouldn't believe."> -<!-- Book: Hitchhiker's Guide To The Galaxy. What the Sirius Cybernetics Corporation calls robots. --> -<!ENTITY robots.errorLongDesc3 "Robots are Your Plastic Pal Who's Fun To Be With."> -<!-- TV: Futurama. Bender's first line is "Bite my shiny metal ass." --> -<!ENTITY robots.errorLongDesc4 "Robots have shiny metal posteriors which should not be bitten."> -<!-- TV: Battlestar Galactica (2004 series). From the opening text. --> -<!ENTITY robots.errorTrailerDescText "And they have a plan."> -<!-- TV: Battlestar Galactica (2004 series). Common expletive referring to Cylons. --> -<!ENTITY robots.imgtitle "Frakkin' Toasters"> -<!-- Book: Hitchhiker's Guide To The Galaxy. Arthur presses a button and it warns him. --> -<!ENTITY robots.dontpress "Please do not press this button again."> diff --git a/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd b/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd index a926b0ed2..dd88a3384 100644 --- a/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd @@ -14,6 +14,9 @@ for the help button in the menubar but Gnome does not. --> <!ENTITY helpMenuWin.label "Help"> <!ENTITY helpMenuWin.accesskey "H"> +<!ENTITY updateCmd.label "Check for Updates…"> +<!ENTITY helpReleaseNotes.label "Release Notes"> +<!ENTITY helpReleaseNotes.accesskey "N"> <!ENTITY aboutProduct.label "About &brandShortName;"> <!ENTITY aboutProduct.accesskey "A"> <!ENTITY productHelp.label "&brandShortName; Help"> diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.dtd b/application/palemoon/locales/en-US/chrome/browser/browser.dtd index 2d80c8078..c810b074e 100644 --- a/application/palemoon/locales/en-US/chrome/browser/browser.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/browser.dtd @@ -417,8 +417,8 @@ items are mutually exclusive. --> <!ENTITY mediaMute.accesskey "M"> <!ENTITY mediaUnmute.label "Unmute"> <!ENTITY mediaUnmute.accesskey "m"> -<!ENTITY mediaPlaybackRate.label "Play Speed"> -<!ENTITY mediaPlaybackRate.accesskey "l"> +<!ENTITY mediaPlaybackRate2.label "Play Speed"> +<!ENTITY mediaPlaybackRate2.accesskey "d"> <!ENTITY mediaPlaybackRate050x.label "Slow Motion (0.5×)"> <!ENTITY mediaPlaybackRate050x.accesskey "S"> <!ENTITY mediaPlaybackRate100x.label "Normal Speed"> @@ -430,6 +430,8 @@ movie "Space Balls" and is meant to say that this speed is very fast. --> <!ENTITY mediaPlaybackRate200x.label "Ludicrous Speed (2×)"> <!ENTITY mediaPlaybackRate200x.accesskey "L"> +<!ENTITY mediaLoop.label "Loop"> +<!ENTITY mediaLoop.accesskey "L"> <!-- LOCALIZATION NOTE: The access keys for "Show Controls" and "Hide Controls" are the same because the two context-menu items are mutually exclusive. --> @@ -507,6 +509,8 @@ you can use these alternative items. Otherwise, their values should be empty. - <!ENTITY closeCmd.key "W"> <!ENTITY closeCmd.accesskey "C"> +<!ENTITY toggleMuteCmd.key "M"> + <!ENTITY pageStyleMenu.label "Page Style"> <!ENTITY pageStyleMenu.accesskey "y"> <!ENTITY pageStyleNoStyle.label "No Style"> @@ -565,6 +569,7 @@ just addresses the organization to follow, e.g. "This site is run by " --> The word "toolbar" is appended automatically and should not be contained below! --> <!ENTITY tabsToolbar.label "Browser tabs"> +#ifdef MOZ_SERVICES_SYNC <!-- LOCALIZATION NOTE (syncTabsMenu2.label): This appears in the history menu --> <!ENTITY syncTabsMenu2.label "Tabs From Other Devices"> @@ -575,6 +580,7 @@ just addresses the organization to follow, e.g. "This site is run by " --> <!ENTITY syncSyncNowItem.label "Sync Now"> <!ENTITY syncSyncNowItem.accesskey "S"> <!ENTITY syncToolbarButton.label "Sync"> +#endif <!ENTITY addonBarCloseButton.tooltip "Close Add-on Bar"> <!ENTITY toggleAddonBarCmd.key "/"> diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.properties b/application/palemoon/locales/en-US/chrome/browser/browser.properties index 9969bd753..4c45e2513 100644 --- a/application/palemoon/locales/en-US/chrome/browser/browser.properties +++ b/application/palemoon/locales/en-US/chrome/browser/browser.properties @@ -201,6 +201,22 @@ update.openUpdateUI.upgradeButton.accesskey=U update.restart.upgradeButton.label=Upgrade Now update.restart.upgradeButton.accesskey=U +# Check for Updates in the Help Menu +# LOCALIZATION NOTE (updatesItem_*): these are alternative labels for Check for Update item in Help menu. +# Which one is used depends on Update process state. +updatesItem_default=Check for Updates… +updatesItem_defaultFallback=Check for Updates… +updatesItem_default.accesskey=C +updatesItem_downloading=Downloading %S… +updatesItem_downloadingFallback=Downloading Update… +updatesItem_downloading.accesskey=D +updatesItem_resume=Resume Downloading %S… +updatesItem_resumeFallback=Resume Downloading Update… +updatesItem_resume.accesskey=D +updatesItem_pending=Apply Downloaded Update Now… +updatesItem_pendingFallback=Apply Downloaded Update Now… +updatesItem_pending.accesskey=D + # RSS Pretty Print feedShowFeedNew=Subscribe to '%S'… @@ -397,3 +413,8 @@ slowStartup.helpButton.label = Learn How to Speed It Up slowStartup.helpButton.accesskey = L slowStartup.disableNotificationButton.label = Don't Tell Me Again slowStartup.disableNotificationButton.accesskey = A + +muteTab.label = Mute Tab +muteTab.accesskey = M +unmuteTab.label = Unmute Tab +unmuteTab.accesskey = M
\ No newline at end of file diff --git a/application/palemoon/locales/en-US/chrome/browser/downloads/downloads.properties b/application/palemoon/locales/en-US/chrome/browser/downloads/downloads.properties index 2a5b77633..44d9ec90e 100644 --- a/application/palemoon/locales/en-US/chrome/browser/downloads/downloads.properties +++ b/application/palemoon/locales/en-US/chrome/browser/downloads/downloads.properties @@ -67,6 +67,9 @@ shortTimeLeftDays=%1$Sd statusSeparator=%1$S \u2014 %2$S statusSeparatorBeforeNumber=%1$S \u2014 %2$S +fileExecutableSecurityWarning="%S" is an executable file. Executable files may contain viruses or other malicious code that could harm your computer. Use caution when opening this file. Are you sure you want to launch "%S"? +fileExecutableSecurityWarningTitle=Open Executable File? + # LOCALIZATION NOTE (otherDownloads2): # This is displayed in an item at the bottom of the Downloads Panel when # there are more downloads than can fit in the list in the panel. Use a diff --git a/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd b/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd index 038d8eb75..4b4fac9ff 100644 --- a/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd @@ -2,13 +2,14 @@ - 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.title.66.1 +'The Chronicles of the Pale Moon, 66:1'> -<!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.quote.66.1 +'The <em>landscape changed</em> as time went on: flowing, twisting, corrupting. The dull sheen of <em>tainted metal</em> shining through everywhere.<br/> +In the trees, roots, animals, and even the <em>mountainous valleys</em> that had always been an <em>oasis of difference</em>.<br/> +Still, our dragon continued, untainted and resolute, soaring above.<br/> +There would be a home yet, <em>a sanctuary</em>, a place for all those not given in to this <em>singular</em> invading force that was <em>misshaping</em> the world.'> -<!ENTITY chronicles.from.55.2 -'from <strong>The Chronicles of the Pale Moon,</strong> 55:2'> +<!ENTITY chronicles.from.66.1 +'from <strong>The Chronicles of the Pale Moon,</strong> 66:1'> diff --git a/application/palemoon/locales/en-US/chrome/browser/permissions/aboutPermissions.dtd b/application/palemoon/locales/en-US/chrome/browser/permissions/aboutPermissions.dtd index 2030d4f59..5b220a7f0 100644 --- a/application/palemoon/locales/en-US/chrome/browser/permissions/aboutPermissions.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/permissions/aboutPermissions.dtd @@ -32,7 +32,7 @@ <!ENTITY image.label "Load Images"> -<!ENTITY cookie.label "Set Cookies"> +<!ENTITY cookie.label "Store Cookies and Site Data"> <!ENTITY cookie.remove "Remove Cookies"> <!ENTITY cookie.manage "Manage Cookies…"> <!ENTITY cookie.removeAll "Remove All Cookies"> diff --git a/application/palemoon/locales/en-US/chrome/browser/preferences/advanced.dtd b/application/palemoon/locales/en-US/chrome/browser/preferences/advanced.dtd index 6ef29c680..bb8dd12d2 100644 --- a/application/palemoon/locales/en-US/chrome/browser/preferences/advanced.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/preferences/advanced.dtd @@ -33,6 +33,15 @@ <!ENTITY setDefault.accesskey "d"> <!ENTITY isDefault.label "&brandShortName; is currently your default browser"> +<!ENTITY UACompatGroup.label "Compatibility"> +<!ENTITY UACompat.label "User Agent Mode:"> +<!ENTITY UACompat.Native "Native"> +<!ENTITY UACompat.Gecko "Gecko Compatibility"> +<!ENTITY UACompat.Firefox "Firefox Compatibility"> + +<!ENTITY captivePortalGroup.label "Captive portals"> +<!ENTITY captivePortalDetect.label "Detect restricted network access"> + <!ENTITY dataChoicesTab.label "Data Choices"> <!ENTITY crashReporterSection.label "Crash Reporter"> @@ -126,12 +135,6 @@ <!ENTITY viewSecurityDevices.label "Security Devices"> <!ENTITY viewSecurityDevices.accesskey "y"> -<!ENTITY UACompatGroup.label "Compatibility"> -<!ENTITY UACompat.label "User Agent Mode:"> -<!ENTITY UACompat.Native "Native"> -<!ENTITY UACompat.Gecko "Gecko Compatibility"> -<!ENTITY UACompat.Firefox "Firefox Compatibility"> - <!ENTITY scrollparamTab.label "Scrolling"> <!ENTITY smoothscroll.explain.label "The parameters below only have an effect if smooth scrolling is enabled overall with the checkbox above."> <!ENTITY smoothscroll.to "to"> @@ -144,3 +147,5 @@ <!ENTITY smoothscroll.pagekeys.duration "Page up/down scroll duration:"> <!ENTITY smoothscroll.scrollbar.label "Smooth scroll with scrollbars"> <!ENTITY smoothscroll.scrollbar.duration "Scrollbar smooth scroll duration:"> + +<!ENTITY smoothscroll.overall.yspeed.label "Overall smooth scroll speed:"> diff --git a/application/palemoon/locales/en-US/chrome/browser/preferences/preferences.properties b/application/palemoon/locales/en-US/chrome/browser/preferences/preferences.properties index b262eebf5..34f167586 100644 --- a/application/palemoon/locales/en-US/chrome/browser/preferences/preferences.properties +++ b/application/palemoon/locales/en-US/chrome/browser/preferences/preferences.properties @@ -8,8 +8,8 @@ labelDefaultFont=Default (%S) #### Permissions Manager -cookiepermissionstext=You can specify which websites are always or never allowed to use cookies. Type the exact address of the site you want to manage and then click Block, Allow for Session, or Allow. -cookiepermissionstitle=Exceptions - Cookies +cookiepermissionstext=You can specify which websites are always or never allowed to use cookies or store site data. Type the exact address of the site you want to manage and then click Block, Allow for Session, or Allow. +cookiepermissionstitle=Exceptions - Cookies and Site Data addonspermissionstext=You can specify which websites are allowed to install add-ons. Type the exact address of the site you want to allow and then click Allow. addons_permissions_title=Allowed Sites - Add-ons Installation popuppermissionstext=You can specify which websites are allowed to open pop-up windows. Type the exact address of the site you want to allow and then click Allow. 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 ef3303b94..37f8b78c0 100644 --- a/application/palemoon/locales/en-US/chrome/browser/preferences/privacy.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/preferences/privacy.dtd @@ -20,10 +20,10 @@ <!ENTITY locbar.openpage.label "Open tabs"> <!ENTITY locbar.openpage.accesskey "O"> -<!ENTITY acceptCookies.label "Accept cookies from sites"> +<!ENTITY acceptCookies.label "Allow sites to store cookies and data"> <!ENTITY acceptCookies.accesskey "A"> -<!ENTITY acceptThirdParty.pre.label "Accept third-party cookies:"> +<!ENTITY acceptThirdParty.pre.label "Accept third-party cookies and site data:"> <!ENTITY acceptThirdParty.pre.accesskey "c"> <!ENTITY acceptThirdParty.always.label "Always"> <!ENTITY acceptThirdParty.never.label "Never"> @@ -48,7 +48,7 @@ <!ENTITY historyHeader.custom.label "Use custom settings for history"> <!ENTITY historyHeader.post.label ""> -<!ENTITY rememberDescription.label "&brandShortName; will remember your browsing, download, form and search history, and keep cookies from websites you visit."> +<!ENTITY rememberDescription.label "&brandShortName; will remember your browsing, download, form and search history, and keep cookies and site data from websites you visit."> <!-- LOCALIZATION NOTE (rememberActions.pre.label): include a trailing space as needed --> <!-- LOCALIZATION NOTE (rememberActions.middle.label): include a starting and trailing space as needed --> diff --git a/application/palemoon/locales/en-US/chrome/browser/preferences/security.dtd b/application/palemoon/locales/en-US/chrome/browser/preferences/security.dtd index 2bd3b3aec..930736d56 100644 --- a/application/palemoon/locales/en-US/chrome/browser/preferences/security.dtd +++ b/application/palemoon/locales/en-US/chrome/browser/preferences/security.dtd @@ -40,6 +40,10 @@ <!ENTITY enableHPKP.label "Enable Certificate Key Pinning (HPKP)"> <!ENTITY enableHPKP.accesskey "C"> +<!ENTITY OpEnc.label "Opportunistic Encryption (OE)"> +<!ENTITY enableUIROpEnc.label "Enable Upgrade Insecure Requests"> +<!ENTITY enableAltSvcOpEnc.label "Enable HTTP Alternative Services for OE"> + <!ENTITY XSSFilt.label "XSS Filter"> <!ENTITY enableXSSFilt.label "Enable XSS filter"> <!ENTITY enableXSSFilt.accesskey "f"> diff --git a/application/palemoon/locales/en-US/chrome/browser/tabbrowser.properties b/application/palemoon/locales/en-US/chrome/browser/tabbrowser.properties index 0d21d4d14..a4a0be0a0 100644 --- a/application/palemoon/locales/en-US/chrome/browser/tabbrowser.properties +++ b/application/palemoon/locales/en-US/chrome/browser/tabbrowser.properties @@ -24,3 +24,7 @@ tabs.closeWarningTitle=Confirm close tabs.closeWarningMultipleTabs=You are about to close %S tabs. Are you sure you want to continue? tabs.closeButtonMultiple=Close tabs tabs.closeWarningPromptMe=Warn me when I attempt to close multiple tabs + +tabs.muteAudio.tooltip=Mute tab +tabs.unmuteAudio.tooltip=Unmute tab +tabs.unblockAudio.tooltip=Play tab diff --git a/application/palemoon/locales/en-US/installer/custom.properties b/application/palemoon/locales/en-US/installer/custom.properties index ef29b1e7e..8f95a194b 100644 --- a/application/palemoon/locales/en-US/installer/custom.properties +++ b/application/palemoon/locales/en-US/installer/custom.properties @@ -46,7 +46,9 @@ WARN_MANUALLY_CLOSE_APP_UNINSTALL=$BrandShortName must be closed to proceed with WARN_MANUALLY_CLOSE_APP_LAUNCH=$BrandShortName is already running.\n\nPlease close $BrandShortName prior to launching the version you have just installed. WARN_WRITE_ACCESS=You don't have access to write to the installation directory.\n\nClick OK to select a different directory. WARN_DISK_SPACE=You don't have sufficient disk space to install to this location.\n\nClick OK to select a different location. -WARN_MIN_SUPPORTED_OS_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer. +WARN_MIN_SUPPORTED_OSVER_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer. +WARN_MIN_SUPPORTED_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires a processor with ${MinSupportedCPU} support. +WARN_MIN_SUPPORTED_OSVER_CPU_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer and a processor with ${MinSupportedCPU} support. WARN_RESTART_REQUIRED_UNINSTALL=Your computer must be restarted to complete a previous uninstall of $BrandShortName. Do you want to reboot now? WARN_RESTART_REQUIRED_UPGRADE=Your computer must be restarted to complete a previous upgrade of $BrandShortName. Do you want to reboot now? ERROR_CREATE_DIRECTORY_PREFIX=Error creating directory: diff --git a/application/palemoon/locales/en-US/installer/nsisstrings.properties b/application/palemoon/locales/en-US/installer/nsisstrings.properties deleted file mode 100644 index 0144c2a98..000000000 --- a/application/palemoon/locales/en-US/installer/nsisstrings.properties +++ /dev/null @@ -1,64 +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/. - -# LOCALIZATION NOTE: - -# This file must be saved as UTF8 - -# Accesskeys are defined by prefixing the letter that is to be used for the -# accesskey with an ampersand (e.g. &). - -# Do not replace $BrandShortName, $BrandFullName, or $BrandFullNameDA with a -# custom string and always use the same one as used by the en-US files. -# $BrandFullNameDA allows the string to contain an ampersand (e.g. DA stands -# for double ampersand) and prevents the letter following the ampersand from -# being used as an accesskey. - -# You can use \n to create a newline in the string but only when the string -# from en-US contains a \n. - -WIN_CAPTION=$BrandShortName Setup - -INTRO_BLURB1=Thanks for choosing $BrandFullName, the browser that chooses you above everything else. -INSTALL_BLURB1=You're about to enjoy the very latest in speed, flexibility and security so you're always in control. -INSTALL_BLURB2=That's because $BrandShortName is made by a non-profit to make browsing and the Web better for you. -INSTALL_BLURB3=You're also joining a global community of users, contributors and developers working to make the best browser in the world. - -WARN_MIN_SUPPORTED_OS_MSG=Sorry, $BrandShortName can't be installed. This version of $BrandShortName requires ${MinSupportedVer} or newer. -WARN_WRITE_ACCESS=You don't have access to write to the installation directory.\n\nClick OK to select a different directory. -WARN_DISK_SPACE=You don't have sufficient disk space to install to this location.\n\nClick OK to select a different location. -WARN_ROOT_INSTALL=Unable to install to the root of your disk.\n\nClick OK to select a different location. -WARN_MANUALLY_CLOSE_APP_LAUNCH=$BrandShortName is already running.\n\nPlease close $BrandShortName prior to launching the version you have just installed. - -ERROR_DOWNLOAD=Your download was interrupted.\n\nPlease click the OK button to continue. - -INSTALL_BUTTON=&Install -UPGRADE_BUTTON=&Upgrade -CANCEL_BUTTON=Cancel -OPTIONS_BUTTON=&Options - -MAKE_DEFAULT=&Make $BrandShortName my default browser -CREATE_SHORTCUTS=Create Shortcuts for $BrandShortName: -ADD_SC_TASKBAR=On my &Task bar -ADD_SC_QUICKLAUNCHBAR=On my &Quick Launch bar -ADD_CheckboxShortcutInStartMenu=In my &Start Menu Programs Folder -ADD_CheckboxShortcutOnDesktop=On my &Desktop -SPACE_REQUIRED=Space Required: -SPACE_AVAILABLE=Space Available: -ONE_MOMENT=One moment, $BrandShortName will launch as soon as the install is complete… -SEND_PING=S&end information about this installation to Mozilla -BROWSE_BUTTON=B&rowse… -DEST_FOLDER=Destination Folder - -DOWNLOADING_IN_PROGRESS=Downloading… -DOWNLOADING_DONE=Downloaded -INSTALLING_TO_BE_DONE=Installing -INSTALLING_IN_PROGRESS=Installing… - -SELECT_FOLDER_TEXT=Select the folder to install $BrandShortName in. - -BYTE=B -KILO=K -MEGA=M -GIGA=G diff --git a/application/palemoon/locales/generic/profile/bookmarks.html.in b/application/palemoon/locales/generic/profile/bookmarks.html.in index 96270641a..90e3adfe9 100644 --- a/application/palemoon/locales/generic/profile/bookmarks.html.in +++ b/application/palemoon/locales/generic/profile/bookmarks.html.in @@ -11,9 +11,9 @@ <DT><H3 PERSONAL_TOOLBAR_FOLDER="true" ID="rdf:#$FvPhC3">@bookmarks_toolbarfolder@</H3> <DD>@bookmarks_toolbarfolder_description@ <DL><p> - <DT><A HREF="http://www.palemoon.org/" ICON_URI="http://www.palemoon.org/favicon.ico" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADe0lEQVQ4jW2T7VPTBQDHfwd/gpZW57bwuvJFIQ1lPgy9g7KzNCO4A9sDA8FNTCyg0KD9GBuCIrYhHYPw6Ygd2xB0rAFrEfxikA03YibyIO4pYGwONlhbx923F72I2/V5/f18X32/BBHDrox6ejKnlTxSaqRKlROuK5op1w3DHKUfdZC1d36hxeY3Qca9lVFH7uG2RFLPdKGo0YqOQTcouw/T7hBcy2E4l9YjuhGHmCDJuFg7bmd6mXrXMRleO9EEZp4axc2T6DH/CddyGN5ABMH1vxGObMC/GoVp3N1JEJtKXmadEdPY50FLJ/FGphIHzurx5Y1HMFiW8HB2BX84gvD4wghHNvBXdAMeXxi3fpj5+l+ZWUjbzsyL0NjFeDOjAcm823inxIjSVjuMD72g7D5YZ1fw2BmEbzWCQCgK29wK6rXTEYF0aAexPTmX3MbkY+fhYqQKlMgW/wiObAzFzZNo1s9D/2ARk/OrGPrdB5PVC5PVi7HHz3FaYUN29ZCYePFt/vDW3VwkfnARR4tuouAyBUGdGbw6C9r6HTDZlmF/tgoN5UFbnwPynjk06+chUz1B2vn7Q8RLyTzX1kQOEg59iiOF3+IkOQCejIJQboXi3lOMzwQw7Q5h5JEf6mEPbhudEF2fwNGKEbBOqZ0ELYXn2pLIwQvMPLB5cmSU68C7NIqSlilcveuCweLH+EwI1tkg9A8WofrZDW6tBccvDoN9Wu0k6Ck8alsSB6+kFCDpIylOlPUgR0JB+I0V4g43FL1+dFIhGH5bR1v/EiTfP4VIPoHMykGkCjXDBC1FUEXbywFjfz7Y2VJkXtAhp2oQIrkNEvUC6nV+NPaH0NgXQv19PyranTjbZEeOhMLBQhVJMFhCBmPvJ9GE/Twwj5fj/c+04NaMoKT1CRp6A7g+sAZFXxByQxBXdc8h1S6hst2BD8sHIkknv6MTBEEQ9H25klf3ccE8VobMLzQQXrNA0ulB08AamoxraOwPoaE3gNruZZAqN0QKGw6JtFWblpwVT2fxtQkH8pFeoAS/hsKFW7O4cs+Ha/oA6rq9qOlahLjDBaHchrRz3VqCyIqPuUNW/A5WfvXr71VE3z3XBX7tGMraplHZ/gxf3ZnH5y1T4MhGo6kiTfX/yP/BOEwyducopWlFXeYs8U8Lgsu/LvAvmc0fV5ikrFwVIzb/D6b/QY5z63dPAAAAAElFTkSuQmCC">Pale Moon</A> - <DT><A HREF="https://forum.palemoon.org/index.php" ICON_URI="https://forum.palemoon.org/favicon.ico" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADWUlEQVQ4jW1T60+Tdxj9Bf4CyXRR21Kixgheq1baAo2IaLkIpi0tpdQCBZHLNIIgQvGlpVkHOnnpFKrOTafUtjIuVYmXKBZREzLB4A0NbOVFghVtcEOqJid+YMlI50meb+ecPM/JeQgJQESymcNTNVHx+7vcJdYBps7+dNTS9tz9s2uQ0pQ7OIH8OaCCVqb+QG3ItPqj81tRYHmIltsMeh5PYoh5D8Y7Dc/EPzNnrzw5TCgqKFAdtCSuzL480YQlO34CL8uO4qZBtN0bB+OdxmvfDKamP2Ha/xmTU3503h25SMgck0XCosOsqO/AiqXAiinFvDAhlvK2ImpLEuIkKdgqSUG2bje8kz588H/G2JsPOGZ/qJ8VxxSwv12f7V8sLELEzqMIl1SAEPLV6fvjEd69/4iBYR/qnS9mlJXtbLKIn0ct4GkQJi5GtNYKhf464tP2ghACmUyOevokpHIlVoSHw+a6h5v9Xtx/9ha5dD+Sy69WkwXrte6Q1WqsSqyApOAMdHVuiNMNIIRAkZ6Byz1D6HvyCiftt9HUPgi6fRjNV/5ErW0I4sLWO2ThBg0TsjoDYTFFiM89gfTqa4hW1IAQAhabg81xCdiWmIraY7/A3j2KX294kG95BMmhu4jUOTyEzc9kQlap8M26LESpG7CzzIWYdNP/7lepNfi9+yVs3WNQm/uQfNANUd7FUcKJ3NUzf40KC/k6rE01YkdpOwSy2Q2ksjQYjpzG9/Q5NJ5qRXPnCGouDCOfHoC06hYEOS13CEeQW8PaqEKoIAsihRHS8k4IZfrZEBVq1DleorHLh8arPtR3TKLyvAeFxx9DaXCDrz1LkbDYktBQvsrPjczEuqQyJOx1IurfDGTKTNAdDBq7ptDQNYUjrneodU6g6rwHKRXXZyLk9Gy1Q0U6A3dTBnhJJZAecCClsBkrwlciZ3cx6M4xWK79jR8v+2Bue4Nq2xjy6QEIcltq5jRZHsyJ1F7iCrMRm2OFxtSNcsstmM704mjHa5jbvDBdmoC+hUFeQz/EBU4nIfLggHeQB7NFeYZl2yr9ccWt0JgfoPT0C1T99hcqzo1gn/UZ1KZev0hnM3xF/B+42ynumrQTRvEeR69Mf3Nca34wnmF09yYccBnXKpu4gfwvLIL1Qrog43cAAAAASUVORK5CYII=" LAST_CHARSET="UTF-8">Pale Moon forum</A> - <DT><A HREF="http://www.palemoon.org/faq.shtml" ICON_URI="http://www.palemoon.org/favicon.ico" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADe0lEQVQ4jW2T7VPTBQDHfwd/gpZW57bwuvJFIQ1lPgy9g7KzNCO4A9sDA8FNTCyg0KD9GBuCIrYhHYPw6Ygd2xB0rAFrEfxikA03YibyIO4pYGwONlhbx923F72I2/V5/f18X32/BBHDrox6ejKnlTxSaqRKlROuK5op1w3DHKUfdZC1d36hxeY3Qca9lVFH7uG2RFLPdKGo0YqOQTcouw/T7hBcy2E4l9YjuhGHmCDJuFg7bmd6mXrXMRleO9EEZp4axc2T6DH/CddyGN5ABMH1vxGObMC/GoVp3N1JEJtKXmadEdPY50FLJ/FGphIHzurx5Y1HMFiW8HB2BX84gvD4wghHNvBXdAMeXxi3fpj5+l+ZWUjbzsyL0NjFeDOjAcm823inxIjSVjuMD72g7D5YZ1fw2BmEbzWCQCgK29wK6rXTEYF0aAexPTmX3MbkY+fhYqQKlMgW/wiObAzFzZNo1s9D/2ARk/OrGPrdB5PVC5PVi7HHz3FaYUN29ZCYePFt/vDW3VwkfnARR4tuouAyBUGdGbw6C9r6HTDZlmF/tgoN5UFbnwPynjk06+chUz1B2vn7Q8RLyTzX1kQOEg59iiOF3+IkOQCejIJQboXi3lOMzwQw7Q5h5JEf6mEPbhudEF2fwNGKEbBOqZ0ELYXn2pLIwQvMPLB5cmSU68C7NIqSlilcveuCweLH+EwI1tkg9A8WofrZDW6tBccvDoN9Wu0k6Ck8alsSB6+kFCDpIylOlPUgR0JB+I0V4g43FL1+dFIhGH5bR1v/EiTfP4VIPoHMykGkCjXDBC1FUEXbywFjfz7Y2VJkXtAhp2oQIrkNEvUC6nV+NPaH0NgXQv19PyranTjbZEeOhMLBQhVJMFhCBmPvJ9GE/Twwj5fj/c+04NaMoKT1CRp6A7g+sAZFXxByQxBXdc8h1S6hst2BD8sHIkknv6MTBEEQ9H25klf3ccE8VobMLzQQXrNA0ulB08AamoxraOwPoaE3gNruZZAqN0QKGw6JtFWblpwVT2fxtQkH8pFeoAS/hsKFW7O4cs+Ha/oA6rq9qOlahLjDBaHchrRz3VqCyIqPuUNW/A5WfvXr71VE3z3XBX7tGMraplHZ/gxf3ZnH5y1T4MhGo6kiTfX/yP/BOEwyducopWlFXeYs8U8Lgsu/LvAvmc0fV5ikrFwVIzb/D6b/QY5z63dPAAAAAElFTkSuQmCC">F.A.Q.</A> - <DT><A HREF="http://www.palemoon.org/releasenotes.shtml" ICON_URI="http://www.palemoon.org/favicon.ico" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADe0lEQVQ4jW2T7VPTBQDHfwd/gpZW57bwuvJFIQ1lPgy9g7KzNCO4A9sDA8FNTCyg0KD9GBuCIrYhHYPw6Ygd2xB0rAFrEfxikA03YibyIO4pYGwONlhbx923F72I2/V5/f18X32/BBHDrox6ejKnlTxSaqRKlROuK5op1w3DHKUfdZC1d36hxeY3Qca9lVFH7uG2RFLPdKGo0YqOQTcouw/T7hBcy2E4l9YjuhGHmCDJuFg7bmd6mXrXMRleO9EEZp4axc2T6DH/CddyGN5ABMH1vxGObMC/GoVp3N1JEJtKXmadEdPY50FLJ/FGphIHzurx5Y1HMFiW8HB2BX84gvD4wghHNvBXdAMeXxi3fpj5+l+ZWUjbzsyL0NjFeDOjAcm823inxIjSVjuMD72g7D5YZ1fw2BmEbzWCQCgK29wK6rXTEYF0aAexPTmX3MbkY+fhYqQKlMgW/wiObAzFzZNo1s9D/2ARk/OrGPrdB5PVC5PVi7HHz3FaYUN29ZCYePFt/vDW3VwkfnARR4tuouAyBUGdGbw6C9r6HTDZlmF/tgoN5UFbnwPynjk06+chUz1B2vn7Q8RLyTzX1kQOEg59iiOF3+IkOQCejIJQboXi3lOMzwQw7Q5h5JEf6mEPbhudEF2fwNGKEbBOqZ0ELYXn2pLIwQvMPLB5cmSU68C7NIqSlilcveuCweLH+EwI1tkg9A8WofrZDW6tBccvDoN9Wu0k6Ck8alsSB6+kFCDpIylOlPUgR0JB+I0V4g43FL1+dFIhGH5bR1v/EiTfP4VIPoHMykGkCjXDBC1FUEXbywFjfz7Y2VJkXtAhp2oQIrkNEvUC6nV+NPaH0NgXQv19PyranTjbZEeOhMLBQhVJMFhCBmPvJ9GE/Twwj5fj/c+04NaMoKT1CRp6A7g+sAZFXxByQxBXdc8h1S6hst2BD8sHIkknv6MTBEEQ9H25klf3ccE8VobMLzQQXrNA0ulB08AamoxraOwPoaE3gNruZZAqN0QKGw6JtFWblpwVT2fxtQkH8pFeoAS/hsKFW7O4cs+Ha/oA6rq9qOlahLjDBaHchrRz3VqCyIqPuUNW/A5WfvXr71VE3z3XBX7tGMraplHZ/gxf3ZnH5y1T4MhGo6kiTfX/yP/BOEwyducopWlFXeYs8U8Lgsu/LvAvmc0fV5ikrFwVIzb/D6b/QY5z63dPAAAAAElFTkSuQmCC">Release notes</A> + <DT><A HREF="http://www.palemoon.org/" ICON_URI="http://www.palemoon.org/favicon.ico" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAFXRFWHRDcmVhdGlvbiBUaW1lAAfjBQQNKi3s6zvVAAAAB3RJTUUH4wUFDiY4QniqfgAAAAlwSFlzAAAK8AAACvABQqw0mAAAAn1JREFUeNpVU9FKW0EUnLO7NzdFY5uqRSMSoSj1F/paP0EEoU/2H/pWIkiLX+GzH5HnQj9BENQqpSgWkdbeu/fubudsCKQ3CSS7M3PmzDmRb5f3mH1SShsGcmAF7wTYaGMC35cQjBNwYoxczeJlKpASrAFGHYOP3cKUJMO3Cb4JMPwhIggJdZNwLEaOKBiU52bIp73S7jp+iyyJFNG2/JBlSBYC6KrsWhnR1XYQ2Sc1GuRKcTTXMbudwqpcfokxUPtamV/heGWdgaVKYWXPpvRp0sLF/ZB3Z72uKx0B3ocswis8VQ0CRf7yTMWflRZTh00bq1awpS18IK8kXltBQWDbBroK2X7Byxc9m9tIk7Qyju66EThwjHhHyS3DQpG0dSYVEELM9rWdyKskmmDMEpaphjpAnOw4VhuayAMGBi85cX0UzF7xVEfUdJNyV5Ltu5wNYIJsOK1GPji6TFKBkm3wJxq6iLQkMWVXhkmqkAktHHF/qgDnfXsZUhi03mTVqm7gFKiDzuPUXWg4FabPqbdRRVWcZOcuiJXx02P1VgjU8HJM2rtWysFOzh1dcXSaPizolEKdue5Yvp7fDn+efz+LtS81Bt2YIHn1Jn0SqLO31ubwtLzlGfekerm5vuWss1fzz3vHtxc/RpE9q4cmkcCKUW2yGc2EFLQpTdcei8OVL8a567zKCyuLR78f6u37m7s9iS0rE1HrhD1qilXC6vyIddCr/mr/dH516bNy8ypz3mHwZrD/anPt0JuyqkOBqtJlKrhMFk2dUPkID1MtvV45XNsevCcn/vdvnD6+btbvbn4dPNw+7lSVH+pZOde96i8vjJcH/ZNO6a5n8f8A5KRcUpQlS3kAAAAASUVORK5CYII=">Pale Moon</A> + <DT><A HREF="https://forum.palemoon.org/index.php" ICON_URI="https://forum.palemoon.org/favicon.ico" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAFXRFWHRDcmVhdGlvbiBUaW1lAAfjBQQNKi3s6zvVAAAAB3RJTUUH4wUFDiY4QniqfgAAAAlwSFlzAAAK8AAACvABQqw0mAAAAn1JREFUeNpVU9FKW0EUnLO7NzdFY5uqRSMSoSj1F/paP0EEoU/2H/pWIkiLX+GzH5HnQj9BENQqpSgWkdbeu/fubudsCKQ3CSS7M3PmzDmRb5f3mH1SShsGcmAF7wTYaGMC35cQjBNwYoxczeJlKpASrAFGHYOP3cKUJMO3Cb4JMPwhIggJdZNwLEaOKBiU52bIp73S7jp+iyyJFNG2/JBlSBYC6KrsWhnR1XYQ2Sc1GuRKcTTXMbudwqpcfokxUPtamV/heGWdgaVKYWXPpvRp0sLF/ZB3Z72uKx0B3ocswis8VQ0CRf7yTMWflRZTh00bq1awpS18IK8kXltBQWDbBroK2X7Byxc9m9tIk7Qyju66EThwjHhHyS3DQpG0dSYVEELM9rWdyKskmmDMEpaphjpAnOw4VhuayAMGBi85cX0UzF7xVEfUdJNyV5Ltu5wNYIJsOK1GPji6TFKBkm3wJxq6iLQkMWVXhkmqkAktHHF/qgDnfXsZUhi03mTVqm7gFKiDzuPUXWg4FabPqbdRRVWcZOcuiJXx02P1VgjU8HJM2rtWysFOzh1dcXSaPizolEKdue5Yvp7fDn+efz+LtS81Bt2YIHn1Jn0SqLO31ubwtLzlGfekerm5vuWss1fzz3vHtxc/RpE9q4cmkcCKUW2yGc2EFLQpTdcei8OVL8a567zKCyuLR78f6u37m7s9iS0rE1HrhD1qilXC6vyIddCr/mr/dH516bNy8ypz3mHwZrD/anPt0JuyqkOBqtJlKrhMFk2dUPkID1MtvV45XNsevCcn/vdvnD6+btbvbn4dPNw+7lSVH+pZOde96i8vjJcH/ZNO6a5n8f8A5KRcUpQlS3kAAAAASUVORK5CYII=" LAST_CHARSET="UTF-8">Pale Moon forum</A> + <DT><A HREF="http://www.palemoon.org/faq.shtml" ICON_URI="http://www.palemoon.org/favicon.ico" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAFXRFWHRDcmVhdGlvbiBUaW1lAAfjBQQNKi3s6zvVAAAAB3RJTUUH4wUFDiY4QniqfgAAAAlwSFlzAAAK8AAACvABQqw0mAAAAn1JREFUeNpVU9FKW0EUnLO7NzdFY5uqRSMSoSj1F/paP0EEoU/2H/pWIkiLX+GzH5HnQj9BENQqpSgWkdbeu/fubudsCKQ3CSS7M3PmzDmRb5f3mH1SShsGcmAF7wTYaGMC35cQjBNwYoxczeJlKpASrAFGHYOP3cKUJMO3Cb4JMPwhIggJdZNwLEaOKBiU52bIp73S7jp+iyyJFNG2/JBlSBYC6KrsWhnR1XYQ2Sc1GuRKcTTXMbudwqpcfokxUPtamV/heGWdgaVKYWXPpvRp0sLF/ZB3Z72uKx0B3ocswis8VQ0CRf7yTMWflRZTh00bq1awpS18IK8kXltBQWDbBroK2X7Byxc9m9tIk7Qyju66EThwjHhHyS3DQpG0dSYVEELM9rWdyKskmmDMEpaphjpAnOw4VhuayAMGBi85cX0UzF7xVEfUdJNyV5Ltu5wNYIJsOK1GPji6TFKBkm3wJxq6iLQkMWVXhkmqkAktHHF/qgDnfXsZUhi03mTVqm7gFKiDzuPUXWg4FabPqbdRRVWcZOcuiJXx02P1VgjU8HJM2rtWysFOzh1dcXSaPizolEKdue5Yvp7fDn+efz+LtS81Bt2YIHn1Jn0SqLO31ubwtLzlGfekerm5vuWss1fzz3vHtxc/RpE9q4cmkcCKUW2yGc2EFLQpTdcei8OVL8a567zKCyuLR78f6u37m7s9iS0rE1HrhD1qilXC6vyIddCr/mr/dH516bNy8ypz3mHwZrD/anPt0JuyqkOBqtJlKrhMFk2dUPkID1MtvV45XNsevCcn/vdvnD6+btbvbn4dPNw+7lSVH+pZOde96i8vjJcH/ZNO6a5n8f8A5KRcUpQlS3kAAAAASUVORK5CYII=">F.A.Q.</A> + <DT><A HREF="http://www.palemoon.org/releasenotes.shtml" ICON_URI="http://www.palemoon.org/favicon.ico" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAFXRFWHRDcmVhdGlvbiBUaW1lAAfjBQQNKi3s6zvVAAAAB3RJTUUH4wUFDiY4QniqfgAAAAlwSFlzAAAK8AAACvABQqw0mAAAAn1JREFUeNpVU9FKW0EUnLO7NzdFY5uqRSMSoSj1F/paP0EEoU/2H/pWIkiLX+GzH5HnQj9BENQqpSgWkdbeu/fubudsCKQ3CSS7M3PmzDmRb5f3mH1SShsGcmAF7wTYaGMC35cQjBNwYoxczeJlKpASrAFGHYOP3cKUJMO3Cb4JMPwhIggJdZNwLEaOKBiU52bIp73S7jp+iyyJFNG2/JBlSBYC6KrsWhnR1XYQ2Sc1GuRKcTTXMbudwqpcfokxUPtamV/heGWdgaVKYWXPpvRp0sLF/ZB3Z72uKx0B3ocswis8VQ0CRf7yTMWflRZTh00bq1awpS18IK8kXltBQWDbBroK2X7Byxc9m9tIk7Qyju66EThwjHhHyS3DQpG0dSYVEELM9rWdyKskmmDMEpaphjpAnOw4VhuayAMGBi85cX0UzF7xVEfUdJNyV5Ltu5wNYIJsOK1GPji6TFKBkm3wJxq6iLQkMWVXhkmqkAktHHF/qgDnfXsZUhi03mTVqm7gFKiDzuPUXWg4FabPqbdRRVWcZOcuiJXx02P1VgjU8HJM2rtWysFOzh1dcXSaPizolEKdue5Yvp7fDn+efz+LtS81Bt2YIHn1Jn0SqLO31ubwtLzlGfekerm5vuWss1fzz3vHtxc/RpE9q4cmkcCKUW2yGc2EFLQpTdcei8OVL8a567zKCyuLR78f6u37m7s9iS0rE1HrhD1qilXC6vyIddCr/mr/dH516bNy8ypz3mHwZrD/anPt0JuyqkOBqtJlKrhMFk2dUPkID1MtvV45XNsevCcn/vdvnD6+btbvbn4dPNw+7lSVH+pZOde96i8vjJcH/ZNO6a5n8f8A5KRcUpQlS3kAAAAASUVORK5CYII=">Release notes</A> </DL><p> </DL><p> diff --git a/application/palemoon/locales/jar.mn b/application/palemoon/locales/jar.mn index e3477c320..5fcee246e 100644 --- a/application/palemoon/locales/jar.mn +++ b/application/palemoon/locales/jar.mn @@ -6,93 +6,92 @@ @AB_CD@.jar: % locale browser @AB_CD@ %locale/browser/ - locale/browser/aboutCertError.dtd (%chrome/browser/aboutCertError.dtd) - locale/browser/aboutDialog.dtd (%chrome/browser/aboutDialog.dtd) - locale/browser/aboutPrivateBrowsing.dtd (%chrome/browser/aboutPrivateBrowsing.dtd) - locale/browser/aboutRobots.dtd (%chrome/browser/aboutRobots.dtd) - locale/browser/aboutHome.dtd (%chrome/browser/aboutHome.dtd) - locale/browser/aboutSessionRestore.dtd (%chrome/browser/aboutSessionRestore.dtd) + locale/browser/aboutCertError.dtd (%chrome/browser/aboutCertError.dtd) + locale/browser/aboutDialog.dtd (%chrome/browser/aboutDialog.dtd) + locale/browser/aboutPrivateBrowsing.dtd (%chrome/browser/aboutPrivateBrowsing.dtd) +* locale/browser/aboutHome.dtd (%chrome/browser/aboutHome.dtd) + locale/browser/aboutSessionRestore.dtd (%chrome/browser/aboutSessionRestore.dtd) #ifdef MOZ_SERVICES_SYNC - locale/browser/syncProgress.dtd (%chrome/browser/syncProgress.dtd) - locale/browser/aboutSyncTabs.dtd (%chrome/browser/aboutSyncTabs.dtd) + locale/browser/syncProgress.dtd (%chrome/browser/syncProgress.dtd) + locale/browser/aboutSyncTabs.dtd (%chrome/browser/aboutSyncTabs.dtd) #endif -* locale/browser/browser.dtd (%chrome/browser/browser.dtd) - locale/browser/baseMenuOverlay.dtd (%chrome/browser/baseMenuOverlay.dtd) - locale/browser/charsetOverlay.dtd (%chrome/browser/charsetOverlay.dtd) - locale/browser/browser.properties (%chrome/browser/browser.properties) - locale/browser/charsetMenu.properties (%chrome/browser/charsetMenu.properties) - locale/browser/charsetMenu.dtd (%chrome/browser/charsetMenu.dtd) - locale/browser/newTab.dtd (%chrome/browser/newTab.dtd) - locale/browser/newTab.properties (%chrome/browser/newTab.properties) - locale/browser/openLocation.dtd (%chrome/browser/openLocation.dtd) - 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) - locale/browser/search.properties (%chrome/browser/search.properties) - locale/browser/searchbar.dtd (%chrome/browser/searchbar.dtd) - locale/browser/engineManager.dtd (%chrome/browser/engineManager.dtd) - locale/browser/engineManager.properties (%chrome/browser/engineManager.properties) - locale/browser/setDesktopBackground.dtd (%chrome/browser/setDesktopBackground.dtd) - locale/browser/shellservice.properties (%chrome/browser/shellservice.properties) - locale/browser/statusbar/statusbar-overlay.dtd (%chrome/browser/statusbar/statusbar-overlay.dtd) - locale/browser/statusbar/statusbar-prefs.dtd (%chrome/browser/statusbar/statusbar-prefs.dtd) - locale/browser/statusbar/meta.properties (%chrome/browser/statusbar/meta.properties) - locale/browser/statusbar/overlay.properties (%chrome/browser/statusbar/overlay.properties) - locale/browser/statusbar/prefs.properties (%chrome/browser/statusbar/prefs.properties) - locale/browser/tabbrowser.dtd (%chrome/browser/tabbrowser.dtd) - locale/browser/tabbrowser.properties (%chrome/browser/tabbrowser.properties) - locale/browser/taskbar.properties (%chrome/browser/taskbar.properties) - locale/browser/downloads/downloads.dtd (%chrome/browser/downloads/downloads.dtd) - locale/browser/downloads/downloads.properties (%chrome/browser/downloads/downloads.properties) - locale/browser/places/places.dtd (%chrome/browser/places/places.dtd) - locale/browser/places/places.properties (%chrome/browser/places/places.properties) - locale/browser/places/editBookmarkOverlay.dtd (%chrome/browser/places/editBookmarkOverlay.dtd) - locale/browser/places/bookmarkProperties.properties (%chrome/browser/places/bookmarkProperties.properties) - locale/browser/preferences/selectBookmark.dtd (%chrome/browser/preferences/selectBookmark.dtd) - 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/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) - locale/browser/preferences/colors.dtd (%chrome/browser/preferences/colors.dtd) - locale/browser/preferences/cookies.dtd (%chrome/browser/preferences/cookies.dtd) - locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd) - locale/browser/preferences/connection.dtd (%chrome/browser/preferences/connection.dtd) - locale/browser/preferences/applications.dtd (%chrome/browser/preferences/applications.dtd) - locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd) - locale/browser/preferences/main.dtd (%chrome/browser/preferences/main.dtd) - locale/browser/preferences/languages.dtd (%chrome/browser/preferences/languages.dtd) - locale/browser/preferences/permissions.dtd (%chrome/browser/preferences/permissions.dtd) - locale/browser/preferences/preferences.dtd (%chrome/browser/preferences/preferences.dtd) - locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties) - locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd) - locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd) +* locale/browser/browser.dtd (%chrome/browser/browser.dtd) + locale/browser/baseMenuOverlay.dtd (%chrome/browser/baseMenuOverlay.dtd) + locale/browser/charsetOverlay.dtd (%chrome/browser/charsetOverlay.dtd) + locale/browser/browser.properties (%chrome/browser/browser.properties) + locale/browser/charsetMenu.properties (%chrome/browser/charsetMenu.properties) + locale/browser/charsetMenu.dtd (%chrome/browser/charsetMenu.dtd) + locale/browser/newTab.dtd (%chrome/browser/newTab.dtd) + locale/browser/newTab.properties (%chrome/browser/newTab.properties) + locale/browser/openLocation.dtd (%chrome/browser/openLocation.dtd) + 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) + locale/browser/search.properties (%chrome/browser/search.properties) + locale/browser/searchbar.dtd (%chrome/browser/searchbar.dtd) + locale/browser/engineManager.dtd (%chrome/browser/engineManager.dtd) + locale/browser/engineManager.properties (%chrome/browser/engineManager.properties) + locale/browser/setDesktopBackground.dtd (%chrome/browser/setDesktopBackground.dtd) + locale/browser/shellservice.properties (%chrome/browser/shellservice.properties) + locale/browser/statusbar/statusbar-overlay.dtd (%chrome/browser/statusbar/statusbar-overlay.dtd) + locale/browser/statusbar/statusbar-prefs.dtd (%chrome/browser/statusbar/statusbar-prefs.dtd) + locale/browser/statusbar/meta.properties (%chrome/browser/statusbar/meta.properties) + locale/browser/statusbar/overlay.properties (%chrome/browser/statusbar/overlay.properties) + locale/browser/statusbar/prefs.properties (%chrome/browser/statusbar/prefs.properties) + locale/browser/tabbrowser.dtd (%chrome/browser/tabbrowser.dtd) + locale/browser/tabbrowser.properties (%chrome/browser/tabbrowser.properties) + locale/browser/taskbar.properties (%chrome/browser/taskbar.properties) + locale/browser/downloads/downloads.dtd (%chrome/browser/downloads/downloads.dtd) + locale/browser/downloads/downloads.properties (%chrome/browser/downloads/downloads.properties) + locale/browser/places/places.dtd (%chrome/browser/places/places.dtd) + locale/browser/places/places.properties (%chrome/browser/places/places.properties) + locale/browser/places/editBookmarkOverlay.dtd (%chrome/browser/places/editBookmarkOverlay.dtd) + locale/browser/places/bookmarkProperties.properties (%chrome/browser/places/bookmarkProperties.properties) + locale/browser/preferences/selectBookmark.dtd (%chrome/browser/preferences/selectBookmark.dtd) + 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/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) + locale/browser/preferences/colors.dtd (%chrome/browser/preferences/colors.dtd) + locale/browser/preferences/cookies.dtd (%chrome/browser/preferences/cookies.dtd) + locale/browser/preferences/content.dtd (%chrome/browser/preferences/content.dtd) + locale/browser/preferences/connection.dtd (%chrome/browser/preferences/connection.dtd) + locale/browser/preferences/applications.dtd (%chrome/browser/preferences/applications.dtd) + locale/browser/preferences/fonts.dtd (%chrome/browser/preferences/fonts.dtd) + locale/browser/preferences/main.dtd (%chrome/browser/preferences/main.dtd) + locale/browser/preferences/languages.dtd (%chrome/browser/preferences/languages.dtd) + locale/browser/preferences/permissions.dtd (%chrome/browser/preferences/permissions.dtd) + locale/browser/preferences/preferences.dtd (%chrome/browser/preferences/preferences.dtd) + locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties) + locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd) + locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd) #ifdef MOZ_SERVICES_SYNC - locale/browser/preferences/sync.dtd (%chrome/browser/preferences/sync.dtd) + locale/browser/preferences/sync.dtd (%chrome/browser/preferences/sync.dtd) #endif - locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd) + locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd) #ifdef MOZ_SERVICES_SYNC - locale/browser/syncBrand.dtd (%chrome/browser/syncBrand.dtd) - locale/browser/syncSetup.dtd (%chrome/browser/syncSetup.dtd) - locale/browser/syncSetup.properties (%chrome/browser/syncSetup.properties) - locale/browser/syncGenericChange.properties (%chrome/browser/syncGenericChange.properties) - locale/browser/syncKey.dtd (%chrome/browser/syncKey.dtd) - locale/browser/syncQuota.dtd (%chrome/browser/syncQuota.dtd) - locale/browser/syncQuota.properties (%chrome/browser/syncQuota.properties) + locale/browser/syncBrand.dtd (%chrome/browser/syncBrand.dtd) + locale/browser/syncSetup.dtd (%chrome/browser/syncSetup.dtd) + locale/browser/syncSetup.properties (%chrome/browser/syncSetup.properties) + locale/browser/syncGenericChange.properties (%chrome/browser/syncGenericChange.properties) + locale/browser/syncKey.dtd (%chrome/browser/syncKey.dtd) + locale/browser/syncQuota.dtd (%chrome/browser/syncQuota.dtd) + locale/browser/syncQuota.properties (%chrome/browser/syncQuota.properties) #endif % locale browser-region @AB_CD@ %locale/browser-region/ - locale/browser-region/region.properties (%chrome/browser-region/region.properties) + locale/browser-region/region.properties (%chrome/browser-region/region.properties) # the following files are browser-specific overrides - locale/browser/netError.dtd (%chrome/overrides/netError.dtd) - locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties) - locale/browser/downloads/settingsChange.dtd (%chrome/overrides/settingsChange.dtd) + locale/browser/netError.dtd (%chrome/overrides/netError.dtd) + locale/browser/appstrings.properties (%chrome/overrides/appstrings.properties) + locale/browser/downloads/settingsChange.dtd (%chrome/overrides/settingsChange.dtd) % override chrome://global/locale/netError.dtd chrome://browser/locale/netError.dtd % override chrome://global/locale/appstrings.properties chrome://browser/locale/appstrings.properties % override chrome://mozapps/locale/downloads/settingsChange.dtd chrome://browser/locale/downloads/settingsChange.dtd diff --git a/application/palemoon/modules/FormSubmitObserver.jsm b/application/palemoon/modules/FormSubmitObserver.jsm index e4d3e765e..6b2ea3c84 100644 --- a/application/palemoon/modules/FormSubmitObserver.jsm +++ b/application/palemoon/modules/FormSubmitObserver.jsm @@ -42,10 +42,10 @@ FormSubmitObserver.prototype = { this._content = aWindow; this._tab = aTabChildGlobal; - this._mm =
- this._content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .sameTypeRootTreeItem
+ this._mm = + this._content.QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDocShell) + .sameTypeRootTreeItem .QueryInterface(Ci.nsIDocShell) .QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIContentFrameMessageManager); @@ -104,13 +104,13 @@ FormSubmitObserver.prototype = return; } - // Insure that this is the FormSubmitObserver associated with the form + // Ensure that this is the FormSubmitObserver associated with the // element / window this notification is about. - if (this._content != aFormElement.ownerDocument.defaultView.top.document.defaultView) { + let element = aInvalidElements.queryElementAt(0, Ci.nsISupports); + if (this._content != element.ownerGlobal.top.document.defaultView) { return; } - let element = aInvalidElements.queryElementAt(0, Ci.nsISupports); if (!(element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement || element instanceof HTMLSelectElement || @@ -118,6 +118,9 @@ FormSubmitObserver.prototype = return; } + // Update validation message before showing notification + this._validationMessage = element.validationMessage; + // Don't connect up to the same element more than once. if (this._element == element) { this._showPopup(element); @@ -127,8 +130,6 @@ FormSubmitObserver.prototype = element.focus(); - this._validationMessage = element.validationMessage; - // Watch for input changes which may change the validation message. element.addEventListener("input", this, false); @@ -142,7 +143,7 @@ FormSubmitObserver.prototype = /* * Internal */ -
+ /* * Handles input changes on the form element we've associated a popup * with. Updates the validation message or closes the popup if form data @@ -189,18 +190,17 @@ FormSubmitObserver.prototype = // Note, this is relative to the browser and needs to be translated // in chrome. - panelData.contentRect = this._msgRect(aElement); + panelData.contentRect = BrowserUtils.getElementBoundingRect(aElement); // We want to show the popup at the middle of checkbox and radio buttons // and where the content begin for the other elements. let offset = 0; - let position = ""; if (aElement.tagName == 'INPUT' && (aElement.type == 'radio' || aElement.type == 'checkbox')) { panelData.position = "bottomcenter topleft"; } else { - let win = aElement.ownerDocument.defaultView; + let win = aElement.ownerGlobal; let style = win.getComputedStyle(aElement, null); if (style.direction == 'rtl') { offset = parseInt(style.paddingRight) + parseInt(style.borderRightWidth); @@ -218,8 +218,8 @@ FormSubmitObserver.prototype = this._mm.sendAsyncMessage("FormValidation:HidePopup", {}); }, - _getWindowUtils: function () {
- return this._content.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
+ _getWindowUtils: function () { + return this._content.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils); }, _isRootDocumentEvent: function (aEvent) { @@ -231,21 +231,5 @@ FormSubmitObserver.prototype = (target.ownerDocument && target.ownerDocument == this._content.document)); }, - /* - * Return a message manager rect for the element's bounding client rect - * in top level browser coords. - */ - _msgRect: function (aElement) { - let domRect = aElement.getBoundingClientRect(); - let zoomFactor = this._getWindowUtils().fullZoom; - let { offsetX, offsetY } = BrowserUtils.offsetToTopLevelWindow(this._content, aElement); - return { - left: (domRect.left + offsetX) * zoomFactor, - top: (domRect.top + offsetY) * zoomFactor, - width: domRect.width * zoomFactor, - height: domRect.height * zoomFactor - }; - }, - QueryInterface : XPCOMUtils.generateQI([Ci.nsIFormSubmitObserver]) }; diff --git a/application/palemoon/modules/WindowsPreviewPerTab.jsm b/application/palemoon/modules/WindowsPreviewPerTab.jsm index c1ed05c39..4b5030ad4 100644 --- a/application/palemoon/modules/WindowsPreviewPerTab.jsm +++ b/application/palemoon/modules/WindowsPreviewPerTab.jsm @@ -3,12 +3,10 @@ * 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/. */ /* - * This module implements the front end behavior for AeroPeek. Starting in - * Windows Vista, the taskbar began showing live thumbnail previews of windows - * when the user hovered over the window icon in the taskbar. Starting with - * Windows 7, the taskbar allows an application to expose its tabbed interface - * in the taskbar by showing thumbnail previews rather than the default window - * preview. Additionally, when a user hovers over a thumbnail (tab or window), + * This module implements the front end behavior for AeroPeek. The taskbar + * allows an application to expose its tabbed interface by showing thumbnail + * previews rather than the default window preview. + * Additionally, when a user hovers over a thumbnail (tab or window), * they are shown a live preview of the window (or tab + its containing window). * * In Windows 7, a title, icon, close button and optional toolbar are shown for @@ -31,7 +29,7 @@ * Screen real estate is limited so when there are too many thumbnails to fit * on the screen, the taskbar stops displaying thumbnails and instead displays * just the title, icon and close button in a similar fashion to previous - * versions of the taskbar. If there are still too many previews to fit on the + * versions of the taskbar. If there are still too many previews to fit on the * screen, the taskbar resorts to a scroll up and scroll down button pair to let * the user scroll through the list of tabs. Since this is undoubtedly * inconvenient for users with many tabs, the AeroPeek objects turns off all of @@ -47,9 +45,11 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cu = Components.utils; -Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); +Cu.import("resource://gre/modules/PlacesUtils.jsm"); Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); // Pref to enable/disable preview-per-tab const TOGGLE_PREF_NAME = "browser.taskbar.previews.enable"; @@ -60,17 +60,15 @@ const CACHE_EXPIRATION_TIME_PREF_NAME = "browser.taskbar.previews.cachetime"; const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1"; -//////////////////////////////////////////////////////////////////////////////// -//// Various utility properties +// Various utility properties XPCOMUtils.defineLazyServiceGetter(this, "imgTools", "@mozilla.org/image/tools;1", "imgITools"); -XPCOMUtils.defineLazyServiceGetter(this, "faviconSvc", - "@mozilla.org/browser/favicon-service;1", - "nsIFaviconService"); +XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs", + "resource://gre/modules/PageThumbs.jsm"); // nsIURI -> imgIContainer -function _imageFromURI(doc, uri, privateMode, callback) { +function _imageFromURI(uri, privateMode, callback) { let channel = NetUtil.newChannel({ uri: uri, loadUsingSystemPrincipal: true, @@ -93,19 +91,20 @@ function _imageFromURI(doc, uri, privateMode, callback) { } catch (e) { // We failed, so use the default favicon (only if this wasn't the default // favicon). - let defaultURI = faviconSvc.defaultFavicon; + let defaultURI = PlacesUtils.favicons.defaultFavicon; if (!defaultURI.equals(uri)) - _imageFromURI(doc, defaultURI, privateMode, callback); + _imageFromURI(defaultURI, privateMode, callback); } }); } // string? -> imgIContainer -function getFaviconAsImage(doc, iconurl, privateMode, callback) { - if (iconurl) - _imageFromURI(doc, NetUtil.newURI(iconurl), privateMode, callback); - else - _imageFromURI(doc, faviconSvc.defaultFavicon, privateMode, callback); +function getFaviconAsImage(iconurl, privateMode, callback) { + if (iconurl) { + _imageFromURI(NetUtil.newURI(iconurl), privateMode, callback); + } else { + _imageFromURI(PlacesUtils.favicons.defaultFavicon, privateMode, callback); + } } // Snaps the given rectangle to be pixel-aligned at the given scale @@ -121,16 +120,17 @@ function snapRectAtScale(r, scale) { r.height = height / scale; } -//////////////////////////////////////////////////////////////////////////////// -//// PreviewController +// PreviewController /* - * This class manages the behavior of the preview. - * - * To give greater performance when drawing, the dirty areas of the content - * window are tracked and drawn on demand into a canvas of the same size. - * This provides a great increase in responsiveness when drawing a preview - * for unchanged (or even only slightly changed) tabs. + * This class manages the behavior of thumbnails and previews. It has the following + * responsibilities: + * 1) Responding to requests from Windows taskbar for a thumbnail or window + * preview. + * 2) Listening for DOM events that result in a thumbnail or window preview needing + * to be refreshed, and communicating this to the taskbar. + * 3) Handling queryies and returning new thumbnail or window preview images to the + * taskbar through PageThumbs. * * @param win * The TabWindow (see below) that owns the preview that this controls @@ -143,206 +143,182 @@ function PreviewController(win, tab) { this.linkedBrowser = tab.linkedBrowser; this.preview = this.win.createTabPreview(this); - this.linkedBrowser.addEventListener("MozAfterPaint", this, false); this.tab.addEventListener("TabAttrModified", this, false); XPCOMUtils.defineLazyGetter(this, "canvasPreview", function () { - let canvas = this.win.win.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas"); + let canvas = PageThumbs.createCanvas(); canvas.mozOpaque = true; return canvas; }); - - XPCOMUtils.defineLazyGetter(this, "dirtyRegion", - function () { - let dirtyRegion = Cc["@mozilla.org/gfx/region;1"] - .createInstance(Ci.nsIScriptableRegion); - dirtyRegion.init(); - return dirtyRegion; - }); - - XPCOMUtils.defineLazyGetter(this, "winutils", - function () { - let win = tab.linkedBrowser.contentWindow; - return win.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils); - }); } PreviewController.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsITaskbarPreviewController, Ci.nsIDOMEventListener]), + destroy: function () { this.tab.removeEventListener("TabAttrModified", this, false); - this.linkedBrowser.removeEventListener("MozAfterPaint", this, false); // Break cycles, otherwise we end up leaking the window with everything // attached to it. delete this.win; delete this.preview; - delete this.dirtyRegion; }, + get wrappedJSObject() { return this; }, - get dirtyRects() { - let rectstream = this.dirtyRegion.getRects(); - if (!rectstream) - return []; - let rects = []; - for (let i = 0; i < rectstream.length; i+= 4) { - let r = {x: rectstream[i], - y: rectstream[i+1], - width: rectstream[i+2], - height: rectstream[i+3]}; - rects.push(r); - } - return rects; - }, - // Resizes the canvasPreview to 0x0, essentially freeing its memory. - // updateCanvasPreview() will detect the size mismatch as a resize event - // the next time it is called. resetCanvasPreview: function () { this.canvasPreview.width = 0; this.canvasPreview.height = 0; }, + /** + * Set the canvas dimensions. + */ + resizeCanvasPreview: function (aRequestedWidth, aRequestedHeight) { + this.canvasPreview.width = aRequestedWidth; + this.canvasPreview.height = aRequestedHeight; + }, + + get zoom() { // Note that winutils.fullZoom accounts for "quantization" of the zoom factor - // from nsIMarkupDocumentViewer due to conversion through appUnits. + // from nsIContentViewer due to conversion through appUnits. // We do -not- want screenPixelsPerCSSPixel here, because that would -also- // incorporate any scaling that is applied due to hi-dpi resolution options. - return this.winutils.fullZoom; - }, - - // Updates the controller's canvas with the parts of the <browser> that need - // to be redrawn. - updateCanvasPreview: function () { - let win = this.linkedBrowser.contentWindow; - let bx = this.linkedBrowser.boxObject; - // Check for resize - if (bx.width != this.canvasPreview.width || - bx.height != this.canvasPreview.height) { - // Invalidate the entire area and repaint - this.onTabPaint({left:0, top:0, right:win.innerWidth, bottom:win.innerHeight}); - this.canvasPreview.width = bx.width; - this.canvasPreview.height = bx.height; - } + return this.tab.linkedBrowser.fullZoom; + }, - // Draw dirty regions - let ctx = this.canvasPreview.getContext("2d"); - let scale = this.zoom; - - let flags = this.canvasPreviewFlags; - // The dirty region may include parts that are offscreen so we clip to the - // canvas area. - this.dirtyRegion.intersectRect(0, 0, win.innerWidth, win.innerHeight); - this.dirtyRects.forEach(function (r) { - // We need to snap the rectangle to be pixel aligned in the destination - // coordinate space. Otherwise natively themed widgets might not draw. - snapRectAtScale(r, scale); - let x = r.x; - let y = r.y; - let width = r.width; - let height = r.height; + get screenPixelsPerCSSPixel() { + let chromeWin = this.tab.ownerGlobal; + let windowUtils = chromeWin.getInterface(Ci.nsIDOMWindowUtils); + return windowUtils.screenPixelsPerCSSPixel; + }, - ctx.save(); - ctx.scale(scale, scale); - ctx.translate(x, y); - ctx.drawWindow(win, x, y, width, height, "white", flags); - ctx.restore(); - }); - this.dirtyRegion.setToRect(0,0,0,0); + get browserDims() { + return this.tab.linkedBrowser.getBoundingClientRect(); + }, + + cacheBrowserDims: function () { + let dims = this.browserDims; + this._cachedWidth = dims.width; + this._cachedHeight = dims.height; + }, + testCacheBrowserDims: function () { + let dims = this.browserDims; + return this._cachedWidth == dims.width && + this._cachedHeight == dims.height; + }, + + /** + * Capture a new thumbnail image for this preview. Called by the controller + * in response to a request for a new thumbnail image. + */ + updateCanvasPreview: function (aFullScale, aCallback) { + // Update our cached browser dims so that delayed resize + // events don't trigger another invalidation if this tab becomes active. + this.cacheBrowserDims(); + PageThumbs.captureToCanvas(this.linkedBrowser, this.canvasPreview, + aCallback, { fullScale: aFullScale }); // If we're updating the canvas, then we're in the middle of a peek so // don't discard the cache of previews. AeroPeek.resetCacheTimer(); }, - onTabPaint: function (rect) { - let x = Math.floor(rect.left), - y = Math.floor(rect.top), - width = Math.ceil(rect.right) - x, - height = Math.ceil(rect.bottom) - y; - this.dirtyRegion.unionRect(x, y, width, height); - }, - updateTitleAndTooltip: function () { let title = this.win.tabbrowser.getWindowTitleForBrowser(this.linkedBrowser); this.preview.title = title; this.preview.tooltip = title; }, - ////////////////////////////////////////////////////////////////////////////// - //// nsITaskbarPreviewController + // nsITaskbarPreviewController + // window width and height, not browser get width() { return this.win.width; }, + // window width and height, not browser get height() { return this.win.height; }, get thumbnailAspectRatio() { - let boxObject = this.tab.linkedBrowser.boxObject; + let browserDims = this.browserDims; // Avoid returning 0 - let tabWidth = boxObject.width || 1; + let tabWidth = browserDims.width || 1; // Avoid divide by 0 - let tabHeight = boxObject.height || 1; + let tabHeight = browserDims.height || 1; return tabWidth / tabHeight; }, - drawPreview: function (ctx) { - let self = this; - this.win.tabbrowser.previewTab(this.tab, function () self.previewTabCallback(ctx)); - - // We must avoid having the frame drawn around the window. See bug 520807 - return false; - }, - - previewTabCallback: function (ctx) { - // This will extract the resolution-scale component of the scaling we need, - // which should be applied to both chrome and content; - // the page zoom component is applied (to content only) within updateCanvasPreview. - let scale = this.winutils.screenPixelsPerCSSPixel / this.winutils.fullZoom; - ctx.save(); - ctx.scale(scale, scale); - let width = this.win.width; - let height = this.win.height; - // Draw our toplevel window - ctx.drawWindow(this.win.win, 0, 0, width, height, "transparent"); - - // XXX (jfkthame): Pending tabs don't seem to draw with the proper scaling - // unless we use this block of code; but doing this for "normal" (loaded) tabs - // results in blurry rendering on hidpi systems, so we avoid it if possible. - // I don't understand why pending and loaded tabs behave differently here... - // (see bug 857061). - if (this.tab.hasAttribute("pending")) { - // Compositor, where art thou? - // Draw the tab content on top of the toplevel window - this.updateCanvasPreview(); - - let boxObject = this.linkedBrowser.boxObject; - ctx.translate(boxObject.x, boxObject.y); - ctx.drawImage(this.canvasPreview, 0, 0); - } + /** + * Responds to taskbar requests for window previews. Returns the results asynchronously + * through updateCanvasPreview. + * + * @param aTaskbarCallback nsITaskbarPreviewCallback results callback + */ + requestPreview: function (aTaskbarCallback) { + // Grab a high res content preview + this.resetCanvasPreview(); + this.updateCanvasPreview(true, (aPreviewCanvas) => { + let winWidth = this.win.width; + let winHeight = this.win.height; - ctx.restore(); - }, + let composite = PageThumbs.createCanvas(); - drawThumbnail: function (ctx, width, height) { - this.updateCanvasPreview(); + // Use transparency, Aero glass is drawn black without it. + composite.mozOpaque = false; - let scale = width/this.linkedBrowser.boxObject.width; - ctx.scale(scale, scale); - ctx.drawImage(this.canvasPreview, 0, 0); + let ctx = composite.getContext('2d'); + let scale = this.screenPixelsPerCSSPixel / this.zoom; - // Don't draw a frame around the thumbnail - return false; + composite.width = winWidth * scale; + composite.height = winHeight * scale; + + ctx.save(); + ctx.scale(scale, scale); + + // Draw chrome. Note we currently do not get scrollbars for remote frames + // in the image above. + ctx.drawWindow(this.win.win, 0, 0, winWidth, winHeight, "rgba(0,0,0,0)"); + + // Draw the content are into the composite canvas at the right location. + ctx.drawImage(aPreviewCanvas, this.browserDims.x, this.browserDims.y, + aPreviewCanvas.width, aPreviewCanvas.height); + ctx.restore(); + + // Deliver the resulting composite canvas to Windows + this.win.tabbrowser.previewTab(this.tab, function () { + aTaskbarCallback.done(composite, false); + }); + }); }, + /** + * Responds to taskbar requests for tab thumbnails. Returns the results asynchronously + * through updateCanvasPreview. + * + * Note Windows requests a specific width and height here, if the resulting thumbnail + * does not match these dimensions thumbnail display will fail. + * + * @param aTaskbarCallback nsITaskbarPreviewCallback results callback + * @param aRequestedWidth width of the requested thumbnail + * @param aRequestedHeight height of the requested thumbnail + */ + requestThumbnail: function (aTaskbarCallback, aRequestedWidth, aRequestedHeight) { + this.resizeCanvasPreview(aRequestedWidth, aRequestedHeight); + this.updateCanvasPreview(false, (aThumbnailCanvas) => { + aTaskbarCallback.done(aThumbnailCanvas, false); + }); + }, + + // Event handling + onClose: function () { this.win.tabbrowser.removeTab(this.tab); }, @@ -355,22 +331,9 @@ PreviewController.prototype = { return true; }, - //// nsIDOMEventListener + // nsIDOMEventListener handleEvent: function (evt) { switch (evt.type) { - case "MozAfterPaint": - if (evt.originalTarget === this.linkedBrowser.contentWindow) { - let clientRects = evt.clientRects; - let length = clientRects.length; - for (let i = 0; i < length; i++) { - let r = clientRects.item(i); - this.onTabPaint(r); - } - } - let preview = this.preview; - if (preview.visible) - preview.invalidate(); - break; case "TabAttrModified": this.updateTitleAndTooltip(); break; @@ -386,14 +349,13 @@ XPCOMUtils.defineLazyGetter(PreviewController.prototype, "canvasPreviewFlags", | canvasInterface.DRAWWINDOW_DO_NOT_FLUSH; }); -//////////////////////////////////////////////////////////////////////////////// -//// TabWindow +// TabWindow /* * This class monitors a browser window for changes to its tabs * * @param win - * The nsIDOMWindow browser window + * The nsIDOMWindow browser window */ function TabWindow(win) { this.win = win; @@ -403,6 +365,10 @@ function TabWindow(win) { for (let i = 0; i < this.tabEvents.length; i++) this.tabbrowser.tabContainer.addEventListener(this.tabEvents[i], this, false); + + for (let i = 0; i < this.winEvents.length; i++) + this.win.addEventListener(this.winEvents[i], this, false); + this.tabbrowser.addTabsProgressListener(this); AeroPeek.windows.push(this); @@ -416,7 +382,10 @@ function TabWindow(win) { TabWindow.prototype = { _enabled: false, + _cachedWidth: 0, + _cachedHeight: 0, tabEvents: ["TabOpen", "TabClose", "TabSelect", "TabMove"], + winEvents: ["resize"], destroy: function () { this._destroying = true; @@ -424,6 +393,10 @@ TabWindow.prototype = { let tabs = this.tabbrowser.tabs; this.tabbrowser.removeTabsProgressListener(this); + + for (let i = 0; i < this.winEvents.length; i++) + this.win.removeEventListener(this.winEvents[i], this, false); + for (let i = 0; i < this.tabEvents.length; i++) this.tabbrowser.tabContainer.removeEventListener(this.tabEvents[i], this, false); @@ -442,6 +415,15 @@ TabWindow.prototype = { return this.win.innerHeight; }, + cacheDims: function () { + this._cachedWidth = this.width; + this._cachedHeight = this.height; + }, + + testCacheDims: function () { + return this._cachedWidth == this.width && this._cachedHeight == this.height; + }, + // Invoked when the given tab is added to this window newTab: function (tab) { let controller = new PreviewController(this, tab); @@ -461,18 +443,8 @@ TabWindow.prototype = { let preview = AeroPeek.taskbar.createTaskbarTabPreview(docShell, controller); preview.visible = AeroPeek.enabled; preview.active = this.tabbrowser.selectedTab == controller.tab; - // Grab the default favicon - getFaviconAsImage( - controller.linkedBrowser.contentWindow.document, - null, - PrivateBrowsingUtils.isWindowPrivate(this.win), - function (img) { - // It is possible that we've already gotten the real favicon, so make sure - // we have not set one before setting this default one. - if (!preview.icon) - preview.icon = img; - }); - + this.onLinkIconAvailable(controller.tab.linkedBrowser, + controller.tab.getAttribute("image")); return preview; }, @@ -484,8 +456,6 @@ TabWindow.prototype = { preview.move(null); preview.controller.wrappedJSObject.destroy(); - // We don't want to splice from the array if the tabs aren't being removed - // from the tab bar as well (as is the case when the window closes). this.previews.delete(tab); AeroPeek.removePreview(preview); }, @@ -499,7 +469,7 @@ TabWindow.prototype = { // Because making a tab visible requires that the tab it is next to be // visible, it is far simpler to unset the 'next' tab and recreate them all // at once. - for (let [tab, preview] of this.previews) { + for (let [, preview] of this.previews) { preview.move(null); preview.visible = enable; } @@ -514,27 +484,25 @@ TabWindow.prototype = { let previews = this.previews; let tabs = this.tabbrowser.tabs; - // Previews are internally stored using a map, so we need to iterate over - // the tabbrowser's array of tabs to retrieve previews in the same order. - // Tycho: let inorder = [previews.get(t) for (t of tabs) if (previews.has(t))]; + // Previews are internally stored using a map, so we need to iterate the + // tabbrowser's array of tabs to retrieve previews in the same order. let inorder = []; - for (let t of tabs) { if (previews.has(t)) { inorder.push(previews.get(t)); } } - // Since the internal taskbar array has not yet been updated, we must force - // the sorting order of our local array on it. To do so, we must walk - // the local array backwards, because otherwise we would send move requests - // in the wrong order. See bug 522610 for details. + // Since the internal taskbar array has not yet been updated we must force + // on it the sorting order of our local array. To do so we must walk + // the local array backwards, otherwise we would send move requests in the + // wrong order. See bug 522610 for details. for (let i = inorder.length - 1; i >= 0; i--) { inorder[i].move(inorder[i + 1] || null); } }, - //// nsIDOMEventListener + // nsIDOMEventListener handleEvent: function (evt) { let tab = evt.originalTarget; switch (evt.type) { @@ -552,28 +520,118 @@ TabWindow.prototype = { case "TabMove": this.updateTabOrdering(); break; + case "resize": + if (!AeroPeek._prefenabled) + return; + this.onResize(); + break; + } + }, + + // Set or reset a timer that will invalidate visible thumbnails soon. + setInvalidationTimer: function () { + if (!this.invalidateTimer) { + this.invalidateTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); } + this.invalidateTimer.cancel(); + + // delay 1 second before invalidating + this.invalidateTimer.initWithCallback(() => { + // invalidate every preview. note the internal implementation of + // invalidate ignores thumbnails that aren't visible. + this.previews.forEach(function (aPreview) { + let controller = aPreview.controller.wrappedJSObject; + if (!controller.testCacheBrowserDims()) { + controller.cacheBrowserDims(); + aPreview.invalidate(); + } + }); + }, 1000, Ci.nsITimer.TYPE_ONE_SHOT); }, - //// Browser progress listener + onResize: function () { + // Specific to a window. + + // Call invalidate on each tab thumbnail so that Windows will request an + // updated image. However don't do this repeatedly across multiple resize + // events triggered during window border drags. + + if (this.testCacheDims()) { + return; + } + + // update the window dims on our TabWindow object. + this.cacheDims(); + + // invalidate soon + this.setInvalidationTimer(); + }, + + invalidateTabPreview: function(aBrowser) { + for (let [tab, preview] of this.previews) { + if (aBrowser == tab.linkedBrowser) { + preview.invalidate(); + break; + } + } + }, + + // Browser progress listener + + onLocationChange: function (aBrowser) { + // I'm not sure we need this, onStateChange does a really good job + // of picking up page changes. + // this.invalidateTabPreview(aBrowser); + }, + + onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) { + if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP && + aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) { + this.invalidateTabPreview(aBrowser); + } + }, + + directRequestProtocols: new Set([ + "file", "chrome", "resource", "about" + ]), onLinkIconAvailable: function (aBrowser, aIconURL) { let self = this; + let requestURL = null; + if (aIconURL) { + let shouldRequestFaviconURL = true; + try { + let urlObject = NetUtil.newURI(aIconURL); + shouldRequestFaviconURL = + !this.directRequestProtocols.has(urlObject.scheme); + } catch (ex) {} + + requestURL = shouldRequestFaviconURL ? + "moz-anno:favicon:" + aIconURL : + aIconURL; + } + let isDefaultFavicon = !requestURL; getFaviconAsImage( - aBrowser.contentWindow.document, - aIconURL,PrivateBrowsingUtils.isWindowPrivate(this.win), - function (img) { + requestURL, + PrivateBrowsingUtils.isWindowPrivate(self.win), + img => { let index = self.tabbrowser.browsers.indexOf(aBrowser); - // Only add it if we've found the index. The tab could have closed! + // Only add it if we've found the index and the URI is still the same. + // The tab could have closed, and there's no guarantee the icons + // will have finished fetching 'in order'. if (index != -1) { let tab = self.tabbrowser.tabs[index]; - self.previews.get(tab).icon = img; + let preview = self.previews.get(tab); + if (tab.getAttribute("image") == aIconURL || + (!preview.icon && isDefaultFavicon)) { + preview.icon = img; + } } - }); + } + ); } } -//////////////////////////////////////////////////////////////////////////////// -//// AeroPeek +// AeroPeek /* * This object acts as global storage and external interface for this feature. @@ -582,10 +640,12 @@ TabWindow.prototype = { this.AeroPeek = { available: false, // Does the pref say we're enabled? - _prefenabled: true, + __prefenabled: false, _enabled: true, + initialized: false, + // nsITaskbarTabPreview array previews: [], @@ -609,24 +669,14 @@ this.AeroPeek = { if (!this.available) return; - this.prefs.addObserver(TOGGLE_PREF_NAME, this, false); - this.prefs.addObserver(DISABLE_THRESHOLD_PREF_NAME, this, false); - this.prefs.addObserver(CACHE_EXPIRATION_TIME_PREF_NAME, this, false); - - this.cacheLifespan = this.prefs.getIntPref(CACHE_EXPIRATION_TIME_PREF_NAME); - - this.maxpreviews = this.prefs.getIntPref(DISABLE_THRESHOLD_PREF_NAME); - + this.prefs.addObserver(TOGGLE_PREF_NAME, this, true); this.enabled = this._prefenabled = this.prefs.getBoolPref(TOGGLE_PREF_NAME); + this.initialized = true; }, destroy: function destroy() { this._enabled = false; - this.prefs.removeObserver(TOGGLE_PREF_NAME, this); - this.prefs.removeObserver(DISABLE_THRESHOLD_PREF_NAME, this); - this.prefs.removeObserver(CACHE_EXPIRATION_TIME_PREF_NAME, this); - if (this.cacheTimer) this.cacheTimer.cancel(); }, @@ -646,6 +696,61 @@ this.AeroPeek = { }); }, + get _prefenabled() { + return this.__prefenabled; + }, + + set _prefenabled(enable) { + if (enable == this.__prefenabled) { + return; + } + this.__prefenabled = enable; + + if (enable) { + this.enable(); + } else { + this.disable(); + } + }, + + _observersAdded: false, + + enable() { + if (!this._observersAdded) { + this.prefs.addObserver(DISABLE_THRESHOLD_PREF_NAME, this, true); + this.prefs.addObserver(CACHE_EXPIRATION_TIME_PREF_NAME, this, true); + PlacesUtils.history.addObserver(this, true); + this._observersAdded = true; + } + + this.cacheLifespan = this.prefs.getIntPref(CACHE_EXPIRATION_TIME_PREF_NAME); + + this.maxpreviews = this.prefs.getIntPref(DISABLE_THRESHOLD_PREF_NAME); + + // If the user toggled us on/off while the browser was already up + // (rather than this code running on startup because the pref was + // already set to true), we must initialize previews for open windows: + if (this.initialized) { + let browserWindows = Services.wm.getEnumerator("navigator:browser"); + while (browserWindows.hasMoreElements()) { + let win = browserWindows.getNext(); + if (!win.closed) { + this.onOpenWindow(win); + } + } + } + }, + + disable() { + while (this.windows.length) { + // We can't call onCloseWindow here because it'll bail if we're not + // enabled. + let tabWinObject = this.windows[0]; + tabWinObject.destroy(); // This will remove us from the array. + delete tabWinObject.win.gTaskbarTabGroup; // Tidy up the window. + } + }, + addPreview: function (preview) { this.previews.push(preview); this.checkPreviewCount(); @@ -658,15 +763,15 @@ this.AeroPeek = { }, checkPreviewCount: function () { - if (this.previews.length > this.maxpreviews) - this.enabled = false; - else - this.enabled = this._prefenabled; + if (!this._prefenabled) { + return; + } + this.enabled = this.previews.length <= this.maxpreviews; }, onOpenWindow: function (win) { // This occurs when the taskbar service is not available (xp, vista) - if (!this.available) + if (!this.available || !this._prefenabled) return; win.gTaskbarTabGroup = new TabWindow(win); @@ -674,7 +779,7 @@ this.AeroPeek = { onCloseWindow: function (win) { // This occurs when the taskbar service is not available (xp, vista) - if (!this.available) + if (!this.available || !this._prefenabled) return; win.gTaskbarTabGroup.destroy(); @@ -689,16 +794,20 @@ this.AeroPeek = { this.cacheTimer.init(this, 1000*this.cacheLifespan, Ci.nsITimer.TYPE_ONE_SHOT); }, - //// nsIObserver + // nsIObserver observe: function (aSubject, aTopic, aData) { + if (aTopic == "nsPref:changed" && aData == TOGGLE_PREF_NAME) { + this._prefenabled = this.prefs.getBoolPref(TOGGLE_PREF_NAME); + } + if (!this._prefenabled) { + return; + } switch (aTopic) { case "nsPref:changed": if (aData == CACHE_EXPIRATION_TIME_PREF_NAME) break; - if (aData == TOGGLE_PREF_NAME) - this._prefenabled = this.prefs.getBoolPref(TOGGLE_PREF_NAME); - else if (aData == DISABLE_THRESHOLD_PREF_NAME) + if (aData == DISABLE_THRESHOLD_PREF_NAME) this.maxpreviews = this.prefs.getIntPref(DISABLE_THRESHOLD_PREF_NAME); // Might need to enable/disable ourselves this.checkPreviewCount(); @@ -710,10 +819,38 @@ this.AeroPeek = { }); break; } - } + }, + + /* nsINavHistoryObserver implementation */ + onBeginUpdateBatch() {}, + onEndUpdateBatch() {}, + onVisit() {}, + onTitleChanged() {}, + onFrecencyChanged() {}, + onManyFrecenciesChanged() {}, + onDeleteURI() {}, + onClearHistory() {}, + onDeleteVisits() {}, + onPageChanged(uri, changedConst, newValue) { + if (this.enabled && changedConst == Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON) { + for (let win of this.windows) { + for (let [tab, ] of win.previews) { + if (tab.getAttribute("image") == newValue) { + win.onLinkIconAvailable(tab.linkedBrowser, newValue); + } + } + } + } + }, + + QueryInterface: XPCOMUtils.generateQI([ + Ci.nsISupportsWeakReference, + Ci.nsINavHistoryObserver, + Ci.nsIObserver + ]), }; -XPCOMUtils.defineLazyGetter(AeroPeek, "cacheTimer", function () +XPCOMUtils.defineLazyGetter(AeroPeek, "cacheTimer", () => Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer) ); diff --git a/application/palemoon/modules/moz.build b/application/palemoon/modules/moz.build index 8032930b2..12a3ece2e 100644 --- a/application/palemoon/modules/moz.build +++ b/application/palemoon/modules/moz.build @@ -4,7 +4,6 @@ # 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/. - EXTRA_JS_MODULES += [ 'AutoCompletePopup.jsm', 'BrowserNewTabPreloader.jsm', @@ -38,5 +37,6 @@ EXTRA_PP_JS_MODULES += [ # Pass down 'official build' flags if CONFIG['MC_OFFICIAL']: DEFINES['MC_OFFICIAL'] = 1 + if CONFIG['MOZILLA_OFFICIAL']: DEFINES['MOZILLA_OFFICIAL'] = 1 diff --git a/application/palemoon/moz.build b/application/palemoon/moz.build index 2b9d8f09b..72e37673c 100644 --- a/application/palemoon/moz.build +++ b/application/palemoon/moz.build @@ -15,9 +15,7 @@ DIRS += [ 'themes', ] -DIRS += [ - 'app', -] +DIRS += ['app'] if CONFIG['MAKENSISU']: DIRS += ['installer/windows'] diff --git a/application/palemoon/moz.configure b/application/palemoon/moz.configure index 72236254f..de9b10b16 100644 --- a/application/palemoon/moz.configure +++ b/application/palemoon/moz.configure @@ -5,3 +5,5 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. include('../../toolkit/moz.configure') + + diff --git a/application/palemoon/themes/linux/browser.css b/application/palemoon/themes/linux/browser.css index 987406264..4933b4069 100644 --- a/application/palemoon/themes/linux/browser.css +++ b/application/palemoon/themes/linux/browser.css @@ -1570,12 +1570,6 @@ 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; @@ -1613,6 +1607,17 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- background-image: linear-gradient(to top, rgba(0,0,0,.3) 1px, rgba(0,0,0,.05) 1px, transparent 50%); } +/* When the tab bar is collapsed, show a 1px border in its place. */ +#TabsToolbar[tabsontop="false"][collapsed="true"]:not([customizing="true"]) { + visibility: visible; + height: 1px; + border-bottom-width: 1px; + /* !important here to override border-style: none on the toolbar */ + border-bottom-style: solid !important; + border-bottom-color: ThreeDShadow; + overflow: hidden; +} + .tabbrowser-tab, .tabs-newtab-button { position: static; @@ -1764,6 +1769,90 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- -moz-margin-end: -1px; } +/* Tab sound indicator */ +.tab-icon-sound { + -moz-margin-start: 4px; + width: 16px; + height: 16px; + padding: 0; +} + +.allTabs-endimage[soundplaying], +.tab-icon-sound[soundplaying] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio"); +} + +.allTabs-endimage[muted], +.tab-icon-sound[muted] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted"); +} + +.allTabs-endimage[blocked], +.tab-icon-sound[blocked] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-blocked"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-sound[soundplaying], +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-sound[blocked], +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-sound[muted] { + filter: invert(1); +} + +.tab-icon-sound[soundplaying-scheduledremoval]:not([muted]):not(:hover), +.tab-icon-overlay[soundplaying-scheduledremoval]:not([muted]):not(:hover) { + transition: opacity .3s linear var(--soundplaying-removal-delay); + opacity: 0; +} + +/* Tab icon overlay */ +.tab-icon-overlay { + width: 16px; + height: 16px; + margin-top: -8px; + margin-inline-start: -15px; + margin-inline-end: -1px; + position: relative; +} + +.tab-icon-overlay[soundplaying], +.tab-icon-overlay[muted]:not([crashed]), +.tab-icon-overlay[blocked]:not([crashed]) { + border-radius: 10px; +} + +.tab-icon-overlay[soundplaying]:hover, +.tab-icon-overlay[muted]:not([crashed]):hover, +.tab-icon-overlay[blocked]:not([crashed]):hover { + background-color: white; +} + +.tab-icon-overlay[soundplaying] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio"); +} + +.tab-icon-overlay[muted] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-muted"); +} + +.tab-icon-overlay[blocked] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-blocked"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-overlay[soundplaying]:not([selected]):not(:hover), +.tab-icon-overlay[soundplaying][selected]:-moz-lwtheme-brighttext:not(:hover) { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-overlay[muted]:not([crashed]):not([selected]):not(:hover), +.tab-icon-overlay[muted][selected]:-moz-lwtheme-brighttext:not(:hover) { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white-muted"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-overlay[blocked]:not([crashed]):not([selected]):not(:hover), +.tab-icon-overlay[blocked][selected]:-moz-lwtheme-brighttext:not(:hover) { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white-blocked"); +} + /* Tabstrip new tab button */ .tabs-newtab-button, #TabsToolbar > #new-tab-button , diff --git a/application/palemoon/themes/linux/communicator/jar.mn b/application/palemoon/themes/linux/communicator/jar.mn index dfd20c523..612d13335 100644 --- a/application/palemoon/themes/linux/communicator/jar.mn +++ b/application/palemoon/themes/linux/communicator/jar.mn @@ -4,4 +4,4 @@ browser.jar: % skin communicator classic/1.0 %skin/classic/communicator/ - skin/classic/communicator/communicator.css + skin/classic/communicator/communicator.css diff --git a/application/palemoon/themes/linux/jar.mn b/application/palemoon/themes/linux/jar.mn index 8b2e9dc77..a7c426bce 100644 --- a/application/palemoon/themes/linux/jar.mn +++ b/application/palemoon/themes/linux/jar.mn @@ -59,70 +59,70 @@ browser.jar: skin/classic/browser/webRTC-shareDevice-64.png skin/classic/browser/webRTC-sharingDevice-16.png #endif - skin/classic/browser/downloads/buttons.png (downloads/buttons.png) - skin/classic/browser/downloads/download-glow.png (downloads/download-glow.png) - skin/classic/browser/downloads/download-glow-small.png (downloads/download-glow-small.png) - skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) - skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) - skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) - skin/classic/browser/downloads/downloads.css (downloads/downloads.css) - skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) - skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) - skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) - 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 (../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) -* skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) - skin/classic/browser/places/livemark-item.png (places/livemark-item.png) - skin/classic/browser/places/pageStarred.png (places/pageStarred.png) - skin/classic/browser/places/star-icons.png (places/star-icons.png) - skin/classic/browser/places/starred48.png (places/starred48.png) - skin/classic/browser/places/unstarred48.png (places/unstarred48.png) - skin/classic/browser/places/places.css (places/places.css) - skin/classic/browser/places/organizer.css (places/organizer.css) - skin/classic/browser/places/organizer.xml (places/organizer.xml) - skin/classic/browser/places/query.png (places/query.png) - skin/classic/browser/places/starPage.png (places/starPage.png) - skin/classic/browser/places/tag.png (places/tag.png) - 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) + skin/classic/browser/downloads/buttons.png (downloads/buttons.png) + skin/classic/browser/downloads/download-glow.png (downloads/download-glow.png) + skin/classic/browser/downloads/download-glow-small.png (downloads/download-glow-small.png) + skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) + skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) + skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) + skin/classic/browser/downloads/downloads.css (downloads/downloads.css) + skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) + skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) + skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) + 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 (../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) +* skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) + skin/classic/browser/places/livemark-item.png (places/livemark-item.png) + skin/classic/browser/places/pageStarred.png (places/pageStarred.png) + skin/classic/browser/places/star-icons.png (places/star-icons.png) + skin/classic/browser/places/starred48.png (places/starred48.png) + skin/classic/browser/places/unstarred48.png (places/unstarred48.png) + skin/classic/browser/places/places.css (places/places.css) + skin/classic/browser/places/organizer.css (places/organizer.css) + skin/classic/browser/places/organizer.xml (places/organizer.xml) + skin/classic/browser/places/query.png (places/query.png) + skin/classic/browser/places/starPage.png (places/starPage.png) + skin/classic/browser/places/tag.png (places/tag.png) + 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) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) + skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) #endif -* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) - skin/classic/browser/preferences/applications.css (preferences/applications.css) -#ifdef MOZ_BROWSER_STATUSBAR - skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) -* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) -* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) - skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) - skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) - skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) - skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) - skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) -#endif - skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) - skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) - skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) - skin/classic/browser/tabbrowser/tab.png (tabbrowser/tab.png) - skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) - skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) +* skin/classic/browser/preferences/preferences.css (preferences/preferences.css) + skin/classic/browser/preferences/applications.css (preferences/applications.css) + skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) +* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) +* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) + skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) + skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) + skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) + skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) + skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) + skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) + skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) + skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) + skin/classic/browser/tabbrowser/tab.png (tabbrowser/tab.png) + skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) + skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) + skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg) + skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg) #ifdef MOZ_SERVICES_SYNC skin/classic/browser/sync-16-throbber.png skin/classic/browser/sync-16.png @@ -137,6 +137,6 @@ browser.jar: skin/classic/browser/syncQuota.css skin/classic/browser/syncProgress.css #endif - skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) - skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) - skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) + skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) + skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) + skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) diff --git a/application/palemoon/themes/moz.build b/application/palemoon/themes/moz.build index d82bda3ef..5040c10c1 100644 --- a/application/palemoon/themes/moz.build +++ b/application/palemoon/themes/moz.build @@ -12,4 +12,3 @@ elif toolkit in ('gtk2', 'gtk3', 'qt'): DIRS += ['linux'] else: DIRS += ['windows'] - diff --git a/application/palemoon/themes/osx/browser.css b/application/palemoon/themes/osx/browser.css index 97073b161..20e453d11 100644 --- a/application/palemoon/themes/osx/browser.css +++ b/application/palemoon/themes/osx/browser.css @@ -1601,12 +1601,6 @@ 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 { @@ -1636,6 +1630,17 @@ richlistitem[type~="action"][actiontype="switchtab"][selected="true"] > .ac-url- background-image: linear-gradient(to top, @toolbarShadowColor@ 1px, rgba(0,0,0,.05) 1px, transparent 50%); } +/* When the tab bar is collapsed, show a 1px border in its place. */ +#TabsToolbar[tabsontop="false"][collapsed="true"]:not([customizing="true"]) { + visibility: visible; + height: 1px; + border-bottom-width: 1px; + /* !important here to override border-style: none on the toolbar */ + border-bottom-style: solid !important; + border-bottom-color: ThreeDShadow; + overflow: hidden; +} + @media (-moz-mac-lion-theme) { #main-window[sizemode=normal] #TabsToolbar { padding-left: 2px; @@ -1827,6 +1832,90 @@ richlistitem[type~="action"][actiontype="switchtab"][selected="true"] > .ac-url- } } +/* Tab sound indicator */ +.tab-icon-sound { + -moz-margin-start: 4px; + width: 16px; + height: 16px; + padding: 0; +} + +.allTabs-endimage[soundplaying], +.tab-icon-sound[soundplaying] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio"); +} + +.allTabs-endimage[muted], +.tab-icon-sound[muted] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted"); +} + +.allTabs-endimage[blocked], +.tab-icon-sound[blocked] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-blocked"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-sound[soundplaying], +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-sound[blocked], +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-sound[muted] { + filter: invert(1); +} + +.tab-icon-sound[soundplaying-scheduledremoval]:not([muted]):not(:hover), +.tab-icon-overlay[soundplaying-scheduledremoval]:not([muted]):not(:hover) { + transition: opacity .3s linear var(--soundplaying-removal-delay); + opacity: 0; +} + +/* Tab icon overlay */ +.tab-icon-overlay { + width: 16px; + height: 16px; + margin-top: -8px; + margin-inline-start: -15px; + margin-inline-end: -1px; + position: relative; +} + +.tab-icon-overlay[soundplaying], +.tab-icon-overlay[muted]:not([crashed]), +.tab-icon-overlay[blocked]:not([crashed]) { + border-radius: 10px; +} + +.tab-icon-overlay[soundplaying]:hover, +.tab-icon-overlay[muted]:not([crashed]):hover, +.tab-icon-overlay[blocked]:not([crashed]):hover { + background-color: white; +} + +.tab-icon-overlay[soundplaying] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio"); +} + +.tab-icon-overlay[muted] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-muted"); +} + +.tab-icon-overlay[blocked] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-blocked"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-overlay[soundplaying]:not([selected]):not(:hover), +.tab-icon-overlay[soundplaying][selected]:-moz-lwtheme-brighttext:not(:hover) { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-overlay[muted]:not([crashed]):not([selected]):not(:hover), +.tab-icon-overlay[muted][selected]:-moz-lwtheme-brighttext:not(:hover) { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white-muted"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-overlay[blocked]:not([crashed]):not([selected]):not(:hover), +.tab-icon-overlay[blocked][selected]:-moz-lwtheme-brighttext:not(:hover) { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white-blocked"); +} + /* Tab scrollbox arrow, tabstrip new tab and all-tabs buttons */ .tabbrowser-arrowscrollbox > .scrollbutton-up, diff --git a/application/palemoon/themes/osx/communicator/jar.mn b/application/palemoon/themes/osx/communicator/jar.mn index dfd20c523..612d13335 100644 --- a/application/palemoon/themes/osx/communicator/jar.mn +++ b/application/palemoon/themes/osx/communicator/jar.mn @@ -4,4 +4,4 @@ browser.jar: % skin communicator classic/1.0 %skin/classic/communicator/ - skin/classic/communicator/communicator.css + skin/classic/communicator/communicator.css diff --git a/application/palemoon/themes/osx/jar.mn b/application/palemoon/themes/osx/jar.mn index 3df9496e8..67339c7cc 100644 --- a/application/palemoon/themes/osx/jar.mn +++ b/application/palemoon/themes/osx/jar.mn @@ -4,174 +4,178 @@ browser.jar: % skin browser classic/1.0 %skin/classic/browser/ - skin/classic/browser/sanitizeDialog.css -* skin/classic/browser/aboutPrivateBrowsing.css -* skin/classic/browser/aboutSessionRestore.css - skin/classic/browser/aboutSessionRestore-window-icon.png (preferences/application.png) - skin/classic/browser/aboutCertError.css - skin/classic/browser/aboutCertError_sectionCollapsed.png - skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png - skin/classic/browser/aboutCertError_sectionExpanded.png + skin/classic/browser/sanitizeDialog.css +* skin/classic/browser/aboutPrivateBrowsing.css +* skin/classic/browser/aboutSessionRestore.css + skin/classic/browser/aboutSessionRestore-window-icon.png (preferences/application.png) + skin/classic/browser/aboutCertError.css + skin/classic/browser/aboutCertError_sectionCollapsed.png + skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png + skin/classic/browser/aboutCertError_sectionExpanded.png #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/aboutSyncTabs.css + skin/classic/browser/aboutSyncTabs.css #endif -* skin/classic/browser/autocomplete.css - skin/classic/browser/actionicon-tab.png - skin/classic/browser/appmenu-icons.png - skin/classic/browser/appmenu-dropmarker.png -* skin/classic/browser/browser.css - skin/classic/browser/click-to-play-warning-stripes.png -* skin/classic/browser/engineManager.css - skin/classic/browser/Geolocation-16.png - skin/classic/browser/Geolocation-64.png - skin/classic/browser/Info.png - skin/classic/browser/identity.png - skin/classic/browser/imagedocument.png - skin/classic/browser/identity-icons-generic.png - skin/classic/browser/identity-icons-https.png - skin/classic/browser/identity-icons-https-ev.png - skin/classic/browser/identity-icons-https-mixed-active.png - skin/classic/browser/keyhole-forward-mask.svg - skin/classic/browser/KUI-background.png - skin/classic/browser/KUI-close.png - skin/classic/browser/livemark-folder.png - skin/classic/browser/menu-back.png - skin/classic/browser/menu-forward.png - skin/classic/browser/mixed-content-blocked-16.png - skin/classic/browser/mixed-content-blocked-64.png - skin/classic/browser/monitor.png - skin/classic/browser/monitor_16-10.png +* skin/classic/browser/autocomplete.css + skin/classic/browser/actionicon-tab.png + skin/classic/browser/appmenu-icons.png + skin/classic/browser/appmenu-dropmarker.png +* skin/classic/browser/browser.css + skin/classic/browser/click-to-play-warning-stripes.png +* skin/classic/browser/engineManager.css + skin/classic/browser/Geolocation-16.png + skin/classic/browser/Geolocation-64.png + skin/classic/browser/Info.png + skin/classic/browser/identity.png + skin/classic/browser/imagedocument.png + skin/classic/browser/identity-icons-generic.png + skin/classic/browser/identity-icons-https.png + skin/classic/browser/identity-icons-https-ev.png + skin/classic/browser/identity-icons-https-mixed-active.png + skin/classic/browser/keyhole-forward-mask.svg + skin/classic/browser/KUI-background.png + skin/classic/browser/KUI-close.png + skin/classic/browser/livemark-folder.png + skin/classic/browser/menu-back.png + skin/classic/browser/menu-forward.png + skin/classic/browser/mixed-content-blocked-16.png + skin/classic/browser/mixed-content-blocked-64.png + skin/classic/browser/monitor.png + skin/classic/browser/monitor_16-10.png skin/classic/browser/panel-expander-closed.png skin/classic/browser/panel-expander-closed@2x.png skin/classic/browser/panel-expander-open.png skin/classic/browser/panel-expander-open@2x.png skin/classic/browser/panel-plus-sign.png - skin/classic/browser/pageInfo.css - skin/classic/browser/pageInfo.png - skin/classic/browser/page-livemarks.png - skin/classic/browser/page-livemarks@2x.png - skin/classic/browser/pointerLock-16.png - skin/classic/browser/pointerLock-64.png - skin/classic/browser/Privacy-16.png - skin/classic/browser/Privacy-32.png - skin/classic/browser/Privacy-48.png + skin/classic/browser/pageInfo.css + skin/classic/browser/pageInfo.png + skin/classic/browser/page-livemarks.png + skin/classic/browser/page-livemarks@2x.png + skin/classic/browser/pointerLock-16.png + skin/classic/browser/pointerLock-64.png + 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 - skin/classic/browser/Search-glass.png - skin/classic/browser/searchbar.css - skin/classic/browser/searchbar-dropdown-arrow.png - skin/classic/browser/Secure24.png - skin/classic/browser/setDesktopBackground.css - skin/classic/browser/slowStartup-16.png - skin/classic/browser/Toolbar.png - skin/classic/browser/Toolbar-inverted.png - skin/classic/browser/toolbarbutton-dropdown-arrow.png - skin/classic/browser/toolbarbutton-dropdown-arrow-inverted.png - skin/classic/browser/urlbar-arrow.png - skin/classic/browser/urlbar-popup-blocked.png - skin/classic/browser/urlbar-history-dropmarker.png - skin/classic/browser/web-notifications-icon.svg - skin/classic/browser/web-notifications-tray.svg - skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) - skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) - skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) + skin/classic/browser/privatebrowsing-light.png + skin/classic/browser/privatebrowsing-dark.png + skin/classic/browser/reload-stop-go.png + skin/classic/browser/Search-glass.png + skin/classic/browser/searchbar.css + skin/classic/browser/searchbar-dropdown-arrow.png + skin/classic/browser/Secure24.png + skin/classic/browser/setDesktopBackground.css + skin/classic/browser/slowStartup-16.png + skin/classic/browser/Toolbar.png + skin/classic/browser/Toolbar-inverted.png + skin/classic/browser/toolbarbutton-dropdown-arrow.png + skin/classic/browser/toolbarbutton-dropdown-arrow-inverted.png + skin/classic/browser/urlbar-arrow.png + skin/classic/browser/urlbar-popup-blocked.png + skin/classic/browser/urlbar-history-dropmarker.png + skin/classic/browser/web-notifications-icon.svg + skin/classic/browser/web-notifications-tray.svg + skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) + skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) + skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) #ifdef MOZ_WEBRTC - skin/classic/browser/webRTC-shareDevice-16.png - skin/classic/browser/webRTC-shareDevice-64.png - skin/classic/browser/webRTC-sharingDevice-16.png + skin/classic/browser/webRTC-shareDevice-16.png + skin/classic/browser/webRTC-shareDevice-64.png + skin/classic/browser/webRTC-sharingDevice-16.png #endif - skin/classic/browser/downloads/buttons.png (downloads/buttons.png) - skin/classic/browser/downloads/download-glow.png (downloads/download-glow.png) - skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) - skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) - skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) -* skin/classic/browser/downloads/downloads.css (downloads/downloads.css) -* skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) - skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) - skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/feed-icons-16.png (feeds/feed-icons-16.png) - skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) - 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 (../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) - skin/classic/browser/places/bookmark.png (places/bookmark.png) - skin/classic/browser/places/query.png (places/query.png) - skin/classic/browser/places/query@2x.png (places/query@2x.png) - skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) - skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) - skin/classic/browser/places/bookmarksToolbar@2x.png (places/bookmarksToolbar@2x.png) - skin/classic/browser/places/calendar.png (places/calendar.png) - skin/classic/browser/places/folderDropArrow.png (places/folderDropArrow.png) - skin/classic/browser/places/folderDropArrow@2x.png (places/folderDropArrow@2x.png) - skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) - skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) - skin/classic/browser/places/libraryToolbar.png (places/libraryToolbar.png) - skin/classic/browser/places/starred48.png (places/starred48.png) - skin/classic/browser/places/unstarred48.png (places/unstarred48.png) - skin/classic/browser/places/tag.png (places/tag.png) - skin/classic/browser/places/tag@2x.png (places/tag@2x.png) - skin/classic/browser/places/history.png (places/history.png) - skin/classic/browser/places/history@2x.png (places/history@2x.png) - skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png) - 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/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) - skin/classic/browser/preferences/Options.png (preferences/Options.png) + skin/classic/browser/downloads/buttons.png (downloads/buttons.png) + skin/classic/browser/downloads/download-glow.png (downloads/download-glow.png) + skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) + skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) + skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) +* skin/classic/browser/downloads/downloads.css (downloads/downloads.css) +* skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) + skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) + skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/feed-icons-16.png (feeds/feed-icons-16.png) + skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) + 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 (../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) + skin/classic/browser/places/bookmark.png (places/bookmark.png) + skin/classic/browser/places/query.png (places/query.png) + skin/classic/browser/places/query@2x.png (places/query@2x.png) + skin/classic/browser/places/bookmarksMenu.png (places/bookmarksMenu.png) + skin/classic/browser/places/bookmarksToolbar.png (places/bookmarksToolbar.png) + skin/classic/browser/places/bookmarksToolbar@2x.png (places/bookmarksToolbar@2x.png) + skin/classic/browser/places/calendar.png (places/calendar.png) + skin/classic/browser/places/folderDropArrow.png (places/folderDropArrow.png) + skin/classic/browser/places/folderDropArrow@2x.png (places/folderDropArrow@2x.png) + skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) + skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) + skin/classic/browser/places/libraryToolbar.png (places/libraryToolbar.png) + skin/classic/browser/places/starred48.png (places/starred48.png) + skin/classic/browser/places/unstarred48.png (places/unstarred48.png) + skin/classic/browser/places/unfiledBookmarks.png (places/unfiledBookmarks.png) + skin/classic/browser/places/unfiledBookmarks@2x.png (places/unfiledBookmarks@2x.png) + skin/classic/browser/places/tag.png (places/tag.png) + skin/classic/browser/places/tag@2x.png (places/tag@2x.png) + skin/classic/browser/places/history.png (places/history.png) + skin/classic/browser/places/history@2x.png (places/history@2x.png) + skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png) + skin/classic/browser/places/unsortedBookmarks.png (places/unsortedBookmarks.png) + skin/classic/browser/places/downloads.png (places/downloads.png) + skin/classic/browser/places/expander-closed-active.png (places/expander-closed-active.png) + skin/classic/browser/places/expander-open-active.png (places/expander-open-active.png) + 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) + skin/classic/browser/preferences/Options.png (preferences/Options.png) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) + skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) #endif - 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) -#ifdef MOZ_BROWSER_STATUSBAR - skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) -* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) -* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) - skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) - skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) - skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) - skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) - skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) -#endif - skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) - skin/classic/browser/tabbrowser/alltabs-inverted.png (tabbrowser/alltabs-inverted.png) - skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) - skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png) - skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) - skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) - skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) - skin/classic/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png) - skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) - skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) + 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/statusbar/dynamic.css (../shared/statusbar/dynamic.css) +* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) +* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) + skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) + skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) + skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) + skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) + skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) + skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) + skin/classic/browser/tabbrowser/alltabs-inverted.png (tabbrowser/alltabs-inverted.png) + skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) + skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png) + skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) + skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) + skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) + skin/classic/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png) + skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) + skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) + skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg) + skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/sync-throbber.png - skin/classic/browser/sync-16.png - skin/classic/browser/sync-32.png - skin/classic/browser/sync-128.png - skin/classic/browser/sync-bg.png - skin/classic/browser/sync-desktopIcon.png - skin/classic/browser/sync-mobileIcon.png - skin/classic/browser/syncSetup.css - skin/classic/browser/syncCommon.css - skin/classic/browser/syncQuota.css - skin/classic/browser/syncProgress.css + skin/classic/browser/sync-throbber.png + skin/classic/browser/sync-16.png + skin/classic/browser/sync-32.png + skin/classic/browser/sync-128.png + skin/classic/browser/sync-bg.png + skin/classic/browser/sync-desktopIcon.png + skin/classic/browser/sync-mobileIcon.png + skin/classic/browser/syncSetup.css + skin/classic/browser/syncCommon.css + skin/classic/browser/syncQuota.css + skin/classic/browser/syncProgress.css #endif diff --git a/application/palemoon/themes/osx/places/editBookmarkOverlay.css b/application/palemoon/themes/osx/places/editBookmarkOverlay.css index 3becb5069..cc749c115 100644 --- a/application/palemoon/themes/osx/places/editBookmarkOverlay.css +++ b/application/palemoon/themes/osx/places/editBookmarkOverlay.css @@ -2,8 +2,12 @@ * 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/. */ +@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); + /**** folder menulist ****/ -.folder-icon > .menulist-label-box > .menulist-icon { +.folder-icon > .menulist-label-box > .menulist-icon, +.folder-icon > .menu-iconic-left > .menu-iconic-icon { width: 16px; height: 16px; } @@ -16,27 +20,41 @@ list-style-image: url("chrome://global/skin/tree/folder.png") !important; } +@media (min-resolution: 2dppx) { + .folder-icon { + list-style-image: url("chrome://global/skin/tree/folder@2x.png") !important; + } +} + +.menulist-icon { + margin: 0 !important; +} /**** expanders ****/ .expander-up, .expander-down { - min-width: 0; + -moz-appearance: none; margin: 0; - -moz-margin-end: 4px; -} - -.expander-up > .button-box, -.expander-down > .button-box { + margin-left: 8px; padding: 0; + min-width: 0; } .expander-up { - list-style-image: url("chrome://global/skin/icons/collapse.png"); + list-style-image: url("chrome://browser/skin/places/expander-open.png"); } .expander-down { - list-style-image: url("chrome://global/skin/icons/expand.png"); + list-style-image: url("chrome://browser/skin/places/expander-closed.png"); +} + +.expander-down:hover:active { + list-style-image: url("chrome://browser/skin/places/expander-closed-active.png"); +} + +.expander-up:hover:active { + list-style-image: url("chrome://browser/skin/places/expander-open-active.png"); } #editBookmarkPanelContent { @@ -44,8 +62,7 @@ } #editBMPanel_folderTree { - margin-top: 2px; - margin-bottom: 2px; + margin: 6px 4px 0 4px; } /* Hide the value column of the tag autocomplete popup @@ -58,22 +75,31 @@ } -/* ::::: bookmark panel dropdown icons ::::: */ +/* ----- BOOKMARK PANEL DROPDOWN MENU ITEMS ----- */ #editBMPanel_folderMenuList[selectedIndex="0"], #editBMPanel_toolbarFolderItem { - list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.png") !important; - -moz-image-region: auto !important; + list-style-image: url("chrome://browser/skin/places/bookmarksToolbar.png") !important; } #editBMPanel_folderMenuList[selectedIndex="1"], #editBMPanel_bmRootItem { - list-style-image: url("chrome://browser/skin/places/bookmarksMenu.png") !important; - -moz-image-region: auto !important; + list-style-image: url("chrome://browser/skin/places/bookmarksMenu.png") !important; } #editBMPanel_folderMenuList[selectedIndex="2"], #editBMPanel_unfiledRootItem { - list-style-image: url("chrome://browser/skin/places/unsortedBookmarks.png") !important; - -moz-image-region: auto !important; + list-style-image: url("chrome://browser/skin/places/unfiledBookmarks.png") !important; +} + +@media (min-resolution: 2dppx) { + #editBMPanel_folderMenuList[selectedIndex="0"], + #editBMPanel_toolbarFolderItem { + list-style-image: url("chrome://browser/skin/places/bookmarksToolbar@2x.png") !important; + } + + #editBMPanel_folderMenuList[selectedIndex="2"], + #editBMPanel_unfiledRootItem { + list-style-image: url("chrome://browser/skin/places/unfiledBookmarks@2x.png") !important; + } } diff --git a/application/palemoon/themes/osx/places/expander-closed-active.png b/application/palemoon/themes/osx/places/expander-closed-active.png Binary files differnew file mode 100644 index 000000000..7ef5f04f9 --- /dev/null +++ b/application/palemoon/themes/osx/places/expander-closed-active.png diff --git a/application/palemoon/themes/osx/places/expander-open-active.png b/application/palemoon/themes/osx/places/expander-open-active.png Binary files differnew file mode 100644 index 000000000..673ead568 --- /dev/null +++ b/application/palemoon/themes/osx/places/expander-open-active.png diff --git a/application/palemoon/themes/osx/places/unfiledBookmarks.png b/application/palemoon/themes/osx/places/unfiledBookmarks.png Binary files differnew file mode 100644 index 000000000..69495dac0 --- /dev/null +++ b/application/palemoon/themes/osx/places/unfiledBookmarks.png diff --git a/application/palemoon/themes/osx/places/unfiledBookmarks@2x.png b/application/palemoon/themes/osx/places/unfiledBookmarks@2x.png Binary files differnew file mode 100644 index 000000000..44efd6aba --- /dev/null +++ b/application/palemoon/themes/osx/places/unfiledBookmarks@2x.png diff --git a/application/palemoon/themes/shared/tabbrowser/tab-audio-small.svg b/application/palemoon/themes/shared/tabbrowser/tab-audio-small.svg new file mode 100644 index 000000000..abfe71268 --- /dev/null +++ b/application/palemoon/themes/shared/tabbrowser/tab-audio-small.svg @@ -0,0 +1,58 @@ +<?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/. --> +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16"> + <style> + .icon:not(:target) { + display: none; + } + + .icon { + fill: #262626; + } + .icon > .outline { + fill: #fff; + } + + .icon.white { + fill: #fff; + } + .icon.white > .outline { + fill: #000; + fill-opacity: .5; + } + </style> + + <g id="tab-audio" class="icon"> + <path class="outline" d="M12.4,3.6l-1-0.6l-0.9,2.5H10V1.8c0-0.4-0.5-0.7-0.9-0.4L5.6,5H4C2.9,5,2,5.9,2,7v2c0,1.1,0.9,2,2,2h1.6l3.6,3.6 c0.3,0.3,0.9,0.1,0.9-0.4v-3.7h0.5l0.9,2.5l1-0.6C14,11.5,15,9.8,15,8S14,4.5,12.4,3.6z M9,13l-3-3H4c-0.6,0-1-0.4-1-1V7 c0-0.6,0.4-1,1-1h2l3-3V13z M10,9.5v-3c0.8,0,1.5,0.7,1.5,1.5S10.8,9.5,10,9.5z M11.9,11.5l-0.4-0.9C12.4,10,13,9.1,13,8 s-0.6-2-1.4-2.5l0.3-1C13.2,5.2,14,6.5,14,8S13.2,10.8,11.9,11.5z"/> + <path d="M4,6C3.4,6,3,6.4,3,7v2c0,0.6,0.4,1,1,1h2l3,3V3L6,6H4z M10,6.5v3c0.8,0,1.5-0.7,1.5-1.5S10.8,6.5,10,6.5z M11.9,4.5 l-0.4,0.9C12.4,6,13,6.9,13,8s-0.6,2-1.4,2.5l0.4,0.9c1.2-0.7,2.1-2,2.1-3.5S13.2,5.2,11.9,4.5z"/> + </g> + <g id="tab-audio-muted" class="icon"> + <path class="outline" d="M5.6,5H4C2.9,5,2,5.9,2,7v2c0,0.7,0.3,1.3,0.9,1.7l-1.8,1.8l2.5,2.5l3-3l2.6,2.6c0.3,0.3,0.9,0.1,0.9-0.4V8.5l3.9-3.9 l-2.5-2.5L10,3.5V1.8c0-0.4-0.5-0.7-0.9-0.4L5.6,5z"/> + <path d="M11.5,3.5L9,5.9V3L6,6H4C3.4,6,3,6.4,3,7v2c0,0.6,0.4,1,1,1h0.9l-2.5,2.5l1.1,1.1l9-9L11.5,3.5z M9,13V9.7l-1.7,1.7L9,13z"/> + </g> + + <g id="tab-audio-white" class="icon white"> + <path class="outline" d="M12.4,3.6l-1-0.6l-0.9,2.5H10V1.8c0-0.4-0.5-0.7-0.9-0.4L5.6,5H4C2.9,5,2,5.9,2,7v2c0,1.1,0.9,2,2,2h1.6l3.6,3.6 c0.3,0.3,0.9,0.1,0.9-0.4v-3.7h0.5l0.9,2.5l1-0.6C14,11.5,15,9.8,15,8S14,4.5,12.4,3.6z M9,13l-3-3H4c-0.6,0-1-0.4-1-1V7 c0-0.6,0.4-1,1-1h2l3-3V13z M10,9.5v-3c0.8,0,1.5,0.7,1.5,1.5S10.8,9.5,10,9.5z M11.9,11.5l-0.4-0.9C12.4,10,13,9.1,13,8 s-0.6-2-1.4-2.5l0.3-1C13.2,5.2,14,6.5,14,8S13.2,10.8,11.9,11.5z"/> + <path d="M4,6C3.4,6,3,6.4,3,7v2c0,0.6,0.4,1,1,1h2l3,3V3L6,6H4z M10,6.5v3c0.8,0,1.5-0.7,1.5-1.5S10.8,6.5,10,6.5z M11.9,4.5 l-0.4,0.9C12.4,6,13,6.9,13,8s-0.6,2-1.4,2.5l0.4,0.9c1.2-0.7,2.1-2,2.1-3.5S13.2,5.2,11.9,4.5z"/> + </g> + <g id="tab-audio-white-muted" class="icon white"> + <path class="outline" d="M5.6,5H4C2.9,5,2,5.9,2,7v2c0,0.7,0.3,1.3,0.9,1.7l-1.8,1.8l2.5,2.5l3-3l2.6,2.6c0.3,0.3,0.9,0.1,0.9-0.4V8.5l3.9-3.9 l-2.5-2.5L10,3.5V1.8c0-0.4-0.5-0.7-0.9-0.4L5.6,5z"/> + <path d="M11.5,3.5L9,5.9V3L6,6H4C3.4,6,3,6.4,3,7v2c0,0.6,0.4,1,1,1h0.9l-2.5,2.5l1.1,1.1l9-9L11.5,3.5z M9,13V9.7l-1.7,1.7L9,13z"/> + </g> + + <g id="tab-audio-blocked" class="icon"> + <path class="outline" d="M8,1.2C4.3,1.2,1.2,4.3,1.2,8s3.1,6.8,6.8,6.8s6.8-3.1,6.8-6.8S11.7,1.2,8,1.2z M8,11.9 + c-2.1,0-3.9-1.7-3.9-3.9c0-2.1,1.7-3.9,3.9-3.9s3.9,1.7,3.9,3.9C11.9,10.1,10.1,11.9,8,11.9z M11.1,7.3L6.6,4.6L5.4,3.9v1.4v5.3V12 + l1.2-0.7L11,8.6L12.2,8L11.1,7.3z"/> + <path d="M8,2C4.7,2,2,4.7,2,8s2.7,6,6,6s6-2.7,6-6S11.3,2,8,2z M8,12.7c-2.6,0-4.7-2.1-4.7-4.7 + S5.4,3.3,8,3.3s4.7,2.1,4.7,4.7S10.6,12.7,8,12.7z M10.7,8L6.2,5.3v5.4L10.7,8z"/> + </g> + <g id="tab-audio-white-blocked" class="icon"> + <path class="outline" d="M8,0c3.3,0,6.4,2.2,7.5,5.3c1.1,3.1,0.1,6.7-2.5,8.9c-2.6,2.1-6.3,2.4-9.2,0.7 + C1,13.1-0.5,9.8,0.1,6.5C0.9,2.8,4.2,0,8,0z"/> + <path d="M8,2C4.7,2,2,4.7,2,8s2.7,6,6,6s6-2.7,6-6S11.3,2,8,2z M8,12.7c-2.6,0-4.7-2.1-4.7-4.7 + S5.4,3.3,8,3.3s4.7,2.1,4.7,4.7S10.6,12.7,8,12.7z M10.7,8L6.2,5.3v5.4L10.7,8z"/> + </g> +</svg> diff --git a/application/palemoon/themes/shared/tabbrowser/tab-audio.svg b/application/palemoon/themes/shared/tabbrowser/tab-audio.svg new file mode 100644 index 000000000..274e10c29 --- /dev/null +++ b/application/palemoon/themes/shared/tabbrowser/tab-audio.svg @@ -0,0 +1,18 @@ +<?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/. --> +<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"> + <style> + path:not(:target) { + display: none; + } + </style> + + <path id="tab-audio" d="M4,5C2.9,5,2,5.9,2,7v2c0,1.1,0.9,2,2,2h1.2L9,14V2L5.2,5H4z M11,8c0-0.6-0.4-1-1-1v2C10.6,9,11,8.6,11,8z M13,8 c0-1.4-1-2.6-2.3-2.9L10.4,6C11.3,6.2,12,7,12,8s-0.7,1.8-1.6,2l0.4,0.9C12,10.6,13,9.4,13,8z M11.4,3.2l-0.4,0.9 C12.8,4.6,14,6.2,14,8s-1.2,3.4-2.9,3.8l0.4,0.9C13.5,12.2,15,10.3,15,8S13.5,3.8,11.4,3.2z"/> + + <path id="tab-audio-muted" d="M12.5,3.4L9,6.3V2L5.2,5H4C2.9,5,2,5.9,2,7v2c0,0.9,0.6,1.6,1.4,1.9l-1.9,1.5l1,1.2l11-9L12.5,3.4z M9,14v-4l-2.5,2L9,14z"/> + + <path id="tab-audio-blocked" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M5.6,11.6l6-3.6l-6-3.6V11.6z M8,14.2 + c-3.4,0-6.2-2.8-6.2-6.2S4.6,1.8,8,1.8s6.2,2.8,6.2,6.2S11.4,14.2,8,14.2z"/> +</svg> diff --git a/application/palemoon/themes/windows/Toolbar-glass.png b/application/palemoon/themes/windows/Toolbar-glass.png Binary files differindex 23cc4bfaf..f8aac2467 100644 --- a/application/palemoon/themes/windows/Toolbar-glass.png +++ b/application/palemoon/themes/windows/Toolbar-glass.png diff --git a/application/palemoon/themes/windows/Toolbar-glass.svg b/application/palemoon/themes/windows/Toolbar-glass.svg new file mode 100644 index 000000000..9feaac251 --- /dev/null +++ b/application/palemoon/themes/windows/Toolbar-glass.svg @@ -0,0 +1,3218 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + id="PaleMoonToolbarSVG" + x="0px" + y="0px" + width="378" + height="38" + viewBox="0 0 378 38" + enable-background="new 0 0 378 38"> + <metadata + id="metadata146"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs144"> + <radialGradient + xlink:href="#linearGradient4635" + id="radialGradient4669" + cx="10.529827" + cy="14.778796" + fx="10.529827" + fy="14.778796" + r="7.1399999" + gradientTransform="matrix(1,0,0,1.1087088,0,-1.2351844)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4635"> + <stop + style="stop-color:#6198cb;stop-opacity:1" + offset="0" + id="stop4631" /> + <stop + style="stop-color:#3a78b2;stop-opacity:1" + offset="1" + id="stop4633" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient4635" + id="radialGradient4637" + cx="11.063469" + cy="38.79744" + fx="11.063469" + fy="38.79744" + r="8.7600002" + gradientTransform="matrix(1,0,0,1.0853313,0,-3.029369)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4635" + id="radialGradient4677" + cx="34.841751" + cy="14.552581" + fx="34.841751" + fy="14.552581" + r="7.1399999" + gradientTransform="matrix(1,0,0,1.1003056,0,-1.1335797)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4603" + id="radialGradient4605" + cx="58.062626" + cy="12.761739" + fx="58.062626" + fy="12.761739" + r="7.6799994" + gradientTransform="matrix(1,0,0,0.99218759,0,0.09141507)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4603"> + <stop + style="stop-color:#e72b1d;stop-opacity:1" + offset="0" + id="stop4599" /> + <stop + style="stop-color:#cc4338;stop-opacity:1" + offset="1" + id="stop4601" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient4523-3" + id="radialGradient4525" + cx="79.305222" + cy="13.939252" + fx="79.305222" + fy="13.939252" + r="7.8000002" + gradientTransform="matrix(1,0,0,1.0769231,0,-0.86932835)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4523-3"> + <stop + style="stop-color:#4fb55d;stop-opacity:1" + offset="0" + id="stop4519" /> + <stop + style="stop-color:#2d8539;stop-opacity:1" + offset="1" + id="stop4521" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient4527" + id="radialGradient4529" + cx="103.23091" + cy="12.664675" + fx="103.23091" + fy="12.664675" + r="9.5995998" + gradientTransform="matrix(1,0,0,0.87507716,0,1.3868386)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4527"> + <stop + style="stop-color:#3f6bbd;stop-opacity:1" + offset="0" + id="stop4523" /> + <stop + style="stop-color:#29467b;stop-opacity:1" + offset="1" + id="stop4525" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4709" + cx="125.30523" + cy="16.659737" + fx="125.30523" + fy="16.659737" + r="8.3726959" + gradientTransform="matrix(1,0,0,1.0032611,0,-0.03620244)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4707"> + <stop + style="stop-color:#8c9ba5;stop-opacity:1" + offset="0" + id="stop4703" /> + <stop + style="stop-color:#607480;stop-opacity:1" + offset="1" + id="stop4705" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient4727" + id="radialGradient4729" + cx="149.26262" + cy="12.784631" + fx="149.26262" + fy="12.784631" + r="8.6400051" + gradientTransform="matrix(1,0,0,0.993055,0,0.07848724)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4727"> + <stop + style="stop-color:#3eb796;stop-opacity:1" + offset="0" + id="stop4723" /> + <stop + style="stop-color:#31a886;stop-opacity:1" + offset="1" + id="stop4725" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient5023" + id="radialGradient5017" + cx="466.94476" + cy="12.037849" + fx="466.94476" + fy="12.037849" + r="9.6007004" + gradientTransform="matrix(0.79035186,0,0,0.79508811,-0.14216924,6.9389816e-4)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient5023"> + <stop + id="stop5019" + offset="0" + style="stop-color:#c6cdd2;stop-opacity:1" /> + <stop + id="stop5021" + offset="1" + style="stop-color:#9cabb4;stop-opacity:1" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4793" + cx="194.44176" + cy="13.746766" + fx="194.44176" + fy="13.746766" + r="9.5999947" + gradientTransform="matrix(1,0,0,0.87500048,0,1.3876528)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4833" + cx="239.2" + cy="11.101265" + fx="239.2" + fy="11.101265" + r="9.6000004" + gradientTransform="matrix(1,0,0,0.87500002,0,1.3876579)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4841" + cx="242.0894" + cy="12.418613" + fx="242.0894" + fy="12.418613" + r="3.5288758" + gradientTransform="matrix(0.79274533,0,0,0.78327978,-0.14435628,0.11758726)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient5037" + id="radialGradient5031" + cx="466.39926" + cy="31.105829" + fx="466.39926" + fy="31.105829" + r="9.7507105" + gradientTransform="matrix(1,0,0,0.99992718,0,0.00247197)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient5037"> + <stop + id="stop5033" + offset="0" + style="stop-color:#e8e1a1;stop-opacity:1" /> + <stop + id="stop5035" + offset="1" + style="stop-color:#baad3e;stop-opacity:1" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4813" + cx="217.95329" + cy="16.56296" + fx="217.95329" + fy="16.56296" + r="10.35937" + gradientTransform="matrix(1,0,0,0.8160434,0,2.0506693)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4861" + cx="262.79288" + cy="15.840806" + fx="262.79288" + fy="15.840806" + r="8.5577164" + gradientTransform="matrix(1,0,0,0.9969072,0,0.03528241)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4881" + cx="286.58698" + cy="14.171478" + fx="286.58698" + fy="14.171478" + r="8.53125" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4901" + cx="308.97141" + cy="14.457072" + fx="308.97141" + fy="14.457072" + r="6.09375" + gradientTransform="matrix(1,0,0,1.4,0,-4.4901397)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4921" + cx="331.15933" + cy="13.119289" + fx="331.15933" + fy="13.119289" + r="8.53125" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4941" + cx="353.15076" + cy="11.316628" + fx="353.15076" + fy="11.316628" + r="6.09375" + gradientTransform="matrix(0.79035186,0,0,0.15902921,-0.14216924,7.1987363)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + gradientTransform="matrix(0.79035186,0,0,0.79514603,-0.14216924,3.8580698e-5)" + xlink:href="#linearGradient4707" + id="radialGradient4949" + cx="375.97003" + cy="11.407905" + fx="375.97003" + fy="11.407905" + r="6.09375" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4957" + cx="400.5007" + cy="13.518586" + fx="400.5007" + fy="13.518586" + r="8.5350475" + gradientTransform="matrix(1,0,0,0.99701325,0,0.03407254)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4975" + id="radialGradient4977" + cx="417.02075" + cy="15.742972" + fx="417.02075" + fy="15.742972" + r="8.53125" + gradientTransform="matrix(1.357667,-0.02466618,0.02411975,1.3275908,-149.53429,5.1574131)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4975"> + <stop + style="stop-color:#f79729;stop-opacity:1" + offset="0" + id="stop4971" /> + <stop + style="stop-color:#d2831f;stop-opacity:1" + offset="1" + id="stop4973" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4997" + cx="444.33652" + cy="11.316628" + fx="444.33652" + fy="11.316628" + r="8.53125" + gradientTransform="matrix(1,0,0,0.71428563,0,3.2333231)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4747" + id="radialGradient4710" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.265625,0,0,1.1109477,-0.05703897,1.4865748)" + cx="134.97461" + cy="9" + fx="134.97461" + fy="9" + r="7.9746099" /> + <linearGradient + id="linearGradient4747"> + <stop + style="stop-color:#c5b631;stop-opacity:1" + offset="0" + id="stop4743" /> + <stop + style="stop-color:#baad3e;stop-opacity:1" + offset="1" + id="stop4745" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient5037" + id="radialGradient4712" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.265625,0,0,1.1109477,-0.05703897,1.4865748)" + cx="132.6468" + cy="9.0947113" + fx="132.6468" + fy="9.0947113" + r="7.9746099" /> + <radialGradient + xlink:href="#linearGradient4747" + id="radialGradient4714" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.265625,0,0,1.1109477,-0.05703897,1.4865748)" + cx="134.97461" + cy="9" + fx="134.97461" + fy="9" + r="7.9746099" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4750" + cx="166.37157" + cy="11.485105" + fx="166.37157" + fy="11.485105" + r="0.31640625" + gradientTransform="matrix(1,0,0,28.000001,0,-310.09784)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4832" + id="radialGradient4709-1" + cx="125.30523" + cy="16.659737" + fx="125.30523" + fy="16.659737" + r="8.3726959" + gradientTransform="matrix(1,0,0,1.0032611,0.11563445,22.233158)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4832"> + <stop + id="stop5029" + offset="0" + style="stop-color:#22e23d;stop-opacity:1" /> + <stop + id="stop4830" + offset="1" + style="stop-color:#38a748;stop-opacity:1" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4883"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4873" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4875" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4877" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4879" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4881" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6673" /> + <feFlood + id="feFlood6675" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6677" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6679" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6681" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6683" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4895"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4885" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4887" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4889" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4891" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4893" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6685" /> + <feFlood + id="feFlood6687" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6689" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6691" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6693" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6695" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4907"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4897" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4899" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4901" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4903" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4905" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6697" /> + <feFlood + id="feFlood6699" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6701" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6703" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6705" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6707" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4919"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4909" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4911" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4913" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4915" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4917" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6709" /> + <feFlood + id="feFlood6711" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6713" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6715" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6717" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6719" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4931"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4921" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4923" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4925" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4927" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4929" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6721" /> + <feFlood + id="feFlood6723" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6725" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6727" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6729" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6731" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4943"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4933" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4935" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4937" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4939" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4941" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6733" /> + <feFlood + id="feFlood6735" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6737" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6739" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6741" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6743" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4955"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4945" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4947" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4949" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4951" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4953" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6745" /> + <feFlood + id="feFlood6747" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6749" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6751" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6753" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6755" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4967"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4957" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4959" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4961" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4963" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4965" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6757" /> + <feFlood + id="feFlood6759" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6761" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6763" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6765" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6767" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4979"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4969" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4971" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4973" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4975" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4977" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6769" /> + <feFlood + id="feFlood6771" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6773" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6775" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6777" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6779" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter4991"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4981" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4983" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4985" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4987" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite4989" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6781" /> + <feFlood + id="feFlood6783" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6785" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6787" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6789" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6791" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5003"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4993" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4995" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4997" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4999" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5001" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6793" /> + <feFlood + id="feFlood6795" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6797" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6799" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6801" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6803" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5015"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5005" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5007" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5009" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5011" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5013" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6805" /> + <feFlood + id="feFlood6807" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6809" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6811" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6813" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6815" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5027"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5017" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5019" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5021" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5023" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5025" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6817" /> + <feFlood + id="feFlood6819" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6821" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6823" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6825" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6827" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5039"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5029" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5031" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5033" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5035" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5037" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6829" /> + <feFlood + id="feFlood6831" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6833" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6835" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6837" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6839" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5051"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5041" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5043" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5045" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5047" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5049" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6841" /> + <feFlood + id="feFlood6843" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6845" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6847" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6849" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6851" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5063"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5053" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5055" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5057" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5059" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5061" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6853" /> + <feFlood + id="feFlood6855" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6857" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6859" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6861" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6863" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5075"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5065" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5067" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5069" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5071" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5073" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6865" /> + <feFlood + id="feFlood6867" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6869" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6871" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6873" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6875" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5087"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5077" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5079" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5081" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5083" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5085" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6877" /> + <feFlood + id="feFlood6879" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6881" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6883" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6885" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6887" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5099"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5089" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5091" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5093" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5095" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5097" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6889" /> + <feFlood + id="feFlood6891" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6893" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6895" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6897" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6899" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5111"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5101" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5103" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5105" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5107" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5109" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6901" /> + <feFlood + id="feFlood6903" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6905" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6907" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6909" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6911" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5123"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5113" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5115" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5117" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5119" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5121" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6913" /> + <feFlood + id="feFlood6915" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6917" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6919" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6921" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6923" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5135"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5125" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5127" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5129" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5131" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5133" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6925" /> + <feFlood + id="feFlood6927" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6929" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6931" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6933" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6935" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5147"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5137" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5139" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5141" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5143" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5145" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6937" /> + <feFlood + id="feFlood6939" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6941" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6943" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6945" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6947" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5159"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5149" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5151" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5153" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5155" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5157" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6949" /> + <feFlood + id="feFlood6951" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6953" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6955" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6957" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6959" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter5171"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5161" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5163" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5165" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset5167" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="fbSourceGraphic" + id="feComposite5169" /> + <feColorMatrix + result="fbSourceGraphicAlpha" + in="fbSourceGraphic" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + id="feColorMatrix6961" /> + <feFlood + id="feFlood6963" + flood-opacity="1" + flood-color="rgb(255,255,255)" + result="flood" + in="fbSourceGraphic" /> + <feComposite + in2="fbSourceGraphic" + id="feComposite6965" + in="flood" + operator="in" + result="composite1" /> + <feGaussianBlur + id="feGaussianBlur6967" + in="composite1" + stdDeviation="1" + result="blur" /> + <feOffset + id="feOffset6969" + dx="2.77556e-017" + dy="0" + result="offset" /> + <feComposite + in2="offset" + id="feComposite6971" + in="fbSourceGraphic" + operator="over" + result="composite2" /> + </filter> + <radialGradient + xlink:href="#linearGradient4635" + id="radialGradient4669-9" + cx="10.529827" + cy="14.778796" + fx="10.529827" + fy="14.778796" + r="7.1399999" + gradientTransform="matrix(1,0,0,1.1087088,0,-1.2351844)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4701"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4691" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4693" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4695" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4697" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4699" /> + </filter> + <radialGradient + xlink:href="#linearGradient4635" + id="radialGradient4637-5" + cx="11.063469" + cy="38.79744" + fx="11.063469" + fy="38.79744" + r="8.7600002" + gradientTransform="matrix(1,0,0,1.0853313,0,-3.029369)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4661"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4651" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4653" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4655" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4657" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4659" /> + </filter> + <radialGradient + xlink:href="#linearGradient4635" + id="radialGradient4677-0" + cx="34.841751" + cy="14.552581" + fx="34.841751" + fy="14.552581" + r="7.1399999" + gradientTransform="matrix(1,0,0,1.1003056,0,-1.1335797)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4689"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4679" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4681" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4683" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4685" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4687" /> + </filter> + <radialGradient + xlink:href="#linearGradient4603" + id="radialGradient4605-8" + cx="58.062626" + cy="12.761739" + fx="58.062626" + fy="12.761739" + r="7.6799994" + gradientTransform="matrix(1,0,0,0.99218759,0,0.09141507)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4629"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4619" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4621" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4623" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4625" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4627" /> + </filter> + <radialGradient + xlink:href="#linearGradient4523-3" + id="radialGradient4525-6" + cx="79.305222" + cy="13.939252" + fx="79.305222" + fy="13.939252" + r="7.8000002" + gradientTransform="matrix(1,0,0,1.0769231,0,-0.86932835)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4597"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4587" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4589" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4591" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4593" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4595" /> + </filter> + <radialGradient + xlink:href="#linearGradient4527" + id="radialGradient4529-9" + cx="103.23091" + cy="12.664675" + fx="103.23091" + fy="12.664675" + r="9.5995998" + gradientTransform="matrix(1,0,0,0.87507716,0,1.3868386)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4783"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4773" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4775" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4777" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4779" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4781" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4709-11" + cx="125.30523" + cy="16.659737" + fx="125.30523" + fy="16.659737" + r="8.3726959" + gradientTransform="matrix(1,0,0,1.0032611,0,-0.03620244)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4721"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4711" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4713" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4715" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4717" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4719" /> + </filter> + <radialGradient + xlink:href="#linearGradient4727" + id="radialGradient4729-5" + cx="149.26262" + cy="12.784631" + fx="149.26262" + fy="12.784631" + r="8.6400051" + gradientTransform="matrix(1,0,0,0.993055,0,0.07848724)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4741"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4731" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4733" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4735" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4737" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4739" /> + </filter> + <radialGradient + xlink:href="#linearGradient5023" + id="radialGradient5017-9" + cx="466.94476" + cy="12.037849" + fx="466.94476" + fy="12.037849" + r="9.6007004" + gradientTransform="matrix(0.79035186,0,0,0.79508811,-0.14216924,6.9389816e-4)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4793-8" + cx="194.44176" + cy="13.746766" + fx="194.44176" + fy="13.746766" + r="9.5999947" + gradientTransform="matrix(1,0,0,0.87500048,0,1.3876528)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4805"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4795" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4797" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4799" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4801" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4803" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4833-4" + cx="239.2" + cy="11.101265" + fx="239.2" + fy="11.101265" + r="9.6000004" + gradientTransform="matrix(1,0,0,0.87500002,0,1.3876579)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4853"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4843" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4845" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4847" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4849" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4851" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4841-0" + cx="242.26164" + cy="12.423289" + fx="242.26164" + fy="12.423289" + r="3.5288758" + gradientTransform="matrix(0.79274531,0,0,0.78327977,-0.14435628,0.11758726)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient8829" + cx="242.26164" + cy="12.423289" + fx="242.26164" + fy="12.423289" + r="3.5288758" + gradientTransform="matrix(0.79274531,0,0,0.78327977,-0.14435628,0.11758726)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient5037" + id="radialGradient5031-1" + cx="466.39926" + cy="31.105829" + fx="466.39926" + fy="31.105829" + r="9.7507105" + gradientTransform="matrix(1,0,0,0.99992718,0,0.00247197)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter5049"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5039" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5041" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5043" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset5045" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite5047" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4813-2" + cx="217.95329" + cy="16.56296" + fx="217.95329" + fy="16.56296" + r="10.35937" + gradientTransform="matrix(1,0,0,0.8160434,0,2.0506693)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4825"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4815" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4817" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4819" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4821" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4823" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4861-6" + cx="262.79288" + cy="15.840806" + fx="262.79288" + fy="15.840806" + r="8.5577164" + gradientTransform="matrix(1,0,0,0.9969072,0,0.03528241)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4873"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4863" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4865" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4867" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4869" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4871" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4881-9" + cx="286.58698" + cy="14.171478" + fx="286.58698" + fy="14.171478" + r="8.53125" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4893"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4883" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4885" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4887" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4889" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4891" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4901-6" + cx="308.97141" + cy="14.457072" + fx="308.97141" + fy="14.457072" + r="6.09375" + gradientTransform="matrix(1,0,0,1.4,0,-4.4901397)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4913"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4903" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4905-1" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4907" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4909" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4911-2" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4921-8" + cx="331.15933" + cy="13.119289" + fx="331.15933" + fy="13.119289" + r="8.53125" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4933"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4923" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4925" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4927" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4929" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4931" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4941-9" + cx="353.15076" + cy="11.316628" + fx="353.15076" + fy="11.316628" + r="6.09375" + gradientTransform="matrix(0.79035186,0,0,0.15902921,-0.14216924,7.1987363)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + gradientTransform="matrix(0.79035186,0,0,0.79514603,-0.14216924,3.8580698e-5)" + xlink:href="#linearGradient4707" + id="radialGradient4949-5" + cx="375.97003" + cy="11.407905" + fx="375.97003" + fy="11.407905" + r="6.09375" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4957-2" + cx="400.5007" + cy="13.518586" + fx="400.5007" + fy="13.518586" + r="8.5350475" + gradientTransform="matrix(1,0,0,0.99701325,0,0.03407254)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4969"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4959" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4961" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4963" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4965" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4967" /> + </filter> + <radialGradient + xlink:href="#linearGradient4975" + id="radialGradient4977-4" + cx="417.02075" + cy="15.742972" + fx="417.02075" + fy="15.742972" + r="8.53125" + gradientTransform="matrix(1.357667,-0.02466618,0.02411975,1.3275908,-149.53429,5.1574131)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4989"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4979" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4981" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4983" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4985" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4987" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4997-5" + cx="444.33652" + cy="11.316628" + fx="444.33652" + fy="11.316628" + r="8.53125" + gradientTransform="matrix(1,0,0,0.71428563,0,3.2333231)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter5009"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4999" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5001-8" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5003" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset5005" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite5007-3" /> + </filter> + <radialGradient + xlink:href="#linearGradient4747" + id="radialGradient4710-4" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.265625,0,0,1.1109477,-0.05703897,1.4865748)" + cx="134.97461" + cy="9" + fx="134.97461" + fy="9" + r="7.9746099" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4729"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4719" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4721" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4723" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4725" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4727" /> + </filter> + <radialGradient + xlink:href="#linearGradient5037" + id="radialGradient4712-2" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.265625,0,0,1.1109477,-0.05703897,1.4865748)" + cx="132.6468" + cy="9.0947113" + fx="132.6468" + fy="9.0947113" + r="7.9746099" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4774"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4764" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4766" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4768" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4770" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4772" /> + </filter> + <radialGradient + xlink:href="#linearGradient4747" + id="radialGradient4714-4" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.265625,0,0,1.1109477,-0.05703897,1.4865748)" + cx="134.97461" + cy="9" + fx="134.97461" + fy="9" + r="7.9746099" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4750-3" + cx="166.37157" + cy="11.485105" + fx="166.37157" + fy="11.485105" + r="0.31640625" + gradientTransform="matrix(0.99998863,-0.00473886,0.08838422,18.426509,-1.0132111,-199.35688)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4832" + id="radialGradient4709-1-2" + cx="125.30523" + cy="16.659737" + fx="125.30523" + fy="16.659737" + r="8.3726959" + gradientTransform="matrix(1,0,0,1.0032611,0.11563445,22.233158)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4844"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4834" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4836" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4838" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4840" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4842" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient9039" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.79274531,0,0,0.78327977,-0.14435628,0.11758726)" + cx="242.26164" + cy="12.423289" + fx="242.26164" + fy="12.423289" + r="3.5288758" /> + <filter + id="filter10217" + style="color-interpolation-filters:sRGB;"> + <feFlood + id="feFlood10207" + result="flood" + flood-color="rgb(0,0,0)" + flood-opacity="1" /> + <feComposite + id="feComposite10209" + result="composite1" + operator="out" + in2="SourceGraphic" + in="flood" /> + <feGaussianBlur + id="feGaussianBlur10211" + result="blur" + stdDeviation="0.5" + in="composite1" /> + <feOffset + id="feOffset10213" + result="offset" + dy="0" + dx="2.77556e-017" /> + <feComposite + id="feComposite10215" + result="fbSourceGraphic" + operator="atop" + in2="SourceGraphic" + in="offset" /> + <feColorMatrix + id="feColorMatrix10219" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + in="fbSourceGraphic" + result="fbSourceGraphicAlpha" /> + <feFlood + in="fbSourceGraphic" + result="flood" + flood-color="rgb(255,255,255)" + flood-opacity="1" + id="feFlood10221" /> + <feComposite + result="composite1" + operator="in" + in="flood" + id="feComposite10223" + in2="fbSourceGraphic" /> + <feGaussianBlur + result="blur" + stdDeviation="1" + in="composite1" + id="feGaussianBlur10225" /> + <feOffset + result="offset" + dy="0" + dx="2.77556e-017" + id="feOffset10227" /> + <feComposite + result="composite2" + operator="over" + in="fbSourceGraphic" + id="feComposite10229" + in2="offset" /> + </filter> + </defs> + <g + style="filter:url(#filter10217)" + id="g7757"> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4669-9);fill-opacity:1;stroke-width:1;filter:url(#filter4701)" + d="m 17.870749,13.841269 -6.303534,-0.0074 2.264363,2.148431 c 0.615648,0.584128 0.72,1.44 0.24,1.92 l -0.96,1.08 c -0.48,0.48 -1.32,0.36 -1.92,-0.24 0,0 -6.4200001,-6.6 -6.4800001,-6.6 -0.06,0 -0.36,-0.48 -0.48,-0.84 0,-0.359999 0.36,-0.719999 0.48,-0.839999 l 6.3600001,-6.48 c 0.6,-0.6000001 1.44,-0.7200001 1.92,-0.24 l 0.96,1.0799999 c 0.48,0.48 0.36,1.32 -0.24,1.9200001 l -2.144363,2.0610645 6.359451,0.043374 c 0.719983,0.00491 1.227959,0.50779 1.227959,1.2277905 v 2.483369 c 0,0.72 -0.563877,1.284215 -1.283876,1.28337 z" + id="path4" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4637-5);fill-opacity:1;stroke-width:1;filter:url(#filter4661)" + id="path4154" + d="m 19.187889,37.765372 -7.620674,-0.0365 3.352509,3.266174 c 0.515294,0.50108 0.829738,1.388534 0.443269,1.764345 l -1.759464,1.992905 c -0.356609,0.403923 -1.52102,-0.108922 -2.036314,-0.735274 L 3.9756591,36.471238 c 0,0 -0.7399492,-0.710192 -0.7399492,-1.211274 0,-0.501081 0.7399492,-1.303987 0.7399492,-1.303987 l 7.5915559,-7.545783 c 0.515294,-0.50108 1.613776,-1.093109 1.980397,-0.698138 l 1.815381,1.955768 c 0.386469,0.375811 0.172889,1.300401 -0.471228,1.801482 l -3.32455,3.229041 7.620674,0.02842 c 0.772936,0.0029 1.344153,0.417712 1.344153,1.169335 v 2.560987 c 0,0.751622 -0.571221,1.311987 -1.344153,1.308283 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4677-0);fill-opacity:1;stroke-width:1;filter:url(#filter4689)" + id="path4165" + d="m 26.776124,12.612425 v -2.53895 c 0,-0.7200003 0.480206,-1.3282747 1.2,-1.3111602 l 5.76,0.041051 L 31.66,6.7412646 c -0.602042,-0.5979755 -0.72,-1.4399999 -0.24,-1.92 l 0.96,-1.08 c 0.48,-0.48 1.32,-0.36 1.92,0.24 l 6.36,6.4800004 c 0.12,0.12 0.48,0.48 0.48,0.84 0,0.36 -0.36,0.84 -0.48,0.84 l -6.48,6.48 c -0.6,0.6 -1.44,0.72 -1.92,0.24 l -0.96,-1.08 c -0.48,-0.48 -0.36,-1.32 0.24,-1.92 L 33.736124,13.833888 28.06,13.868005 c -0.719987,0.0043 -1.283876,-0.53558 -1.283876,-1.25558 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4605-8);fill-opacity:1;stroke-width:1;filter:url(#filter4629)" + id="path4176" + d="m 64.708108,6.2881044 -5.061037,5.0305226 5.061037,5.030522 -2.530518,2.515261 -5.061038,-5.030522 -5.061037,5.030522 -2.530519,-2.515261 5.061037,-5.030522 -5.061037,-5.0305226 2.530519,-2.5152612 5.061037,5.0305223 5.061038,-5.0305223 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4525-6);fill-opacity:1;stroke-width:1;filter:url(#filter4597)" + id="path4187" + d="m 87.482777,11.318627 h -8.856816 l 3.13833,-3.0716727 C 81.15648,7.545735 80.363876,6.712205 79.283876,6.712205 c -2.64,0 -5.107543,1.9376803 -5.107543,4.577681 0,2.64 2.411627,5.050109 5.051627,5.050109 1.68,0 3.619039,-1.066107 4.459039,-2.506107 l 2.530518,1.25763 c -1.32,2.4 -3.961599,4.443007 -6.961599,4.443007 -4.32,0 -8.219378,-3.896849 -8.219378,-8.216849 0,-4.3200008 3.927337,-7.633261 8.247337,-7.633261 1.8,0 3.619792,0.8778997 5.059792,1.9578998 l 3.139108,-3.1271021 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4529-9);fill-opacity:1;stroke:none;stroke-width:1;stroke-opacity:1;filter:url(#filter4783)" + d="M 102.66589,2.5152127 92.543814,11.318627 h 3.795778 v 7.545783 h 5.061038 v -5.030522 h 2.53052 v 5.030522 h 5.06104 v -7.545783 h 3.79577 z" + id="path4209" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4709-11);fill-opacity:1;stroke-width:1;filter:url(#filter4721)" + id="path4214" + d="m 133.03211,12.576257 -6.32629,6.288153 c -0.24,0.36 -0.82401,0.692435 -1.30401,0.692435 -0.48,0 -0.86651,-0.332435 -1.22651,-0.692435 l -6.3263,-6.288153 c -0.79571,-0.72 -0.93921,-1.286268 0.0208,-1.280462 l 3.77501,0.02283 -0.0107,-7.5841022 c -0.001,-0.7199993 0.50796,-1.1722101 1.22796,-1.1722101 h 5.10754 c 0.72,0 1.22426,0.4800094 1.22796,1.2 l 0.0388,7.5563123 3.80118,-0.05062 c 0.95992,-0.01278 0.71459,0.588252 -0.005,1.308252 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4729-5);fill-opacity:1;stroke-width:1;filter:url(#filter4741)" + id="path4225" + d="m 148.19571,20.103585 c -4.8,0 -8.89163,-3.97895 -8.89163,-8.77895 0,-4.6800005 4.11959,-8.7145303 8.91959,-8.7145303 4.8,0 8.80776,3.9511599 8.80776,8.7511603 0,4.68 -4.03572,8.74232 -8.83572,8.74232 z m 0.0559,-15.04801 c -3.36,0 -6.39142,2.9178996 -6.39142,6.2779 0,3.24 2.9755,6.22232 6.3355,6.22232 3.36,0 6.33551,-2.86232 6.33551,-6.22232 0,-3.3600004 -2.91959,-6.2779 -6.27959,-6.2779 z m -0.63959,7.520682 c -0.48,-0.12 -0.63716,-0.735044 -0.64429,-1.214992 l -0.0559,-3.7667402 c -0.0107,-0.7199217 0.53592,-1.28337 1.25592,-1.28337 0.72,0 1.27834,0.535601 1.28388,1.25558 l 0.0289,3.7518922 c 1.32,1.32 2.53051,3.772891 2.53051,3.772891 0,0 -3.07896,-1.195261 -4.39896,-2.515261 z" /> + <path + style="display:inline;fill:url(#radialGradient5017-9);fill-opacity:1;stroke-width:0.79274529" + id="path4355" + d="m 369.00476,4.7878231 0.94842,1.9083504 0.47422,0.858758 0.94842,0.190835 2.18136,0.3816699 -1.61231,1.7175156 -0.6639,0.667923 0.0948,0.954175 0.37937,2.290022 -1.89685,-0.954178 -0.85358,-0.477086 -0.85358,0.477086 -1.89685,0.954178 0.37938,-2.290022 0.0948,-0.954175 -0.6639,-0.667923 -1.61232,-1.7175156 2.27622,-0.3816699 0.94842,-0.190835 0.37936,-0.858758 0.94843,-1.9083504 m 0,-3.4350309 c -0.28454,0 -0.56906,0.1908348 -0.75874,0.667922 l -1.89683,3.9121193 -4.07821,0.6679227 c -0.94842,0.190835 -1.13812,0.8587576 -0.47421,1.5266802 l 2.94011,3.1487776 -0.66391,4.389208 c -0.0948,0.572504 0.1897,0.954174 0.66391,0.954174 0.18967,0 0.37936,-0.09542 0.56905,-0.190835 l 3.69885,-2.003768 3.69884,2.003768 c 0.18969,0.09543 0.47421,0.190835 0.56906,0.190835 0.4742,0 0.75873,-0.38167 0.6639,-1.049592 l -0.6639,-4.389207 2.9401,-3.1487781 c 0.66391,-0.6679226 0.37938,-1.3358454 -0.4742,-1.5266803 L 371.66031,5.837416 369.76347,1.9252968 C 369.5738,1.543627 369.28926,1.3527922 369.00474,1.3527922 Z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4793-8);fill-opacity:1;stroke-width:1;filter:url(#filter4805)" + id="path4366" + d="m 202.62125,17.648005 -2.53039,-0.04122 1.26526,2.515261 h -15.18311 l 1.26526,-2.515261 -2.51784,0.02249 c -0.71997,0.0064 -1.31817,-0.563397 -1.31184,-1.28337 l 0.0559,-6.3612693 c 0.006,-0.7199727 0.59192,-1.2112687 1.31183,-1.2000001 l 1.19667,0.018731 0.0313,-2.5298907 c 0.009,-0.7199457 0.51397,-1.243001 1.23397,-1.243001 l 0.022,-1.2403691 c 0.0127,-0.7198886 0.6198,-1.2535885 1.33979,-1.2555799 l 10.04733,-0.02779 c 0.72,-0.00199 1.21931,0.5078413 1.22796,1.22779 l 0.0156,1.295949 c 0.72,0 1.2692,0.5785813 1.26831,1.2985809 l -0.003,2.4743108 1.26513,-1e-7 c 0.71992,-0.010711 1.26205,0.5376375 1.26526,1.2576305 v 6.288153 c 0,0.729621 -0.61509,1.257631 -1.26526,1.257631 z m -15.18298,-0.04122 1.26526,-2.515262 h -1.26526 z m 0.6,-6.288153 h -0.6 -0.6 c -0.36,0 -0.6,0.24 -0.6,0.6 0,0.36 0.24,0.6 0.6,0.6 h 1.2 c 0.36,0 0.6,-0.24 0.6,-0.6 0,-0.36 -0.25348,-0.503016 -0.6,-0.6 z M 198.8256,5.0304738 c 0,-0.72 -0.54528,-1.2523398 -1.26526,-1.2576306 h -7.59155 c -0.71998,-0.00529 -1.28117,0.5378043 -1.26526,1.2576306 v 3.7728917 c 0.0159,0.7198264 0.54528,1.2629215 1.26526,1.2576305 h 7.59155 c 0.71999,-0.0053 1.24942,-0.5078188 1.25592,-1.2277899 z m -1.26526,10.0610482 h -7.59155 l -1.26526,3.772892 h 10.12207 z m 2.53052,0 h -1.26526 l 1.26526,2.515262 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4833-4);fill-opacity:1;stroke-width:1;filter:url(#filter4853)" + id="path4388" + d="m 248.17426,18.945466 -16.43876,-0.02779 c -0.96,-0.0016 -1.40468,-0.339789 -1.40858,-1.299781 l -0.0559,-13.7557998 c -0.004,-0.959992 0.47654,-1.3847678 1.43653,-1.3831504 l 16.49468,0.02779 c 0.96,0.00162 1.24473,0.3675784 1.24083,1.3275705 l -0.0559,13.7557997 c -0.004,0.959992 -0.25287,1.356983 -1.21287,1.355361 z M 239.88388,3.8178947 c -0.36,0 -0.6,0.24 -0.6,0.6 0,0.36 0.24,0.6 0.6,0.6 0.36,0 0.6,-0.24 0.6,-0.6 0,-0.36 -0.24,-0.6 -0.6,-0.6 z m 2.64346,0 c -0.36,0 -0.6,0.24 -0.6,0.6 0,0.36 0.36,0.6 0.6,0.6 0.36,0 0.6,-0.24 0.6,-0.6 0,-0.36 -0.24,-0.6 -0.6,-0.6 z m 3.72,0 h -1.2 c -0.36,0 -0.6,0.24 -0.6,0.6 0,0.36 0.24,0.6 0.6,0.6 h 1.2 c 0.36,0 0.6,-0.24 0.6,-0.6 0,-0.36 -0.24,-0.6 -0.6,-0.6 z m 0.65592,4.9945298 c 0.005,-0.7199803 -0.53592,-1.2538267 -1.25592,-1.2555798 l -11.41287,-0.02779 c -0.72,-0.00175 -1.22533,0.5077946 -1.22796,1.2277899 l -0.028,7.6724304 c -0.003,0.719994 0.50796,1.175707 1.22795,1.172209 l 11.44083,-0.05558 c 0.71999,-0.0035 1.19464,-0.507809 1.2,-1.227789 z" /> + <g + aria-label="+" + transform="scale(0.98484984,1.0153832)" + style="font-style:normal;font-weight:normal;font-size:9.51294327px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:url(#radialGradient4841-0);fill-opacity:1;stroke:none;stroke-width:0.79274535px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="text4409"> + <path + d="m 194.95358,9.8484986 h -2.03077 v 1.9696994 h -1.01538 V 9.8484986 h -2.03077 V 8.8636487 h 2.03077 V 6.893949 h 1.01538 v 1.9696997 h 2.03077 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.55116463px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#radialGradient9039);fill-opacity:1;stroke-width:0.79274535px" + id="path7725" /> + </g> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 467.25784,24.196945 c -0.36562,0 -0.73125,0.24375 -0.975,0.853125 l -2.4375,4.996876 -5.24062,0.853125 c -1.21875,0.24375 -1.4625,1.096875 -0.60938,1.95 l 3.77813,4.021875 -0.85313,5.60625 c -0.12181,0.73125 0.24375,1.21875 0.85313,1.21875 0.24375,0 0.4875,-0.121875 0.73125,-0.24375 l 4.75312,-2.559375 4.75313,2.559375 c 0.24375,0.121875 0.60937,0.24375 0.73125,0.24375 0.60937,0 0.975,-0.4875 0.85312,-1.340625 l -0.85312,-5.60625 3.77812,-4.021875 c 0.85313,-0.853125 0.4875,-1.70625 -0.60937,-1.95 l -5.24063,-0.853125 -2.4375,-4.996876 c -0.24375,-0.4875 -0.60937,-0.73125 -0.975,-0.73125 z" + id="path6182" + style="display:inline;fill:url(#radialGradient5031-1);fill-opacity:1;stroke-width:1.21875;filter:url(#filter5049)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 226.66131,15.091518 -0.0388,3.707848 c -0.007,0.673061 -0.5177,1.245488 -1.19079,1.24654 l -17.77799,0.02779 c -0.6731,0.0011 -1.2416,-0.573462 -1.24671,-1.24654 l -0.028,-3.688049 c -0.005,-0.673078 0.6302,-1.305219 1.30331,-1.305219 1.26531,-1.257631 1.03718,-3.269047 1.26531,-5.0305225 0.4278,-2.8226251 0.0953,-6.2244545 3.80878,-6.2479747 l 7.52682,-0.047673 c 3.73297,-0.023644 3.4173,3.4730226 3.84751,6.2956477 0.41438,2.7153765 0,3.7728915 1.26526,5.0305225 0.70548,0 1.26526,0.515815 1.26526,1.25763 z m -7.68106,-4.410561 h -1.82811 V 8.8528316 c 0,-0.8124995 -1.21875,-0.8124995 -1.21875,0 v 1.8281254 h -1.82814 c -0.8125,0 -0.8125,1.218749 0,1.218749 h 1.82814 v 1.828125 c 0,0.812501 1.21875,0.812501 1.21875,0 v -1.828125 h 1.82811 c 0.8125,0 0.8125,-1.218749 0,-1.218749 z" + id="path7318" + style="display:inline;fill:url(#radialGradient4813-2);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4825)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 269.02823,19.939154 c -0.975,0 -1.82813,-0.24375 -2.80313,-1.584375 -0.975,-1.340625 -2.07187,-3.046875 -2.07187,-3.046875 0,0 -0.85313,-1.096875 -1.34063,-1.95 -0.60937,-0.853125 -1.34062,-0.609375 -1.34062,-0.609375 0,0 -3.53438,-5.7281239 -4.14375,-6.581249 -0.73125,-1.21875 0.73125,-3.290625 0.73125,-3.290625 l 5.3625,8.531249 c 0,0 1.70625,2.315625 2.31562,2.803125 0.60938,0.4875 1.70625,-0.4875 3.4125,1.096875 2.31563,2.19375 1.58438,4.63125 -0.12181,4.63125 z m -0.36563,-3.534375 c -1.09687,-1.21875 -2.07187,-1.096875 -2.31562,-0.73125 -0.24375,0.365625 0,1.4625 0.4875,2.071875 0.4875,0.609375 0.975,0.853125 1.70625,0.853125 0.73125,0.121875 1.34062,-0.853125 0.1218,-2.19375 z m -4.63125,-5.728124 -1.4625,-2.19375 3.53438,-5.60625 c 0,0 1.4625,2.071875 0.73125,3.290625 -0.36563,0.4875001 -1.70625,2.803125 -2.80313,4.509375 z m -5.60625,3.534374 c 0.36563,-0.365625 1.21875,-1.340625 1.70625,-2.071875 l 0.975,1.4625 c -0.4875,0.73125 -1.09687,1.70625 -1.09687,1.70625 0,0 -1.09688,1.70625 -2.07188,3.046875 -0.85312,1.340625 -1.70625,1.584375 -2.80312,1.584375 -1.70625,0 -2.55938,-2.4375 -0.12181,-4.63125 1.70625,-1.4625 2.80312,-0.609375 3.4125,-1.096875 z m -2.925,2.19375 c -1.09687,1.21875 -0.4875,2.19375 0.24375,2.19375 0.73125,0 1.21875,-0.24375 1.70625,-0.853125 0.4875,-0.609375 0.73125,-1.828125 0.4875,-2.071875 -0.36562,-0.365625 -1.34062,-0.4875 -2.4375,0.73125 z" + id="path7886" + style="display:inline;fill:url(#radialGradient4861-6);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4873)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 292.45286,20.11787 h -7.56413 c -0.73125,0 -1.32549,-0.515308 -1.33058,-1.24654 l -0.028,-4.017519 v -3.16875 -2.9250003 c 0,-0.73125 0.4875,-1.21875 1.21875,-1.21875 l 6.44059,0.00442 2.53052,2.5152613 0.0354,8.810334 c 0.003,0.731244 -0.57138,1.24654 -1.30263,1.24654 z M 289.62394,8.7600607 v 2.4375003 h 2.4375 z m -7.3125,-0.6736655 0.0213,0.7169703 v 2.5152615 3.772891 l -5.06403,0.04019 c -0.73123,0.0058 -1.21672,-0.598663 -1.21875,-1.32991 l -0.028,-10.0556901 c -0.002,-0.7312471 0.4875,-1.21875 1.21875,-1.21875 h 6.09375 l 2.79402,2.5031129 v 1.81343 h -2.53052 c -0.67317,-0.017075 -1.31624,0.241688 -1.28654,1.2424914 z m 0.0213,-4.7304016 v 2.4596813 l 2.53052,-0.02779 z" + id="path8454" + style="display:inline;fill:url(#radialGradient4881-9);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4893)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 312.76384,20.20124 -10.1808,-0.02779 c -0.75126,-0.0021 -1.21143,-0.547743 -1.21303,-1.272325 l -0.028,-12.6083588 c -0.002,-0.9749978 0.29395,-1.2762443 1.26895,-1.2723257 l 2.49639,0.010033 c 0,0 0.0587,-2.5309032 2.49616,-2.5309032 2.4375,0 2.56487,2.5309032 2.56487,2.5309032 l 2.48359,0.017757 c 0.97497,0.00697 1.35938,0.3251372 1.35283,1.3001156 l -0.0839,12.4971989 c -0.005,0.808245 -0.51762,1.35744 -1.15713,1.355695 z m -1.86968,-13.8508896 -1.34061,-0.609375 c 0,0 0,-1.8281249 -1.95,-1.8281249 -1.95,0 -1.95,1.8281249 -1.95,1.8281249 l -1.34063,0.609375 -0.47079,1.1953846 h 7.59155 z m 0.53952,2.4530151 h -6.32629 l -2.53052,2.5152615 2.53052,5.030522 7.59155,-5.030522 z" + id="path9022" + style="display:inline;fill:url(#radialGradient4901-6);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4913)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="M 335.47361,15.091518 V 7.545735 l 3.79578,3.772892 z m -8.85681,1.257631 h 7.59155 l -3.79578,3.772892 z m 6.32629,-1.257631 h -5.06103 c -0.73124,-0.0041 -1.26114,-0.526392 -1.26526,-1.25763 V 8.8033655 c -0.004,-0.7312386 0.53401,-1.2576305 1.26526,-1.2576305 h 5.06103 c 0.73125,0 1.26526,0.5263804 1.26526,1.2576305 v 5.0305225 c 0,0.609375 -0.53402,1.261705 -1.26526,1.25763 z m 0,-3.772891 c 0,-0.73125 -0.53401,-1.257631 -1.26526,-1.257631 h -2.53052 c -0.73125,0 -1.26525,0.526381 -1.26525,1.257631 v 1.25763 c 0,0.73125 0.534,1.257631 1.26525,1.257631 h 2.53052 c 0.73125,0 1.26526,-0.526381 1.26526,-1.257631 z m -2.53052,-8.8034143 3.79578,3.7728917 h -7.59155 z m -5.06103,5.0305223 v 7.545783 l -3.79578,-3.772891 z" + id="path9590" + style="display:inline;fill:url(#radialGradient4921-8);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4933)" /> + <path + d="m 274,8 h 10 v 2 h -10 z" + id="path10158" + style="display:inline;fill:url(#radialGradient4941-9);fill-opacity:1;stroke-width:0.96615839" /> + <path + d="m 302,10 h -4 v 4 h -2 v -4 h -4 V 8 h 4 V 4 h 2 v 4 h 4 z" + id="path10726" + style="display:inline;fill:url(#radialGradient4949-5);fill-opacity:1;stroke-width:0.96615839" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 406.82037,12.583531 c -0.12181,0.73125 -0.24375,1.4625 -0.4875,2.071875 -0.4875,1.584375 -1.4625,3.046875 -3.04686,4.021874 0.4875,0.4875 1.58436,1.096875 1.58436,1.096875 0,0 -2.4375,0.365625 -4.99686,0.365625 l -0.12181,-0.121875 v 0.121875 c -1.21875,0 -2.4375,-0.365625 -3.65625,-0.73125 0.85311,-0.73125 1.4625,-1.584374 1.95,-2.559374 0.73125,-1.4625 0.73125,-3.65625 0.73125,-3.65625 0,0 1.09686,1.828125 1.70625,2.559375 1.4625,-0.73125 2.4375,-2.19375 2.55936,-3.65625 0.12181,-1.096875 -0.24375,-2.071875 -0.73125,-2.8031253 -0.4875,-0.8531251 -1.21875,-1.3406251 -2.07186,-1.7062501 0.24375,-0.4874999 0.60936,-1.0968749 0.975,-1.584375 0.4875,-0.73125 1.09686,-1.21875 1.58436,-1.4625 2.55939,1.340625 4.3875,4.5093751 4.02189,8.0437504 z m -8.53125,-2.4375 c 0,0 -1.34061,-1.8281254 -1.95,-2.4375004 -1.70625,0.853125 -2.68125,2.4375004 -2.68125,4.1437504 0.12181,1.828125 1.34064,3.290625 2.925,4.021875 -0.36561,0.609375 -0.73125,1.21875 -1.21875,1.70625 -0.4875,0.609375 -1.09686,0.974999 -1.4625,1.340624 -2.80311,-1.706249 -4.50936,-4.874999 -4.02186,-8.287499 0.1218,-0.8531253 0.36561,-1.7062504 0.60936,-2.4375004 0.4875,-1.3406249 1.34064,-2.4375 2.55939,-3.290625 0.1218,-0.121875 0.24375,-0.121875 0.36561,-0.24375 -0.4875,-0.4875 -1.95,-0.975 -1.95,-0.975 0,0 3.04689,-0.975 8.2875,-0.365625 -1.58436,2.315625 -1.4625,6.8250004 -1.4625,6.8250004 z" + id="path11294" + style="display:inline;fill:url(#radialGradient4957-2);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4969)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 429.73975,20.187746 -2.55504,0.05558 c -0.48738,0.0106 -0.61242,-0.769541 -0.61242,-1.378916 0,0 0.31966,-4.276424 -3.79578,-8.803414 -3.20233,-3.5225593 -8.85682,-3.7728916 -8.85682,-3.7728916 -0.60938,0 -1.26177,-0.171597 -1.25602,-0.6590635 l 0.028,-2.3732094 c 0.006,-0.4874666 0.61868,-0.7406188 1.22806,-0.7406188 0,0 7.05132,0.3003217 11.38734,5.0305223 3.72704,4.065871 5.06103,11.318675 5.06103,11.318675 0,0.4875 -0.0191,1.310083 -0.62831,1.323336 z M 413.91969,8.8033655 c 0,0 4.48239,0.7421569 7.0114,3.0905195 2.59016,2.40515 3.11068,6.970525 3.11068,6.970525 0,0.4875 -0.7448,1.278471 -1.23236,1.278471 h -1.35283 c -0.4875,0 -1.21059,-0.669096 -1.21059,-1.278471 0,0 0.4472,-2.304652 -1.91012,-4.45401 -1.78736,-1.629677 -4.41618,-1.834143 -4.41618,-1.834143 -0.60938,0 -1.23946,-0.793663 -1.22806,-1.281032 l 0.028,-1.195314 c 0.0114,-0.4873685 0.59073,-1.2965455 1.20011,-1.2965455 z m 1.20944,6.3426395 c 1.34062,0 2.54933,1.124665 2.54933,2.46529 0,1.340626 -1.09688,2.576451 -2.4375,2.576451 -1.34063,0 -2.54933,-1.208035 -2.54933,-2.548661 0,-1.340625 1.09687,-2.49308 2.4375,-2.49308 z" + id="path11862" + style="display:inline;fill:url(#radialGradient4977-4);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4989)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 448.08169,13.833888 v 2.515261 c 0,0.975 -0.41214,1.257631 -1.26525,1.257631 h -10.12208 c -0.85314,0 -1.26526,-0.282631 -1.26526,-1.257631 V 6.2881044 c 0,-0.9750001 0.41212,-1.2576306 1.26526,-1.2576306 h 10.12208 c 0.85311,0 1.26525,0.2826305 1.26525,1.2576306 v 2.5152611 l 5.06104,-2.5152611 V 16.349149 Z" + id="path12430" + style="display:inline;fill:url(#radialGradient4997-5);fill-opacity:1;stroke-width:1.21875;filter:url(#filter5009)" /> + <g + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline" + id="g4779"> + <path + id="bookmarks-star-4" + d="M 165.92886,2.5152127 V 20.122041 h 8.85681 1.26526 2.53052 c 1.26526,0 2.53052,-1.257631 2.53052,-2.515261 V 15.091518 7.545735 5.0304738 c 0,-1.2576306 -1.26526,-2.5152611 -2.53052,-2.5152611 h -2.53052 -1.26526 z m 7.59155,2.5152611 1.26526,2.5152612 c 0,0 0.39827,0.9972133 0.68613,1.1930622 0.26974,0.1834496 1.07417,0.064568 1.07417,0.064568 h 3.30074 l -2.53052,3.1379238 c 0,0 -0.38069,0.332603 -0.51773,0.634968 -0.20593,0.452534 -0.18971,0.518683 -0.12151,1.257631 0.10732,1.162403 0.63924,3.772892 0.63924,3.772892 l -2.53052,-1.257631 c 0,0 -0.77873,-0.42944 -1.26526,-0.430166 -0.5721,0 -1.26526,0.430166 -1.26526,0.430166 l -2.53051,1.257631 c 0,0 0.56012,-2.658345 0.73559,-3.772892 0.11606,-0.733074 0.10061,-0.753616 -0.15752,-1.257631 -0.13995,-0.274086 -0.57807,-0.782455 -0.57807,-0.782455 l -2.53052,-2.9904368 h 3.02161 c 0,0 0.91024,-0.099407 1.27135,-0.3263622 0.27408,-0.1711231 0.76807,-0.9312683 0.76807,-0.9312683 z" + style="fill:url(#radialGradient4710-4);fill-opacity:1;stroke-width:1.265625;filter:url(#filter4729)" /> + <path + id="bookmarks-overlay-1" + d="m 163.39834,2.5152127 c -1.26526,0 -2.53052,1.2576305 -2.53052,2.5152611 v 2.5152612 7.545783 2.515262 c 0,1.25763 1.26526,2.515261 2.53052,2.515261 h 2.91839 l 0.0559,-4.840061 V 7.6882296 l 0.028,-5.1730169 z" + style="fill:url(#radialGradient4712-2);fill-opacity:1;stroke:none;stroke-width:1.265625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill;filter:url(#filter4774)" /> + <path + id="bookmarks-divider-7" + d="M 165.92886,2.5152127 V 20.122041" + style="opacity:0.66300001;fill:url(#radialGradient4714-4);fill-opacity:1;stroke:url(#radialGradient4750-3);stroke-width:1.2614392;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4709-1-2);fill-opacity:1;stroke-width:1;filter:url(#filter4844)" + id="path4214-3" + d="m 133.03211,35.213608 -6.32629,6.288153 c -0.24,0.36 -0.8202,0.518975 -1.3002,0.518975 -0.48,0 -0.87032,-0.158975 -1.23032,-0.518975 l -6.3263,-6.288153 c -0.6,-0.72 -0.96335,-1.29465 -0.003,-1.287183 l 3.79916,0.02955 -0.0908,-7.535242 c -0.009,-0.719949 0.67572,-1.307177 1.39571,-1.31116 l 5.02367,-0.02779 c 0.71999,-0.004 1.25401,0.619416 1.22796,1.33895 l 0.035,7.535242 3.80499,-0.02955 c 0.95998,-0.0075 0.71078,0.567183 -0.009,1.287183 z" /> + </g> +</svg> diff --git a/application/palemoon/themes/windows/Toolbar-inverted.png b/application/palemoon/themes/windows/Toolbar-inverted.png Binary files differindex 2c3253fe8..54d83bf5f 100644 --- a/application/palemoon/themes/windows/Toolbar-inverted.png +++ b/application/palemoon/themes/windows/Toolbar-inverted.png diff --git a/application/palemoon/themes/windows/Toolbar-inverted.svg b/application/palemoon/themes/windows/Toolbar-inverted.svg new file mode 100644 index 000000000..ce59313e6 --- /dev/null +++ b/application/palemoon/themes/windows/Toolbar-inverted.svg @@ -0,0 +1,302 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + enable-background="new 0 0 378 38" + viewBox="0 0 378 38" + height="38" + width="378" + y="0px" + x="0px" + id="strataToolbarSVG" + version="1.1"> + <metadata + id="metadata146"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs144"> + <filter + id="filter1070" + style="color-interpolation-filters:sRGB;"> + <feFlood + id="feFlood1060" + result="flood" + flood-color="rgb(0,0,0)" + flood-opacity="0.498039" /> + <feComposite + id="feComposite1062" + result="composite1" + operator="in" + in2="SourceGraphic" + in="flood" /> + <feGaussianBlur + id="feGaussianBlur1064" + result="blur" + stdDeviation="0.5" + in="composite1" /> + <feOffset + id="feOffset1066" + result="offset" + dy="0" + dx="0" /> + <feComposite + id="feComposite1068" + result="fbSourceGraphic" + operator="over" + in2="offset" + in="SourceGraphic" /> + <feColorMatrix + id="feColorMatrix1072" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + in="fbSourceGraphic" + result="fbSourceGraphicAlpha" /> + <feFlood + in="fbSourceGraphic" + result="flood" + flood-color="rgb(0,0,0)" + flood-opacity="0.498039" + id="feFlood1074" /> + <feComposite + result="composite1" + operator="in" + in="flood" + id="feComposite1076" + in2="fbSourceGraphic" /> + <feGaussianBlur + result="blur" + stdDeviation="0.5" + in="composite1" + id="feGaussianBlur1078" /> + <feOffset + result="offset" + dy="0" + dx="0" + id="feOffset1080" /> + <feComposite + result="fbSourceGraphic" + operator="over" + in="fbSourceGraphic" + id="feComposite1082" + in2="offset" /> + <feColorMatrix + id="feColorMatrix1084" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + in="fbSourceGraphic" + result="fbSourceGraphicAlpha" /> + <feFlood + in="fbSourceGraphic" + result="flood" + flood-color="rgb(0,0,0)" + flood-opacity="0.498039" + id="feFlood1086" /> + <feComposite + result="composite1" + operator="in" + in="flood" + id="feComposite1088" + in2="fbSourceGraphic" /> + <feGaussianBlur + result="blur" + stdDeviation="0.5" + in="composite1" + id="feGaussianBlur1090" /> + <feOffset + result="offset" + dy="0" + dx="0" + id="feOffset1092" /> + <feComposite + result="fbSourceGraphic" + operator="over" + in="fbSourceGraphic" + id="feComposite1094" + in2="offset" /> + <feColorMatrix + id="feColorMatrix1096" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + in="fbSourceGraphic" + result="fbSourceGraphicAlpha" /> + <feFlood + in="fbSourceGraphic" + result="flood" + flood-color="rgb(0,0,0)" + flood-opacity="0.498039" + id="feFlood1098" /> + <feComposite + result="composite1" + operator="in" + in="flood" + id="feComposite1100" + in2="fbSourceGraphic" /> + <feGaussianBlur + result="blur" + stdDeviation="0.5" + in="composite1" + id="feGaussianBlur1102" /> + <feOffset + result="offset" + dy="0" + dx="0" + id="feOffset1104" /> + <feComposite + result="fbSourceGraphic" + operator="over" + in="fbSourceGraphic" + id="feComposite1106" + in2="offset" /> + <feColorMatrix + id="feColorMatrix1108" + values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0" + in="fbSourceGraphic" + result="fbSourceGraphicAlpha" /> + <feFlood + in="fbSourceGraphic" + result="flood" + flood-color="rgb(0,0,0)" + flood-opacity="0.498039" + id="feFlood1110" /> + <feComposite + result="composite1" + operator="in" + in="flood" + id="feComposite1112" + in2="fbSourceGraphic" /> + <feGaussianBlur + result="blur" + stdDeviation="0.5" + in="composite1" + id="feGaussianBlur1114" /> + <feOffset + result="offset" + dy="0" + dx="0" + id="feOffset1116" /> + <feComposite + result="composite2" + operator="over" + in="fbSourceGraphic" + id="feComposite1118" + in2="offset" /> + </filter> + </defs> + <g + style="fill:#ffffff;filter:url(#filter1070)" + id="toolbar"> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 14.7,10.7 C 14.464283,10.935746 14.000125,11 14.000125,11 H 9 l 2.132,2.085573 c 0.519423,0.508112 0.595,1.2729 0.198,1.6979 l -0.793,0.9549 c -0.396,0.424 -1.091,0.318 -1.587,-0.212 L 3.595,9.690773 3,8.946873 l 0.595,-0.743 5.256,-5.7295 c 0.496,-0.531 1.19,-0.637 1.587,-0.212 l 0.794,0.9549 c 0.396,0.425 0.297,1.1669 -0.198,1.6979 L 9,7 h 4.999875 c 0,0 0.464437,0.064342 0.700125,0.3 0.235717,0.2356875 0.299875,0.7 0.299875,0.7 l 2.5e-4,2 c 0,0 -0.06444,0.464283 -0.300125,0.7 z" + id="back" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="back-large" + d="m 16.441631,29.733331 c -0.275,0.275034 -0.816512,0.349996 -0.816512,0.349996 H 8.999927 l 2.487308,2.516543 c 0.595913,0.602917 0.694159,1.485034 0.230997,1.980862 l -0.925157,1.114039 C 10.33108,36.189432 9.5202547,36.065767 8.9415947,35.44744 L 2.6941594,28.639311 2,27.771437 2.6941594,26.904612 8.8260957,20.220265 c 0.57866,-0.619493 1.3883193,-0.743159 1.8514803,-0.24733 l 0.926324,1.114038 c 0.461995,0.495828 0.346497,1.361369 -0.230997,1.980863 l -2.37283,2.348836 h 6.6249 c 0,0 0.541837,0.07506 0.816804,0.349997 0.275,0.274966 0.34985,0.816658 0.34985,0.816658 l 1.46e-4,2.333346 c 0,0 -0.07518,0.541658 -0.350142,0.816658 z" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="forward" + d="m 21.30025,10.7 c 0.235717,0.235746 0.699875,0.3 0.699875,0.3 h 5.000125 l -2.132,2.085573 c -0.519423,0.508112 -0.595,1.2729 -0.198,1.6979 l 0.793,0.9549 c 0.396,0.424 1.091,0.318 1.587,-0.212 l 5.355,-5.8356 0.595,-0.7439 -0.595,-0.743 -5.256,-5.7295 c -0.496,-0.531 -1.19,-0.637 -1.587,-0.212 l -0.794,0.9549 c -0.396,0.425 -0.297,1.1669 0.198,1.6979 L 27.00025,7 h -4.999875 c 0,0 -0.464437,0.064342 -0.700125,0.3 C 21.064533,7.5356875 21.000375,8 21.000375,8 l -2.5e-4,2 c 0,0 0.06444,0.464283 0.300125,0.7 z" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 51.5,4.64955 47.233834,8.949625 51.5,13.248616 49.366916,15.398166 45,11.201008 40.733834,15.5 38.60075,13.35045 42.866916,8.9485416 38.5,4.64955 40.633084,2.5 45,6.800075 49.266166,2.5 Z" + id="stop" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 69,9 H 62 L 64.8,6.2 C 64.1,5.7 63.4,5.5 62.5,5.5 c -2.2,0 -4,1.8 -4,4 0,2.2 1.8,4 4,4 1.399,0 2.7,-0.7 3.399,-1.9 l 2.301,1 C 67.099,14.6 65,16 62.5,16 58.899,16 56,13.1 56,9.5 56,5.9 58.899,3 62.5,3 64,3 65.399,3.5 66.6,4.4 L 69,2 Z" + id="reload" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 76,9 h -3 l 8,-7 8,7 h -3 v 6.5 H 82 V 12 h -2 v 3.5 h -4 z" + id="home" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 91.5,9 h 4.453 V 2 h 6.093 V 9 H 106.5 L 99,16 Z" + id="download" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 117,2 c -3.866,0 -7,3.134 -7,7 0,3.866 3.134,7 7,7 3.866,0 7,-3.134 7,-7 0,-3.866 -3.134,-7 -7,-7 z m 0,2 c 2.761,0 5,2.238 5,5 0,2.762 -2.239,5 -5,5 -2.762,0 -5,-2.238 -5,-5 0,-2.762 2.239,-5 5,-5 z m -0.7,1.2 C 116.0643,5.4357023 116,6 116,6 v 4 l 4,2 -2,-3 V 6 C 118,6 117.9357,5.4357023 117.7,5.2 117.4643,4.9642977 117,5 117,5 c 0,0 -0.4643,-0.035702 -0.7,0.2 z" + id="history" /> + <g + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="bookmarks"> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 131,2 v 14 h 7.44922 0.55078 1.94922 c 0.99175,-0.258441 1.76717,-1.038297 2,-2 V 12 6 4 c -0.23283,-0.9617034 -1.00825,-1.7415586 -2,-2 h -1.63672 -0.86328 z m 6.11523,2.4160156 1.05469,1.7714844 c 0,0 0.29209,0.4878333 0.51953,0.6425781 0.21313,0.1449479 0.73828,0.2285157 0.73828,0.2285157 h 2.15625 l -1.49804,2.4335937 c 0,0 -0.21789,0.4778906 -0.32617,0.7167965 -0.16271,0.357558 0.005,0.982547 0.0586,1.566407 0.0848,0.918442 0.15039,1.80664 0.15039,1.80664 l -1.75,-0.894531 c 0,0 -0.71714,-0.337318 -1.10156,-0.337891 -0.45203,0 -1.29883,0.392579 -1.29883,0.392579 l -1.75391,0.841796 c 0,0 0.12894,-0.80101 0.26758,-1.68164 0.0917,-0.579219 0.34458,-1.238485 0.14063,-1.636719 -0.11058,-0.216562 -0.33204,-0.6484375 -0.33204,-0.6484375 l -1.7246,-2.5019531 h 2.14257 c 0,0 0.69711,-0.049193 0.98243,-0.2285156 0.21656,-0.1352084 0.48242,-0.5957032 0.48242,-0.5957032 z" + id="bookmarks-star" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 129,2 c -0.99175,0.2584414 -1.76717,1.0382967 -2,2 v 2 6 2 c 0.23283,0.961703 1.00825,1.741559 2,2 h 2.5 V 12 6 2 Z" + id="bookmarks-overlay" /> + <path + style="stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 131.49914,2 V 16" + id="bookmarks-divider" /> + </g> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 160,14 h -2 l 1,2 h -12 l 1,-2 h -2 c -0.601,0 -1,-0.4 -1,-1 V 8 c 0,-0.6 0.70113,-0.635443 1,-1 0.38098,-0.4647208 0.61902,-1.0352792 1,-1.5 0.29887,-0.364557 0.399,-1 1,-1 V 3 c 0,-0.6 0.399,-1 1,-1 h 8 c 0.6,0 1,0.4 1,1 v 1.5 c 0.6,0 0.70113,0.635443 1,1 0.38098,0.4647208 0.61902,1.0352792 1,1.5 0.29887,0.364557 1,0.4 1,1 v 5 c 0,0.6 -0.4,1 -1,1 z M 148.5,9 h -0.5 -0.5 c -0.3,0 -0.5,0.2 -0.5,0.5 0,0.3 0.2,0.5 0.5,0.5 h 1 C 148.8,10 149,9.8 149,9.5 149,9.2 148.8,9 148.5,9 Z M 157,4 c 0,-0.6 -0.4,-1 -1,-1 h -6 c -0.601,0 -1,0.4 -1,1 v 3 c 0,0.6 0.399,1 1,1 h 6 c 0.6,0 1,-0.4 1,-1 z m -0.9,9 h -6.2 l -0.899,2 h 8 z" + id="print" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="newtab" + d="m 170.93359,2 -4.01562,0.00195 c 0,0.00178 -0.87681,0.216686 -0.87695,1.4980469 v 2.8164062 c 0,0 -0.0732,0.3643751 -0.19922,0.484375 C 165.69982,6.9357812 165.29102,7 165.29102,7 c 0,0 -0.53242,-0.057 -0.7754,0 -0.36297,0.086 -0.73599,0.236 -1,0.5 -0.26399,0.264 -0.41502,0.637 -0.5,1 -0.038,0.162 0,0.5 0,0.5 v 5.537109 c 0,0 0.24003,0.710891 0.5,0.962891 0.27398,0.267 1.03516,0.5 1.03516,0.5 h 13.0957 c 0,0 0.60287,-0.276 0.83985,-0.5 0.21699,-0.205 0.49023,-0.742188 0.49023,-0.742188 V 9 c 0.026,-0.322 0.038,-0.338 0,-0.5 -0.086,-0.363 -0.22624,-0.736 -0.49023,-1 -0.26398,-0.264 -0.63802,-0.415 -1,-0.5 -0.22799,-0.054 -0.69922,0 -0.69922,0 0,0 -0.44657,-0.056219 -0.60156,-0.1992188 -0.12799,-0.1189999 -0.19922,-0.484375 -0.19922,-0.484375 L 175.98828,3.5 C 175.98843,2.1047456 174.9707,2 174.9707,2 Z m -0.79101,5 h 1.71484 V 9.1425781 H 174 v 1.7148439 h -2.14258 V 13 h -1.71484 V 10.857422 H 168 V 9.1425781 h 2.14258 z" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="newwindow" + d="M 182.4375,2 C 181.52354,2.2781435 181.28553,2.8114358 181,3.6875 V 14.125 c 0.21642,1.330001 0.75257,1.636052 2.0625,1.875 H 195 c 1.30474,-0.204204 1.70477,-0.57308 2,-1.875 V 4 C 196.8019,2.7723315 196.4998,2.3703399 195.3125,2 Z M 190,3 h 1 v 1 h -1 z m 2,0 h 1 v 1 h -1 z m 2,0 h 2 v 1 h -2 z m -11,3 h 12 v 8 h -12 z m 5.14258,1 V 9.1425781 H 186 v 1.7148439 h 2.14258 V 13 h 1.71484 V 10.857422 H 192 V 9.1425781 h -2.14258 V 7 Z" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 212.70159,16 c -0.79707,0 -1.49513,-0.2 -2.2922,-1.3 -0.79807,-1.1 -1.69515,-2.5 -1.69515,-2.5 0,0 -0.69706,-0.9 -1.09709,-1.6 -0.49805,-0.7 -1.0971,-0.5 -1.0971,-0.5 0,0 -2.89125,-4.7 -3.3903,-5.4 -0.59805,-1 0.59906,-2.7 0.59906,-2.7 l 4.38738,7 c 0,0 1.39612,1.9 1.89417,2.3 0.49904,0.4 1.39612,-0.4 2.79224,0.9 1.89417,1.8 1.29611,3.8 -0.10101,3.8 z m -0.29802,-2.9 c -0.89708,-1 -1.69415,-0.9 -1.89417,-0.6 -0.20002,0.3 0,1.2 0.39804,1.7 0.39803,0.5 0.79806,0.7 1.39612,0.7 0.59905,0.1 1.09709,-0.7 0.10001,-1.8 z m -3.78934,-4.7 -1.1961,-1.8 2.89125,-4.6 c 0,0 1.19611,1.7 0.59906,2.7 -0.29903,0.4 -1.39613,2.3 -2.29421,3.7 z m -4.5854,2.899 c 0.29903,-0.3 0.99709,-1.1 1.39613,-1.7 l 0.79806,1.2 c -0.39803,0.6 -0.89707,1.4 -0.89707,1.4 0,0 -0.89608,1.4 -1.69415,2.5 -0.69806,1.1 -1.39612,1.3 -2.2932,1.3 -1.39613,0 -2.09419,-2 -0.10001,-3.8 1.39412,-1.199 2.2912,-0.499 2.79024,-0.9 z m -2.39321,1.801 c -0.89708,1 -0.39803,1.8 0.19902,1.8 0.59905,0 0.99709,-0.2 1.39612,-0.7 0.39804,-0.5 0.59806,-1.5 0.39804,-1.7 -0.29803,-0.3 -1.0961,-0.4 -1.99318,0.6 z" + id="cut" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 231,16 h -6 c -0.601,0 -1,-0.4 -1,-1 V 12 9.4 7 c 0,-0.6 0.399,-1 1,-1 0,0 3.2,0 5,0 l 2,2 c 0,2.2 0,7 0,7 0,0.6 -0.4,1 -1,1 z m -2,-9 v 2 h 2 z M 223,5.9 V 7 8.9 12 h -4 c -0.601,0 -1,-0.4 -1,-1 V 3 c 0,-0.6 0.399,-1 1,-1 0,0 3.2,0 5,0 l 2,2 c 0,0.4 0,0.8 0,1.3 h -2.5 C 223.2,5.4 223,5.6 223,5.9 Z M 223,3 v 2 h 2 z" + id="copy" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 246.8507,16 h -7.7014 C 238.26914,16 237.5,15.3 237.5,14.5 v -9 c 0,-0.8 0.77014,-1.5 1.6493,-1.5 h 1.6503 c 0,0 0,-2 2.2004,-2 2.2004,0 2.2004,2 2.2004,2 h 1.6493 c 0.88016,0 1.6503,0.7 1.6503,1.5 v 9 c 0.001,0.799 -0.76914,1.5 -1.6493,1.5 z M 245.97054,5 244.76032,4.5 c 0,0 0,-1.5 -1.76032,-1.5 -1.76032,0 -1.76032,1.5 -1.76032,1.5 l -1.21122,0.5 -0.5501,1 h 2.7505 3.52164 0.88016 z m 0.11002,1.7 h -5.17094 l -3.3016,1.7 3.08056,4.9 7.26232,-3.8 z" + id="paste" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 265,12 V 6 l 3,3 z m -7,1 h 6 l -3,3 z m 0,-1 V 6 h 6 v 6 z m 5,-4 h -4 v 3 h 4 z m -2,-6 3,3 h -6 z m -4,4 v 6 l -3,-3 z" + id="fullscreen" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 274,8 h 10 v 2 h -10 z" + id="minus" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 302,10 h -4 v 4 h -2 v -4 h -4 V 8 h 4 V 4 h 2 v 4 h 4 z" + id="plus" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 321.96164,9.3589991 c -0.0996,0.5880529 -0.19907,1.1749739 -0.39904,1.6649929 -0.39904,1.272996 -2.49721,3.230982 -2.49721,3.230982 l 1.23012,1.745023 -4.92726,6e-6 V 9.849 c 0,0 0.89889,1.46799 1.39795,2.05599 1.19912,-0.588025 1.99814,-1.762997 2.09818,-2.9380158 0.10109,-0.8810027 -0.19905,-1.6639894 -0.59902,-2.2510039 -0.18813,-0.3229439 -0.42109,-0.5799624 -0.68685,-0.7931908 -0.30005,-0.23897 -1.01208,-0.5779774 -1.01208,-0.5779774 l 0.0174,-3.3306603 c 1.03186,0.2680556 1.4999,0.3864246 2.85781,1.3686643 1.67715,1.2509803 2.78224,3.5019854 2.52022,5.9759989 z m -6.99262,-1.9580198 c 0,0 -1.09884,-1.4681946 -1.59912,-1.9580122 -1.39809,0.6859994 -2.19718,1.957993 -2.19714,3.3290059 0.39151,1.955025 1.15486,2.878079 2.87049,3.728027 V 16 c -1.14823,-0.14515 -2.89657,-1.144129 -3.76062,-2.017966 -1.64214,-1.695027 -2.56324,-3.735 -2.20626,-6.1889776 0.1,-0.6850241 0.30006,-1.3699914 0.49903,-1.9580159 0.40011,-1.0769929 1.10011,-1.957978 2.09921,-2.6429982 0.0997,-0.098323 0.199,-0.098023 0.29929,-0.1955973 -0.39905,-0.3919885 -1.2861,-0.9964444 -1.2861,-0.9964444 l 5.35545,-1.3e-6 z" + id="sync" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 339.29905,15.9 h -1.49989 c -0.39997,0 -0.79995,-0.3 -0.79995,-0.8 0,0 0.29998,-3.6 -3.19977,-7.2 -2.49982,-3 -6.9995,-3.2 -6.9995,-3.2 C 326.29998,4.7 326,4.4 326,4 V 2.6 c 0,-0.4 0.29998,-0.7 0.79994,-0.7 0,0 6.29955,0.4 9.59932,4.5 3.29976,3.1 3.60074,8.8 3.60074,8.8 -10e-4,0.4 -0.20099,0.7 -0.70095,0.7 z m -12.49911,-9 c 0,0 3.69974,0.5 5.79959,2.4 2.09985,2 2.49982,5.9 2.49982,5.9 0,0.4 -0.1,0.8 -0.49996,0.8 h -1.4999 c -0.39997,0 -0.59995,-0.3 -0.59995,-0.8 0,0 0.1,-2.4 -1.80088,-4.2 C 329.19877,9.7 326.79994,9.6 326.79994,9.6 326.29998,9.6 326,9.3 326,8.9 V 7.6 c 0,-0.4 0.29998,-0.7 0.79994,-0.7 z m 1.19992,5 c 1.09992,0 1.99985,0.9 1.99985,2 0,1.1 -0.89993,2 -1.99985,2 C 326.89894,15.9 326,15 326,13.9 c 0,-1.1 0.89994,-2 1.99986,-2 z" + id="rss" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 344.5,5 c 0,0 0.0643,-0.4642977 0.3,-0.7 0.2357,-0.2357023 0.7,-0.3 0.7,-0.3 h 7.5 c 0,0 0.4643,0.064298 0.7,0.3 0.2357,0.2357023 0.3,0.7 0.3,0.7 v 2 l 4.0245,-3 -0.049,10 L 354,11 v 2 c 0,0 -0.0643,0.464298 -0.3,0.7 -0.2357,0.235702 -0.7,0.3 -0.7,0.3 h -7.5 c 0,0 -0.4643,-0.0643 -0.7,-0.3 -0.2357,-0.235702 -0.3,-0.7 -0.3,-0.7 z" + id="webrtc" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="bookmark-none" + d="m 369.20312,1 -1.9082,3.2734375 c 0,0 -0.46184,0.8030625 -0.83984,1.0390625 -0.498,0.313 -1.71875,0.3984375 -1.71875,0.3984375 H 361 l 3.00781,4.3652345 c 0,0 0.38708,0.754812 0.58008,1.132812 0.356,0.6951 -0.0841,1.844469 -0.24414,2.855469 -0.242,1.5371 -0.4668,2.935547 -0.4668,2.935547 l 3.06055,-1.466797 c 0,0 1.47663,-0.685547 2.26562,-0.685547 0.671,10e-4 1.92579,0.587891 1.92579,0.587891 l 3.05273,1.5625 c 0,0 -0.11177,-1.549244 -0.25976,-3.152344 -0.093,-1.0191 -0.38752,-2.112228 -0.10352,-2.736328 0.189,-0.417 0.56836,-1.2519531 0.56836,-1.2519531 L 377,5.6113281 h -3.76172 c 0,0 -0.91706,-0.1454375 -1.28906,-0.3984375 -0.397,-0.2701 -0.90625,-1.1210937 -0.90625,-1.1210937 z m -0.0762,3 1.15039,1.9316406 c 0,0 0.31633,0.5323647 0.56446,0.7011719 0.23249,0.1581201 0.80664,0.25 0.80664,0.25 H 374 l -1.63281,2.6542969 c 0,0 -0.23929,0.5206326 -0.35742,0.7812496 -0.17749,0.39005 0.008,1.074021 0.0664,1.710938 C 372.16866,13.031203 372.23828,14 372.23828,14 l -1.9082,-0.978516 c 0,0 -0.78376,-0.366562 -1.20313,-0.367187 -0.4931,0 -1.41601,0.429687 -1.41601,0.429687 L 365.79883,14 c 0,0 0.13977,-0.873327 0.29101,-1.833984 0.1,-0.631855 0.37484,-1.350734 0.15235,-1.785157 -0.12063,-0.236243 -0.36133,-0.708984 -0.36133,-0.708984 L 364,6.9453125 h 2.33594 c 0,0 0.76298,-0.054381 1.07422,-0.25 0.23624,-0.1474953 0.52343,-0.6484375 0.52343,-0.6484375 z" /> + <path + style="stroke:none;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + id="bookmark-added" + d="m 369.202,19 -1.908,3.2732 c 0,0 -0.461,0.8031 -0.839,1.0391 -0.498,0.313 -1.718,0.399 -1.718,0.399 H 361 l 3.008,4.3643 c 0,0 0.387,0.755 0.58,1.133 0.356,0.6951 -0.084,1.8452 -0.244,2.8562 C 364.102,33.6019 363.877,35 363.877,35 l 3.06,-1.4671 c 0,0 1.477,-0.686 2.266,-0.686 0.671,0.001 1.925,0.588 1.925,0.588 l 3.053,1.5641 c 0,0 -0.112,-1.5501 -0.26,-3.1532 -0.093,-1.0191 -0.388,-2.1121 -0.104,-2.7362 0.189,-0.417 0.57,-1.252 0.57,-1.252 L 377,23.6123 h -3.763 c 0,0 -0.917,-0.146 -1.289,-0.399 -0.397,-0.2701 -0.906,-1.1221 -0.906,-1.1221 z" /> + </g> +</svg> diff --git a/application/palemoon/themes/windows/Toolbar.png b/application/palemoon/themes/windows/Toolbar.png Binary files differindex 3d1b80ec7..8ec756e03 100644 --- a/application/palemoon/themes/windows/Toolbar.png +++ b/application/palemoon/themes/windows/Toolbar.png diff --git a/application/palemoon/themes/windows/Toolbar.svg b/application/palemoon/themes/windows/Toolbar.svg new file mode 100644 index 000000000..7a68c0608 --- /dev/null +++ b/application/palemoon/themes/windows/Toolbar.svg @@ -0,0 +1,1356 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + id="PaleMoonToolbarSVG" + x="0px" + y="0px" + width="378" + height="38" + viewBox="0 0 378 38" + enable-background="new 0 0 378 38"> + <metadata + id="metadata146"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <defs + id="defs144"> + <radialGradient + id="globalGradient" + cy="0.69999999"> + <stop + offset="0.05" + id="stop4" + style="stop-color:#87939b;stop-opacity:1" /> + <stop + offset="1" + id="stop6" + style="stop-color:#45555f;stop-opacity:1" /> + </radialGradient> + <filter + id="insetShadow"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood1875" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite1877" /> + <feGaussianBlur + in="composite1" + stdDeviation="2" + result="blur" + id="feGaussianBlur1879" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset1881" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite1883" /> + </filter> + <filter + style="color-interpolation-filters:sRGB;" + id="filter2164"> + <feFlood + flood-opacity="1" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood2154" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite2156" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur2158" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset2160" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite2162" /> + </filter> + <radialGradient + gradientUnits="userSpaceOnUse" + r="7.2456884" + fy="12.21416" + fx="95.643087" + cx="95.643087" + gradientTransform="matrix(1.0350983,0,0,0.96609178,0,18)" + id="globalGradient-8" + cy="12.21416"> + <stop + offset="0.05" + id="stop4-5" + style="stop-color:#12d92d;stop-opacity:1" /> + <stop + offset="1" + id="stop6-5" + style="stop-color:#01b222;stop-opacity:1" /> + </radialGradient> + <radialGradient + xlink:href="#linearGradient4635" + id="radialGradient4669" + cx="10.529827" + cy="14.778796" + fx="10.529827" + fy="14.778796" + r="7.1399999" + gradientTransform="matrix(1,0,0,1.1087088,0,-1.2351844)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4635"> + <stop + style="stop-color:#6198cb;stop-opacity:1" + offset="0" + id="stop4631" /> + <stop + style="stop-color:#3a78b2;stop-opacity:1" + offset="1" + id="stop4633" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter4701"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4691" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4693" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4695" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4697" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4699" /> + </filter> + <radialGradient + xlink:href="#linearGradient4635" + id="radialGradient4637" + cx="11.063469" + cy="38.79744" + fx="11.063469" + fy="38.79744" + r="8.7600002" + gradientTransform="matrix(1,0,0,1.0853313,0,-3.029369)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4661"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4651" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4653" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4655" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4657" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4659" /> + </filter> + <radialGradient + xlink:href="#linearGradient4635" + id="radialGradient4677" + cx="34.841751" + cy="14.552581" + fx="34.841751" + fy="14.552581" + r="7.1399999" + gradientTransform="matrix(1,0,0,1.1003056,0,-1.1335797)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4689"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4679" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4681" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4683" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4685" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4687" /> + </filter> + <radialGradient + xlink:href="#linearGradient4603" + id="radialGradient4605" + cx="58.062626" + cy="12.761739" + fx="58.062626" + fy="12.761739" + r="7.6799994" + gradientTransform="matrix(1,0,0,0.99218759,0,0.09141507)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4603"> + <stop + style="stop-color:#e72b1d;stop-opacity:1" + offset="0" + id="stop4599" /> + <stop + style="stop-color:#cc4338;stop-opacity:1" + offset="1" + id="stop4601" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter4629"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4619" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4621" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4623" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4625" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4627" /> + </filter> + <radialGradient + xlink:href="#linearGradient4523-3" + id="radialGradient4525" + cx="79.305222" + cy="13.939252" + fx="79.305222" + fy="13.939252" + r="7.8000002" + gradientTransform="matrix(1,0,0,1.0769231,0,-0.86932835)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4523-3"> + <stop + style="stop-color:#4fb55d;stop-opacity:1" + offset="0" + id="stop4519" /> + <stop + style="stop-color:#2d8539;stop-opacity:1" + offset="1" + id="stop4521" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter4597"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4587" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4589" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4591" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4593" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4595" /> + </filter> + <radialGradient + xlink:href="#linearGradient4527" + id="radialGradient4529" + cx="103.23091" + cy="12.664675" + fx="103.23091" + fy="12.664675" + r="9.5995998" + gradientTransform="matrix(1,0,0,0.87507716,0,1.3868386)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4527"> + <stop + style="stop-color:#3f6bbd;stop-opacity:1" + offset="0" + id="stop4523" /> + <stop + style="stop-color:#29467b;stop-opacity:1" + offset="1" + id="stop4525" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter4783"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4773" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4775" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4777" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4779" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4781" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4709" + cx="125.30523" + cy="16.659737" + fx="125.30523" + fy="16.659737" + r="8.3726959" + gradientTransform="matrix(1,0,0,1.0032611,0,-0.03620244)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4707"> + <stop + style="stop-color:#8c9ba5;stop-opacity:1" + offset="0" + id="stop4703" /> + <stop + style="stop-color:#607480;stop-opacity:1" + offset="1" + id="stop4705" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter4721"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4711" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4713" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4715" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4717" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4719" /> + </filter> + <radialGradient + xlink:href="#linearGradient4727" + id="radialGradient4729" + cx="149.26262" + cy="12.784631" + fx="149.26262" + fy="12.784631" + r="8.6400051" + gradientTransform="matrix(1,0,0,0.993055,0,0.07848724)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4727"> + <stop + style="stop-color:#3eb796;stop-opacity:1" + offset="0" + id="stop4723" /> + <stop + style="stop-color:#31a886;stop-opacity:1" + offset="1" + id="stop4725" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter4741"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4731" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4733" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4735" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4737" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4739" /> + </filter> + <radialGradient + xlink:href="#linearGradient5023" + id="radialGradient5017" + cx="466.94476" + cy="12.037849" + fx="466.94476" + fy="12.037849" + r="9.6007004" + gradientTransform="matrix(0.79035186,0,0,0.79508811,-0.14216924,6.9389816e-4)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient5023"> + <stop + id="stop5019" + offset="0" + style="stop-color:#c6cdd2;stop-opacity:1" /> + <stop + id="stop5021" + offset="1" + style="stop-color:#9cabb4;stop-opacity:1" /> + </linearGradient> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4793" + cx="194.44176" + cy="13.746766" + fx="194.44176" + fy="13.746766" + r="9.5999947" + gradientTransform="matrix(1,0,0,0.87500048,0,1.3876528)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4805"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4795" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4797" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4799" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4801" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4803" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4833" + cx="239.2" + cy="11.101265" + fx="239.2" + fy="11.101265" + r="9.6000004" + gradientTransform="matrix(1,0,0,0.87500002,0,1.3876579)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4853"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4843" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4845" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4847" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4849" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4851" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4841" + cx="242.26164" + cy="12.423289" + fx="242.26164" + fy="12.423289" + r="3.5288758" + gradientTransform="matrix(0.79274531,0,0,0.78327977,-0.14435628,0.11758726)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4858" + cx="242.0894" + cy="12.418613" + fx="242.0894" + fy="12.418613" + r="3.5288758" + gradientTransform="matrix(1,0,0,0.9880597,0,0.14828194)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient5037" + id="radialGradient5031" + cx="466.39926" + cy="31.105829" + fx="466.39926" + fy="31.105829" + r="9.7507105" + gradientTransform="matrix(1,0,0,0.99992718,0,0.00247197)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient5037"> + <stop + id="stop5033" + offset="0" + style="stop-color:#e8e1a1;stop-opacity:1" /> + <stop + id="stop5035" + offset="1" + style="stop-color:#baad3e;stop-opacity:1" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter5049"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood5039" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5041" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5043" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset5045" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite5047" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4813" + cx="217.95329" + cy="16.56296" + fx="217.95329" + fy="16.56296" + r="10.35937" + gradientTransform="matrix(1,0,0,0.8160434,0,2.0506693)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4825"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4815" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4817" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4819" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4821" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4823" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4861" + cx="262.79288" + cy="15.840806" + fx="262.79288" + fy="15.840806" + r="8.5577164" + gradientTransform="matrix(1,0,0,0.9969072,0,0.03528241)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4873"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4863" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4865" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4867" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4869" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4871" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4881" + cx="286.58698" + cy="14.171478" + fx="286.58698" + fy="14.171478" + r="8.53125" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4893"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4883" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4885" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4887" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4889" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4891" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4901" + cx="308.97141" + cy="14.457072" + fx="308.97141" + fy="14.457072" + r="6.09375" + gradientTransform="matrix(1,0,0,1.4,0,-4.4901397)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4913"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4903" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4905" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4907" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4909" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4911" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4921" + cx="331.15933" + cy="13.119289" + fx="331.15933" + fy="13.119289" + r="8.53125" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4933"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4923" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4925" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4927" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4929" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4931" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4941" + cx="353.15076" + cy="11.316628" + fx="353.15076" + fy="11.316628" + r="6.09375" + gradientTransform="matrix(0.79035186,0,0,0.15902921,-0.14216924,7.1987363)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + gradientTransform="matrix(0.79035186,0,0,0.79514603,-0.14216924,3.8580698e-5)" + xlink:href="#linearGradient4707" + id="radialGradient4949" + cx="375.97003" + cy="11.407905" + fx="375.97003" + fy="11.407905" + r="6.09375" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4957" + cx="400.5007" + cy="13.518586" + fx="400.5007" + fy="13.518586" + r="8.5350475" + gradientTransform="matrix(1,0,0,0.99701325,0,0.03407254)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4969"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4959" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4961" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4963" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4965" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4967" /> + </filter> + <radialGradient + xlink:href="#linearGradient4975" + id="radialGradient4977" + cx="417.02075" + cy="15.742972" + fx="417.02075" + fy="15.742972" + r="8.53125" + gradientTransform="matrix(1.357667,-0.02466618,0.02411975,1.3275908,-149.53429,5.1574131)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4975"> + <stop + style="stop-color:#f79729;stop-opacity:1" + offset="0" + id="stop4971" /> + <stop + style="stop-color:#d2831f;stop-opacity:1" + offset="1" + id="stop4973" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter4989"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4979" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4981" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4983" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset4985" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4987" /> + </filter> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4997" + cx="444.33652" + cy="11.316628" + fx="444.33652" + fy="11.316628" + r="8.53125" + gradientTransform="matrix(1,0,0,0.71428563,0,3.2333231)" + gradientUnits="userSpaceOnUse" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter5009"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4999" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite5001" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur5003" /> + <feOffset + dx="0" + dy="0" + result="offset" + id="feOffset5005" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite5007" /> + </filter> + <radialGradient + xlink:href="#linearGradient4747" + id="radialGradient4710" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.265625,0,0,1.1109477,-0.05703897,1.4865748)" + cx="134.97461" + cy="9" + fx="134.97461" + fy="9" + r="7.9746099" /> + <linearGradient + id="linearGradient4747"> + <stop + style="stop-color:#c5b631;stop-opacity:1" + offset="0" + id="stop4743" /> + <stop + style="stop-color:#baad3e;stop-opacity:1" + offset="1" + id="stop4745" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter4729"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4719" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4721" /> + <feGaussianBlur + in="composite1" + stdDeviation="1" + result="blur" + id="feGaussianBlur4723" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4725" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4727" /> + </filter> + <radialGradient + xlink:href="#linearGradient5037" + id="radialGradient4712" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.265625,0,0,1.1109477,-0.05703897,1.4865748)" + cx="132.6468" + cy="9.0947113" + fx="132.6468" + fy="9.0947113" + r="7.9746099" /> + <filter + style="color-interpolation-filters:sRGB" + id="filter4774"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4764" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4766" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4768" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4770" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4772" /> + </filter> + <radialGradient + xlink:href="#linearGradient4747" + id="radialGradient4714" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.265625,0,0,1.1109477,-0.05703897,1.4865748)" + cx="134.97461" + cy="9" + fx="134.97461" + fy="9" + r="7.9746099" /> + <radialGradient + xlink:href="#linearGradient4707" + id="radialGradient4750" + cx="166.37157" + cy="11.485105" + fx="166.37157" + fy="11.485105" + r="0.31640625" + gradientTransform="matrix(0.99998863,-0.00473886,0.08838422,18.426509,-1.0132111,-199.35688)" + gradientUnits="userSpaceOnUse" /> + <radialGradient + xlink:href="#linearGradient4832" + id="radialGradient4709-1" + cx="125.30523" + cy="16.659737" + fx="125.30523" + fy="16.659737" + r="8.3726959" + gradientTransform="matrix(1,0,0,1.0032611,0.11563445,22.233158)" + gradientUnits="userSpaceOnUse" /> + <linearGradient + id="linearGradient4832"> + <stop + id="stop5029" + offset="0" + style="stop-color:#22e23d;stop-opacity:1" /> + <stop + id="stop4830" + offset="1" + style="stop-color:#38a748;stop-opacity:1" /> + </linearGradient> + <filter + style="color-interpolation-filters:sRGB" + id="filter4844"> + <feFlood + flood-opacity="0.498039" + flood-color="rgb(0,0,0)" + result="flood" + id="feFlood4834" /> + <feComposite + in="flood" + in2="SourceGraphic" + operator="out" + result="composite1" + id="feComposite4836" /> + <feGaussianBlur + in="composite1" + stdDeviation="0.5" + result="blur" + id="feGaussianBlur4838" /> + <feOffset + dx="2.77556e-017" + dy="0" + result="offset" + id="feOffset4840" /> + <feComposite + in="offset" + in2="SourceGraphic" + operator="atop" + result="composite2" + id="feComposite4842" /> + </filter> + </defs> + <g + id="g7757"> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4669);fill-opacity:1;stroke-width:1;filter:url(#filter4701)" + d="m 17.870749,13.841269 -6.303534,-0.0074 2.264363,2.148431 c 0.615648,0.584128 0.72,1.44 0.24,1.92 l -0.96,1.08 c -0.48,0.48 -1.32,0.36 -1.92,-0.24 0,0 -6.4200001,-6.6 -6.4800001,-6.6 -0.06,0 -0.36,-0.48 -0.48,-0.84 0,-0.359999 0.36,-0.719999 0.48,-0.839999 l 6.3600001,-6.48 c 0.6,-0.6000001 1.44,-0.7200001 1.92,-0.24 l 0.96,1.0799999 c 0.48,0.48 0.36,1.32 -0.24,1.9200001 l -2.144363,2.0610645 6.359451,0.043374 c 0.719983,0.00491 1.227959,0.50779 1.227959,1.2277905 v 2.483369 c 0,0.72 -0.563877,1.284215 -1.283876,1.28337 z" + id="path4" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4637);fill-opacity:1;stroke-width:1;filter:url(#filter4661)" + id="path4154" + d="m 19.187889,37.765372 -7.620674,-0.0365 3.352509,3.266174 c 0.515294,0.50108 0.829738,1.388534 0.443269,1.764345 l -1.759464,1.992905 c -0.356609,0.403923 -1.52102,-0.108922 -2.036314,-0.735274 L 3.9756591,36.471238 c 0,0 -0.7399492,-0.710192 -0.7399492,-1.211274 0,-0.501081 0.7399492,-1.303987 0.7399492,-1.303987 l 7.5915559,-7.545783 c 0.515294,-0.50108 1.613776,-1.093109 1.980397,-0.698138 l 1.815381,1.955768 c 0.386469,0.375811 0.172889,1.300401 -0.471228,1.801482 l -3.32455,3.229041 7.620674,0.02842 c 0.772936,0.0029 1.344153,0.417712 1.344153,1.169335 v 2.560987 c 0,0.751622 -0.571221,1.311987 -1.344153,1.308283 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4677);fill-opacity:1;stroke-width:1;filter:url(#filter4689)" + id="path4165" + d="m 26.776124,12.612425 v -2.53895 c 0,-0.7200003 0.480206,-1.3282747 1.2,-1.3111602 l 5.76,0.041051 L 31.66,6.7412646 c -0.602042,-0.5979755 -0.72,-1.4399999 -0.24,-1.92 l 0.96,-1.08 c 0.48,-0.48 1.32,-0.36 1.92,0.24 l 6.36,6.4800004 c 0.12,0.12 0.48,0.48 0.48,0.84 0,0.36 -0.36,0.84 -0.48,0.84 l -6.48,6.48 c -0.6,0.6 -1.44,0.72 -1.92,0.24 l -0.96,-1.08 c -0.48,-0.48 -0.36,-1.32 0.24,-1.92 L 33.736124,13.833888 28.06,13.868005 c -0.719987,0.0043 -1.283876,-0.53558 -1.283876,-1.25558 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4605);fill-opacity:1;stroke-width:1;filter:url(#filter4629)" + id="path4176" + d="m 64.708108,6.2881044 -5.061037,5.0305226 5.061037,5.030522 -2.530518,2.515261 -5.061038,-5.030522 -5.061037,5.030522 -2.530519,-2.515261 5.061037,-5.030522 -5.061037,-5.0305226 2.530519,-2.5152612 5.061037,5.0305223 5.061038,-5.0305223 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4525);fill-opacity:1;stroke-width:1;filter:url(#filter4597)" + id="path4187" + d="m 87.482777,11.318627 h -8.856816 l 3.13833,-3.0716727 C 81.15648,7.545735 80.363876,6.712205 79.283876,6.712205 c -2.64,0 -5.107543,1.9376803 -5.107543,4.577681 0,2.64 2.411627,5.050109 5.051627,5.050109 1.68,0 3.619039,-1.066107 4.459039,-2.506107 l 2.530518,1.25763 c -1.32,2.4 -3.961599,4.443007 -6.961599,4.443007 -4.32,0 -8.219378,-3.896849 -8.219378,-8.216849 0,-4.3200008 3.927337,-7.633261 8.247337,-7.633261 1.8,0 3.619792,0.8778997 5.059792,1.9578998 l 3.139108,-3.1271021 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4529);fill-opacity:1;stroke:none;stroke-width:1;stroke-opacity:1;filter:url(#filter4783)" + d="M 102.66589,2.5152127 92.543814,11.318627 h 3.795778 v 7.545783 h 5.061038 v -5.030522 h 2.53052 v 5.030522 h 5.06104 v -7.545783 h 3.79577 z" + id="path4209" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4709);fill-opacity:1;stroke-width:1;filter:url(#filter4721)" + id="path4214" + d="m 133.03211,12.576257 -6.32629,6.288153 c -0.24,0.36 -0.82401,0.692435 -1.30401,0.692435 -0.48,0 -0.86651,-0.332435 -1.22651,-0.692435 l -6.3263,-6.288153 c -0.79571,-0.72 -0.93921,-1.286268 0.0208,-1.280462 l 3.77501,0.02283 -0.0107,-7.5841022 c -0.001,-0.7199993 0.50796,-1.1722101 1.22796,-1.1722101 h 5.10754 c 0.72,0 1.22426,0.4800094 1.22796,1.2 l 0.0388,7.5563123 3.80118,-0.05062 c 0.95992,-0.01278 0.71459,0.588252 -0.005,1.308252 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4729);fill-opacity:1;stroke-width:1;filter:url(#filter4741)" + id="path4225" + d="m 148.19571,20.103585 c -4.8,0 -8.89163,-3.97895 -8.89163,-8.77895 0,-4.6800005 4.11959,-8.7145303 8.91959,-8.7145303 4.8,0 8.80776,3.9511599 8.80776,8.7511603 0,4.68 -4.03572,8.74232 -8.83572,8.74232 z m 0.0559,-15.04801 c -3.36,0 -6.39142,2.9178996 -6.39142,6.2779 0,3.24 2.9755,6.22232 6.3355,6.22232 3.36,0 6.33551,-2.86232 6.33551,-6.22232 0,-3.3600004 -2.91959,-6.2779 -6.27959,-6.2779 z m -0.63959,7.520682 c -0.48,-0.12 -0.63716,-0.735044 -0.64429,-1.214992 l -0.0559,-3.7667402 c -0.0107,-0.7199217 0.53592,-1.28337 1.25592,-1.28337 0.72,0 1.27834,0.535601 1.28388,1.25558 l 0.0289,3.7518922 c 1.32,1.32 2.53051,3.772891 2.53051,3.772891 0,0 -3.07896,-1.195261 -4.39896,-2.515261 z" /> + <path + style="display:inline;fill:url(#radialGradient5017);fill-opacity:1;stroke-width:0.79274529" + id="path4355" + d="m 369.00476,4.7878231 0.94842,1.9083504 0.47422,0.858758 0.94842,0.190835 2.18136,0.3816699 -1.61231,1.7175156 -0.6639,0.667923 0.0948,0.954175 0.37937,2.290022 -1.89685,-0.954178 -0.85358,-0.477086 -0.85358,0.477086 -1.89685,0.954178 0.37938,-2.290022 0.0948,-0.954175 -0.6639,-0.667923 -1.61232,-1.7175156 2.27622,-0.3816699 0.94842,-0.190835 0.37936,-0.858758 0.94843,-1.9083504 m 0,-3.4350309 c -0.28454,0 -0.56906,0.1908348 -0.75874,0.667922 l -1.89683,3.9121193 -4.07821,0.6679227 c -0.94842,0.190835 -1.13812,0.8587576 -0.47421,1.5266802 l 2.94011,3.1487776 -0.66391,4.389208 c -0.0948,0.572504 0.1897,0.954174 0.66391,0.954174 0.18967,0 0.37936,-0.09542 0.56905,-0.190835 l 3.69885,-2.003768 3.69884,2.003768 c 0.18969,0.09543 0.47421,0.190835 0.56906,0.190835 0.4742,0 0.75873,-0.38167 0.6639,-1.049592 l -0.6639,-4.389207 2.9401,-3.1487781 c 0.66391,-0.6679226 0.37938,-1.3358454 -0.4742,-1.5266803 L 371.66031,5.837416 369.76347,1.9252968 C 369.5738,1.543627 369.28926,1.3527922 369.00474,1.3527922 Z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4793);fill-opacity:1;stroke-width:1;filter:url(#filter4805)" + id="path4366" + d="m 202.62125,17.648005 -2.53039,-0.04122 1.26526,2.515261 h -15.18311 l 1.26526,-2.515261 -2.51784,0.02249 c -0.71997,0.0064 -1.31817,-0.563397 -1.31184,-1.28337 l 0.0559,-6.3612693 c 0.006,-0.7199727 0.59192,-1.2112687 1.31183,-1.2000001 l 1.19667,0.018731 0.0313,-2.5298907 c 0.009,-0.7199457 0.51397,-1.243001 1.23397,-1.243001 l 0.022,-1.2403691 c 0.0127,-0.7198886 0.6198,-1.2535885 1.33979,-1.2555799 l 10.04733,-0.02779 c 0.72,-0.00199 1.21931,0.5078413 1.22796,1.22779 l 0.0156,1.295949 c 0.72,0 1.2692,0.5785813 1.26831,1.2985809 l -0.003,2.4743108 1.26513,-10e-8 c 0.71992,-0.010711 1.26205,0.5376375 1.26526,1.2576305 v 6.288153 c 0,0.729621 -0.61509,1.257631 -1.26526,1.257631 z m -15.18298,-0.04122 1.26526,-2.515262 h -1.26526 z m 0.6,-6.288153 h -0.6 -0.6 c -0.36,0 -0.6,0.24 -0.6,0.6 0,0.36 0.24,0.6 0.6,0.6 h 1.2 c 0.36,0 0.6,-0.24 0.6,-0.6 0,-0.36 -0.25348,-0.503016 -0.6,-0.6 z M 198.8256,5.0304738 c 0,-0.72 -0.54528,-1.2523398 -1.26526,-1.2576306 h -7.59155 c -0.71998,-0.00529 -1.28117,0.5378043 -1.26526,1.2576306 v 3.7728917 c 0.0159,0.7198264 0.54528,1.2629215 1.26526,1.2576305 h 7.59155 c 0.71999,-0.0053 1.24942,-0.5078188 1.25592,-1.2277899 z m -1.26526,10.0610482 h -7.59155 l -1.26526,3.772892 h 10.12207 z m 2.53052,0 h -1.26526 l 1.26526,2.515262 z" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4833);fill-opacity:1;stroke-width:1;filter:url(#filter4853)" + id="path4388" + d="m 248.17426,18.945466 -16.43876,-0.02779 c -0.96,-0.0016 -1.40468,-0.339789 -1.40858,-1.299781 l -0.0559,-13.7557998 c -0.004,-0.959992 0.47654,-1.3847678 1.43653,-1.3831504 l 16.49468,0.02779 c 0.96,0.00162 1.24473,0.3675784 1.24083,1.3275705 l -0.0559,13.7557997 c -0.004,0.959992 -0.25287,1.356983 -1.21287,1.355361 z M 239.88388,3.8178947 c -0.36,0 -0.6,0.24 -0.6,0.6 0,0.36 0.24,0.6 0.6,0.6 0.36,0 0.6,-0.24 0.6,-0.6 0,-0.36 -0.24,-0.6 -0.6,-0.6 z m 2.64346,0 c -0.36,0 -0.6,0.24 -0.6,0.6 0,0.36 0.36,0.6 0.6,0.6 0.36,0 0.6,-0.24 0.6,-0.6 0,-0.36 -0.24,-0.6 -0.6,-0.6 z m 3.72,0 h -1.2 c -0.36,0 -0.6,0.24 -0.6,0.6 0,0.36 0.24,0.6 0.6,0.6 h 1.2 c 0.36,0 0.6,-0.24 0.6,-0.6 0,-0.36 -0.24,-0.6 -0.6,-0.6 z m 0.65592,4.9945298 c 0.005,-0.7199803 -0.53592,-1.2538267 -1.25592,-1.2555798 l -11.41287,-0.02779 c -0.72,-0.00175 -1.22533,0.5077946 -1.22796,1.2277899 l -0.028,7.6724304 c -0.003,0.719994 0.50796,1.175707 1.22795,1.172209 l 11.44083,-0.05558 c 0.71999,-0.0035 1.19464,-0.507809 1.2,-1.227789 z" /> + <g + aria-label="+" + transform="scale(0.98484984,1.0153832)" + style="font-style:normal;font-weight:normal;font-size:9.51294327px;line-height:0%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;display:inline;fill:url(#radialGradient4841);fill-opacity:1;stroke:none;stroke-width:0.79274535px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + id="text4409"> + <path + d="m 194.95358,9.8484986 h -2.03077 v 1.9696994 h -1.01538 V 9.8484986 h -2.03077 V 8.8636487 h 2.03077 V 6.893949 h 1.01538 v 1.9696997 h 2.03077 z" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.55116463px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:'sans-serif, Bold';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:url(#radialGradient4841);fill-opacity:1;stroke-width:0.79274535px" + id="path7725" /> + </g> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 467.25784,24.196945 c -0.36562,0 -0.73125,0.24375 -0.975,0.853125 l -2.4375,4.996876 -5.24062,0.853125 c -1.21875,0.24375 -1.4625,1.096875 -0.60938,1.95 l 3.77813,4.021875 -0.85313,5.60625 c -0.12181,0.73125 0.24375,1.21875 0.85313,1.21875 0.24375,0 0.4875,-0.121875 0.73125,-0.24375 l 4.75312,-2.559375 4.75313,2.559375 c 0.24375,0.121875 0.60937,0.24375 0.73125,0.24375 0.60937,0 0.975,-0.4875 0.85312,-1.340625 l -0.85312,-5.60625 3.77812,-4.021875 c 0.85313,-0.853125 0.4875,-1.70625 -0.60937,-1.95 l -5.24063,-0.853125 -2.4375,-4.996876 c -0.24375,-0.4875 -0.60937,-0.73125 -0.975,-0.73125 z" + id="path6182" + style="display:inline;fill:url(#radialGradient5031);fill-opacity:1;stroke-width:1.21875;filter:url(#filter5049)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 226.66131,15.091518 -0.0388,3.707848 c -0.007,0.673061 -0.5177,1.245488 -1.19079,1.24654 l -17.77799,0.02779 c -0.6731,0.0011 -1.2416,-0.573462 -1.24671,-1.24654 l -0.028,-3.688049 c -0.005,-0.673078 0.6302,-1.305219 1.30331,-1.305219 1.26531,-1.257631 1.03718,-3.269047 1.26531,-5.0305225 0.4278,-2.8226251 0.0953,-6.2244545 3.80878,-6.2479747 l 7.52682,-0.047673 c 3.73297,-0.023644 3.4173,3.4730226 3.84751,6.2956477 0.41438,2.7153765 0,3.7728915 1.26526,5.0305225 0.70548,0 1.26526,0.515815 1.26526,1.25763 z m -7.68106,-4.410561 h -1.82811 V 8.8528316 c 0,-0.8124995 -1.21875,-0.8124995 -1.21875,0 v 1.8281254 h -1.82814 c -0.8125,0 -0.8125,1.218749 0,1.218749 h 1.82814 v 1.828125 c 0,0.812501 1.21875,0.812501 1.21875,0 v -1.828125 h 1.82811 c 0.8125,0 0.8125,-1.218749 0,-1.218749 z" + id="path7318" + style="display:inline;fill:url(#radialGradient4813);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4825)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 269.02823,19.939154 c -0.975,0 -1.82813,-0.24375 -2.80313,-1.584375 -0.975,-1.340625 -2.07187,-3.046875 -2.07187,-3.046875 0,0 -0.85313,-1.096875 -1.34063,-1.95 -0.60937,-0.853125 -1.34062,-0.609375 -1.34062,-0.609375 0,0 -3.53438,-5.7281239 -4.14375,-6.581249 -0.73125,-1.21875 0.73125,-3.290625 0.73125,-3.290625 l 5.3625,8.531249 c 0,0 1.70625,2.315625 2.31562,2.803125 0.60938,0.4875 1.70625,-0.4875 3.4125,1.096875 2.31563,2.19375 1.58438,4.63125 -0.12181,4.63125 z m -0.36563,-3.534375 c -1.09687,-1.21875 -2.07187,-1.096875 -2.31562,-0.73125 -0.24375,0.365625 0,1.4625 0.4875,2.071875 0.4875,0.609375 0.975,0.853125 1.70625,0.853125 0.73125,0.121875 1.34062,-0.853125 0.1218,-2.19375 z m -4.63125,-5.728124 -1.4625,-2.19375 3.53438,-5.60625 c 0,0 1.4625,2.071875 0.73125,3.290625 -0.36563,0.4875001 -1.70625,2.803125 -2.80313,4.509375 z m -5.60625,3.534374 c 0.36563,-0.365625 1.21875,-1.340625 1.70625,-2.071875 l 0.975,1.4625 c -0.4875,0.73125 -1.09687,1.70625 -1.09687,1.70625 0,0 -1.09688,1.70625 -2.07188,3.046875 -0.85312,1.340625 -1.70625,1.584375 -2.80312,1.584375 -1.70625,0 -2.55938,-2.4375 -0.12181,-4.63125 1.70625,-1.4625 2.80312,-0.609375 3.4125,-1.096875 z m -2.925,2.19375 c -1.09687,1.21875 -0.4875,2.19375 0.24375,2.19375 0.73125,0 1.21875,-0.24375 1.70625,-0.853125 0.4875,-0.609375 0.73125,-1.828125 0.4875,-2.071875 -0.36562,-0.365625 -1.34062,-0.4875 -2.4375,0.73125 z" + id="path7886" + style="display:inline;fill:url(#radialGradient4861);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4873)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 292.45286,20.11787 -7.56413,0 c -0.73125,0 -1.32549,-0.515308 -1.33058,-1.24654 l -0.028,-4.017519 v -3.16875 -2.9250003 c 0,-0.73125 0.4875,-1.21875 1.21875,-1.21875 l 6.44059,0.00442 2.53052,2.515261 0.0354,8.810334 c 0.003,0.731244 -0.57138,1.24654 -1.30263,1.24654 z M 289.62394,8.7600607 v 2.4375003 h 2.4375 z m -7.3125,-0.6736655 0.0213,0.7169703 v 2.5152615 3.772891 l -5.06403,0.04019 c -0.73123,0.0058 -1.21672,-0.598663 -1.21875,-1.32991 l -0.028,-10.0556901 c -0.002,-0.7312471 0.4875,-1.21875 1.21875,-1.21875 h 6.09375 l 2.79402,2.5031129 v 1.81343 h -2.53052 c -0.67317,-0.017075 -1.31624,0.241688 -1.28654,1.2424914 z m 0.0213,-4.7304016 v 2.4596813 l 2.53052,-0.02779 z" + id="path8454" + style="display:inline;fill:url(#radialGradient4881);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4893)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 312.76384,20.20124 -10.1808,-0.02779 c -0.75126,-0.0021 -1.21143,-0.547743 -1.21303,-1.272325 l -0.028,-12.6083588 c -0.002,-0.9749978 0.29395,-1.2762443 1.26895,-1.2723257 l 2.49639,0.010033 c 0,0 0.0587,-2.5309032 2.49616,-2.5309032 2.4375,0 2.56487,2.5309032 2.56487,2.5309032 l 2.48359,0.017757 c 0.97497,0.00697 1.35938,0.3251372 1.35283,1.3001156 l -0.0839,12.4971989 c -0.005,0.808245 -0.51762,1.35744 -1.15713,1.355695 z m -1.86968,-13.8508896 -1.34061,-0.609375 c 0,0 0,-1.8281249 -1.95,-1.8281249 -1.95,0 -1.95,1.8281249 -1.95,1.8281249 l -1.34063,0.609375 -0.47079,1.1953846 h 7.59155 z m 0.53952,2.4530151 h -6.32629 l -2.53052,2.5152615 2.53052,5.030522 7.59155,-5.030522 z" + id="path9022" + style="display:inline;fill:url(#radialGradient4901);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4913)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="M 335.47361,15.091518 V 7.545735 l 3.79578,3.772892 z m -8.85681,1.257631 h 7.59155 l -3.79578,3.772892 z m 6.32629,-1.257631 h -5.06103 c -0.73124,-0.0041 -1.26114,-0.526392 -1.26526,-1.25763 V 8.8033655 c -0.004,-0.7312386 0.53401,-1.2576305 1.26526,-1.2576305 h 5.06103 c 0.73125,0 1.26526,0.5263804 1.26526,1.2576305 v 5.0305225 c 0,0.609375 -0.53402,1.261705 -1.26526,1.25763 z m 0,-3.772891 c 0,-0.73125 -0.53401,-1.257631 -1.26526,-1.257631 h -2.53052 c -0.73125,0 -1.26525,0.526381 -1.26525,1.257631 v 1.25763 c 0,0.73125 0.534,1.257631 1.26525,1.257631 h 2.53052 c 0.73125,0 1.26526,-0.526381 1.26526,-1.257631 z m -2.53052,-8.8034143 3.79578,3.7728917 h -7.59155 z m -5.06103,5.0305223 v 7.545783 l -3.79578,-3.772891 z" + id="path9590" + style="display:inline;fill:url(#radialGradient4921);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4933)" /> + <path + d="m 274,8 h 10 v 2 h -10 z" + id="path10158" + style="display:inline;fill:url(#radialGradient4941);fill-opacity:1;stroke-width:0.96615839" /> + <path + d="m 302,10 h -4 v 4 h -2 v -4 h -4 V 8 h 4 V 4 h 2 v 4 h 4 z" + id="path10726" + style="display:inline;fill:url(#radialGradient4949);fill-opacity:1;stroke-width:0.96615839" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 406.82037,12.583531 c -0.12181,0.73125 -0.24375,1.4625 -0.4875,2.071875 -0.4875,1.584375 -1.4625,3.046875 -3.04686,4.021874 0.4875,0.4875 1.58436,1.096875 1.58436,1.096875 0,0 -2.4375,0.365625 -4.99686,0.365625 l -0.12181,-0.121875 v 0.121875 c -1.21875,0 -2.4375,-0.365625 -3.65625,-0.73125 0.85311,-0.73125 1.4625,-1.584374 1.95,-2.559374 0.73125,-1.4625 0.73125,-3.65625 0.73125,-3.65625 0,0 1.09686,1.828125 1.70625,2.559375 1.4625,-0.73125 2.4375,-2.19375 2.55936,-3.65625 0.12181,-1.096875 -0.24375,-2.071875 -0.73125,-2.8031253 -0.4875,-0.8531251 -1.21875,-1.3406251 -2.07186,-1.7062501 0.24375,-0.4874999 0.60936,-1.0968749 0.975,-1.584375 0.4875,-0.73125 1.09686,-1.21875 1.58436,-1.4625 2.55939,1.340625 4.3875,4.5093751 4.02189,8.0437504 z m -8.53125,-2.4375 c 0,0 -1.34061,-1.8281254 -1.95,-2.4375004 -1.70625,0.853125 -2.68125,2.4375004 -2.68125,4.1437504 0.12181,1.828125 1.34064,3.290625 2.925,4.021875 -0.36561,0.609375 -0.73125,1.21875 -1.21875,1.70625 -0.4875,0.609375 -1.09686,0.974999 -1.4625,1.340624 -2.80311,-1.706249 -4.50936,-4.874999 -4.02186,-8.287499 0.1218,-0.8531253 0.36561,-1.7062504 0.60936,-2.4375004 0.4875,-1.3406249 1.34064,-2.4375 2.55939,-3.290625 0.1218,-0.121875 0.24375,-0.121875 0.36561,-0.24375 -0.4875,-0.4875 -1.95,-0.975 -1.95,-0.975 0,0 3.04689,-0.975 8.2875,-0.365625 -1.58436,2.315625 -1.4625,6.8250004 -1.4625,6.8250004 z" + id="path11294" + style="display:inline;fill:url(#radialGradient4957);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4969)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 429.73975,20.187746 -2.55504,0.05558 c -0.48738,0.0106 -0.61242,-0.769541 -0.61242,-1.378916 0,0 0.31966,-4.276424 -3.79578,-8.803414 -3.20233,-3.5225593 -8.85682,-3.7728916 -8.85682,-3.7728916 -0.60938,0 -1.26177,-0.171597 -1.25602,-0.6590635 l 0.028,-2.3732094 c 0.006,-0.4874666 0.61868,-0.7406188 1.22806,-0.7406188 0,0 7.05132,0.3003217 11.38734,5.0305223 3.72704,4.065871 5.06103,11.318675 5.06103,11.318675 0,0.4875 -0.0191,1.310083 -0.62831,1.323336 z M 413.91969,8.8033655 c 0,0 4.48239,0.7421569 7.0114,3.0905195 2.59016,2.40515 3.11068,6.970525 3.11068,6.970525 0,0.4875 -0.7448,1.278471 -1.23236,1.278471 h -1.35283 c -0.4875,0 -1.21059,-0.669096 -1.21059,-1.278471 0,0 0.4472,-2.304652 -1.91012,-4.45401 -1.78736,-1.629677 -4.41618,-1.834143 -4.41618,-1.834143 -0.60938,0 -1.23946,-0.793663 -1.22806,-1.281032 l 0.028,-1.195314 c 0.0114,-0.4873685 0.59073,-1.2965455 1.20011,-1.2965455 z m 1.20944,6.3426395 c 1.34062,0 2.54933,1.124665 2.54933,2.46529 0,1.340626 -1.09688,2.576451 -2.4375,2.576451 -1.34063,0 -2.54933,-1.208035 -2.54933,-2.548661 0,-1.340625 1.09687,-2.49308 2.4375,-2.49308 z" + id="path11862" + style="display:inline;fill:url(#radialGradient4977);fill-opacity:1;stroke-width:1.21875;filter:url(#filter4989)" /> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + d="m 448.08169,13.833888 v 2.515261 c 0,0.975 -0.41214,1.257631 -1.26525,1.257631 h -10.12208 c -0.85314,0 -1.26526,-0.282631 -1.26526,-1.257631 V 6.2881044 c 0,-0.9750001 0.41212,-1.2576306 1.26526,-1.2576306 h 10.12208 c 0.85311,0 1.26525,0.2826305 1.26525,1.2576306 v 2.5152611 l 5.06104,-2.5152611 V 16.349149 Z" + id="path12430" + style="display:inline;fill:url(#radialGradient4997);fill-opacity:1;stroke-width:1.21875;filter:url(#filter5009)" /> + <g + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline" + id="g4779"> + <path + id="bookmarks-star-4" + d="M 165.92886,2.5152127 V 20.122041 h 8.85681 1.26526 2.53052 c 1.26526,0 2.53052,-1.257631 2.53052,-2.515261 V 15.091518 7.545735 5.0304738 c 0,-1.2576306 -1.26526,-2.5152611 -2.53052,-2.5152611 h -2.53052 -1.26526 z m 7.59155,2.5152611 1.26526,2.5152612 c 0,0 0.39827,0.9972133 0.68613,1.1930622 0.26974,0.1834496 1.07417,0.064568 1.07417,0.064568 h 3.30074 l -2.53052,3.1379238 c 0,0 -0.38069,0.332603 -0.51773,0.634968 -0.20593,0.452534 -0.18971,0.518683 -0.12151,1.257631 0.10732,1.162403 0.63924,3.772892 0.63924,3.772892 l -2.53052,-1.257631 c 0,0 -0.77873,-0.42944 -1.26526,-0.430166 -0.5721,0 -1.26526,0.430166 -1.26526,0.430166 l -2.53051,1.257631 c 0,0 0.56012,-2.658345 0.73559,-3.772892 0.11606,-0.733074 0.10061,-0.753616 -0.15752,-1.257631 -0.13995,-0.274086 -0.57807,-0.782455 -0.57807,-0.782455 l -2.53052,-2.9904368 h 3.02161 c 0,0 0.91024,-0.099407 1.27135,-0.3263622 0.27408,-0.1711231 0.76807,-0.9312683 0.76807,-0.9312683 z" + style="fill:url(#radialGradient4710);fill-opacity:1;stroke-width:1.265625;filter:url(#filter4729)" /> + <path + id="bookmarks-overlay-1" + d="m 163.39834,2.5152127 c -1.26526,0 -2.53052,1.2576305 -2.53052,2.5152611 v 2.5152612 7.545783 2.515262 c 0,1.25763 1.26526,2.515261 2.53052,2.515261 h 2.91839 l 0.0559,-4.840061 V 7.6882296 l 0.028,-5.1730169 z" + style="fill:url(#radialGradient4712);fill-opacity:1;stroke:none;stroke-width:1.265625;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers stroke fill;filter:url(#filter4774)" /> + <path + id="bookmarks-divider-7" + d="M 165.92886,2.5152127 V 20.122041" + style="opacity:0.66300001;fill:url(#radialGradient4714);fill-opacity:1;stroke:url(#radialGradient4750);stroke-width:1.2614392;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + </g> + <path + transform="matrix(0.79035179,0,0,0.79514606,-0.14216927,3.8570695e-5)" + style="display:inline;fill:url(#radialGradient4709-1);fill-opacity:1;stroke-width:1;filter:url(#filter4844)" + id="path4214-3" + d="m 133.03211,35.213608 -6.32629,6.288153 c -0.24,0.36 -0.8202,0.518975 -1.3002,0.518975 -0.48,0 -0.87032,-0.158975 -1.23032,-0.518975 l -6.3263,-6.288153 c -0.6,-0.72 -0.96335,-1.29465 -0.003,-1.287183 l 3.79916,0.02955 -0.0908,-7.535242 c -0.009,-0.719949 0.67572,-1.307177 1.39571,-1.31116 l 5.02367,-0.02779 c 0.71999,-0.004 1.25401,0.619416 1.22796,1.33895 l 0.035,7.535242 3.80499,-0.02955 c 0.95998,-0.0075 0.71078,0.567183 -0.009,1.287183 z" /> + </g> +</svg> diff --git a/application/palemoon/themes/windows/browser.css b/application/palemoon/themes/windows/browser.css index 1aefa428c..88c3087ae 100644 --- a/application/palemoon/themes/windows/browser.css +++ b/application/palemoon/themes/windows/browser.css @@ -31,6 +31,8 @@ %endif :root { + --toolbox-after-color: ThreeDShadow; + --toolbar-custom-color: hsl(210,75%,92%); --toolbar-highlight-top: rgba(255,255,255,.5); --toolbar-highlight-bottom: transparent; @@ -52,6 +54,15 @@ --window-text-color: currentColor; } +/* Use SVG for HiDPI 133%+ */ +@media (min-resolution: 1.33dppx) { + :root { + --toolbarbutton-image: url("chrome://browser/skin/Toolbar.svg"); + --toolbarbutton-glass-image: url("chrome://browser/skin/Toolbar-glass.svg"); + --toolbarbutton-inverted-image: url("chrome://browser/skin/Toolbar-inverted.svg"); + } +} + :root:-moz-lwtheme-brighttext { --toolbar-highlight-top: rgba(32,32,32,.8); --toolbar-highlight-bottom: rgba(32,32,32,0); @@ -82,7 +93,7 @@ display: -moz-box; -moz-box-ordinal-group: 101; /* tabs toolbar is 100 */ height: 1px; - background-color: ThreeDShadow; + background-color: var(--toolbox-after-color); } #navigator-toolbox[tabsontop=false]::after, #main-window[disablechrome] #navigator-toolbox::after { @@ -1788,12 +1799,6 @@ 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 { @@ -1838,6 +1843,17 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- background-image: linear-gradient(to top, @toolbarShadowColor@ 1px, rgba(0,0,0,.05) 1px, transparent 50%); } +/* When the tab bar is collapsed, show a 1px border in its place. */ +#TabsToolbar[tabsontop="false"][collapsed="true"]:not([customizing="true"]) { + visibility: visible; + height: 1px; + border-bottom-width: 1px; + /* !important here to override border-style: none on the toolbar */ + border-bottom-style: solid !important; + border-bottom-color: var(--toolbox-after-color); + overflow: hidden; +} + .tabbrowser-tab, .tabs-newtab-button { -moz-appearance: none; @@ -2024,6 +2040,90 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action- list-style-image: url("chrome://global/skin/icons/close-inverted.svg"); } +/* Tab sound indicator */ +.tab-icon-sound { + -moz-margin-start: 4px; + width: 16px; + height: 16px; + padding: 0; +} + +.allTabs-endimage[soundplaying], +.tab-icon-sound[soundplaying] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio"); +} + +.allTabs-endimage[muted], +.tab-icon-sound[muted] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-muted"); +} + +.allTabs-endimage[blocked], +.tab-icon-sound[blocked] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio.svg#tab-audio-blocked"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-sound[soundplaying], +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-sound[blocked], +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-sound[muted] { + filter: invert(1); +} + +.tab-icon-sound[soundplaying-scheduledremoval]:not([muted]):not(:hover), +.tab-icon-overlay[soundplaying-scheduledremoval]:not([muted]):not(:hover) { + transition: opacity .3s linear var(--soundplaying-removal-delay); + opacity: 0; +} + +/* Tab icon overlay */ +.tab-icon-overlay { + width: 16px; + height: 16px; + margin-top: -8px; + margin-inline-start: -15px; + margin-inline-end: -1px; + position: relative; +} + +.tab-icon-overlay[soundplaying], +.tab-icon-overlay[muted]:not([crashed]), +.tab-icon-overlay[blocked]:not([crashed]) { + border-radius: 10px; +} + +.tab-icon-overlay[soundplaying]:hover, +.tab-icon-overlay[muted]:not([crashed]):hover, +.tab-icon-overlay[blocked]:not([crashed]):hover { + background-color: white; +} + +.tab-icon-overlay[soundplaying] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio"); +} + +.tab-icon-overlay[muted] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-muted"); +} + +.tab-icon-overlay[blocked] { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-blocked"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-overlay[soundplaying]:not([selected]):not(:hover), +.tab-icon-overlay[soundplaying][selected]:-moz-lwtheme-brighttext:not(:hover) { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-overlay[muted]:not([crashed]):not([selected]):not(:hover), +.tab-icon-overlay[muted][selected]:-moz-lwtheme-brighttext:not(:hover) { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white-muted"); +} + +#TabsToolbar:-moz-lwtheme-brighttext .tab-icon-overlay[blocked]:not([crashed]):not([selected]):not(:hover), +.tab-icon-overlay[blocked][selected]:-moz-lwtheme-brighttext:not(:hover) { + list-style-image: url("chrome://browser/skin/tabbrowser/tab-audio-small.svg#tab-audio-white-blocked"); +} + /* Tab scrollbox arrow, tabstrip new tab and all-tabs buttons */ .tabbrowser-arrowscrollbox > .scrollbutton-up, @@ -2957,8 +3057,8 @@ toolbar[brighttext] #addonbar-closebutton { @media (-moz-os-version: windows-vista), (-moz-os-version: windows-win7) { - #navigator-toolbox:not(:-moz-lwtheme)::after { - background-color: #aabccf; + :root:not(:-moz-lwtheme) { + --toolbox-after-color: #aabccf; } } @@ -2967,9 +3067,9 @@ toolbar[brighttext] #addonbar-closebutton { :root { --toolbar-custom-color: hsl(210,0%,92%); } - - #navigator-toolbox:not(:-moz-lwtheme)::after { - background-color: #bcbcbc; + + :root:not(:-moz-lwtheme) { + --toolbox-after-color: #bcbcbc; } } diff --git a/application/palemoon/themes/windows/communicator/jar.mn b/application/palemoon/themes/windows/communicator/jar.mn index dfd20c523..612d13335 100644 --- a/application/palemoon/themes/windows/communicator/jar.mn +++ b/application/palemoon/themes/windows/communicator/jar.mn @@ -4,4 +4,4 @@ browser.jar: % skin communicator classic/1.0 %skin/classic/communicator/ - skin/classic/communicator/communicator.css + skin/classic/communicator/communicator.css diff --git a/application/palemoon/themes/windows/downloads/download-glow.png b/application/palemoon/themes/windows/downloads/download-glow.png Binary files differdeleted file mode 100644 index 53182d7a4..000000000 --- a/application/palemoon/themes/windows/downloads/download-glow.png +++ /dev/null diff --git a/application/palemoon/themes/windows/downloads/downloads.css b/application/palemoon/themes/windows/downloads/downloads.css index 91ea652ed..f16989655 100644 --- a/application/palemoon/themes/windows/downloads/downloads.css +++ b/application/palemoon/themes/windows/downloads/downloads.css @@ -326,6 +326,11 @@ toolbar[brighttext] #downloads-indicator-icon { 0, 108, 18, 90) center no-repeat; } +#downloads-indicator[attention] > #downloads-indicator-anchor > #downloads-indicator-icon { + background: -moz-image-rect(var(--toolbarbutton-image), + 19, 108, 36, 90) center no-repeat; +} + @media (-moz-windows-compositor) { :-moz-any(#toolbar-menubar, #nav-bar[tabsontop=false]) #downloads-indicator-icon:not(:-moz-lwtheme), #TabsToolbar[tabsontop=true] #downloads-indicator-icon:not(:-moz-lwtheme), @@ -333,10 +338,12 @@ toolbar[brighttext] #downloads-indicator-icon { background: -moz-image-rect(var(--toolbarbutton-glass-image), 0, 108, 18, 90) center no-repeat; } + #downloads-indicator[attention] > #downloads-indicator-anchor > #downloads-indicator-icon { + background: -moz-image-rect(var(--toolbarbutton-glass-image), + 19, 108, 36, 90) center no-repeat; } -#downloads-indicator[attention] > #downloads-indicator-anchor > #downloads-indicator-icon { - background-image: url("chrome://browser/skin/downloads/download-glow.png"); + } /* In the next few rules, we use :not([counter]) as a shortcut that is @@ -360,10 +367,10 @@ toolbar[brighttext] #downloads-indicator:not([counter]) > #downloads-indicator-a background: -moz-image-rect(var(--toolbarbutton-glass-image), 0, 108, 18, 90) center no-repeat; } -} - -#downloads-indicator:not([counter])[attention] > #downloads-indicator-anchor > #downloads-indicator-progress-area > #downloads-indicator-counter { - background-image: url("chrome://browser/skin/downloads/download-glow.png"); + #downloads-indicator:not([counter])[attention] > #downloads-indicator-anchor > #downloads-indicator-progress-area > #downloads-indicator-counter { + background: -moz-image-rect(var(--toolbarbutton-glass-image), + 19, 108, 36, 90) center no-repeat; + } } /*** Download notifications ***/ diff --git a/application/palemoon/themes/windows/jar.mn b/application/palemoon/themes/windows/jar.mn index 0a4342d40..4422bb666 100644 --- a/application/palemoon/themes/windows/jar.mn +++ b/application/palemoon/themes/windows/jar.mn @@ -4,163 +4,165 @@ browser.jar: % skin browser classic/1.0 %skin/classic/browser/ - skin/classic/browser/sanitizeDialog.css -* skin/classic/browser/aboutPrivateBrowsing.css -* skin/classic/browser/aboutSessionRestore.css - skin/classic/browser/aboutSessionRestore-window-icon.png - skin/classic/browser/aboutCertError.css - skin/classic/browser/aboutCertError_sectionCollapsed.png - skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png - skin/classic/browser/aboutCertError_sectionExpanded.png + skin/classic/browser/sanitizeDialog.css +* skin/classic/browser/aboutPrivateBrowsing.css +* skin/classic/browser/aboutSessionRestore.css + skin/classic/browser/aboutSessionRestore-window-icon.png + skin/classic/browser/aboutCertError.css + skin/classic/browser/aboutCertError_sectionCollapsed.png + skin/classic/browser/aboutCertError_sectionCollapsed-rtl.png + skin/classic/browser/aboutCertError_sectionExpanded.png #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/aboutSyncTabs.css + skin/classic/browser/aboutSyncTabs.css #endif -* skin/classic/browser/autocomplete.css - skin/classic/browser/actionicon-tab.png - skin/classic/browser/appmenu-icons.png - skin/classic/browser/appmenu-dropmarker.png -* skin/classic/browser/browser.css - skin/classic/browser/caption-buttons.svg - skin/classic/browser/click-to-play-warning-stripes.png -* skin/classic/browser/engineManager.css - skin/classic/browser/Geolocation-16.png - skin/classic/browser/Geolocation-64.png - skin/classic/browser/Info.png - skin/classic/browser/identity.png - skin/classic/browser/imagedocument.png - skin/classic/browser/identity-icons-generic.png - skin/classic/browser/identity-icons-https.png - skin/classic/browser/identity-icons-https-ev.png - skin/classic/browser/identity-icons-https-mixed-active.png - skin/classic/browser/keyhole-forward-mask.svg - skin/classic/browser/KUI-background.png - skin/classic/browser/KUI-close.png - skin/classic/browser/livemark-folder.png - skin/classic/browser/menu-back.png - skin/classic/browser/menu-forward.png - skin/classic/browser/mixed-content-blocked-16.png - skin/classic/browser/mixed-content-blocked-64.png - skin/classic/browser/monitor.png - skin/classic/browser/monitor_16-10.png - skin/classic/browser/pageInfo.css - skin/classic/browser/pageInfo.png - skin/classic/browser/page-livemarks.png (feeds/feedIcon16.png) - skin/classic/browser/pointerLock-16.png - skin/classic/browser/pointerLock-64.png - skin/classic/browser/Privacy-16.png - skin/classic/browser/Privacy-32.png - skin/classic/browser/Privacy-48.png - skin/classic/browser/Privacy-64.png - skin/classic/browser/privatebrowsing-light.png - skin/classic/browser/privatebrowsing-dark.png - skin/classic/browser/reload-stop-go.png - skin/classic/browser/sanitize.png - skin/classic/browser/searchbar.css - skin/classic/browser/searchbar-dropdown-arrow.png - skin/classic/browser/Secure24.png - skin/classic/browser/setDesktopBackground.css - skin/classic/browser/slowStartup-16.png - skin/classic/browser/Toolbar.png - skin/classic/browser/Toolbar-glass.png - skin/classic/browser/Toolbar-inverted.png - skin/classic/browser/toolbarbutton-dropdown-arrow.png - skin/classic/browser/toolbarbutton-dropdown-arrow-inverted.png - skin/classic/browser/urlbar-arrow.png - skin/classic/browser/urlbar-popup-blocked.png - skin/classic/browser/urlbar-history-dropmarker.png - skin/classic/browser/web-notifications-icon.svg - skin/classic/browser/web-notifications-tray.svg - skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) - skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) - skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) +* skin/classic/browser/autocomplete.css + skin/classic/browser/actionicon-tab.png + skin/classic/browser/appmenu-icons.png + skin/classic/browser/appmenu-dropmarker.png +* skin/classic/browser/browser.css + skin/classic/browser/caption-buttons.svg + skin/classic/browser/click-to-play-warning-stripes.png +* skin/classic/browser/engineManager.css + skin/classic/browser/Geolocation-16.png + skin/classic/browser/Geolocation-64.png + skin/classic/browser/Info.png + skin/classic/browser/identity.png + skin/classic/browser/imagedocument.png + skin/classic/browser/identity-icons-generic.png + skin/classic/browser/identity-icons-https.png + skin/classic/browser/identity-icons-https-ev.png + skin/classic/browser/identity-icons-https-mixed-active.png + skin/classic/browser/keyhole-forward-mask.svg + skin/classic/browser/KUI-background.png + skin/classic/browser/KUI-close.png + skin/classic/browser/livemark-folder.png + skin/classic/browser/menu-back.png + skin/classic/browser/menu-forward.png + skin/classic/browser/mixed-content-blocked-16.png + skin/classic/browser/mixed-content-blocked-64.png + skin/classic/browser/monitor.png + skin/classic/browser/monitor_16-10.png + skin/classic/browser/pageInfo.css + skin/classic/browser/pageInfo.png + skin/classic/browser/page-livemarks.png (feeds/feedIcon16.png) + skin/classic/browser/pointerLock-16.png + skin/classic/browser/pointerLock-64.png + skin/classic/browser/Privacy-16.png + skin/classic/browser/Privacy-32.png + skin/classic/browser/Privacy-48.png + skin/classic/browser/Privacy-64.png + skin/classic/browser/privatebrowsing-light.png + skin/classic/browser/privatebrowsing-dark.png + skin/classic/browser/reload-stop-go.png + skin/classic/browser/sanitize.png + skin/classic/browser/searchbar.css + skin/classic/browser/searchbar-dropdown-arrow.png + skin/classic/browser/Secure24.png + skin/classic/browser/setDesktopBackground.css + skin/classic/browser/slowStartup-16.png + skin/classic/browser/Toolbar.png + skin/classic/browser/Toolbar-glass.png + skin/classic/browser/Toolbar-inverted.png + skin/classic/browser/Toolbar.svg + skin/classic/browser/Toolbar-glass.svg + skin/classic/browser/Toolbar-inverted.svg + skin/classic/browser/toolbarbutton-dropdown-arrow.png + skin/classic/browser/toolbarbutton-dropdown-arrow-inverted.png + skin/classic/browser/urlbar-arrow.png + skin/classic/browser/urlbar-popup-blocked.png + skin/classic/browser/urlbar-history-dropmarker.png + skin/classic/browser/web-notifications-icon.svg + skin/classic/browser/web-notifications-tray.svg + skin/classic/browser/notification-pluginNormal.png (../shared/plugins/notification-pluginNormal.png) + skin/classic/browser/notification-pluginAlert.png (../shared/plugins/notification-pluginAlert.png) + skin/classic/browser/notification-pluginBlocked.png (../shared/plugins/notification-pluginBlocked.png) #ifdef MOZ_WEBRTC - skin/classic/browser/webRTC-shareDevice-16.png - skin/classic/browser/webRTC-shareDevice-64.png - skin/classic/browser/webRTC-sharingDevice-16.png + skin/classic/browser/webRTC-shareDevice-16.png + skin/classic/browser/webRTC-shareDevice-64.png + skin/classic/browser/webRTC-sharingDevice-16.png #endif - skin/classic/browser/downloads/buttons.png (downloads/buttons.png) - skin/classic/browser/downloads/download-glow.png (downloads/download-glow.png) - skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) - skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) - skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) - skin/classic/browser/downloads/downloads.css (downloads/downloads.css) - skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) - skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) - skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) - skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) - skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) - 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 (../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) - skin/classic/browser/places/bookmark.png (places/bookmark.png) - skin/classic/browser/places/query.png (places/query.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) - skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) - skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) - skin/classic/browser/places/libraryToolbar.png (places/libraryToolbar.png) - skin/classic/browser/places/starred48.png (places/starred48.png) - skin/classic/browser/places/unstarred48.png (places/unstarred48.png) - skin/classic/browser/places/tag.png (places/tag.png) - skin/classic/browser/places/history.png (places/history.png) - skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png) - 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) - skin/classic/browser/preferences/Options.png (preferences/Options.png) + skin/classic/browser/downloads/buttons.png (downloads/buttons.png) + skin/classic/browser/downloads/download-notification-finish.png (downloads/download-notification-finish.png) + skin/classic/browser/downloads/download-notification-start.png (downloads/download-notification-start.png) + skin/classic/browser/downloads/download-summary.png (downloads/download-summary.png) + skin/classic/browser/downloads/downloads.css (downloads/downloads.css) + skin/classic/browser/downloads/allDownloadsViewOverlay.css (downloads/allDownloadsViewOverlay.css) + skin/classic/browser/downloads/contentAreaDownloadsView.css (downloads/contentAreaDownloadsView.css) + skin/classic/browser/feeds/feedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/feedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/videoFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/videoFeedIcon16.png (feeds/feedIcon16.png) + skin/classic/browser/feeds/audioFeedIcon.png (feeds/feedIcon.png) + skin/classic/browser/feeds/audioFeedIcon16.png (feeds/feedIcon16.png) + 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 (../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) + skin/classic/browser/places/bookmark.png (places/bookmark.png) + skin/classic/browser/places/query.png (places/query.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) + skin/classic/browser/places/toolbarDropMarker.png (places/toolbarDropMarker.png) + skin/classic/browser/places/editBookmarkOverlay.css (places/editBookmarkOverlay.css) + skin/classic/browser/places/libraryToolbar.png (places/libraryToolbar.png) + skin/classic/browser/places/starred48.png (places/starred48.png) + skin/classic/browser/places/unstarred48.png (places/unstarred48.png) + skin/classic/browser/places/tag.png (places/tag.png) + skin/classic/browser/places/history.png (places/history.png) + skin/classic/browser/places/allBookmarks.png (places/allBookmarks.png) + 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) + skin/classic/browser/preferences/Options.png (preferences/Options.png) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) + skin/classic/browser/preferences/Options-sync.png (preferences/Options-sync.png) #endif - 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) -#ifdef MOZ_BROWSER_STATUSBAR - skin/classic/browser/statusbar/dynamic.css (../shared/statusbar/dynamic.css) -* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) -* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) - skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) - skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) - skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) - skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) - skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) -#endif - skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) - skin/classic/browser/tabbrowser/alltabs-inverted.png (tabbrowser/alltabs-inverted.png) - skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) - skin/classic/browser/tabbrowser/newtab-glass.png (tabbrowser/newtab-glass.png) - skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png) - skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) - skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) - skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) - skin/classic/browser/tabbrowser/tab-arrow-left-glass.png (tabbrowser/tab-arrow-left-glass.png) - skin/classic/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png) - skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) - skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) + 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/statusbar/dynamic.css (../shared/statusbar/dynamic.css) +* skin/classic/browser/statusbar/overlay.css (statusbar/overlay.css) +* skin/classic/browser/statusbar/prefs.css (statusbar/prefs.css) + skin/classic/browser/statusbar/pulse.png (../shared/statusbar/pulse.png) + skin/classic/browser/statusbar/pms16.png (../shared/statusbar/pms16.png) + skin/classic/browser/statusbar/pms24.png (../shared/statusbar/pms24.png) + skin/classic/browser/statusbar/throbber-idle.png (../shared/statusbar/throbber-idle.png) + skin/classic/browser/statusbar/throbberStatic.png (../shared/statusbar/throbberStatic.png) + skin/classic/browser/tabbrowser/alltabs.png (tabbrowser/alltabs.png) + skin/classic/browser/tabbrowser/alltabs-inverted.png (tabbrowser/alltabs-inverted.png) + skin/classic/browser/tabbrowser/newtab.png (tabbrowser/newtab.png) + skin/classic/browser/tabbrowser/newtab-glass.png (tabbrowser/newtab-glass.png) + skin/classic/browser/tabbrowser/newtab-inverted.png (tabbrowser/newtab-inverted.png) + skin/classic/browser/tabbrowser/connecting.png (tabbrowser/connecting.png) + skin/classic/browser/tabbrowser/loading.png (tabbrowser/loading.png) + skin/classic/browser/tabbrowser/tab-arrow-left.png (tabbrowser/tab-arrow-left.png) + skin/classic/browser/tabbrowser/tab-arrow-left-glass.png (tabbrowser/tab-arrow-left-glass.png) + skin/classic/browser/tabbrowser/tab-arrow-left-inverted.png (tabbrowser/tab-arrow-left-inverted.png) + skin/classic/browser/tabbrowser/tab-overflow-border.png (tabbrowser/tab-overflow-border.png) + skin/classic/browser/tabbrowser/tabDragIndicator.png (tabbrowser/tabDragIndicator.png) + skin/classic/browser/tabbrowser/tab-audio.svg (../shared/tabbrowser/tab-audio.svg) + skin/classic/browser/tabbrowser/tab-audio-small.svg (../shared/tabbrowser/tab-audio-small.svg) #ifdef MOZ_SERVICES_SYNC - skin/classic/browser/sync-throbber.png - skin/classic/browser/sync-16.png - skin/classic/browser/sync-32.png - skin/classic/browser/sync-128.png - skin/classic/browser/sync-bg.png - skin/classic/browser/sync-desktopIcon.png - skin/classic/browser/sync-mobileIcon.png - skin/classic/browser/syncSetup.css - skin/classic/browser/syncCommon.css - skin/classic/browser/syncQuota.css - skin/classic/browser/syncProgress.css + skin/classic/browser/sync-throbber.png + skin/classic/browser/sync-16.png + skin/classic/browser/sync-32.png + skin/classic/browser/sync-128.png + skin/classic/browser/sync-bg.png + skin/classic/browser/sync-desktopIcon.png + skin/classic/browser/sync-mobileIcon.png + skin/classic/browser/syncSetup.css + skin/classic/browser/syncCommon.css + skin/classic/browser/syncQuota.css + skin/classic/browser/syncProgress.css #endif diff --git a/application/palemoon/themes/windows/places/organizer.css b/application/palemoon/themes/windows/places/organizer.css index 16a0ab09c..45851d0da 100644 --- a/application/palemoon/themes/windows/places/organizer.css +++ b/application/palemoon/themes/windows/places/organizer.css @@ -8,6 +8,13 @@ --toolbarbutton-image: url("chrome://browser/skin/Toolbar.png"); } +/* Use SVG for HiDPI 133%+ */ +@media (min-resolution: 1.33dppx) { + :root { + --toolbarbutton-image: url("chrome://browser/skin/Toolbar.svg"); + } +} + /* Toolbar */ #placesToolbar { padding: 3px; diff --git a/application/palemoon/themes/windows/statusbar/overlay.css b/application/palemoon/themes/windows/statusbar/overlay.css index 77e8d8732..7f9a5982f 100644 --- a/application/palemoon/themes/windows/statusbar/overlay.css +++ b/application/palemoon/themes/windows/statusbar/overlay.css @@ -53,7 +53,7 @@ toolbar[brighttext] #status4evar-download-button #status4evar-download-icon #status4evar-download-button[attention] #status4evar-download-icon { - background-image: url("chrome://browser/skin/downloads/download-glow.png"); + background: -moz-image-rect(var(--toolbarbutton-glass-image), 19, 108, 36, 90) center no-repeat; } toolbar[mode="icons"] #status4evar-download-button[forcelabel="true"] > label diff --git a/application/xulrunner/confvars.sh b/application/xulrunner/confvars.sh index a317df2a6..794b2b4b1 100644 --- a/application/xulrunner/confvars.sh +++ b/application/xulrunner/confvars.sh @@ -13,10 +13,6 @@ MOZ_CHROME_FILE_FORMAT=omni MOZ_UPDATER=1 -if test "$OS_ARCH" = "WINNT"; then - MOZ_MAINTENANCE_SERVICE= -fi - MOZ_PLACES=1 MOZ_WEBRTC=1 MOZ_WEBGL_CONFORMANT=1 |