summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/palemoon/app.mozbuild2
-rw-r--r--application/palemoon/app/Makefile.in8
-rw-r--r--application/palemoon/app/blocklist.xml14
-rw-r--r--application/palemoon/app/macbuild/Contents/Info.plist.in5
-rw-r--r--application/palemoon/app/moz.build33
-rw-r--r--application/palemoon/app/nsBrowserApp.cpp336
-rw-r--r--application/palemoon/app/profile/palemoon.js3
-rw-r--r--application/palemoon/base/content/abouthome/aboutHome.js4
-rw-r--r--application/palemoon/base/content/autocomplete.css17
-rw-r--r--application/palemoon/base/content/autocomplete.xml2128
-rw-r--r--application/palemoon/base/content/autorecovery.js6
-rw-r--r--application/palemoon/base/content/baseMenuOverlay.xul2
-rw-r--r--application/palemoon/base/content/browser-addons.js4
-rw-r--r--application/palemoon/base/content/browser-appmenu.inc35
-rw-r--r--application/palemoon/base/content/browser-devtools-theme.js91
-rw-r--r--application/palemoon/base/content/browser-fullScreen.js2
-rw-r--r--application/palemoon/base/content/browser-fullZoom.js210
-rw-r--r--application/palemoon/base/content/browser-gestureSupport.js4
-rw-r--r--application/palemoon/base/content/browser-menubar.inc31
-rw-r--r--application/palemoon/base/content/browser-places.js23
-rw-r--r--application/palemoon/base/content/browser-sets.inc78
-rw-r--r--application/palemoon/base/content/browser-syncui.js2
-rw-r--r--application/palemoon/base/content/browser-thumbnails.js11
-rw-r--r--application/palemoon/base/content/browser-uacompat.js45
-rw-r--r--application/palemoon/base/content/browser-webrtcUI.js2
-rw-r--r--application/palemoon/base/content/browser.css83
-rw-r--r--application/palemoon/base/content/browser.js311
-rw-r--r--application/palemoon/base/content/browser.xul62
-rw-r--r--application/palemoon/base/content/content.js127
-rw-r--r--application/palemoon/base/content/global-devtools-theme-scripts.inc (renamed from application/palemoon/components/migration/jar.mn)5
-rw-r--r--application/palemoon/base/content/macBrowserOverlay.xul3
-rw-r--r--application/palemoon/base/content/newtab/drag.js2
-rw-r--r--application/palemoon/base/content/newtab/dragDataHelper.js2
-rw-r--r--application/palemoon/base/content/newtab/drop.js2
-rw-r--r--application/palemoon/base/content/newtab/dropPreview.js2
-rw-r--r--application/palemoon/base/content/newtab/dropTargetShim.js2
-rw-r--r--application/palemoon/base/content/newtab/grid.js9
-rw-r--r--application/palemoon/base/content/newtab/newTab.js6
-rw-r--r--application/palemoon/base/content/newtab/page.js2
-rw-r--r--application/palemoon/base/content/newtab/transformations.js2
-rw-r--r--application/palemoon/base/content/newtab/undo.js2
-rw-r--r--application/palemoon/base/content/newtab/updater.js2
-rw-r--r--application/palemoon/base/content/nsContextMenu.js62
-rw-r--r--application/palemoon/base/content/openLocation.js4
-rw-r--r--application/palemoon/base/content/padlock.js6
-rw-r--r--application/palemoon/base/content/pageinfo/pageInfo.js4
-rw-r--r--application/palemoon/base/content/pageinfo/permissions.js64
-rw-r--r--application/palemoon/base/content/popup-notifications.inc13
-rw-r--r--application/palemoon/base/content/sanitize.js19
-rw-r--r--application/palemoon/base/content/sync/aboutSyncTabs.js2
-rw-r--r--application/palemoon/base/content/sync/addDevice.js2
-rw-r--r--application/palemoon/base/content/sync/genericChange.js2
-rw-r--r--application/palemoon/base/content/sync/progress.js4
-rw-r--r--application/palemoon/base/content/sync/quota.js4
-rw-r--r--application/palemoon/base/content/sync/utils.js2
-rw-r--r--application/palemoon/base/content/tabbrowser.xml196
-rw-r--r--application/palemoon/base/content/urlbarBindings.xml217
-rw-r--r--application/palemoon/base/content/utilityOverlay.js5
-rw-r--r--application/palemoon/base/jar.mn5
-rw-r--r--application/palemoon/branding/official/moz.build6
-rw-r--r--application/palemoon/branding/official/pref/palemoon-branding.js2
-rw-r--r--application/palemoon/branding/shared/branding.mozbuild97
-rw-r--r--application/palemoon/branding/shared/pref/preferences.inc8
-rw-r--r--application/palemoon/branding/shared/pref/uaoverrides.inc2
-rw-r--r--application/palemoon/branding/unofficial/moz.build6
-rw-r--r--application/palemoon/branding/unstable/moz.build6
-rw-r--r--application/palemoon/branding/unstable/pref/palemoon-branding.js2
-rw-r--r--application/palemoon/build.mk24
-rw-r--r--application/palemoon/components/about/AboutRedirector.cpp114
-rw-r--r--application/palemoon/components/build/moz.build7
-rw-r--r--application/palemoon/components/build/nsBrowserCompsCID.h8
-rw-r--r--application/palemoon/components/build/nsModule.cpp21
-rw-r--r--application/palemoon/components/dirprovider/DirectoryProvider.cpp52
-rw-r--r--application/palemoon/components/downloads/DownloadsCommon.jsm18
-rw-r--r--application/palemoon/components/downloads/content/allDownloadsViewOverlay.js23
-rw-r--r--application/palemoon/components/downloads/content/contentAreaDownloadsView.js2
-rw-r--r--application/palemoon/components/downloads/content/downloads.js14
-rw-r--r--application/palemoon/components/downloads/content/indicator.js12
-rw-r--r--application/palemoon/components/feeds/FeedConverter.js2
-rw-r--r--application/palemoon/components/feeds/FeedWriter.js23
-rw-r--r--application/palemoon/components/feeds/moz.build2
-rw-r--r--application/palemoon/components/feeds/nsFeedSniffer.cpp4
-rw-r--r--application/palemoon/components/feeds/nsFeedSniffer.h14
-rw-r--r--application/palemoon/components/fuel/fuelApplication.js2
-rw-r--r--application/palemoon/components/migration/BrowserProfileMigrators.manifest14
-rw-r--r--application/palemoon/components/migration/ChromeProfileMigrator.js463
-rw-r--r--application/palemoon/components/migration/FirefoxProfileMigrator.js117
-rw-r--r--application/palemoon/components/migration/IEProfileMigrator.js521
-rw-r--r--application/palemoon/components/migration/MigrationUtils.jsm644
-rw-r--r--application/palemoon/components/migration/ProfileMigrator.js21
-rw-r--r--application/palemoon/components/migration/SafariProfileMigrator.js416
-rw-r--r--application/palemoon/components/migration/content/migration.js474
-rw-r--r--application/palemoon/components/migration/content/migration.xul96
-rw-r--r--application/palemoon/components/migration/moz.build53
-rw-r--r--application/palemoon/components/migration/nsIBrowserProfileMigrator.idl63
-rw-r--r--application/palemoon/components/migration/nsIEHistoryEnumerator.cpp139
-rw-r--r--application/palemoon/components/migration/nsIEHistoryEnumerator.h37
-rw-r--r--application/palemoon/components/moz.build1
-rw-r--r--application/palemoon/components/nsBrowserContentHandler.js14
-rw-r--r--application/palemoon/components/nsBrowserGlue.js100
-rw-r--r--application/palemoon/components/places/BrowserPlaces.manifest2
-rw-r--r--application/palemoon/components/places/PlacesProtocolHandler.js49
-rw-r--r--application/palemoon/components/places/content/controller.js2
-rw-r--r--application/palemoon/components/places/content/editBookmarkOverlay.js47
-rw-r--r--application/palemoon/components/places/content/places.js13
-rw-r--r--application/palemoon/components/places/content/places.xul7
-rw-r--r--application/palemoon/components/places/content/treeView.js7
-rw-r--r--application/palemoon/components/places/moz.build4
-rw-r--r--application/palemoon/components/preferences/aboutPermissions.js20
-rw-r--r--application/palemoon/components/preferences/cookies.js38
-rw-r--r--application/palemoon/components/preferences/sanitize.js2
-rw-r--r--application/palemoon/components/preferences/security.js25
-rw-r--r--application/palemoon/components/preferences/sync.js2
-rw-r--r--application/palemoon/components/search/content/engineManager.js17
-rw-r--r--application/palemoon/components/search/content/engineManager.xul2
-rw-r--r--application/palemoon/components/sessionstore/SessionStorage.jsm4
-rw-r--r--application/palemoon/components/sessionstore/SessionStore.jsm28
-rw-r--r--application/palemoon/components/sessionstore/_SessionFile.jsm9
-rw-r--r--application/palemoon/components/sessionstore/nsSessionStartup.js13
-rw-r--r--application/palemoon/components/shell/ShellService.jsm114
-rw-r--r--application/palemoon/components/shell/content/setDesktopBackground.js253
-rw-r--r--application/palemoon/components/shell/jar.mn2
-rw-r--r--application/palemoon/components/shell/moz.build12
-rw-r--r--application/palemoon/components/shell/nsGNOMEShellService.cpp77
-rw-r--r--application/palemoon/components/shell/nsGNOMEShellService.h16
-rw-r--r--application/palemoon/components/shell/nsIGNOMEShellService.idl19
-rw-r--r--application/palemoon/components/shell/nsIMacShellService.idl2
-rw-r--r--application/palemoon/components/shell/nsIShellService.idl19
-rw-r--r--application/palemoon/components/shell/nsIWindowsShellService.idl2
-rw-r--r--application/palemoon/components/shell/nsMacShellService.cpp76
-rw-r--r--application/palemoon/components/shell/nsMacShellService.h4
-rw-r--r--application/palemoon/components/shell/nsSetDefaultBrowser.js11
-rw-r--r--application/palemoon/components/shell/nsShellService.h2
-rw-r--r--application/palemoon/components/shell/nsWindowsShellService.cpp349
-rw-r--r--application/palemoon/components/shell/nsWindowsShellService.h8
-rw-r--r--application/palemoon/components/statusbar/Downloads.jsm1256
-rw-r--r--application/palemoon/components/statusbar/Progress.jsm324
-rw-r--r--application/palemoon/components/statusbar/Status.jsm870
-rw-r--r--application/palemoon/components/statusbar/Status4Evar.jsm458
-rw-r--r--application/palemoon/components/statusbar/Toolbars.jsm386
-rw-r--r--application/palemoon/components/statusbar/content/overlay.css5
-rw-r--r--application/palemoon/components/statusbar/content/overlay.js8
-rw-r--r--application/palemoon/components/statusbar/content/overlay.xul92
-rw-r--r--application/palemoon/components/statusbar/content/prefs.css5
-rw-r--r--application/palemoon/components/statusbar/content/prefs.js474
-rw-r--r--application/palemoon/components/statusbar/content/prefs.xml1370
-rw-r--r--application/palemoon/components/statusbar/content/prefs.xul542
-rw-r--r--application/palemoon/components/statusbar/content/tabbrowser.xml410
-rw-r--r--application/palemoon/components/statusbar/status4evar.idl88
-rw-r--r--application/palemoon/components/statusbar/status4evar.js1342
-rw-r--r--application/palemoon/config/version.txt2
-rw-r--r--application/palemoon/configure.in7
-rw-r--r--application/palemoon/confvars.sh129
-rw-r--r--application/palemoon/fonts/EmojiOneMozilla.ttfbin1227260 -> 0 bytes
-rw-r--r--application/palemoon/fonts/README.txt8
-rw-r--r--application/palemoon/fonts/TwemojiMozilla.ttfbin0 -> 1075912 bytes
-rw-r--r--application/palemoon/fonts/moz.build4
-rw-r--r--application/palemoon/installer/Makefile.in25
-rw-r--r--application/palemoon/installer/package-manifest.in600
-rw-r--r--application/palemoon/installer/removed-files.in25
-rw-r--r--application/palemoon/installer/windows/Makefile.in28
-rw-r--r--application/palemoon/installer/windows/moz.build7
-rw-r--r--application/palemoon/installer/windows/nsis/defines.nsi.in47
-rw-r--r--application/palemoon/installer/windows/nsis/installer.nsi371
-rw-r--r--application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi332
-rw-r--r--application/palemoon/installer/windows/nsis/shared.nsh462
-rw-r--r--application/palemoon/installer/windows/nsis/uninstaller.nsi318
-rw-r--r--application/palemoon/installer/windows/stub.tag4
-rw-r--r--application/palemoon/locales/Makefile.in14
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/browser.dtd3
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/browser.properties22
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/migration/migration.dtd36
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/migration/migration.properties51
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/places/places.dtd2
-rw-r--r--application/palemoon/locales/en-US/chrome/overrides/netError.dtd69
-rw-r--r--application/palemoon/locales/generic/install.rdf30
-rw-r--r--application/palemoon/locales/jar.mn4
-rw-r--r--application/palemoon/locales/l10n.ini8
-rw-r--r--application/palemoon/modules/AboutHomeUtils.jsm2
-rw-r--r--application/palemoon/modules/AutoCompletePopup.jsm293
-rw-r--r--application/palemoon/modules/BrowserNewTabPreloader.jsm8
-rw-r--r--application/palemoon/modules/FormSubmitObserver.jsm16
-rw-r--r--application/palemoon/modules/FormValidationHandler.jsm10
-rw-r--r--application/palemoon/modules/NetworkPrioritizer.jsm8
-rw-r--r--application/palemoon/modules/PopupNotifications.jsm125
-rw-r--r--application/palemoon/modules/QuotaManager.jsm14
-rw-r--r--application/palemoon/modules/SharedFrame.jsm2
-rw-r--r--application/palemoon/modules/WindowsPreviewPerTab.jsm64
-rw-r--r--application/palemoon/modules/moz.build12
-rw-r--r--application/palemoon/modules/openLocationLastURL.jsm8
-rw-r--r--application/palemoon/modules/promise.js2
-rw-r--r--application/palemoon/moz.configure7
-rw-r--r--application/palemoon/themes/linux/autocomplete.css210
-rw-r--r--application/palemoon/themes/linux/browser.css41
-rw-r--r--application/palemoon/themes/linux/jar.mn4
-rw-r--r--application/palemoon/themes/linux/sync-notification-24.pngbin1565 -> 0 bytes
-rw-r--r--application/palemoon/themes/osx/autocomplete.css198
-rw-r--r--application/palemoon/themes/osx/browser.css62
-rw-r--r--application/palemoon/themes/osx/jar.mn4
-rw-r--r--application/palemoon/themes/osx/shared.inc2
-rw-r--r--application/palemoon/themes/osx/sync-notification-24.pngbin1119 -> 0 bytes
-rw-r--r--application/palemoon/themes/shared/browser.inc5
-rw-r--r--application/palemoon/themes/windows/autocomplete.css238
-rw-r--r--application/palemoon/themes/windows/browser.css63
-rw-r--r--application/palemoon/themes/windows/jar.mn6
-rw-r--r--application/palemoon/themes/windows/sync-notification-24.pngbin1119 -> 0 bytes
-rw-r--r--application/xulrunner/README.xulrunner13
-rw-r--r--application/xulrunner/app.mozbuild13
-rw-r--r--application/xulrunner/app/Makefile.in75
-rw-r--r--application/xulrunner/app/default16.pngbin0 -> 744 bytes
-rw-r--r--application/xulrunner/app/default32.pngbin0 -> 2084 bytes
-rw-r--r--application/xulrunner/app/default48.pngbin0 -> 3846 bytes
-rw-r--r--application/xulrunner/app/document.icobin0 -> 22486 bytes
-rw-r--r--application/xulrunner/app/install_app.py221
-rw-r--r--application/xulrunner/app/macbuild/Info.plist.in31
-rw-r--r--application/xulrunner/app/macbuild/InfoPlist.stringsbin0 -> 280 bytes
-rw-r--r--application/xulrunner/app/moz.build70
-rw-r--r--application/xulrunner/app/nsXULRunnerApp.cpp294
-rw-r--r--application/xulrunner/app/splash.rc22
-rw-r--r--application/xulrunner/app/xulrunner.exe.manifest38
-rw-r--r--application/xulrunner/app/xulrunner.icobin0 -> 22486 bytes
-rw-r--r--application/xulrunner/app/xulrunner.js26
-rw-r--r--application/xulrunner/config/mozconfig9
-rw-r--r--application/xulrunner/config/mozconfigs/common (renamed from application/palemoon/components/shell/Makefile.in)8
-rw-r--r--application/xulrunner/config/mozconfigs/common.override8
-rw-r--r--application/xulrunner/config/mozconfigs/linux32/xulrunner9
-rw-r--r--application/xulrunner/config/mozconfigs/linux32/xulrunner-qt15
-rw-r--r--application/xulrunner/config/mozconfigs/linux64/xulrunner9
-rw-r--r--application/xulrunner/config/mozconfigs/macosx-universal/xulrunner9
-rw-r--r--application/xulrunner/config/mozconfigs/win32/xulrunner16
-rw-r--r--application/xulrunner/config/mozconfigs/win64/xulrunner15
-rw-r--r--application/xulrunner/configure.in11
-rw-r--r--application/xulrunner/confvars.sh28
-rw-r--r--application/xulrunner/examples/moz.build7
-rw-r--r--application/xulrunner/examples/simple/application.ini43
-rw-r--r--application/xulrunner/examples/simple/components/moz.build7
-rw-r--r--application/xulrunner/examples/simple/components/public/moz.build13
-rw-r--r--application/xulrunner/examples/simple/components/public/nsISimpleTest.idl15
-rw-r--r--application/xulrunner/examples/simple/components/src/SimpleTest.cpp54
-rw-r--r--application/xulrunner/examples/simple/components/src/SimpleTest.js27
-rw-r--r--application/xulrunner/examples/simple/components/src/SimpleTest.manifest2
-rw-r--r--application/xulrunner/examples/simple/components/src/moz.build21
-rw-r--r--application/xulrunner/examples/simple/content/contents.rdf0
-rw-r--r--application/xulrunner/examples/simple/content/simple.js17
-rw-r--r--application/xulrunner/examples/simple/content/simple.xul20
-rw-r--r--application/xulrunner/examples/simple/icons/simple.icobin0 -> 29310 bytes
-rw-r--r--application/xulrunner/examples/simple/jar.mn12
-rw-r--r--application/xulrunner/examples/simple/locale/simple.dtd7
-rw-r--r--application/xulrunner/examples/simple/moz.build22
-rw-r--r--application/xulrunner/examples/simple/simple-prefs.js6
-rw-r--r--application/xulrunner/installer/Makefile.in148
-rw-r--r--application/xulrunner/installer/debian/changelog.in7
-rw-r--r--application/xulrunner/installer/debian/compat1
-rw-r--r--application/xulrunner/installer/debian/control48
-rw-r--r--application/xulrunner/installer/debian/icon_base6436
-rw-r--r--application/xulrunner/installer/debian/menu2
-rw-r--r--application/xulrunner/installer/debian/postinst.in42
-rw-r--r--application/xulrunner/installer/debian/prerm.in29
-rw-r--r--application/xulrunner/installer/debian/xulrunner.links.in2
-rw-r--r--application/xulrunner/installer/debian/xulrunner.service.in4
-rw-r--r--application/xulrunner/installer/libxul-embedding.pc.in10
-rw-r--r--application/xulrunner/installer/libxul.pc.in11
-rw-r--r--application/xulrunner/installer/moz.build6
-rw-r--r--application/xulrunner/installer/mozilla-js.pc.in10
-rw-r--r--application/xulrunner/installer/mozilla-nspr.pc.in11
-rw-r--r--application/xulrunner/installer/mozilla-nss.pc.in10
-rw-r--r--application/xulrunner/installer/mozilla-plugin.pc.in8
-rw-r--r--application/xulrunner/locales/all-locales39
-rw-r--r--application/xulrunner/moz.build11
-rw-r--r--application/xulrunner/moz.configure7
-rw-r--r--application/xulrunner/stub/Makefile.in11
-rw-r--r--application/xulrunner/stub/moz.build51
-rw-r--r--application/xulrunner/stub/nsXULStub.cpp445
-rw-r--r--application/xulrunner/stub/xulrunner-stub.exe.manifest38
-rw-r--r--application/xulrunner/stub/xulrunner-stub.rc6
-rw-r--r--application/xulrunner/tools/redit/Makefile.in11
-rw-r--r--application/xulrunner/tools/redit/moz.build15
-rw-r--r--application/xulrunner/tools/redit/redit.cpp187
278 files changed, 13085 insertions, 10208 deletions
diff --git a/application/palemoon/app.mozbuild b/application/palemoon/app.mozbuild
index 0cbce0f72..1727d4f6b 100644
--- a/application/palemoon/app.mozbuild
+++ b/application/palemoon/app.mozbuild
@@ -13,5 +13,5 @@ DIRS += ['/%s' % CONFIG['MOZ_BRANDING_DIRECTORY']]
# Never add tier dirs after browser because they apparently won't get
# packaged properly on Mac.
-DIRS += ['/browser']
+DIRS += ['/application/palemoon']
diff --git a/application/palemoon/app/Makefile.in b/application/palemoon/app/Makefile.in
index 580fcb164..6f9bbfaf0 100644
--- a/application/palemoon/app/Makefile.in
+++ b/application/palemoon/app/Makefile.in
@@ -54,14 +54,6 @@ GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, palemoon.js)
endif
-ifdef MOZ_WIDGET_GTK
-libs::
- $(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(FINAL_TARGET)/icons
- $(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png $(FINAL_TARGET)/chrome/icons/default
- $(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png $(FINAL_TARGET)/chrome/icons/default
- $(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(FINAL_TARGET)/chrome/icons/default
-endif
-
ifndef LIBXUL_SDK
# channel-prefs.js is handled separate from other prefs due to bug 756325
libs:: $(srcdir)/profile/channel-prefs.js
diff --git a/application/palemoon/app/blocklist.xml b/application/palemoon/app/blocklist.xml
index 9c64af987..296b8ad24 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="1508456048000"
+<blocklist lastupdate="1521130300000"
xmlns="http://www.mozilla.org/2006/addons-blocklist">
<emItems>
<emItem blockID="i545" id="superlrcs@svenyor.net">
@@ -2441,6 +2441,18 @@ xmlns="http://www.mozilla.org/2006/addons-blocklist">
<versionRange minVersion="4.0.0a" maxVersion="4.1.20a"
severity="1" />
</emItem>
+ <emItem blockID="2447476f-043b-4d0b-9d3c-8e859c97d950" id="{44e4b2cf-77ba-4f76-aca7-f3fcbc2dda2f}">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
+ <emItem blockID="f58729ec-f93c-41d9-870d-dd9c9fd811b6" id="/^(addon@fasterweb\.com|\{5f398d3f-25db-47f5-b422-aa2364ff6c0b\}|addon@fasterp\.com|addon@calculator)$/">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
+ <emItem blockID="3d55fab0-ec1a-4bca-84c9-3b74f5d01509" id="/^.*extension.*@asdf\.pl$/">
+ <prefs/>
+ <versionRange minVersion="0" maxVersion="*" severity="3"/>
+ </emItem>
<emItem blockID="pm100" id="{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}">
<versionRange minVersion="0" maxVersion="*" severity="1">
</versionRange>
diff --git a/application/palemoon/app/macbuild/Contents/Info.plist.in b/application/palemoon/app/macbuild/Contents/Info.plist.in
index c77ab1ec5..b224064cf 100644
--- a/application/palemoon/app/macbuild/Contents/Info.plist.in
+++ b/application/palemoon/app/macbuild/Contents/Info.plist.in
@@ -205,6 +205,11 @@
<true/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
+ <key>LSEnvironment</key>
+ <dict>
+ <key>MallocNanoZone</key>
+ <string>0</string>
+ </dict>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
<key>LSMinimumSystemVersionByArchitecture</key>
diff --git a/application/palemoon/app/moz.build b/application/palemoon/app/moz.build
index 929139a6a..8b358b622 100644
--- a/application/palemoon/app/moz.build
+++ b/application/palemoon/app/moz.build
@@ -7,12 +7,9 @@
DIRS += ['profile/extensions']
-if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_ASAN']:
- GoannaProgram(CONFIG['MOZ_APP_NAME'])
-else:
- GoannaProgram(CONFIG['MOZ_APP_NAME'], msvcrt='static')
+GeckoProgram(CONFIG['MOZ_APP_NAME'])
-JS_PREFERENCE_FILES += [
+JS_PREFERENCE_PP_FILES += [
'profile/palemoon.js',
]
@@ -30,14 +27,8 @@ FINAL_TARGET_FILES.defaults.profile += ['profile/prefs.js']
DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
-for var in ('MOZILLA_OFFICIAL', 'LIBXUL_SDK'):
- if CONFIG[var]:
- DEFINES[var] = True
-
-DEFINES['XPCOM_GLUE'] = True
-
-GENERATED_INCLUDES += [
- '/build',
+LOCAL_INCLUDES += [
+ '!/build',
]
LOCAL_INCLUDES += [
@@ -46,11 +37,9 @@ LOCAL_INCLUDES += [
'/xpcom/build',
]
-DELAYLOAD_DLLS += [
- 'mozglue.dll',
+USE_LIBS += [
+ 'mozglue',
]
-USE_STATIC_LIBS = True
-
if CONFIG['_MSC_VER']:
# Always enter a Windows program through wmain, whether or not we're
@@ -72,16 +61,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
LDFLAGS += ['/HEAP:0x40000']
-if CONFIG['OS_ARCH'] == 'WINNT':
- USE_LIBS += [
- 'mozglue',
- 'xpcomglue_staticruntime',
- ]
-else:
- USE_LIBS += [
- 'xpcomglue',
- ]
-
DISABLE_STL_WRAPPING = True
if CONFIG['MOZ_LINKER']:
diff --git a/application/palemoon/app/nsBrowserApp.cpp b/application/palemoon/app/nsBrowserApp.cpp
index f9645b0c6..5b866d6b4 100644
--- a/application/palemoon/app/nsBrowserApp.cpp
+++ b/application/palemoon/app/nsBrowserApp.cpp
@@ -8,25 +8,13 @@
#include "application.ini.h"
#include "nsXPCOMGlue.h"
#if defined(XP_WIN)
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0600
#include <windows.h>
-#include <winbase.h>
-#include <VersionHelpers.h>
#include <stdlib.h>
-#include <io.h>
-#include <fcntl.h>
#elif defined(XP_UNIX)
#include <sys/resource.h>
-#include <time.h>
#include <unistd.h>
#endif
-#ifdef XP_MACOSX
-#include <mach/mach_time.h>
-#include "MacQuirks.h"
-#endif
-
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
@@ -35,20 +23,26 @@
#include "nsIFile.h"
#include "nsStringGlue.h"
-// Easy access to a five second startup delay used to get
-// a debugger attached in the metro environment.
-// #define DEBUG_delay_start_metro
-
#ifdef XP_WIN
-// we want a wmain entry point
-#include "nsWindowsWMain.cpp"
-#define snprintf _snprintf
+#define XRE_WANT_ENVIRON
#define strcasecmp _stricmp
+#ifdef MOZ_SANDBOX
+#include "mozilla/sandboxing/SandboxInitialization.h"
+#endif
#endif
#include "BinaryPath.h"
#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
-#include "mozilla/StartupTimeline.h"
+
+#include "mozilla/Sprintf.h"
+#include "mozilla/Telemetry.h"
+#include "mozilla/WindowsDllBlocklist.h"
+
+#if !defined(MOZ_WIDGET_COCOA) && !defined(MOZ_WIDGET_ANDROID) \
+ && !(defined(XP_LINUX) && defined(MOZ_SANDBOX))
+#define MOZ_BROWSER_CAN_BE_CONTENTPROC
+#include "../../ipc/contentproc/plugin-container.cpp"
+#endif
using namespace mozilla;
@@ -56,12 +50,6 @@ using namespace mozilla;
#define kOSXResourcesFolder "Resources"
#endif
#define kDesktopFolder "browser"
-#define kMetroFolder "metro"
-#define kMetroAppIniFilename "metroapp.ini"
-#ifdef XP_WIN
-#define kMetroTestFile "tests.ini"
-const char* kMetroConsoleIdParam = "testconsoleid=";
-#endif
static void Output(const char *fmt, ... )
{
@@ -84,10 +72,19 @@ static void Output(const char *fmt, ... )
#if MOZ_WINCONSOLE
fwprintf_s(stderr, wide_msg);
#else
- MessageBoxW(nullptr,
- wide_msg,
- L"Pale Moon",
- MB_OK | MB_ICONERROR | MB_SETFOREGROUND);
+ // Linking user32 at load-time interferes with the DLL blocklist (bug 932100).
+ // This is a rare codepath, so we can load user32 at run-time instead.
+ HMODULE user32 = LoadLibraryW(L"user32.dll");
+ if (user32) {
+ decltype(MessageBoxW)* messageBoxW =
+ (decltype(MessageBoxW)*) GetProcAddress(user32, "MessageBoxW");
+ if (messageBoxW) {
+ messageBoxW(nullptr, wide_msg, L"Pale Moon", MB_OK
+ | MB_ICONERROR
+ | MB_SETFOREGROUND);
+ }
+ FreeLibrary(user32);
+ }
#endif
#endif
@@ -114,76 +111,60 @@ static bool IsArg(const char* arg, const char* s)
return false;
}
-#ifdef XP_WIN
-/*
- * AttachToTestHarness - Windows helper for when we are running
- * in the immersive environment. Firefox is launched by Windows in
- * response to a request by metrotestharness, which is launched by
- * runtests.py. As such stdout in fx doesn't point to the right
- * stream. This helper touches up stdout such that test output gets
- * routed to a named pipe metrotestharness creates and dumps to its
- * stdout.
- */
-static void AttachToTestHarness()
-{
- // attach to the metrotestharness named logging pipe
- HANDLE winOut = CreateFileA("\\\\.\\pipe\\metrotestharness",
- GENERIC_WRITE,
- FILE_SHARE_WRITE, 0,
- OPEN_EXISTING, 0, 0);
-
- if (winOut == INVALID_HANDLE_VALUE) {
- OutputDebugStringW(L"Could not create named logging pipe.\n");
- return;
- }
-
- // Set the c runtime handle
- int stdOut = _open_osfhandle((intptr_t)winOut, _O_APPEND);
- if (stdOut == -1) {
- OutputDebugStringW(L"Could not open c-runtime handle.\n");
- return;
- }
- FILE *fp = _fdopen(stdOut, "a");
- *stdout = *fp;
-}
-#endif
-
XRE_GetFileFromPathType XRE_GetFileFromPath;
XRE_CreateAppDataType XRE_CreateAppData;
XRE_FreeAppDataType XRE_FreeAppData;
-#ifdef XRE_HAS_DLL_BLOCKLIST
-XRE_SetupDllBlocklistType XRE_SetupDllBlocklist;
-#endif
+XRE_TelemetryAccumulateType XRE_TelemetryAccumulate;
XRE_StartupTimelineRecordType XRE_StartupTimelineRecord;
XRE_mainType XRE_main;
XRE_StopLateWriteChecksType XRE_StopLateWriteChecks;
+XRE_XPCShellMainType XRE_XPCShellMain;
+XRE_GetProcessTypeType XRE_GetProcessType;
+XRE_SetProcessTypeType XRE_SetProcessType;
+XRE_InitChildProcessType XRE_InitChildProcess;
+XRE_EnableSameExecutableForContentProcType XRE_EnableSameExecutableForContentProc;
+#ifdef LIBFUZZER
+XRE_LibFuzzerSetMainType XRE_LibFuzzerSetMain;
+XRE_LibFuzzerGetFuncsType XRE_LibFuzzerGetFuncs;
+#endif
static const nsDynamicFunctionLoad kXULFuncs[] = {
{ "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath },
{ "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData },
{ "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData },
-#ifdef XRE_HAS_DLL_BLOCKLIST
- { "XRE_SetupDllBlocklist", (NSFuncPtr*) &XRE_SetupDllBlocklist },
-#endif
+ { "XRE_TelemetryAccumulate", (NSFuncPtr*) &XRE_TelemetryAccumulate },
{ "XRE_StartupTimelineRecord", (NSFuncPtr*) &XRE_StartupTimelineRecord },
{ "XRE_main", (NSFuncPtr*) &XRE_main },
{ "XRE_StopLateWriteChecks", (NSFuncPtr*) &XRE_StopLateWriteChecks },
+ { "XRE_XPCShellMain", (NSFuncPtr*) &XRE_XPCShellMain },
+ { "XRE_GetProcessType", (NSFuncPtr*) &XRE_GetProcessType },
+ { "XRE_SetProcessType", (NSFuncPtr*) &XRE_SetProcessType },
+ { "XRE_InitChildProcess", (NSFuncPtr*) &XRE_InitChildProcess },
+ { "XRE_EnableSameExecutableForContentProc", (NSFuncPtr*) &XRE_EnableSameExecutableForContentProc },
+#ifdef LIBFUZZER
+ { "XRE_LibFuzzerSetMain", (NSFuncPtr*) &XRE_LibFuzzerSetMain },
+ { "XRE_LibFuzzerGetFuncs", (NSFuncPtr*) &XRE_LibFuzzerGetFuncs },
+#endif
{ nullptr, nullptr }
};
-static int do_main(int argc, char* argv[], nsIFile *xreDirectory)
+#ifdef LIBFUZZER
+int libfuzzer_main(int argc, char **argv);
+
+/* This wrapper is used by the libFuzzer main to call into libxul */
+
+void libFuzzerGetFuncs(const char* moduleName, LibFuzzerInitFunc* initFunc,
+ LibFuzzerTestingFunc* testingFunc) {
+ return XRE_LibFuzzerGetFuncs(moduleName, initFunc, testingFunc);
+}
+#endif
+
+static int do_main(int argc, char* argv[], char* envp[], nsIFile *xreDirectory)
{
nsCOMPtr<nsIFile> appini;
nsresult rv;
uint32_t mainFlags = 0;
-#ifdef XP_WIN
- if (!IsWindowsVistaOrGreater()) {
- Output("Couldn't load valid PE image.\n");
- return 255;
- }
-
-#endif
// Allow palemoon.exe to launch XULRunner apps via -app <application.ini>
// Note that -app must be the *first* argument.
const char *appDataFile = getenv("XUL_APP_FILE");
@@ -207,14 +188,26 @@ static int do_main(int argc, char* argv[], nsIFile *xreDirectory)
}
char appEnv[MAXPATHLEN];
- snprintf(appEnv, MAXPATHLEN, "XUL_APP_FILE=%s", argv[2]);
- if (putenv(appEnv)) {
+ SprintfLiteral(appEnv, "XUL_APP_FILE=%s", argv[2]);
+ if (putenv(strdup(appEnv))) {
Output("Couldn't set %s.\n", appEnv);
return 255;
}
argv[2] = argv[0];
argv += 2;
argc -= 2;
+ } else if (argc > 1 && IsArg(argv[1], "xpcshell")) {
+ for (int i = 1; i < argc; i++) {
+ argv[i] = argv[i + 1];
+ }
+
+ XREShellData shellData;
+#if defined(XP_WIN) && defined(MOZ_SANDBOX)
+ shellData.sandboxBrokerServices =
+ sandboxing::GetInitializedBrokerServices();
+#endif
+
+ return XRE_XPCShellMain(--argc, argv, envp, &shellData);
}
if (appini) {
@@ -224,6 +217,13 @@ static int do_main(int argc, char* argv[], nsIFile *xreDirectory)
Output("Couldn't read application.ini");
return 255;
}
+#if defined(HAS_DLL_BLOCKLIST)
+ // The dll blocklist operates in the exe vs. xullib. Pass a flag to
+ // xullib so automated tests can check the result once the browser
+ // is up and running.
+ appData->flags |=
+ DllBlocklist_CheckStatus() ? NS_XRE_DLL_BLOCKLIST_ENABLED : 0;
+#endif
// xreDirectory already has a refcount from NS_NewLocalFile
appData->xreDirectory = xreDirectory;
int result = XRE_main(argc, argv, appData, mainFlags);
@@ -231,7 +231,6 @@ static int do_main(int argc, char* argv[], nsIFile *xreDirectory)
return result;
}
- // Desktop browser launch
ScopedAppData appData(&sAppData);
nsCOMPtr<nsIFile> exeFile;
rv = mozilla::BinaryPath::GetFile(argv[0], getter_AddRefs(exeFile));
@@ -243,10 +242,7 @@ static int do_main(int argc, char* argv[], nsIFile *xreDirectory)
nsCOMPtr<nsIFile> greDir;
exeFile->GetParent(getter_AddRefs(greDir));
#ifdef XP_MACOSX
- nsCOMPtr<nsIFile> parent;
- greDir->GetParent(getter_AddRefs(parent));
- greDir = parent.forget();
- greDir->AppendNative(NS_LITERAL_CSTRING(kOSXResourcesFolder));
+ greDir->SetNativeLeafName(NS_LITERAL_CSTRING(kOSXResourcesFolder));
#endif
nsCOMPtr<nsIFile> appSubdir;
greDir->Clone(getter_AddRefs(appSubdir));
@@ -256,33 +252,29 @@ static int do_main(int argc, char* argv[], nsIFile *xreDirectory)
// xreDirectory already has a refcount from NS_NewLocalFile
appData.xreDirectory = xreDirectory;
- return XRE_main(argc, argv, &appData, mainFlags);
-}
+#if defined(HAS_DLL_BLOCKLIST)
+ appData.flags |=
+ DllBlocklist_CheckStatus() ? NS_XRE_DLL_BLOCKLIST_ENABLED : 0;
+#endif
-/**
- * Local TimeStamp::Now()-compatible implementation used to record timestamps
- * which will be passed to XRE_StartupTimelineRecord().
- */
-static uint64_t
-TimeStamp_Now()
-{
-#ifdef XP_WIN
- LARGE_INTEGER freq;
- ::QueryPerformanceFrequency(&freq);
- return GetTickCount64() * freq.QuadPart;
-#elif defined(XP_MACOSX)
- return mach_absolute_time();
-#elif defined(HAVE_CLOCK_MONOTONIC)
- struct timespec ts;
- int rv = clock_gettime(CLOCK_MONOTONIC, &ts);
-
- if (rv != 0) {
- return 0;
+#if defined(XP_WIN) && defined(MOZ_SANDBOX)
+ sandbox::BrokerServices* brokerServices =
+ sandboxing::GetInitializedBrokerServices();
+#if defined(MOZ_CONTENT_SANDBOX)
+ if (!brokerServices) {
+ Output("Couldn't initialize the broker services.\n");
+ return 255;
}
+#endif
+ appData.sandboxBrokerServices = brokerServices;
+#endif
- uint64_t baseNs = (uint64_t)ts.tv_sec * 1000000000;
- return baseNs + (uint64_t)ts.tv_nsec;
+#ifdef LIBFUZZER
+ if (getenv("LIBFUZZER"))
+ XRE_LibFuzzerSetMain(argc, argv, libfuzzer_main);
#endif
+
+ return XRE_main(argc, argv, &appData, mainFlags);
}
static bool
@@ -298,11 +290,6 @@ FileExists(const char *path)
#endif
}
-#ifdef LIBXUL_SDK
-# define XPCOM_PATH "xulrunner" XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL
-#else
-# define XPCOM_PATH XPCOM_DLL
-#endif
static nsresult
InitXPCOMGlue(const char *argv0, nsIFile **xreDirectory)
{
@@ -315,55 +302,13 @@ InitXPCOMGlue(const char *argv0, nsIFile **xreDirectory)
}
char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
- if (!lastSlash || (size_t(lastSlash - exePath) > MAXPATHLEN - sizeof(XPCOM_PATH) - 1))
+ if (!lastSlash ||
+ (size_t(lastSlash - exePath) > MAXPATHLEN - sizeof(XPCOM_DLL) - 1))
return NS_ERROR_FAILURE;
- strcpy(lastSlash + 1, XPCOM_PATH);
- lastSlash += sizeof(XPCOM_PATH) - sizeof(XPCOM_DLL);
+ strcpy(lastSlash + 1, XPCOM_DLL);
if (!FileExists(exePath)) {
-#if defined(LIBXUL_SDK) && defined(XP_MACOSX)
- // Check for <bundle>/Contents/Frameworks/XUL.framework/libxpcom.dylib
- bool greFound = false;
- CFBundleRef appBundle = CFBundleGetMainBundle();
- if (!appBundle)
- return NS_ERROR_FAILURE;
- CFURLRef fwurl = CFBundleCopyPrivateFrameworksURL(appBundle);
- CFURLRef absfwurl = nullptr;
- if (fwurl) {
- absfwurl = CFURLCopyAbsoluteURL(fwurl);
- CFRelease(fwurl);
- }
- if (absfwurl) {
- CFURLRef xulurl =
- CFURLCreateCopyAppendingPathComponent(nullptr, absfwurl,
- CFSTR("XUL.framework"),
- true);
-
- if (xulurl) {
- CFURLRef xpcomurl =
- CFURLCreateCopyAppendingPathComponent(nullptr, xulurl,
- CFSTR("libxpcom.dylib"),
- false);
-
- if (xpcomurl) {
- if (CFURLGetFileSystemRepresentation(xpcomurl, true,
- (UInt8*) exePath,
- sizeof(exePath)) &&
- access(tbuffer, R_OK | X_OK) == 0) {
- if (realpath(tbuffer, exePath)) {
- greFound = true;
- }
- }
- CFRelease(xpcomurl);
- }
- CFRelease(xulurl);
- }
- CFRelease(absfwurl);
- }
- }
- if (!greFound) {
-#endif
Output("Could not find the Mozilla runtime.\n");
return NS_ERROR_FAILURE;
}
@@ -383,45 +328,72 @@ InitXPCOMGlue(const char *argv0, nsIFile **xreDirectory)
return rv;
}
+ // This will set this thread as the main thread.
NS_LogInit();
- // chop XPCOM_DLL off exePath
- *lastSlash = '\0';
+ if (xreDirectory) {
+ // chop XPCOM_DLL off exePath
+ *lastSlash = '\0';
#ifdef XP_MACOSX
- lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
- strcpy(lastSlash + 1, kOSXResourcesFolder);
+ lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
+ strcpy(lastSlash + 1, kOSXResourcesFolder);
#endif
#ifdef XP_WIN
- rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), false,
- xreDirectory);
+ rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(exePath), false,
+ xreDirectory);
#else
- rv = NS_NewNativeLocalFile(nsDependentCString(exePath), false,
- xreDirectory);
+ rv = NS_NewNativeLocalFile(nsDependentCString(exePath), false,
+ xreDirectory);
#endif
+ }
return rv;
}
-int main(int argc, char* argv[])
+int main(int argc, char* argv[], char* envp[])
{
-#ifdef DEBUG_delay_start_metro
- Sleep(5000);
+ mozilla::TimeStamp start = mozilla::TimeStamp::Now();
+
+#ifdef HAS_DLL_BLOCKLIST
+ DllBlocklist_Initialize();
+
+#ifdef DEBUG
+ // In order to be effective against AppInit DLLs, the blocklist must be
+ // initialized before user32.dll is loaded into the process (bug 932100).
+ if (GetModuleHandleA("user32.dll")) {
+ fprintf(stderr, "DLL blocklist was unable to intercept AppInit DLLs.\n");
+ }
+#endif
#endif
- uint64_t start = TimeStamp_Now();
-#ifdef XP_MACOSX
- TriggerQuirks();
+#ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC
+ // We are launching as a content process, delegate to the appropriate
+ // main
+ if (argc > 1 && IsArg(argv[1], "contentproc")) {
+#if defined(XP_WIN) && defined(MOZ_SANDBOX)
+ // We need to initialize the sandbox TargetServices before InitXPCOMGlue
+ // because we might need the sandbox broker to give access to some files.
+ if (IsSandboxedProcess() && !sandboxing::GetInitializedTargetServices()) {
+ Output("Failed to initialize the sandbox target services.");
+ return 255;
+ }
#endif
- int gotCounters;
-#if defined(XP_UNIX)
- struct rusage initialRUsage;
- gotCounters = !getrusage(RUSAGE_SELF, &initialRUsage);
-#elif defined(XP_WIN)
- IO_COUNTERS ioCounters;
- gotCounters = GetProcessIoCounters(GetCurrentProcess(), &ioCounters);
+ nsresult rv = InitXPCOMGlue(argv[0], nullptr);
+ if (NS_FAILED(rv)) {
+ return 255;
+ }
+
+ int result = content_process_main(argc, argv);
+
+ // InitXPCOMGlue calls NS_LogInit, so we need to balance it here.
+ NS_LogTerm();
+
+ return result;
+ }
#endif
+
nsIFile *xreDirectory;
nsresult rv = InitXPCOMGlue(argv[0], &xreDirectory);
@@ -431,11 +403,11 @@ int main(int argc, char* argv[])
XRE_StartupTimelineRecord(mozilla::StartupTimeline::START, start);
-#ifdef XRE_HAS_DLL_BLOCKLIST
- XRE_SetupDllBlocklist();
+#ifdef MOZ_BROWSER_CAN_BE_CONTENTPROC
+ XRE_EnableSameExecutableForContentProc();
#endif
- int result = do_main(argc, argv, xreDirectory);
+ int result = do_main(argc, argv, envp, xreDirectory);
NS_LogTerm();
diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js
index 7338a83a2..ee4a95d38 100644
--- a/application/palemoon/app/profile/palemoon.js
+++ b/application/palemoon/app/profile/palemoon.js
@@ -1036,6 +1036,9 @@ 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);
+
// number of columns of newtab grid
pref("browser.newtabpage.columns", 4);
diff --git a/application/palemoon/base/content/abouthome/aboutHome.js b/application/palemoon/base/content/abouthome/aboutHome.js
index 9e826b69e..6a970acd6 100644
--- a/application/palemoon/base/content/abouthome/aboutHome.js
+++ b/application/palemoon/base/content/abouthome/aboutHome.js
@@ -234,8 +234,8 @@ const SEARCH_ENGINES = {
};
// This global tracks if the page has been set up before, to prevent double inits
-let gInitialized = false;
-let gObserver = new MutationObserver(function (mutations) {
+var gInitialized = false;
+var gObserver = new MutationObserver(function (mutations) {
for (let mutation of mutations) {
if (mutation.attributeName == "searchEngineURL") {
setupSearchEngine();
diff --git a/application/palemoon/base/content/autocomplete.css b/application/palemoon/base/content/autocomplete.css
new file mode 100644
index 000000000..960bdc456
--- /dev/null
+++ b/application/palemoon/base/content/autocomplete.css
@@ -0,0 +1,17 @@
+/* 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/. */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace html url("http://www.w3.org/1999/xhtml");
+
+/* Apply crisp rendering for favicons at exactly 2dppx resolution */
+@media (resolution: 2dppx) {
+ .ac-site-icon {
+ image-rendering: -moz-crisp-edges;
+ }
+}
+
+richlistitem > .ac-title-box > .ac-title > .ac-comment:not([selected]) > html|span.ac-selected-text {
+ display: none;
+}
diff --git a/application/palemoon/base/content/autocomplete.xml b/application/palemoon/base/content/autocomplete.xml
new file mode 100644
index 000000000..bd0928436
--- /dev/null
+++ b/application/palemoon/base/content/autocomplete.xml
@@ -0,0 +1,2128 @@
+<?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/. -->
+
+<bindings id="privateAutocompleteBindings"
+ xmlns="http://www.mozilla.org/xbl"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:xbl="http://www.mozilla.org/xbl">
+
+ <binding id="private-autocomplete" role="xul:combobox"
+ extends="chrome://global/content/bindings/textbox.xml#textbox">
+ <resources>
+ <stylesheet src="chrome://browser/content/autocomplete.css"/>
+ <stylesheet src="chrome://browser/skin/autocomplete.css"/>
+ </resources>
+
+ <content sizetopopup="pref">
+ <xul:hbox class="private-autocomplete-textbox-container" flex="1" xbl:inherits="focused">
+ <children includes="image|deck|stack|box">
+ <xul:image class="private-autocomplete-icon" allowevents="true"/>
+ </children>
+
+ <xul:hbox anonid="textbox-input-box" class="textbox-input-box" flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
+ <children/>
+ <html:input anonid="input" class="private-autocomplete-textbox textbox-input"
+ allowevents="true"
+ xbl:inherits="tooltiptext=inputtooltiptext,value,type=inputtype,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,mozactionhint"/>
+ </xul:hbox>
+ <children includes="hbox"/>
+ </xul:hbox>
+
+ <xul:dropmarker anonid="historydropmarker" class="private-autocomplete-history-dropmarker"
+ allowevents="true"
+ xbl:inherits="open,enablehistory,parentfocused=focused"/>
+
+ <xul:popupset anonid="popupset" class="private-autocomplete-result-popupset"/>
+
+ <children includes="toolbarbutton"/>
+ </content>
+
+ <implementation implements="nsIAutoCompleteInput, nsIDOMXULMenuListElement">
+ <field name="mController">null</field>
+ <field name="mSearchNames">null</field>
+ <field name="mIgnoreInput">false</field>
+ <field name="mEnterEvent">null</field>
+
+ <field name="_searchBeginHandler">null</field>
+ <field name="_searchCompleteHandler">null</field>
+ <field name="_textEnteredHandler">null</field>
+ <field name="_textRevertedHandler">null</field>
+
+ <constructor><![CDATA[
+ this.mController = Components.classes["@mozilla.org/autocomplete/controller;1"].
+ getService(Components.interfaces.nsIAutoCompleteController);
+
+ this._searchBeginHandler = this.initEventHandler("searchbegin");
+ this._searchCompleteHandler = this.initEventHandler("searchcomplete");
+ this._textEnteredHandler = this.initEventHandler("textentered");
+ this._textRevertedHandler = this.initEventHandler("textreverted");
+
+ // For security reasons delay searches on pasted values.
+ this.inputField.controllers.insertControllerAt(0, this._pasteController);
+ ]]></constructor>
+
+ <destructor><![CDATA[
+ this.inputField.controllers.removeController(this._pasteController);
+ ]]></destructor>
+
+ <!-- =================== nsIAutoCompleteInput =================== -->
+
+ <field name="popup"><![CDATA[
+ // Wrap in a block so that the let statements don't
+ // create properties on 'this' (bug 635252).
+ {
+ let popup = null;
+ let popupId = this.getAttribute("autocompletepopup");
+ if (popupId)
+ popup = document.getElementById(popupId);
+ if (!popup) {
+ popup = document.createElement("panel");
+ popup.setAttribute("type", "autocomplete");
+ popup.setAttribute("noautofocus", "true");
+
+ let popupset = document.getAnonymousElementByAttribute(this, "anonid", "popupset");
+ popupset.appendChild(popup);
+ }
+ popup.mInput = this;
+ popup;
+ }
+ ]]></field>
+
+ <property name="controller" onget="return this.mController;" readonly="true"/>
+
+ <property name="popupOpen"
+ onget="return this.popup.popupOpen;"
+ onset="if (val) this.openPopup(); else this.closePopup();"/>
+
+ <property name="disableAutoComplete"
+ onset="this.setAttribute('disableautocomplete', val); return val;"
+ onget="return this.getAttribute('disableautocomplete') == 'true';"/>
+
+ <property name="completeDefaultIndex"
+ onset="this.setAttribute('completedefaultindex', val); return val;"
+ onget="return this.getAttribute('completedefaultindex') == 'true';"/>
+
+ <property name="completeSelectedIndex"
+ onset="this.setAttribute('completeselectedindex', val); return val;"
+ onget="return this.getAttribute('completeselectedindex') == 'true';"/>
+
+ <property name="forceComplete"
+ onset="this.setAttribute('forcecomplete', val); return val;"
+ onget="return this.getAttribute('forcecomplete') == 'true';"/>
+
+ <property name="minResultsForPopup"
+ onset="this.setAttribute('minresultsforpopup', val); return val;"
+ onget="var m = parseInt(this.getAttribute('minresultsforpopup')); return isNaN(m) ? 1 : m;"/>
+
+ <property name="showCommentColumn"
+ onset="this.setAttribute('showcommentcolumn', val); return val;"
+ onget="return this.getAttribute('showcommentcolumn') == 'true';"/>
+
+ <property name="showImageColumn"
+ onset="this.setAttribute('showimagecolumn', val); return val;"
+ onget="return this.getAttribute('showimagecolumn') == 'true';"/>
+
+ <property name="timeout"
+ onset="this.setAttribute('timeout', val); return val;">
+ <getter><![CDATA[
+ // For security reasons delay searches on pasted values.
+ if (this._valueIsPasted) {
+ let t = parseInt(this.getAttribute('pastetimeout'));
+ return isNaN(t) ? 1000 : t;
+ }
+
+ let t = parseInt(this.getAttribute('timeout'));
+ return isNaN(t) ? 50 : t;
+ ]]></getter>
+ </property>
+
+ <property name="searchParam"
+ onget="return this.getAttribute('autocompletesearchparam') || '';"
+ onset="this.setAttribute('autocompletesearchparam', val); return val;"/>
+
+ <property name="searchCount" readonly="true"
+ onget="this.initSearchNames(); return this.mSearchNames.length;"/>
+
+ <field name="shrinkDelay" readonly="true">
+ parseInt(this.getAttribute("shrinkdelay")) || 0
+ </field>
+
+ <field name="PrivateBrowsingUtils" readonly="true">
+ {
+ let utils = {};
+ Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm", utils);
+ utils.PrivateBrowsingUtils
+ }
+ </field>
+
+ <property name="inPrivateContext" readonly="true"
+ onget="return this.PrivateBrowsingUtils.isWindowPrivate(window);"/>
+
+ <property name="noRollupOnCaretMove" readonly="true"
+ onget="return this.popup.getAttribute('norolluponanchor') == 'true'"/>
+
+ <!-- This is the maximum number of drop-down rows we get when we
+ hit the drop marker beside fields that have it (like the URLbar).-->
+ <field name="maxDropMarkerRows" readonly="true">14</field>
+
+ <method name="getSearchAt">
+ <parameter name="aIndex"/>
+ <body><![CDATA[
+ this.initSearchNames();
+ return this.mSearchNames[aIndex];
+ ]]></body>
+ </method>
+
+ <property name="textValue"
+ onget="return this.value;">
+ <setter><![CDATA[
+ // Completing a result should simulate the user typing the result,
+ // so fire an input event.
+ // Trim popup selected values, but never trim results coming from
+ // autofill.
+ if (this.popup.selectedIndex == -1)
+ this._disableTrim = true;
+ this.value = val;
+ this._disableTrim = false;
+
+ var evt = document.createEvent("UIEvents");
+ evt.initUIEvent("input", true, false, window, 0);
+ this.mIgnoreInput = true;
+ this.dispatchEvent(evt);
+ this.mIgnoreInput = false;
+ return this.value;
+ ]]></setter>
+ </property>
+
+ <method name="selectTextRange">
+ <parameter name="aStartIndex"/>
+ <parameter name="aEndIndex"/>
+ <body><![CDATA[
+ this.inputField.setSelectionRange(aStartIndex, aEndIndex);
+ ]]></body>
+ </method>
+
+ <method name="onSearchBegin">
+ <body><![CDATA[
+ if (this.popup && typeof this.popup.onSearchBegin == "function")
+ this.popup.onSearchBegin();
+ if (this._searchBeginHandler)
+ this._searchBeginHandler();
+ ]]></body>
+ </method>
+
+ <method name="onSearchComplete">
+ <body><![CDATA[
+ if (this.mController.matchCount == 0)
+ this.setAttribute("nomatch", "true");
+ else
+ this.removeAttribute("nomatch");
+
+ if (this.ignoreBlurWhileSearching && !this.focused) {
+ this.handleEnter();
+ this.detachController();
+ }
+
+ if (this._searchCompleteHandler)
+ this._searchCompleteHandler();
+ ]]></body>
+ </method>
+
+ <method name="onTextEntered">
+ <body><![CDATA[
+ let rv = false;
+ if (this._textEnteredHandler)
+ rv = this._textEnteredHandler(this.mEnterEvent);
+ this.mEnterEvent = null;
+ return rv;
+ ]]></body>
+ </method>
+
+ <method name="onTextReverted">
+ <body><![CDATA[
+ if (this._textRevertedHandler)
+ return this._textRevertedHandler();
+ return false;
+ ]]></body>
+ </method>
+
+ <!-- =================== nsIDOMXULMenuListElement =================== -->
+
+ <property name="editable" readonly="true"
+ onget="return true;" />
+
+ <property name="crop"
+ onset="this.setAttribute('crop',val); return val;"
+ onget="return this.getAttribute('crop');"/>
+
+ <property name="open"
+ onget="return this.getAttribute('open') == 'true';">
+ <setter><![CDATA[
+ if (val)
+ this.showHistoryPopup();
+ else
+ this.closePopup();
+ ]]></setter>
+ </property>
+
+ <!-- =================== PUBLIC MEMBERS =================== -->
+
+ <field name="valueIsTyped">false</field>
+ <field name="_disableTrim">false</field>
+ <property name="value">
+ <getter><![CDATA[
+ if (typeof this.onBeforeValueGet == "function") {
+ var result = this.onBeforeValueGet();
+ if (result)
+ return result.value;
+ }
+ return this.inputField.value;
+ ]]></getter>
+ <setter><![CDATA[
+ this.mIgnoreInput = true;
+
+ if (typeof this.onBeforeValueSet == "function")
+ val = this.onBeforeValueSet(val);
+
+ if (typeof this.trimValue == "function" && !this._disableTrim)
+ val = this.trimValue(val);
+
+ this.valueIsTyped = false;
+ this.inputField.value = val;
+
+ if (typeof this.formatValue == "function")
+ this.formatValue();
+
+ this.mIgnoreInput = false;
+ var event = document.createEvent('Events');
+ event.initEvent('ValueChange', true, true);
+ this.inputField.dispatchEvent(event);
+ return val;
+ ]]></setter>
+ </property>
+
+ <property name="focused" readonly="true"
+ onget="return this.getAttribute('focused') == 'true';"/>
+
+ <!-- maximum number of rows to display at a time -->
+ <property name="maxRows"
+ onset="this.setAttribute('maxrows', val); return val;"
+ onget="return parseInt(this.getAttribute('maxrows')) || 0;"/>
+
+ <!-- option to allow scrolling through the list via the tab key, rather than
+ tab moving focus out of the textbox -->
+ <property name="tabScrolling"
+ onset="this.setAttribute('tabscrolling', val); return val;"
+ onget="return this.getAttribute('tabscrolling') == 'true';"/>
+
+ <!-- option to completely ignore any blur events while searches are
+ still going on. -->
+ <property name="ignoreBlurWhileSearching"
+ onset="this.setAttribute('ignoreblurwhilesearching', val); return val;"
+ onget="return this.getAttribute('ignoreblurwhilesearching') == 'true';"/>
+
+ <!-- disable key navigation handling in the popup results -->
+ <property name="disableKeyNavigation"
+ onset="this.setAttribute('disablekeynavigation', val); return val;"
+ onget="return this.getAttribute('disablekeynavigation') == 'true';"/>
+
+ <!-- option to highlight entries that don't have any matches -->
+ <property name="highlightNonMatches"
+ onset="this.setAttribute('highlightnonmatches', val); return val;"
+ onget="return this.getAttribute('highlightnonmatches') == 'true';"/>
+
+ <!-- =================== PRIVATE MEMBERS =================== -->
+
+ <!-- ::::::::::::: autocomplete controller ::::::::::::: -->
+
+ <method name="attachController">
+ <body><![CDATA[
+ this.mController.input = this;
+ ]]></body>
+ </method>
+
+ <method name="detachController">
+ <body><![CDATA[
+ if (this.mController.input == this)
+ this.mController.input = null;
+ ]]></body>
+ </method>
+
+ <!-- ::::::::::::: popup opening ::::::::::::: -->
+
+ <method name="openPopup">
+ <body><![CDATA[
+ if (this.focused)
+ this.popup.openAutocompletePopup(this, this);
+ ]]></body>
+ </method>
+
+ <method name="closePopup">
+ <body><![CDATA[
+ this.popup.closePopup();
+ ]]></body>
+ </method>
+
+ <method name="showHistoryPopup">
+ <body><![CDATA[
+ // history dropmarker pushed state
+ function cleanup(popup) {
+ popup.removeEventListener("popupshowing", onShow, false);
+ }
+ function onShow(event) {
+ var popup = event.target, input = popup.input;
+ cleanup(popup);
+ input.setAttribute("open", "true");
+ function onHide() {
+ input.removeAttribute("open");
+ popup.removeEventListener("popuphiding", onHide, false);
+ }
+ popup.addEventListener("popuphiding", onHide, false);
+ }
+ this.popup.addEventListener("popupshowing", onShow, false);
+ setTimeout(cleanup, 1000, this.popup);
+
+ // Store our "normal" maxRows on the popup, so that it can reset the
+ // value when the popup is hidden.
+ this.popup._normalMaxRows = this.maxRows;
+
+ // Increase our maxRows temporarily, since we want the dropdown to
+ // be bigger in this case. The popup's popupshowing/popuphiding
+ // handlers will take care of resetting this.
+ this.maxRows = this.maxDropMarkerRows;
+
+ // Ensure that we have focus.
+ if (!this.focused)
+ this.focus();
+ this.attachController();
+ this.mController.startSearch("");
+ ]]></body>
+ </method>
+
+ <method name="toggleHistoryPopup">
+ <body><![CDATA[
+ // If this method is called on the same event tick as the popup gets
+ // hidden, do nothing to avoid re-opening the popup when the drop
+ // marker is clicked while the popup is still open.
+ if (!this.popup.isPopupHidingTick && !this.popup.popupOpen)
+ this.showHistoryPopup();
+ else
+ this.closePopup();
+ ]]></body>
+ </method>
+
+ <!-- ::::::::::::: event dispatching ::::::::::::: -->
+
+ <method name="initEventHandler">
+ <parameter name="aEventType"/>
+ <body><![CDATA[
+ let handlerString = this.getAttribute("on" + aEventType);
+ if (handlerString) {
+ return (new Function("eventType", "param", handlerString)).bind(this, aEventType);
+ }
+ return null;
+ ]]></body>
+ </method>
+
+ <!-- ::::::::::::: key handling ::::::::::::: -->
+
+ <field name="_selectionDetails">null</field>
+ <method name="onKeyPress">
+ <parameter name="aEvent"/>
+ <body><![CDATA[
+ return this.handleKeyPress(aEvent);
+ ]]></body>
+ </method>
+
+ <method name="handleKeyPress">
+ <parameter name="aEvent"/>
+ <body><![CDATA[
+ if (aEvent.target.localName != "textbox")
+ return true; // Let child buttons of autocomplete take input
+
+ //XXXpch this is so bogus...
+ if (aEvent.defaultPrevented)
+ return false;
+
+ var cancel = false;
+
+ let { AppConstants } =
+ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
+ // Catch any keys that could potentially move the caret. Ctrl can be
+ // used in combination with these keys on Windows and Linux; and Alt
+ // can be used on OS X, so make sure the unused one isn't used.
+ let metaKey = AppConstants.platform == "macosx" ? aEvent.ctrlKey : aEvent.altKey;
+ if (!this.disableKeyNavigation && !metaKey) {
+ switch (aEvent.keyCode) {
+ case KeyEvent.DOM_VK_LEFT:
+ case KeyEvent.DOM_VK_RIGHT:
+ case KeyEvent.DOM_VK_HOME:
+ cancel = this.mController.handleKeyNavigation(aEvent.keyCode);
+ break;
+ }
+ }
+
+ // Handle keys that are not part of a keyboard shortcut (no Ctrl or Alt)
+ if (!this.disableKeyNavigation && !aEvent.ctrlKey && !aEvent.altKey) {
+ switch (aEvent.keyCode) {
+ case KeyEvent.DOM_VK_TAB:
+ if (this.tabScrolling && this.popup.popupOpen)
+ cancel = this.mController.handleKeyNavigation(aEvent.shiftKey ?
+ KeyEvent.DOM_VK_UP :
+ KeyEvent.DOM_VK_DOWN);
+ else if (this.forceComplete && this.mController.matchCount >= 1)
+ this.mController.handleTab();
+ break;
+ case KeyEvent.DOM_VK_UP:
+ case KeyEvent.DOM_VK_DOWN:
+ case KeyEvent.DOM_VK_PAGE_UP:
+ case KeyEvent.DOM_VK_PAGE_DOWN:
+ cancel = this.mController.handleKeyNavigation(aEvent.keyCode);
+ break;
+ }
+ }
+
+ // Handle keys we know aren't part of a shortcut, even with Alt or
+ // Ctrl.
+ switch (aEvent.keyCode) {
+ case KeyEvent.DOM_VK_ESCAPE:
+ cancel = this.mController.handleEscape();
+ break;
+ case KeyEvent.DOM_VK_RETURN:
+ if (AppConstants.platform == "macosx") {
+ // Prevent the default action, since it will beep on Mac
+ if (aEvent.metaKey)
+ aEvent.preventDefault();
+ }
+ this.mEnterEvent = aEvent;
+ if (this.mController.selection) {
+ this._selectionDetails = {
+ index: this.mController.selection.currentIndex,
+ kind: "key"
+ };
+ }
+ cancel = this.handleEnter();
+ break;
+ case KeyEvent.DOM_VK_DELETE:
+ if (AppConstants.platform == "macosx" && !aEvent.shiftKey) {
+ break;
+ }
+ cancel = this.handleDelete();
+ break;
+ case KeyEvent.DOM_VK_BACK_SPACE:
+ if (AppConstants.platform == "macosx" && aEvent.shiftKey) {
+ cancel = this.handleDelete();
+ }
+ break;
+ case KeyEvent.DOM_VK_DOWN:
+ case KeyEvent.DOM_VK_UP:
+ if (aEvent.altKey)
+ this.toggleHistoryPopup();
+ break;
+ case KeyEvent.DOM_VK_F4:
+ if (AppConstants.platform != "macosx") {
+ this.toggleHistoryPopup();
+ }
+ break;
+ }
+
+ if (cancel) {
+ aEvent.stopPropagation();
+ aEvent.preventDefault();
+ }
+
+ return true;
+ ]]></body>
+ </method>
+
+ <method name="handleEnter">
+ <body><![CDATA[
+ return this.mController.handleEnter(false);
+ ]]></body>
+ </method>
+
+ <method name="handleDelete">
+ <body><![CDATA[
+ return this.mController.handleDelete();
+ ]]></body>
+ </method>
+
+ <!-- ::::::::::::: miscellaneous ::::::::::::: -->
+
+ <method name="initSearchNames">
+ <body><![CDATA[
+ if (!this.mSearchNames) {
+ var names = this.getAttribute("autocompletesearch");
+ if (!names)
+ this.mSearchNames = [];
+ else
+ this.mSearchNames = names.split(" ");
+ }
+ ]]></body>
+ </method>
+
+ <method name="_focus">
+ <!-- doesn't reset this.mController -->
+ <body><![CDATA[
+ this._dontBlur = true;
+ this.focus();
+ this._dontBlur = false;
+ ]]></body>
+ </method>
+
+ <method name="resetActionType">
+ <body><![CDATA[
+ if (this.mIgnoreInput)
+ return;
+ this.removeAttribute("actiontype");
+ ]]></body>
+ </method>
+
+ <field name="_valueIsPasted">false</field>
+ <field name="_pasteController"><![CDATA[
+ ({
+ _autocomplete: this,
+ _kGlobalClipboard: Components.interfaces.nsIClipboard.kGlobalClipboard,
+ supportsCommand: aCommand => aCommand == "cmd_paste",
+ doCommand: function(aCommand) {
+ this._autocomplete._valueIsPasted = true;
+ this._autocomplete.editor.paste(this._kGlobalClipboard);
+ this._autocomplete._valueIsPasted = false;
+ },
+ isCommandEnabled: function(aCommand) {
+ return this._autocomplete.editor.isSelectionEditable &&
+ this._autocomplete.editor.canPaste(this._kGlobalClipboard);
+ },
+ onEvent: function() {}
+ })
+ ]]></field>
+
+ <method name="onInput">
+ <parameter name="aEvent"/>
+ <body><![CDATA[
+ if (!this.mIgnoreInput && this.mController.input == this) {
+ this.valueIsTyped = true;
+ this.mController.handleText();
+ }
+ this.resetActionType();
+ ]]></body>
+ </method>
+ </implementation>
+
+ <handlers>
+ <handler event="input"><![CDATA[
+ this.onInput(event);
+ ]]></handler>
+
+ <handler event="keypress" phase="capturing"
+ action="return this.onKeyPress(event);"/>
+
+ <handler event="compositionstart" phase="capturing"
+ action="if (this.mController.input == this) this.mController.handleStartComposition();"/>
+
+ <handler event="compositionend" phase="capturing"
+ action="if (this.mController.input == this) this.mController.handleEndComposition();"/>
+
+ <handler event="focus" phase="capturing"
+ action="this.attachController();"/>
+
+ <handler event="blur" phase="capturing"><![CDATA[
+ if (!this._dontBlur) {
+ if (this.forceComplete && this.mController.matchCount >= 1) {
+ // mousemove sets selected index. Don't blindly use that selected
+ // index in this blur handler since if the popup is open you can
+ // easily "select" another match just by moving the mouse over it.
+ let filledVal = this.value.replace(/.+ >> /, "").toLowerCase();
+ let selectedVal = null;
+ if (this.popup.selectedIndex >= 0) {
+ selectedVal = this.mController.getFinalCompleteValueAt(
+ this.popup.selectedIndex);
+ }
+ if (selectedVal && filledVal != selectedVal.toLowerCase()) {
+ for (let i = 0; i < this.mController.matchCount; i++) {
+ let matchVal = this.mController.getFinalCompleteValueAt(i);
+ if (matchVal.toLowerCase() == filledVal) {
+ this.popup.selectedIndex = i;
+ break;
+ }
+ }
+ }
+ this.mController.handleEnter(false);
+ }
+ if (!this.ignoreBlurWhileSearching)
+ this.detachController();
+ }
+ ]]></handler>
+ </handlers>
+ </binding>
+
+ <binding id="private-autocomplete-result-popup" extends="chrome://browser/content/autocomplete.xml#private-autocomplete-base-popup">
+ <resources>
+ <stylesheet src="chrome://browser/content/autocomplete.css"/>
+ <stylesheet src="chrome://global/skin/tree.css"/>
+ <stylesheet src="chrome://browser/skin/autocomplete.css"/>
+ </resources>
+
+ <content ignorekeys="true" level="top" consumeoutsideclicks="never">
+ <xul:tree anonid="tree" class="private-autocomplete-tree plain" hidecolumnpicker="true" flex="1" seltype="single">
+ <xul:treecols anonid="treecols">
+ <xul:treecol id="treecolAutoCompleteValue" class="private-autocomplete-treecol" flex="1" overflow="true"/>
+ </xul:treecols>
+ <xul:treechildren class="private-autocomplete-treebody"/>
+ </xul:tree>
+ </content>
+
+ <implementation>
+ <field name="mShowCommentColumn">false</field>
+ <field name="mShowImageColumn">false</field>
+
+ <property name="showCommentColumn"
+ onget="return this.mShowCommentColumn;">
+ <setter>
+ <![CDATA[
+ if (!val && this.mShowCommentColumn) {
+ // reset the flex on the value column and remove the comment column
+ document.getElementById("treecolAutoCompleteValue").setAttribute("flex", 1);
+ this.removeColumn("treecolAutoCompleteComment");
+ } else if (val && !this.mShowCommentColumn) {
+ // reset the flex on the value column and add the comment column
+ document.getElementById("treecolAutoCompleteValue").setAttribute("flex", 2);
+ this.addColumn({id: "treecolAutoCompleteComment", flex: 1});
+ }
+ this.mShowCommentColumn = val;
+ return val;
+ ]]>
+ </setter>
+ </property>
+
+ <property name="showImageColumn"
+ onget="return this.mShowImageColumn;">
+ <setter>
+ <![CDATA[
+ if (!val && this.mShowImageColumn) {
+ // remove the image column
+ this.removeColumn("treecolAutoCompleteImage");
+ } else if (val && !this.mShowImageColumn) {
+ // add the image column
+ this.addColumn({id: "treecolAutoCompleteImage", flex: 1});
+ }
+ this.mShowImageColumn = val;
+ return val;
+ ]]>
+ </setter>
+ </property>
+
+
+ <method name="addColumn">
+ <parameter name="aAttrs"/>
+ <body>
+ <![CDATA[
+ var col = document.createElement("treecol");
+ col.setAttribute("class", "private-autocomplete-treecol");
+ for (var name in aAttrs)
+ col.setAttribute(name, aAttrs[name]);
+ this.treecols.appendChild(col);
+ return col;
+ ]]>
+ </body>
+ </method>
+
+ <method name="removeColumn">
+ <parameter name="aColId"/>
+ <body>
+ <![CDATA[
+ return this.treecols.removeChild(document.getElementById(aColId));
+ ]]>
+ </body>
+ </method>
+
+ <property name="selectedIndex"
+ onget="return this.tree.currentIndex;">
+ <setter>
+ <![CDATA[
+ this.tree.view.selection.select(val);
+ if (this.tree.treeBoxObject.height > 0)
+ this.tree.treeBoxObject.ensureRowIsVisible(val < 0 ? 0 : val);
+ // Fire select event on xul:tree so that accessibility API
+ // support layer can fire appropriate accessibility events.
+ var event = document.createEvent('Events');
+ event.initEvent("select", true, true);
+ this.tree.dispatchEvent(event);
+ return val;
+ ]]></setter>
+ </property>
+
+ <method name="adjustHeight">
+ <body>
+ <![CDATA[
+ // detect the desired height of the tree
+ var bx = this.tree.treeBoxObject;
+ var view = this.tree.view;
+ if (!view)
+ return;
+ var rows = this.maxRows;
+ if (!view.rowCount || (rows && view.rowCount < rows))
+ rows = view.rowCount;
+
+ var height = rows * bx.rowHeight;
+
+ if (height == 0) {
+ this.tree.setAttribute("collapsed", "true");
+ } else {
+ if (this.tree.hasAttribute("collapsed"))
+ this.tree.removeAttribute("collapsed");
+
+ this.tree.setAttribute("height", height);
+ }
+ this.tree.setAttribute("hidescrollbar", view.rowCount <= rows);
+ ]]>
+ </body>
+ </method>
+
+ <method name="openAutocompletePopup">
+ <parameter name="aInput"/>
+ <parameter name="aElement"/>
+ <body><![CDATA[
+ // until we have "baseBinding", (see bug #373652) this allows
+ // us to override openAutocompletePopup(), but still call
+ // the method on the base class
+ this._openAutocompletePopup(aInput, aElement);
+ ]]></body>
+ </method>
+
+ <method name="_openAutocompletePopup">
+ <parameter name="aInput"/>
+ <parameter name="aElement"/>
+ <body><![CDATA[
+ if (!this.mPopupOpen) {
+ this.mInput = aInput;
+ this.view = aInput.controller.QueryInterface(Components.interfaces.nsITreeView);
+ this.invalidate();
+
+ this.showCommentColumn = this.mInput.showCommentColumn;
+ this.showImageColumn = this.mInput.showImageColumn;
+
+ var rect = aElement.getBoundingClientRect();
+ var nav = aElement.ownerDocument.defaultView.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
+ .getInterface(Components.interfaces.nsIWebNavigation);
+ var docShell = nav.QueryInterface(Components.interfaces.nsIDocShell);
+ var docViewer = docShell.contentViewer;
+ var width = (rect.right - rect.left) * docViewer.fullZoom;
+ this.setAttribute("width", width > 100 ? width : 100);
+
+ // Adjust the direction of the autocomplete popup list based on the textbox direction, bug 649840
+ var popupDirection = aElement.ownerDocument.defaultView.getComputedStyle(aElement).direction;
+ this.style.direction = popupDirection;
+
+ this.openPopup(aElement, "after_start", 0, 0, false, false);
+ }
+ ]]></body>
+ </method>
+
+ <method name="invalidate">
+ <body><![CDATA[
+ this.adjustHeight();
+ this.tree.treeBoxObject.invalidate();
+ ]]></body>
+ </method>
+
+ <method name="selectBy">
+ <parameter name="aReverse"/>
+ <parameter name="aPage"/>
+ <body><![CDATA[
+ try {
+ var amount = aPage ? 5 : 1;
+ this.selectedIndex = this.getNextIndex(aReverse, amount, this.selectedIndex, this.tree.view.rowCount-1);
+ if (this.selectedIndex == -1) {
+ this.input._focus();
+ }
+ } catch (ex) {
+ // do nothing - occasionally timer-related js errors happen here
+ // e.g. "this.selectedIndex has no properties", when you type fast and hit a
+ // navigation key before this popup has opened
+ }
+ ]]></body>
+ </method>
+
+ <!-- =================== PUBLIC MEMBERS =================== -->
+
+ <field name="tree">
+ document.getAnonymousElementByAttribute(this, "anonid", "tree");
+ </field>
+
+ <field name="treecols">
+ document.getAnonymousElementByAttribute(this, "anonid", "treecols");
+ </field>
+
+ <property name="view"
+ onget="return this.mView;">
+ <setter><![CDATA[
+ // We must do this by hand because the tree binding may not be ready yet
+ this.mView = val;
+ this.tree.boxObject.view = val;
+ ]]></setter>
+ </property>
+
+ </implementation>
+ </binding>
+
+ <binding id="private-autocomplete-base-popup" role="none"
+extends="chrome://global/content/bindings/popup.xml#popup">
+ <implementation implements="nsIAutoCompletePopup">
+ <field name="mInput">null</field>
+ <field name="mPopupOpen">false</field>
+ <field name="mIsPopupHidingTick">false</field>
+
+ <!-- =================== nsIAutoCompletePopup =================== -->
+
+ <property name="input" readonly="true"
+ onget="return this.mInput"/>
+
+ <property name="overrideValue" readonly="true"
+ onget="return null;"/>
+
+ <property name="popupOpen" readonly="true"
+ onget="return this.mPopupOpen;"/>
+
+ <property name="isPopupHidingTick" readonly="true"
+ onget="return this.mIsPopupHidingTick;"/>
+
+ <method name="closePopup">
+ <body>
+ <![CDATA[
+ if (this.mPopupOpen) {
+ this.hidePopup();
+ this.removeAttribute("width");
+ }
+ ]]>
+ </body>
+ </method>
+
+ <!-- This is the default number of rows that we give the autocomplete
+ popup when the textbox doesn't have a "maxrows" attribute
+ for us to use. -->
+ <field name="defaultMaxRows" readonly="true">6</field>
+
+ <!-- In some cases (e.g. when the input's dropmarker button is clicked),
+ the input wants to display a popup with more rows. In that case, it
+ should increase its maxRows property and store the "normal" maxRows
+ in this field. When the popup is hidden, we restore the input's
+ maxRows to the value stored in this field.
+
+ This field is set to -1 between uses so that we can tell when it's
+ been set by the input and when we need to set it in the popupshowing
+ handler. -->
+ <field name="_normalMaxRows">-1</field>
+
+ <property name="maxRows" readonly="true">
+ <getter>
+ <![CDATA[
+ return (this.mInput && this.mInput.maxRows) || this.defaultMaxRows;
+ ]]>
+ </getter>
+ </property>
+
+ <method name="getNextIndex">
+ <parameter name="aReverse"/>
+ <parameter name="aAmount"/>
+ <parameter name="aIndex"/>
+ <parameter name="aMaxRow"/>
+ <body><![CDATA[
+ if (aMaxRow < 0)
+ return -1;
+
+ var newIdx = aIndex + (aReverse?-1:1)*aAmount;
+ if (aReverse && aIndex == -1 || newIdx > aMaxRow && aIndex != aMaxRow)
+ newIdx = aMaxRow;
+ else if (!aReverse && aIndex == -1 || newIdx < 0 && aIndex != 0)
+ newIdx = 0;
+
+ if (newIdx < 0 && aIndex == 0 || newIdx > aMaxRow && aIndex == aMaxRow)
+ aIndex = -1;
+ else
+ aIndex = newIdx;
+
+ return aIndex;
+ ]]></body>
+ </method>
+
+ <method name="onPopupClick">
+ <parameter name="aEvent"/>
+ <body><![CDATA[
+ var controller = this.view.QueryInterface(Components.interfaces.nsIAutoCompleteController);
+ controller.handleEnter(true);
+ ]]></body>
+ </method>
+ </implementation>
+
+ <handlers>
+ <handler event="popupshowing"><![CDATA[
+ // If normalMaxRows wasn't already set by the input, then set it here
+ // so that we restore the correct number when the popup is hidden.
+
+ // Null-check this.mInput; see bug 1017914
+ if (this._normalMaxRows < 0 && this.mInput) {
+ this._normalMaxRows = this.mInput.maxRows;
+ }
+
+ // Set an attribute for styling the popup based on the input.
+ let inputID = "";
+ if (this.mInput && this.mInput.ownerDocument &&
+ this.mInput.ownerDocument.documentURIObject.schemeIs("chrome")) {
+ inputID = this.mInput.id;
+ // Take care of elements with no id that are inside xbl bindings
+ if (!inputID) {
+ let bindingParent = this.mInput.ownerDocument.getBindingParent(this.mInput);
+ if (bindingParent) {
+ inputID = bindingParent.id;
+ }
+ }
+ }
+ this.setAttribute("autocompleteinput", inputID);
+
+ this.mPopupOpen = true;
+ ]]></handler>
+
+ <handler event="popuphiding"><![CDATA[
+ var isListActive = true;
+ if (this.selectedIndex == -1)
+ isListActive = false;
+ var controller = this.view.QueryInterface(Components.interfaces.nsIAutoCompleteController);
+ controller.stopSearch();
+
+ this.removeAttribute("autocompleteinput");
+ this.mPopupOpen = false;
+
+ // Prevent opening popup from historydropmarker mousedown handler
+ // on the same event tick the popup is hidden by the same mousedown
+ // event.
+ this.mIsPopupHidingTick = true;
+ setTimeout(() => {
+ this.mIsPopupHidingTick = false;
+ }, 0);
+
+ // Reset the maxRows property to the cached "normal" value, and reset
+ // _normalMaxRows so that we can detect whether it was set by the input
+ // when the popupshowing handler runs.
+
+ // Null-check this.mInput; see bug 1017914
+ if (this.mInput)
+ this.mInput.maxRows = this._normalMaxRows;
+ this._normalMaxRows = -1;
+ // If the list was being navigated and then closed, make sure
+ // we fire accessible focus event back to textbox
+
+ // Null-check this.mInput; see bug 1017914
+ if (isListActive && this.mInput) {
+ this.mInput.mIgnoreFocus = true;
+ this.mInput._focus();
+ this.mInput.mIgnoreFocus = false;
+ }
+ ]]></handler>
+ </handlers>
+ </binding>
+
+ <binding id="private-autocomplete-rich-result-popup" extends="chrome://browser/content/autocomplete.xml#private-autocomplete-base-popup">
+ <resources>
+ <stylesheet src="chrome://browser/content/autocomplete.css"/>
+ <stylesheet src="chrome://browser/skin/autocomplete.css"/>
+ </resources>
+
+ <content ignorekeys="true" level="top" consumeoutsideclicks="never">
+ <xul:richlistbox anonid="richlistbox" class="private-autocomplete-richlistbox" flex="1"/>
+ <xul:hbox>
+ <children/>
+ </xul:hbox>
+ </content>
+
+ <implementation implements="nsIAutoCompletePopup">
+ <field name="_currentIndex">0</field>
+ <field name="_rowHeight">0</field>
+ <field name="_rlbAnimated">false</field>
+
+ <!-- =================== nsIAutoCompletePopup =================== -->
+
+ <property name="selectedIndex"
+ onget="return this.richlistbox.selectedIndex;">
+ <setter>
+ <![CDATA[
+ this.richlistbox.selectedIndex = val;
+
+ // when clearing the selection (val == -1, so selectedItem will be
+ // null), we want to scroll back to the top. see bug #406194
+ this.richlistbox.ensureElementIsVisible(
+ this.richlistbox.selectedItem || this.richlistbox.firstChild);
+
+ return val;
+ ]]>
+ </setter>
+ </property>
+
+ <method name="onSearchBegin">
+ <body><![CDATA[
+ this.richlistbox.mouseSelectedIndex = -1;
+ ]]></body>
+ </method>
+
+ <method name="openAutocompletePopup">
+ <parameter name="aInput"/>
+ <parameter name="aElement"/>
+ <body>
+ <![CDATA[
+ // until we have "baseBinding", (see bug #373652) this allows
+ // us to override openAutocompletePopup(), but still call
+ // the method on the base class
+ this._openAutocompletePopup(aInput, aElement);
+ ]]>
+ </body>
+ </method>
+
+ <method name="_openAutocompletePopup">
+ <parameter name="aInput"/>
+ <parameter name="aElement"/>
+ <body>
+ <![CDATA[
+ if (!this.mPopupOpen) {
+ this.mInput = aInput;
+ // clear any previous selection, see bugs 400671 and 488357
+ this.selectedIndex = -1;
+
+ var width = aElement.getBoundingClientRect().width;
+ this.setAttribute("width", width > 100 ? width : 100);
+ // invalidate() depends on the width attribute
+ this._invalidate();
+
+ this.openPopup(aElement, "after_start", 0, 0, false, false);
+ }
+ ]]>
+ </body>
+ </method>
+
+ <method name="invalidate">
+ <parameter name="reason"/>
+ <body>
+ <![CDATA[
+ // Don't bother doing work if we're not even showing
+ if (!this.mPopupOpen)
+ return;
+
+ this._invalidate(reason);
+ ]]>
+ </body>
+ </method>
+
+ <method name="_invalidate">
+ <parameter name="reason"/>
+ <body>
+ <![CDATA[
+ // collapsed if no matches
+ this.richlistbox.collapsed = (this._matchCount == 0);
+
+ // Update the richlistbox height.
+ if (this._adjustHeightTimeout) {
+ clearTimeout(this._adjustHeightTimeout);
+ }
+ if (this._shrinkTimeout) {
+ clearTimeout(this._shrinkTimeout);
+ }
+ this._adjustHeightTimeout = setTimeout(() => this.adjustHeight(), 0);
+
+ this._currentIndex = 0;
+ if (this._appendResultTimeout) {
+ clearTimeout(this._appendResultTimeout);
+ }
+ this._appendCurrentResult(reason);
+ ]]>
+ </body>
+ </method>
+
+ <property name="maxResults" readonly="true">
+ <getter>
+ <![CDATA[
+ // this is how many richlistitems will be kept around
+ // (note, this getter may be overridden)
+ return 20;
+ ]]>
+ </getter>
+ </property>
+
+ <property name="_matchCount" readonly="true">
+ <getter>
+ <![CDATA[
+ return Math.min(this.mInput.controller.matchCount, this.maxResults);
+ ]]>
+ </getter>
+ </property>
+
+ <method name="_collapseUnusedItems">
+ <body>
+ <![CDATA[
+ let existingItemsCount = this.richlistbox.childNodes.length;
+ for (let i = this._matchCount; i < existingItemsCount; ++i) {
+ this.richlistbox.childNodes[i].collapsed = true;
+ }
+ ]]>
+ </body>
+ </method>
+
+ <method name="adjustHeight">
+ <body>
+ <![CDATA[
+ // Figure out how many rows to show
+ let rows = this.richlistbox.childNodes;
+ let numRows = Math.min(this._matchCount, this.maxRows, rows.length);
+
+ this.removeAttribute("height");
+
+ // Default the height to 0 if we have no rows to show
+ let height = 0;
+ if (numRows) {
+ if (!this._rowHeight) {
+ let firstRowRect = rows[0].getBoundingClientRect();
+ this._rowHeight = firstRowRect.height;
+
+ let transition =
+ window.getComputedStyle(this.richlistbox).transitionProperty;
+ this._rlbAnimated = transition && transition != "none";
+
+ // Set a fixed max-height to avoid flicker when growing the panel.
+ this.richlistbox.style.maxHeight = (this._rowHeight * this.maxRows) + "px";
+ }
+
+ // Calculate the height to have the first row to last row shown
+ height = this._rowHeight * numRows;
+ }
+
+ let animate = this._rlbAnimated &&
+ this.getAttribute("dontanimate") != "true";
+ let currentHeight = this.richlistbox.getBoundingClientRect().height;
+ if (height > currentHeight) {
+ // Grow immediately.
+ if (animate) {
+ this.richlistbox.removeAttribute("height");
+ this.richlistbox.style.height = height + "px";
+ } else {
+ this.richlistbox.style.removeProperty("height");
+ this.richlistbox.height = height;
+ }
+ } else {
+ // Delay shrinking to avoid flicker.
+ this._shrinkTimeout = setTimeout(() => {
+ this._collapseUnusedItems();
+ if (animate) {
+ this.richlistbox.removeAttribute("height");
+ this.richlistbox.style.height = height + "px";
+ } else {
+ this.richlistbox.style.removeProperty("height");
+ this.richlistbox.height = height;
+ }
+ }, this.mInput.shrinkDelay);
+ }
+ ]]>
+ </body>
+ </method>
+
+ <method name="_appendCurrentResult">
+ <parameter name="invalidateReason"/>
+ <body>
+ <![CDATA[
+ var controller = this.mInput.controller;
+ var matchCount = this._matchCount;
+ var existingItemsCount = this.richlistbox.childNodes.length;
+
+ // Process maxRows per chunk to improve performance and user experience
+ for (let i = 0; i < this.maxRows; i++) {
+ if (this._currentIndex >= matchCount)
+ break;
+
+ var item;
+
+ // trim the leading/trailing whitespace
+ var trimmedSearchString = controller.searchString.replace(/^\s+/, "").replace(/\s+$/, "");
+
+ let url = controller.getValueAt(this._currentIndex);
+
+ if (this._currentIndex < existingItemsCount) {
+ // re-use the existing item
+ item = this.richlistbox.childNodes[this._currentIndex];
+
+ // Completely reuse the existing richlistitem for invalidation
+ // due to new results, but only when: the item is the same, *OR*
+ // we are about to replace the currently mouse-selected item, to
+ // avoid surprising the user.
+ let iface = Components.interfaces.nsIAutoCompletePopup;
+ if (item.getAttribute("text") == trimmedSearchString &&
+ invalidateReason == iface.INVALIDATE_REASON_NEW_RESULT &&
+ (item.getAttribute("url") == url ||
+ this.richlistbox.mouseSelectedIndex === this._currentIndex)) {
+ item.collapsed = false;
+ this._currentIndex++;
+ continue;
+ }
+ }
+ else {
+ // need to create a new item
+ item = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "richlistitem");
+ }
+
+ // set these attributes before we set the class
+ // so that we can use them from the constructor
+ let iconURI = controller.getImageAt(this._currentIndex);
+ item.setAttribute("image", iconURI);
+ item.setAttribute("url", url);
+ item.setAttribute("title", controller.getCommentAt(this._currentIndex));
+ item.setAttribute("type", controller.getStyleAt(this._currentIndex));
+ item.setAttribute("text", trimmedSearchString);
+
+ if (this._currentIndex < existingItemsCount) {
+ // re-use the existing item
+ item._adjustAcItem();
+ item.collapsed = false;
+ }
+ else {
+ // set the class at the end so we can use the attributes
+ // in the xbl constructor
+ item.className = "private-autocomplete-richlistitem";
+ this.richlistbox.appendChild(item);
+ }
+
+ this._currentIndex++;
+ }
+
+ if (typeof this.onResultsAdded == "function")
+ this.onResultsAdded();
+
+ if (this._currentIndex < matchCount) {
+ // yield after each batch of items so that typing the url bar is
+ // responsive
+ this._appendResultTimeout = setTimeout(() => this._appendCurrentResult(), 0);
+ }
+ ]]>
+ </body>
+ </method>
+
+ <method name="selectBy">
+ <parameter name="aReverse"/>
+ <parameter name="aPage"/>
+ <body>
+ <![CDATA[
+ try {
+ var amount = aPage ? 5 : 1;
+
+ // because we collapsed unused items, we can't use this.richlistbox.getRowCount(), we need to use the matchCount
+ this.selectedIndex = this.getNextIndex(aReverse, amount, this.selectedIndex, this._matchCount - 1);
+ if (this.selectedIndex == -1) {
+ this.input._focus();
+ }
+ } catch (ex) {
+ // do nothing - occasionally timer-related js errors happen here
+ // e.g. "this.selectedIndex has no properties", when you type fast and hit a
+ // navigation key before this popup has opened
+ }
+ ]]>
+ </body>
+ </method>
+
+ <field name="richlistbox">
+ document.getAnonymousElementByAttribute(this, "anonid", "richlistbox");
+ </field>
+
+ <property name="view"
+ onget="return this.mInput.controller;"
+ onset="return val;"/>
+
+ </implementation>
+ </binding>
+
+ <binding id="private-autocomplete-richlistitem" extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
+ <content>
+ <xul:hbox align="center" class="ac-title-box">
+ <xul:image xbl:inherits="src=image" class="ac-site-icon"/>
+ <xul:hbox anonid="title-box" class="ac-title" flex="1"
+ onunderflow="_doUnderflow('_title');"
+ onoverflow="_doOverflow('_title');">
+ <xul:description anonid="title" class="ac-normal-text ac-comment" xbl:inherits="selected"/>
+ </xul:hbox>
+ <xul:label anonid="title-overflow-ellipsis" xbl:inherits="selected"
+ class="ac-ellipsis-after ac-comment"/>
+ <xul:hbox anonid="extra-box" class="ac-extra" align="center" hidden="true">
+ <xul:image class="ac-result-type-tag"/>
+ <xul:label class="ac-normal-text ac-comment" xbl:inherits="selected" value=":"/>
+ <xul:description anonid="extra" class="ac-normal-text ac-comment" xbl:inherits="selected"/>
+ </xul:hbox>
+ <xul:image anonid="type-image" class="ac-type-icon" xbl:inherits="selected"/>
+ </xul:hbox>
+ <xul:hbox align="center" class="ac-url-box">
+ <xul:spacer class="ac-site-icon"/>
+ <xul:image class="ac-action-icon"/>
+ <xul:hbox anonid="url-box" class="ac-url" flex="1"
+ onunderflow="_doUnderflow('_url');"
+ onoverflow="_doOverflow('_url');">
+ <xul:description anonid="url" class="ac-normal-text ac-url-text"
+ xbl:inherits="selected type"/>
+ <xul:description anonid="action" class="ac-normal-text ac-action-text"
+ xbl:inherits="selected type"/>
+ </xul:hbox>
+ <xul:label anonid="url-overflow-ellipsis" xbl:inherits="selected"
+ class="ac-ellipsis-after ac-url-text"/>
+ <xul:spacer class="ac-type-icon"/>
+ </xul:hbox>
+ </content>
+ <implementation implements="nsIDOMXULSelectControlItemElement">
+ <constructor>
+ <![CDATA[
+ let ellipsis = "\u2026";
+ try {
+ ellipsis = Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefBranch).
+ getComplexValue("intl.ellipsis",
+ Components.interfaces.nsIPrefLocalizedString).data;
+ } catch (ex) {
+ // Do nothing.. we already have a default
+ }
+
+ this._urlOverflowEllipsis = document.getAnonymousElementByAttribute(this, "anonid", "url-overflow-ellipsis");
+ this._titleOverflowEllipsis = document.getAnonymousElementByAttribute(this, "anonid", "title-overflow-ellipsis");
+
+ this._urlOverflowEllipsis.value = ellipsis;
+ this._titleOverflowEllipsis.value = ellipsis;
+
+ this._typeImage = document.getAnonymousElementByAttribute(this, "anonid", "type-image");
+
+ this._urlBox = document.getAnonymousElementByAttribute(this, "anonid", "url-box");
+ this._url = document.getAnonymousElementByAttribute(this, "anonid", "url");
+ this._action = document.getAnonymousElementByAttribute(this, "anonid", "action");
+
+ this._titleBox = document.getAnonymousElementByAttribute(this, "anonid", "title-box");
+ this._title = document.getAnonymousElementByAttribute(this, "anonid", "title");
+
+ this._extraBox = document.getAnonymousElementByAttribute(this, "anonid", "extra-box");
+ this._extra = document.getAnonymousElementByAttribute(this, "anonid", "extra");
+
+ this._adjustAcItem();
+ ]]>
+ </constructor>
+
+ <property name="label" readonly="true">
+ <getter>
+ <![CDATA[
+ // This property is a string that is read aloud by screen readers,
+ // so it must not contain anything that should not be user-facing.
+
+ let parts = [
+ this.getAttribute("title"),
+ this.getAttribute("displayurl"),
+ ];
+ let label = parts.filter(str => str).join(" ")
+
+ // allow consumers that have extended popups to override
+ // the label values for the richlistitems
+ let panel = this.parentNode.parentNode;
+ if (panel.createResultLabel) {
+ return panel.createResultLabel(this, label);
+ }
+
+ return label;
+ ]]>
+ </getter>
+ </property>
+
+ <property name="_stringBundle">
+ <getter><![CDATA[
+ if (!this.__stringBundle) {
+ this.__stringBundle = Services.strings.createBundle("chrome://global/locale/autocomplete.properties");
+ }
+ return this.__stringBundle;
+ ]]></getter>
+ </property>
+
+ <field name="_boundaryCutoff">null</field>
+
+ <property name="boundaryCutoff" readonly="true">
+ <getter>
+ <![CDATA[
+ if (!this._boundaryCutoff) {
+ this._boundaryCutoff =
+ Components.classes["@mozilla.org/preferences-service;1"].
+ getService(Components.interfaces.nsIPrefBranch).
+ getIntPref("toolkit.autocomplete.richBoundaryCutoff");
+ }
+ return this._boundaryCutoff;
+ ]]>
+ </getter>
+ </property>
+
+ <method name="_getBoundaryIndices">
+ <parameter name="aText"/>
+ <parameter name="aSearchTokens"/>
+ <body>
+ <![CDATA[
+ // Short circuit for empty search ([""] == "")
+ if (aSearchTokens == "")
+ return [0, aText.length];
+
+ // Find which regions of text match the search terms
+ let regions = [];
+ for (let search of Array.prototype.slice.call(aSearchTokens)) {
+ let matchIndex = -1;
+ let searchLen = search.length;
+
+ // Find all matches of the search terms, but stop early for perf
+ let lowerText = aText.substr(0, this.boundaryCutoff).toLowerCase();
+ while ((matchIndex = lowerText.indexOf(search, matchIndex + 1)) >= 0) {
+ regions.push([matchIndex, matchIndex + searchLen]);
+ }
+ }
+
+ // Sort the regions by start position then end position
+ regions = regions.sort((a, b) => {
+ let start = a[0] - b[0];
+ return (start == 0) ? a[1] - b[1] : start;
+ });
+
+ // Generate the boundary indices from each region
+ let start = 0;
+ let end = 0;
+ let boundaries = [];
+ let len = regions.length;
+ for (let i = 0; i < len; i++) {
+ // We have a new boundary if the start of the next is past the end
+ let region = regions[i];
+ if (region[0] > end) {
+ // First index is the beginning of match
+ boundaries.push(start);
+ // Second index is the beginning of non-match
+ boundaries.push(end);
+
+ // Track the new region now that we've stored the previous one
+ start = region[0];
+ }
+
+ // Push back the end index for the current or new region
+ end = Math.max(end, region[1]);
+ }
+
+ // Add the last region
+ boundaries.push(start);
+ boundaries.push(end);
+
+ // Put on the end boundary if necessary
+ if (end < aText.length)
+ boundaries.push(aText.length);
+
+ // Skip the first item because it's always 0
+ return boundaries.slice(1);
+ ]]>
+ </body>
+ </method>
+
+ <method name="_getSearchTokens">
+ <parameter name="aSearch"/>
+ <body>
+ <![CDATA[
+ let search = aSearch.toLowerCase();
+ return search.split(/\s+/);
+ ]]>
+ </body>
+ </method>
+
+ <method name="_setUpDescription">
+ <parameter name="aDescriptionElement"/>
+ <parameter name="aText"/>
+ <parameter name="aNoEmphasis"/>
+ <body>
+ <![CDATA[
+ // Get rid of all previous text
+ while (aDescriptionElement.hasChildNodes())
+ aDescriptionElement.removeChild(aDescriptionElement.firstChild);
+
+ // If aNoEmphasis is specified, don't add any emphasis
+ if (aNoEmphasis) {
+ aDescriptionElement.appendChild(document.createTextNode(aText));
+ return;
+ }
+
+ // Get the indices that separate match and non-match text
+ let search = this.getAttribute("text");
+ let tokens = this._getSearchTokens(search);
+ let indices = this._getBoundaryIndices(aText, tokens);
+
+ let next;
+ let start = 0;
+ let len = indices.length;
+ // Even indexed boundaries are matches, so skip the 0th if it's empty
+ for (let i = indices[0] == 0 ? 1 : 0; i < len; i++) {
+ next = indices[i];
+ let text = aText.substr(start, next - start);
+ start = next;
+
+ if (i % 2 == 0) {
+ // Emphasize the text for even indices
+ let span = aDescriptionElement.appendChild(
+ document.createElementNS("http://www.w3.org/1999/xhtml", "span"));
+ span.className = "ac-emphasize-text";
+ span.textContent = text;
+ } else {
+ // Otherwise, it's plain text
+ aDescriptionElement.appendChild(document.createTextNode(text));
+ }
+ }
+ ]]>
+ </body>
+ </method>
+
+ <!--
+ This will generate an array of emphasis pairs for use with
+ _setUpEmphasisedSections(). Each pair is a tuple (array) that
+ represents a block of text - containing the text of that block, and a
+ boolean for whether that block should have an emphasis styling applied
+ to it.
+
+ These pairs are generated by parsing a localised string (aSourceString)
+ with parameters, in the format that is used by
+ nsIStringBundle.formatStringFromName():
+
+ "textA %1$S textB textC %2$S"
+
+ Or:
+
+ "textA %S"
+
+ Where "%1$S", "%2$S", and "%S" are intended to be replaced by provided
+ replacement strings. These are specified an array of tuples
+ (aReplacements), each containing the replacement text and a boolean for
+ whether that text should have an emphasis styling applied. This is used
+ as a 1-based array - ie, "%1$S" is replaced by the item in the first
+ index of aReplacements, "%2$S" by the second, etc. "%S" will always
+ match the first index.
+ -->
+ <method name="_generateEmphasisPairs">
+ <parameter name="aSourceString"/>
+ <parameter name="aReplacements"/>
+ <body>
+ <![CDATA[
+ let pairs = [];
+
+ // Split on %S, %1$S, %2$S, etc. ie:
+ // "textA %S"
+ // becomes ["textA ", "%S"]
+ // "textA %1$S textB textC %2$S"
+ // becomes ["textA ", "%1$S", " textB textC ", "%2$S"]
+ let parts = aSourceString.split(/(%(?:[0-9]+\$)?S)/);
+
+ for (let part of parts) {
+ // The above regex will actually give us an empty string at the
+ // end - we don't want that, as we don't want to later generate an
+ // empty text node for it.
+ if (part.length === 0)
+ continue;
+
+ // Determine if this token is a replacement token or a normal text
+ // token. If it is a replacement token, we want to extract the
+ // numerical number. However, we still want to match on "$S".
+ let match = part.match(/^%(?:([0-9]+)\$)?S$/);
+
+ if (match) {
+ // "%S" doesn't have a numerical number in it, but will always
+ // be assumed to be 1. Furthermore, the input string specifies
+ // these with a 1-based index, but we want a 0-based index.
+ let index = (match[1] || 1) - 1;
+
+ if (index >= 0 && index < aReplacements.length) {
+ pairs.push([...aReplacements[index]]);
+ }
+ } else {
+ pairs.push([part]);
+ }
+ }
+
+ return pairs;
+ ]]>
+ </body>
+ </method>
+
+ <!--
+ _setUpEmphasisedSections() has the same use as _setUpDescription,
+ except instead of taking a string and highlighting given tokens, it takes
+ an array of pairs generated by _generateEmphasisPairs(). This allows
+ control over emphasising based on specific blocks of text, rather than
+ search for substrings.
+ -->
+ <method name="_setUpEmphasisedSections">
+ <parameter name="aDescriptionElement"/>
+ <parameter name="aTextPairs"/>
+ <body>
+ <![CDATA[
+ // Get rid of all previous text
+ while (aDescriptionElement.hasChildNodes())
+ aDescriptionElement.firstChild.remove();
+
+ for (let [text, emphasise] of aTextPairs) {
+ if (emphasise) {
+ let span = aDescriptionElement.appendChild(
+ document.createElementNS("http://www.w3.org/1999/xhtml", "span"));
+ span.textContent = text;
+ switch(emphasise) {
+ case "match":
+ span.className = "ac-emphasize-text";
+ break;
+ case "selected":
+ span.className = "ac-selected-text";
+ break;
+ }
+ } else {
+ aDescriptionElement.appendChild(document.createTextNode(text));
+ }
+ }
+ ]]>
+ </body>
+ </method>
+
+ <field name="_textToSubURI">null</field>
+ <method name="_unescapeUrl">
+ <parameter name="url"/>
+ <body>
+ <![CDATA[
+ if (!this._textToSubURI) {
+ this._textToSubURI =
+ Components.classes["@mozilla.org/intl/texttosuburi;1"]
+ .getService(Components.interfaces.nsITextToSubURI);
+ }
+ return this._textToSubURI.unEscapeURIForUI("UTF-8", url);
+ ]]>
+ </body>
+ </method>
+
+ <method name="_adjustAcItem">
+ <body>
+ <![CDATA[
+ let originalUrl = this.getAttribute("url");
+ let title = this.getAttribute("title");
+ let type = this.getAttribute("type");
+
+ let displayUrl;
+ let emphasiseTitle = true;
+ let emphasiseUrl = true;
+
+ // Hide the title's extra box by default, until we find out later if
+ // we need extra stuff.
+ this._extraBox.hidden = true;
+ this._titleBox.flex = 1;
+ this._typeImage.hidden = false;
+
+ this.removeAttribute("actiontype");
+ this.classList.remove("overridable-action");
+
+ // The ellipses are hidden via their visibility so that they always
+ // take up space and don't pop in on top of text when shown. For
+ // keyword searches, however, the title ellipsis should not take up
+ // space when hidden. Setting the hidden property accomplishes that.
+ this._titleOverflowEllipsis.hidden = false;
+
+ let types = new Set(type.split(/\s+/));
+
+ // Remove types that should ultimately not be in the `type` string.
+ let initialTypes = new Set(types);
+ types.delete("action");
+ types.delete("autofill");
+ types.delete("heuristic");
+ types.delete("search");
+
+ type = [...types][0] || "";
+
+ // If the type includes an action, set up the item appropriately.
+ if (initialTypes.has("action")) {
+ let action = this._parseActionUrl(originalUrl);
+ this.setAttribute("actiontype", action.type);
+
+ if (action.type == "switchtab") {
+ this.classList.add("overridable-action");
+ displayUrl = this._unescapeUrl(action.params.url);
+ let desc = this._stringBundle.GetStringFromName("switchToTab");
+ this._setUpDescription(this._action, desc, true);
+ } else if (action.type == "remotetab") {
+ displayUrl = this._unescapeUrl(action.params.url);
+ let desc = action.params.deviceName;
+ this._setUpDescription(this._action, desc, true);
+ } else if (action.type == "searchengine") {
+ emphasiseUrl = false;
+
+ // The order here is not localizable, we default to appending
+ // "- Search with Engine" to the search string, to be able to
+ // properly generate emphasis pairs. That said, no localization
+ // changed the order while it was possible, so doesn't look like
+ // there's a strong need for that.
+ let {engineName, searchSuggestion, searchQuery} = action.params;
+ let engineStr = " - " +
+ this._stringBundle.formatStringFromName("searchWithEngine",
+ [engineName], 1);
+
+ // Make the title by generating an array of pairs and its
+ // corresponding interpolation string (e.g., "%1$S") to pass to
+ // _generateEmphasisPairs.
+ let pairs;
+ if (searchSuggestion) {
+ // Check if the search query appears in the suggestion. It may
+ // not. If it does, then emphasize the query in the suggestion
+ // and otherwise just include the suggestion without emphasis.
+ let idx = searchSuggestion.indexOf(searchQuery);
+ if (idx >= 0) {
+ pairs = [
+ [searchSuggestion.substring(0, idx), ""],
+ [searchQuery, "match"],
+ [searchSuggestion.substring(idx + searchQuery.length), ""],
+ ];
+ } else {
+ pairs = [
+ [searchSuggestion, ""],
+ ];
+ }
+ } else {
+ pairs = [
+ [searchQuery, ""],
+ ];
+ }
+ pairs.push([engineStr, "selected"]);
+ let interpStr = pairs.map((pair, i) => `%${i + 1}$S`).join("");
+ title = this._generateEmphasisPairs(interpStr, pairs);
+
+ // If this is a default search match, we remove the image so we
+ // can style it ourselves with a generic search icon.
+ // We don't do this when matching an aliased search engine,
+ // because the icon helps with recognising which engine will be
+ // used (when using the default engine, we don't need that
+ // recognition).
+ if (!action.params.alias) {
+ this.removeAttribute("image");
+ }
+ } else if (action.type == "visiturl") {
+ emphasiseUrl = false;
+ displayUrl = this._unescapeUrl(action.params.url);
+ let sourceStr = this._stringBundle.GetStringFromName("visitURL");
+ title = this._generateEmphasisPairs(sourceStr, [
+ [displayUrl, "match"],
+ ]);
+ }
+ }
+
+ // Check if we have a search engine name
+ if (initialTypes.has("search")) {
+ emphasiseUrl = false;
+
+ const TITLE_SEARCH_ENGINE_SEPARATOR = " \u00B7\u2013\u00B7 ";
+
+ let searchEngine = "";
+ [title, searchEngine] = title.split(TITLE_SEARCH_ENGINE_SEPARATOR);
+ displayUrl = this._stringBundle.formatStringFromName("searchWithEngine", [searchEngine], 1);
+ }
+
+ if (!displayUrl) {
+ let input = this.parentNode.parentNode.input;
+ let url = typeof(input.trimValue) == "function" ?
+ input.trimValue(originalUrl) :
+ originalUrl;
+ displayUrl = this._unescapeUrl(url);
+ }
+ this.setAttribute("displayurl", displayUrl);
+
+ // Check if we have an auto-fill URL
+ if (initialTypes.has("autofill")) {
+ emphasiseUrl = false;
+
+ let sourceStr = this._stringBundle.GetStringFromName("visitURL");
+ title = this._generateEmphasisPairs(sourceStr, [
+ [displayUrl, "match"],
+ ]);
+ }
+
+ // If we have a tag match, show the tags and icon
+ if (type == "tag" || type == "bookmark-tag") {
+ // Configure the extra box for tags display
+ this._extraBox.hidden = false;
+ this._extraBox.childNodes[0].hidden = false;
+ this._extraBox.childNodes[1].hidden = true;
+ this._extraBox.pack = "end";
+ this._titleBox.flex = 1;
+
+ // The title is separated from the tags by an endash
+ let tags;
+ [, title, tags] = title.match(/^(.+) \u2013 (.+)$/);
+
+ // Each tag is split by a comma in an undefined order, so sort it
+ let sortedTags = tags.split(",").sort().join(", ");
+
+ // Emphasize the matching text in the tags
+ this._setUpDescription(this._extra, sortedTags);
+
+ // If we're suggesting bookmarks, then treat tagged matches as
+ // bookmarks for the star.
+ if (type == "bookmark-tag") {
+ type = "bookmark";
+ } else {
+ this._typeImage.hidden = true;
+ }
+ // keyword and favicon type results for search engines
+ // have an extra magnifying glass icon after them
+ } else if (type == "keyword" || (initialTypes.has("search") &&
+ initialTypes.has("favicon"))) {
+ // Configure the extra box for keyword display
+ this._extraBox.hidden = false;
+ this._extraBox.childNodes[0].hidden = true;
+ // The second child node is ":" and it should be hidden for non keyword types
+ this._extraBox.childNodes[1].hidden = type == "keyword" ? false : true;
+ this._extraBox.pack = "start";
+ this._titleBox.flex = 0;
+
+ // Hide the ellipsis so it doesn't take up space.
+ this._titleOverflowEllipsis.hidden = true;
+
+ if (type == "keyword") {
+ // Put the parameters next to the title if we have any
+ let search = this.getAttribute("text");
+ let params = "";
+ let paramsIndex = search.indexOf(" ");
+ if (paramsIndex != -1)
+ params = search.substr(paramsIndex + 1);
+
+ // Emphasize the keyword parameters
+ this._setUpDescription(this._extra, params);
+
+ // Don't emphasize keyword searches in the title or url
+ emphasiseUrl = false;
+ emphasiseTitle = false;
+ } else {
+ // Don't show any description for non keyword types.
+ this._setUpDescription(this._extra, "", true);
+ }
+ // If the result has the type favicon and a known search provider,
+ // customize it the same way as a keyword result.
+ type = "keyword";
+ }
+
+ // Give the image the icon style and a special one for the type
+ this._typeImage.className = "ac-type-icon" +
+ (type ? " ac-result-type-" + type : "");
+
+ // Show the domain as the title if we don't have a title.
+ if (title == "") {
+ title = displayUrl;
+ try {
+ let uri = Services.io.newURI(originalUrl, null, null);
+ // Not all valid URLs have a domain.
+ if (uri.host)
+ title = uri.host;
+ } catch (e) {}
+ }
+
+ // Emphasize the matching search terms for the description
+ if (Array.isArray(title))
+ this._setUpEmphasisedSections(this._title, title);
+ else
+ this._setUpDescription(this._title, title, !emphasiseTitle);
+
+ this._setUpDescription(this._url, displayUrl, !emphasiseUrl);
+
+ // Set up overflow on a timeout because the contents of the box
+ // might not have a width yet even though we just changed them
+ setTimeout(this._setUpOverflow, 0, this._titleBox, this._titleOverflowEllipsis);
+ setTimeout(this._setUpOverflow, 0, this._urlBox, this._urlOverflowEllipsis);
+ ]]>
+ </body>
+ </method>
+
+ <method name="_parseActionUrl">
+ <parameter name="aUrl"/>
+ <body><![CDATA[
+ if (!aUrl.startsWith("moz-action:"))
+ return null;
+
+ // URL is in the format moz-action:ACTION,PARAMS
+ // Where PARAMS is a JSON encoded object.
+ let [, type, params] = aUrl.match(/^moz-action:([^,]+),(.*)$/);
+
+ let action = {
+ type: type,
+ };
+
+ try {
+ action.params = JSON.parse(params);
+ for (let key in action.params) {
+ action.params[key] = decodeURIComponent(action.params[key]);
+ }
+ } catch (e) {
+ // If this failed, we assume that params is not a JSON object, and
+ // is instead just a flat string. This will happen when
+ // UnifiedComplete is disabled - in which case, the param is always
+ // a URL.
+ action.params = {
+ url: params,
+ }
+ }
+
+ return action;
+ ]]></body>
+ </method>
+
+ <method name="_setUpOverflow">
+ <parameter name="aParentBox"/>
+ <parameter name="aEllipsis"/>
+ <body>
+ <![CDATA[
+ // Hide the ellipsis incase there's just enough to not underflow
+ aEllipsis.style.visibility = "hidden";
+
+ // Start with the parent's width and subtract off its children
+ let tooltip = [];
+ let children = aParentBox.childNodes;
+ let widthDiff = aParentBox.boxObject.width;
+
+ for (let i = 0; i < children.length; i++) {
+ // Only consider a child if it actually takes up space
+ let childWidth = children[i].boxObject.width;
+ if (childWidth > 0) {
+ // Subtract a little less to account for subpixel rounding
+ widthDiff -= childWidth - .5;
+
+ // Add to the tooltip if it's not hidden and has text
+ let childText = children[i].textContent;
+ if (childText)
+ tooltip.push(childText);
+ }
+ }
+
+ // If the children take up more space than the parent.. overflow!
+ if (widthDiff < 0) {
+ // Re-show the ellipsis now that we know it's needed
+ aEllipsis.style.visibility = "visible";
+
+ // Separate text components with a ndash --
+ aParentBox.tooltipText = tooltip.join(" \u2013 ");
+ }
+ ]]>
+ </body>
+ </method>
+
+ <method name="_doUnderflow">
+ <parameter name="aName"/>
+ <body>
+ <![CDATA[
+ // Hide the ellipsis right when we know we're underflowing instead of
+ // waiting for the timeout to trigger the _setUpOverflow calculations
+ this[aName + "Box"].tooltipText = "";
+ this[aName + "OverflowEllipsis"].style.visibility = "hidden";
+ ]]>
+ </body>
+ </method>
+
+ <method name="_doOverflow">
+ <parameter name="aName"/>
+ <body>
+ <![CDATA[
+ this._setUpOverflow(this[aName + "Box"],
+ this[aName + "OverflowEllipsis"]);
+ ]]>
+ </body>
+ </method>
+
+ </implementation>
+ </binding>
+
+ <binding id="private-autocomplete-tree" extends="chrome://global/content/bindings/tree.xml#tree">
+ <content>
+ <children includes="treecols"/>
+ <xul:treerows class="private-autocomplete-treerows tree-rows" xbl:inherits="hidescrollbar" flex="1">
+ <children/>
+ </xul:treerows>
+ </content>
+ </binding>
+
+ <binding id="private-autocomplete-richlistbox" extends="chrome://global/content/bindings/richlistbox.xml#richlistbox">
+ <implementation>
+ <field name="mLastMoveTime">Date.now()</field>
+ <field name="mouseSelectedIndex">-1</field>
+ </implementation>
+ <handlers>
+ <handler event="mouseup">
+ <![CDATA[
+ // don't call onPopupClick for the scrollbar buttons, thumb, slider, etc.
+ let item = event.originalTarget;
+ while (item && item.localName != "richlistitem") {
+ item = item.parentNode;
+ }
+
+ if (!item)
+ return;
+
+ this.parentNode.onPopupClick(event);
+ ]]>
+ </handler>
+
+ <handler event="mousemove">
+ <![CDATA[
+ if (Date.now() - this.mLastMoveTime > 30) {
+ let item = event.target;
+ while (item && item.localName != "richlistitem") {
+ item = item.parentNode;
+ }
+
+ if (!item)
+ return;
+
+ let index = this.getIndexOfItem(item);
+ if (index != this.selectedIndex) {
+ this.mouseSelectedIndex = this.selectedIndex = index;
+ }
+
+ this.mLastMoveTime = Date.now();
+ }
+ ]]>
+ </handler>
+ </handlers>
+ </binding>
+
+ <binding id="private-autocomplete-treebody">
+ <implementation>
+ <field name="mLastMoveTime">Date.now()</field>
+ </implementation>
+
+ <handlers>
+ <handler event="mouseup" action="this.parentNode.parentNode.onPopupClick(event);"/>
+
+ <handler event="mousedown"><![CDATA[
+ var rc = this.parentNode.treeBoxObject.getRowAt(event.clientX, event.clientY);
+ if (rc != this.parentNode.currentIndex)
+ this.parentNode.view.selection.select(rc);
+ ]]></handler>
+
+ <handler event="mousemove"><![CDATA[
+ if (Date.now() - this.mLastMoveTime > 30) {
+ var rc = this.parentNode.treeBoxObject.getRowAt(event.clientX, event.clientY);
+ if (rc != this.parentNode.currentIndex)
+ this.parentNode.view.selection.select(rc);
+ this.mLastMoveTime = Date.now();
+ }
+ ]]></handler>
+ </handlers>
+ </binding>
+
+ <binding id="private-autocomplete-treerows">
+ <content>
+ <xul:hbox flex="1" class="tree-bodybox">
+ <children/>
+ </xul:hbox>
+ <xul:scrollbar xbl:inherits="collapsed=hidescrollbar" orient="vertical" class="tree-scrollbar"/>
+ </content>
+ </binding>
+
+ <binding id="private-history-dropmarker" extends="chrome://global/content/bindings/general.xml#dropmarker">
+ <handlers>
+ <handler event="mousedown" button="0"><![CDATA[
+ document.getBindingParent(this).toggleHistoryPopup();
+ ]]></handler>
+ </handlers>
+ </binding>
+
+</bindings>
diff --git a/application/palemoon/base/content/autorecovery.js b/application/palemoon/base/content/autorecovery.js
index 29ccaed3f..01a092f5c 100644
--- a/application/palemoon/base/content/autorecovery.js
+++ b/application/palemoon/base/content/autorecovery.js
@@ -10,9 +10,9 @@
* have been properly initialized already.
*/
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-let Cu = Components.utils;
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
// Services = object with smart getters for common XPCOM services
Cu.import("resource://gre/modules/Services.jsm");
diff --git a/application/palemoon/base/content/baseMenuOverlay.xul b/application/palemoon/base/content/baseMenuOverlay.xul
index c6c1b16dc..f61348c9f 100644
--- a/application/palemoon/base/content/baseMenuOverlay.xul
+++ b/application/palemoon/base/content/baseMenuOverlay.xul
@@ -29,7 +29,7 @@
<menuitem id="menu_mac_show_all" label="&showAllAppsCmdMac.label;"/>
</menupopup>
<!-- Mac window menu -->
-#include ../../../toolkit/content/macWindowMenu.inc
+#include ../../../../toolkit/content/macWindowMenu.inc
#endif
#ifdef XP_WIN
diff --git a/application/palemoon/base/content/browser-addons.js b/application/palemoon/base/content/browser-addons.js
index 7993a0c9c..f5c398f33 100644
--- a/application/palemoon/base/content/browser-addons.js
+++ b/application/palemoon/base/content/browser-addons.js
@@ -226,7 +226,7 @@ const gXPInstallObserver = {
* - If an add-on was installed, incrementing the count, show the bar.
* - If an add-on was uninstalled, and no more items are left, hide the bar.
*/
-let AddonsMgrListener = {
+var AddonsMgrListener = {
get addonBar() document.getElementById("addon-bar"),
get statusBar() document.getElementById("status-bar"),
getAddonBarItemCount: function() {
@@ -461,7 +461,7 @@ var LightWeightThemeWebInstaller = {
/*
* Listen for Lightweight Theme styling changes and update the browser's theme accordingly.
*/
-let LightweightThemeListener = {
+var LightweightThemeListener = {
_modifiedStyles: [],
init: function () {
diff --git a/application/palemoon/base/content/browser-appmenu.inc b/application/palemoon/base/content/browser-appmenu.inc
index 835bf22bc..cfc855484 100644
--- a/application/palemoon/base/content/browser-appmenu.inc
+++ b/application/palemoon/base/content/browser-appmenu.inc
@@ -132,38 +132,8 @@
</splitmenu>
<menuseparator class="appmenu-menuseparator"/>
<splitmenu id="appmenu_webDeveloper"
- command="Tools:DevToolbox"
label="&appMenuWebDeveloper.label;">
<menupopup id="appmenu_webDeveloper_popup">
-#ifdef MOZ_DEVTOOLS
- <menuitem id="appmenu_devToolbox"
- observes="devtoolsMenuBroadcaster_DevToolbox"/>
- <menuseparator id="appmenu_devtools_separator"/>
- <menuitem id="appmenu_devToolbar"
- observes="devtoolsMenuBroadcaster_DevToolbar"/>
- <menuitem id="appmenu_chromeDebugger"
- observes="devtoolsMenuBroadcaster_ChromeDebugger"/>
- <menuitem id="appmenu_browserConsole"
- observes="devtoolsMenuBroadcaster_BrowserConsole"/>
- <menuitem id="appmenu_responsiveUI"
- observes="devtoolsMenuBroadcaster_ResponsiveUI"/>
- <menuitem id="appmenu_eyedropper"
- observes="devtoolsMenuBroadcaster_Eyedropper"/>
- <menuitem id="appmenu_scratchpad"
- observes="devtoolsMenuBroadcaster_Scratchpad"/>
-#endif
- <menuitem id="appmenu_pageSource"
- observes="devtoolsMenuBroadcaster_PageSource"/>
- <menuitem id="appmenu_errorConsole"
- observes="devtoolsMenuBroadcaster_ErrorConsole"/>
-#ifdef MOZ_DEVTOOLS
- <menuitem id="appmenu_devtools_connect"
- observes="devtoolsMenuBroadcaster_connect"/>
-#endif
- <menuseparator id="appmenu_devToolsEndSeparator"/>
- <menuitem id="appmenu_getMoreDevtools"
- observes="devtoolsMenuBroadcaster_GetMoreTools"/>
- <menuseparator/>
#define ID_PREFIX appmenu_developer_
#define OMIT_ACCESSKEYS
#include browser-charsetmenu.inc
@@ -173,6 +143,11 @@
type="checkbox"
observes="workOfflineMenuitemState"
oncommand="BrowserOffline.toggleOfflineStatus();"/>
+ <menuseparator/>
+ <menuitem id="appmenu_pageSource"
+ observes="devtoolsMenuBroadcaster_PageSource"/>
+ <menuitem id="appmenu_javascriptConsole"
+ observes="devtoolsMenuBroadcaster_ErrorConsole"/>
</menupopup>
</splitmenu>
<menuseparator class="appmenu-menuseparator"/>
diff --git a/application/palemoon/base/content/browser-devtools-theme.js b/application/palemoon/base/content/browser-devtools-theme.js
new file mode 100644
index 000000000..7b21ddedc
--- /dev/null
+++ b/application/palemoon/base/content/browser-devtools-theme.js
@@ -0,0 +1,91 @@
+/* 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 DevTools theme.
+ */
+var DevToolsTheme = {
+ _devtoolsThemePrefName: "devtools.theme",
+ styleSheet: null,
+ initialized: false,
+
+ get isStyleSheetEnabled() {
+ return this.styleSheet && !this.styleSheet.sheet.disabled;
+ },
+
+ 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();
+ },
+
+ observe: function (subject, topic, data) {
+ if (topic == "lightweight-theme-styling-update") {
+ let newTheme = JSON.parse(data);
+ this._toggleStyleSheet();
+ }
+
+ 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");
+ }
+ },
+
+ _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._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() {
+ let wasEnabled = this.isStyleSheetEnabled;
+ if (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;
+ }
+};
diff --git a/application/palemoon/base/content/browser-fullScreen.js b/application/palemoon/base/content/browser-fullScreen.js
index b8a29199e..400340e77 100644
--- a/application/palemoon/base/content/browser-fullScreen.js
+++ b/application/palemoon/base/content/browser-fullScreen.js
@@ -304,7 +304,7 @@ var FullScreen = {
},
_cancelAnimation: function() {
- window.mozCancelAnimationFrame(this._animationHandle);
+ window.cancelAnimationFrame(this._animationHandle);
this._animationHandle = 0;
clearTimeout(this._animationTimeout);
this._isAnimating = false;
diff --git a/application/palemoon/base/content/browser-fullZoom.js b/application/palemoon/base/content/browser-fullZoom.js
index 0837bf7c2..890cd8440 100644
--- a/application/palemoon/base/content/browser-fullZoom.js
+++ b/application/palemoon/base/content/browser-fullZoom.js
@@ -1,14 +1,6 @@
-/*
-#ifdef 0
- * This Source Code Form is subject to the terms of the Mozilla Public
+/* 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
- */
-
-// One of the possible values for the mousewheel.* preferences.
-// From nsEventStateManager.cpp.
-const MOUSE_SCROLL_ZOOM = 3;
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Controls the "full zoom" setting and its site-specific preferences.
@@ -36,7 +28,6 @@ var FullZoom = {
return this._siteSpecificPref;
},
- //**************************************************************************//
// nsISupports
QueryInterface: XPCOMUtils.generateQI([Ci.nsIDOMEventListener,
@@ -45,12 +36,10 @@ var FullZoom = {
Ci.nsISupportsWeakReference,
Ci.nsISupports]),
- //**************************************************************************//
// Initialization & Destruction
init: function FullZoom_init() {
- // Listen for scrollwheel events so we can save scrollwheel-based changes.
- window.addEventListener("DOMMouseScroll", this, false);
+ gBrowser.addEventListener("ZoomChangeUsingMouseWheel", this);
// Register ourselves with the service so we know when our pref changes.
this._cps2 = Cc["@mozilla.org/content-pref/service;1"].
@@ -74,76 +63,30 @@ var FullZoom = {
}
// This should be nulled after initialization.
- this._initialLocations.clear();
this._initialLocations = null;
},
destroy: function FullZoom_destroy() {
gPrefService.removeObserver("browser.zoom.", this);
this._cps2.removeObserverForName(this.name, this);
- window.removeEventListener("DOMMouseScroll", this, false);
+ gBrowser.removeEventListener("ZoomChangeUsingMouseWheel", this);
},
- //**************************************************************************//
// Event Handlers
// nsIDOMEventListener
handleEvent: function FullZoom_handleEvent(event) {
switch (event.type) {
- case "DOMMouseScroll":
- this._handleMouseScrolled(event);
+ case "ZoomChangeUsingMouseWheel":
+ let browser = this._getTargetedBrowser(event);
+ this._ignorePendingZoomAccesses(browser);
+ this._applyZoomToPref(browser);
break;
}
},
- _handleMouseScrolled: function FullZoom__handleMouseScrolled(event) {
- // Construct the "mousewheel action" pref key corresponding to this event.
- // Based on nsEventStateManager::WheelPrefs::GetBasePrefName().
- var pref = "mousewheel.";
-
- var pressedModifierCount = event.shiftKey + event.ctrlKey + event.altKey +
- event.metaKey + event.getModifierState("OS");
- if (pressedModifierCount != 1) {
- pref += "default.";
- } else if (event.shiftKey) {
- pref += "with_shift.";
- } else if (event.ctrlKey) {
- pref += "with_control.";
- } else if (event.altKey) {
- pref += "with_alt.";
- } else if (event.metaKey) {
- pref += "with_meta.";
- } else {
- pref += "with_win.";
- }
-
- pref += "action";
-
- // Don't do anything if this isn't a "zoom" scroll event.
- var isZoomEvent = false;
- try {
- isZoomEvent = (gPrefService.getIntPref(pref) == MOUSE_SCROLL_ZOOM);
- } catch (e) {}
- if (!isZoomEvent)
- return;
-
- // XXX Lazily cache all the possible action prefs so we don't have to get
- // them anew from the pref service for every scroll event? We'd have to
- // make sure to observe them so we can update the cache when they change.
-
- // We have to call _applyZoomToPref in a timeout because we handle the
- // event before the event state manager has a chance to apply the zoom
- // during nsEventStateManager::PostHandleEvent.
- let browser = gBrowser.selectedBrowser;
- let token = this._getBrowserToken(browser);
- window.setTimeout(function () {
- if (token.isCurrent)
- this._applyZoomToPref(browser);
- }.bind(this), 0);
- },
-
// nsIObserver
observe: function (aSubject, aTopic, aData) {
@@ -165,12 +108,12 @@ var FullZoom = {
// nsIContentPrefObserver
- onContentPrefSet: function FullZoom_onContentPrefSet(aGroup, aName, aValue) {
- this._onContentPrefChanged(aGroup, aValue);
+ onContentPrefSet: function FullZoom_onContentPrefSet(aGroup, aName, aValue, aIsPrivate) {
+ this._onContentPrefChanged(aGroup, aValue, aIsPrivate);
},
- onContentPrefRemoved: function FullZoom_onContentPrefRemoved(aGroup, aName) {
- this._onContentPrefChanged(aGroup, undefined);
+ onContentPrefRemoved: function FullZoom_onContentPrefRemoved(aGroup, aName, aIsPrivate) {
+ this._onContentPrefChanged(aGroup, undefined, aIsPrivate);
},
/**
@@ -181,7 +124,7 @@ var FullZoom = {
* @param aValue The new value of the changed preference. Pass undefined to
* indicate the preference's removal.
*/
- _onContentPrefChanged: function FullZoom__onContentPrefChanged(aGroup, aValue) {
+ _onContentPrefChanged: function FullZoom__onContentPrefChanged(aGroup, aValue, aIsPrivate) {
if (this._isNextContentPrefChangeInternal) {
// Ignore changes that FullZoom itself makes. This works because the
// content pref service calls callbacks before notifying observers, and it
@@ -194,9 +137,10 @@ var FullZoom = {
if (!browser.currentURI)
return;
+ let ctxt = this._loadContextFromBrowser(browser);
let domain = this._cps2.extractDomain(browser.currentURI.spec);
if (aGroup) {
- if (aGroup == domain)
+ if (aGroup == domain && ctxt.usePrivateBrowsing == aIsPrivate)
this._applyPrefToZoom(aValue, browser);
return;
}
@@ -208,10 +152,9 @@ var FullZoom = {
// zoom should be set to the new global preference now that the global
// preference has changed.
let hasPref = false;
- let ctxt = this._loadContextFromBrowser(browser);
let token = this._getBrowserToken(browser);
this._cps2.getByDomainAndName(browser.currentURI.spec, this.name, ctxt, {
- handleResult: function () hasPref = true,
+ handleResult: function () { hasPref = true; },
handleCompletion: function () {
if (!hasPref && token.isCurrent)
this._applyPrefToZoom(undefined, browser);
@@ -234,6 +177,7 @@ var FullZoom = {
*/
onLocationChange: function FullZoom_onLocationChange(aURI, aIsTabSwitch, aBrowser) {
let browser = aBrowser || gBrowser.selectedBrowser;
+
// If we haven't been initialized yet but receive an onLocationChange
// notification then let's store and replay it upon initialization.
if (this._initialLocations) {
@@ -247,14 +191,14 @@ var FullZoom = {
this._ignorePendingZoomAccesses(browser);
if (!aURI || (aIsTabSwitch && !this.siteSpecific)) {
- this._notifyOnLocationChange();
+ this._notifyOnLocationChange(browser);
return;
}
// Avoid the cps roundtrip and apply the default/global pref.
if (aURI.spec == "about:blank") {
this._applyPrefToZoom(undefined, browser,
- this._notifyOnLocationChange.bind(this));
+ this._notifyOnLocationChange.bind(this, browser));
return;
}
@@ -262,7 +206,7 @@ var FullZoom = {
if (!aIsTabSwitch && browser.isSyntheticDocument) {
ZoomManager.setZoomForBrowser(browser, 1);
// _ignorePendingZoomAccesses already called above, so no need here.
- this._notifyOnLocationChange();
+ this._notifyOnLocationChange(browser);
return;
}
@@ -271,7 +215,7 @@ var FullZoom = {
let pref = this._cps2.getCachedByDomainAndName(aURI.spec, this.name, ctxt);
if (pref) {
this._applyPrefToZoom(pref.value, browser,
- this._notifyOnLocationChange.bind(this));
+ this._notifyOnLocationChange.bind(this, browser));
return;
}
@@ -279,14 +223,14 @@ var FullZoom = {
let value = undefined;
let token = this._getBrowserToken(browser);
this._cps2.getByDomainAndName(aURI.spec, this.name, ctxt, {
- handleResult: function (resultPref) value = resultPref.value,
+ handleResult: function (resultPref) { value = resultPref.value; },
handleCompletion: function () {
if (!token.isCurrent) {
- this._notifyOnLocationChange();
+ this._notifyOnLocationChange(browser);
return;
}
this._applyPrefToZoom(value, browser,
- this._notifyOnLocationChange.bind(this));
+ this._notifyOnLocationChange.bind(this, browser));
}.bind(this)
});
},
@@ -299,7 +243,6 @@ var FullZoom = {
menuItem.setAttribute("checked", !ZoomManager.useFullZoom);
},
- //**************************************************************************//
// Setting & Pref Manipulation
/**
@@ -323,19 +266,32 @@ var FullZoom = {
},
/**
- * Sets the zoom level of the page in the current browser to the global zoom
+ * Sets the zoom level for the given browser to the given floating
+ * point value, where 1 is the default zoom level.
+ */
+ setZoom: function (value, browser = gBrowser.selectedBrowser) {
+ ZoomManager.setZoomForBrowser(browser, value);
+ this._ignorePendingZoomAccesses(browser);
+ this._applyZoomToPref(browser);
+ },
+
+ /**
+ * Sets the zoom level of the page in the given browser to the global zoom
* level.
+ *
+ * @return A promise which resolves when the zoom reset has been applied.
*/
- reset: function FullZoom_reset() {
- let browser = gBrowser.selectedBrowser;
+ reset: function FullZoom_reset(browser = gBrowser.selectedBrowser) {
let token = this._getBrowserToken(browser);
- this._getGlobalValue(browser, function (value) {
+ let result = this._getGlobalValue(browser).then(value => {
if (token.isCurrent) {
ZoomManager.setZoomForBrowser(browser, value === undefined ? 1 : value);
this._ignorePendingZoomAccesses(browser);
+ Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset", "");
}
});
this._removePref(browser);
+ return result;
},
/**
@@ -383,7 +339,7 @@ var FullZoom = {
}
let token = this._getBrowserToken(aBrowser);
- this._getGlobalValue(aBrowser, function (value) {
+ this._getGlobalValue(aBrowser).then(value => {
if (token.isCurrent) {
ZoomManager.setZoomForBrowser(aBrowser, value === undefined ? 1 : value);
this._ignorePendingZoomAccesses(aBrowser);
@@ -399,6 +355,7 @@ var FullZoom = {
* @param browser The zoom of this browser will be saved. Required.
*/
_applyZoomToPref: function FullZoom__applyZoomToPref(browser) {
+ Services.obs.notifyObservers(browser, "browser-fullZoom:zoomChange", "");
if (!this.siteSpecific ||
gInPrintPreviewMode ||
browser.isSyntheticDocument)
@@ -419,6 +376,7 @@ var FullZoom = {
* @param browser The zoom of this browser will be removed. Required.
*/
_removePref: function FullZoom__removePref(browser) {
+ Services.obs.notifyObservers(browser, "browser-fullZoom:zoomReset", "");
if (browser.isSyntheticDocument)
return;
let ctxt = this._loadContextFromBrowser(browser);
@@ -429,7 +387,6 @@ var FullZoom = {
});
},
- //**************************************************************************//
// Utilities
/**
@@ -462,6 +419,30 @@ var FullZoom = {
},
/**
+ * Returns the browser that the supplied zoom event is associated with.
+ * @param event The ZoomChangeUsingMouseWheel event.
+ * @return The associated browser element, if one exists, otherwise null.
+ */
+ _getTargetedBrowser: function FullZoom__getTargetedBrowser(event) {
+ let target = event.originalTarget;
+
+ // With remote content browsers, the event's target is the browser
+ // we're looking for.
+ const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+ if (target instanceof window.XULElement &&
+ target.localName == "browser" &&
+ target.namespaceURI == XUL_NS)
+ return target;
+
+ // With in-process content browsers, the event's target is the content
+ // document.
+ if (target.nodeType == Node.DOCUMENT_NODE)
+ return gBrowser.getBrowserForDocument(target);
+
+ throw new Error("Unexpected ZoomChangeUsingMouseWheel event source");
+ },
+
+ /**
* Increments the zoom change token for the given browser so that pending
* async operations know that it may be unsafe to access they zoom when they
* finish.
@@ -491,54 +472,49 @@ var FullZoom = {
/**
* Gets the global browser.content.full-zoom content preference.
*
- * WARNING: callback may be called synchronously or asynchronously. The
- * reason is that it's usually desirable to avoid turns of the event loop
- * where possible, since they can lead to visible, jarring jumps in zoom
- * level. It's not always possible to avoid them, though. As a convenience,
- * then, this method takes a callback and returns nothing.
- *
- * @param browser The content browser pertaining to the zoom.
- * @param callback Synchronously or asynchronously called when done. It's
- * bound to this object (FullZoom) and called as:
- * callback(prefValue)
+ * @param browser The browser pertaining to the zoom.
+ * @returns Promise<prefValue>
+ * Resolves to the preference value when done.
*/
- _getGlobalValue: function FullZoom__getGlobalValue(browser, callback) {
+ _getGlobalValue: function FullZoom__getGlobalValue(browser) {
// * !("_globalValue" in this) => global value not yet cached.
// * this._globalValue === undefined => global value known not to exist.
// * Otherwise, this._globalValue is a number, the global value.
- if ("_globalValue" in this) {
- callback.call(this, this._globalValue, true);
- return;
- }
- let value = undefined;
- this._cps2.getGlobal(this.name, this._loadContextFromBrowser(browser), {
- handleResult: function (pref) value = pref.value,
- handleCompletion: function (reason) {
- this._globalValue = this._ensureValid(value);
- callback.call(this, this._globalValue);
- }.bind(this)
+ return new Promise(resolve => {
+ if ("_globalValue" in this) {
+ resolve(this._globalValue);
+ return;
+ }
+ let value = undefined;
+ this._cps2.getGlobal(this.name, this._loadContextFromBrowser(browser), {
+ handleResult: function (pref) { value = pref.value; },
+ handleCompletion: (reason) => {
+ this._globalValue = this._ensureValid(value);
+ resolve(this._globalValue);
+ }
+ });
});
},
/**
- * Gets the load context from the given content browser.
+ * Gets the load context from the given Browser.
*
* @param Browser The Browser whose load context will be returned.
- * @return The nsILoadContext of the given Browser.
+ * @return The nsILoadContext of the given Browser.
*/
_loadContextFromBrowser: function FullZoom__loadContextFromBrowser(browser) {
return browser.loadContext;
},
/**
- * Asynchronously broadcasts a "browser-fullZoom:locationChange" notification
- * so that tests can select tabs, load pages, etc. and be notified when the
- * zoom levels on those pages change. The notification is always asynchronous
- * so that observers are guaranteed a consistent behavior.
+ * Asynchronously broadcasts "browser-fullZoom:location-change" so that
+ * listeners can be notified when the zoom levels on those pages change.
+ * The notification is always asynchronous so that observers are guaranteed a
+ * consistent behavior.
*/
- _notifyOnLocationChange: function FullZoom__notifyOnLocationChange() {
+ _notifyOnLocationChange: function FullZoom__notifyOnLocationChange(browser) {
this._executeSoon(function () {
- Services.obs.notifyObservers(null, "browser-fullZoom:locationChange", "");
+ Services.obs.notifyObservers(browser, "browser-fullZoom:location-change", "");
});
},
diff --git a/application/palemoon/base/content/browser-gestureSupport.js b/application/palemoon/base/content/browser-gestureSupport.js
index d88f47c79..13eb71b99 100644
--- a/application/palemoon/base/content/browser-gestureSupport.js
+++ b/application/palemoon/base/content/browser-gestureSupport.js
@@ -13,7 +13,7 @@
// chrome-only, we must listen for the simple gesture events during
// the capturing phase and call stopPropagation on every event.
-let gGestureSupport = {
+var gGestureSupport = {
_currentRotation: 0,
_lastRotateDelta: 0,
_rotateMomentumThreshold: .75,
@@ -532,7 +532,7 @@ let gGestureSupport = {
};
// History Swipe Animation Support (bug 678392)
-let gHistorySwipeAnimation = {
+var gHistorySwipeAnimation = {
active: false,
isLTR: false,
diff --git a/application/palemoon/base/content/browser-menubar.inc b/application/palemoon/base/content/browser-menubar.inc
index fa9d7f0f4..fc6bc7694 100644
--- a/application/palemoon/base/content/browser-menubar.inc
+++ b/application/palemoon/base/content/browser-menubar.inc
@@ -534,43 +534,12 @@
label="&webDeveloperMenu.label;"
accesskey="&webDeveloperMenu.accesskey;">
<menupopup id="menuWebDeveloperPopup">
-#ifdef MOZ_DEVTOOLS
- <menuitem id="menu_devToolbox"
- observes="devtoolsMenuBroadcaster_DevToolbox"
- accesskey="&devToolboxMenuItem.accesskey;"/>
- <menuseparator id="menu_devtools_separator"/>
- <menuitem id="menu_devToolbar"
- observes="devtoolsMenuBroadcaster_DevToolbar"
- accesskey="&devToolbarMenu.accesskey;"/>
- <menuitem id="menu_chromeDebugger"
- observes="devtoolsMenuBroadcaster_ChromeDebugger"/>
- <menuitem id="menu_browserConsole"
- observes="devtoolsMenuBroadcaster_BrowserConsole"
- accesskey="&browserConsoleCmd.accesskey;"/>
- <menuitem id="menu_responsiveUI"
- observes="devtoolsMenuBroadcaster_ResponsiveUI"
- accesskey="&responsiveDesignTool.accesskey;"/>
- <menuitem id="menu_eyedropper"
- observes="devtoolsMenuBroadcaster_Eyedropper"
- accesskey="&eyedropper.accesskey;"/>
- <menuitem id="menu_scratchpad"
- observes="devtoolsMenuBroadcaster_Scratchpad"
- accesskey="&scratchpad.accesskey;"/>
-#endif
<menuitem id="menu_pageSource"
observes="devtoolsMenuBroadcaster_PageSource"
accesskey="&pageSourceCmd.accesskey;"/>
<menuitem id="javascriptConsole"
observes="devtoolsMenuBroadcaster_ErrorConsole"
accesskey="&errorConsoleCmd.accesskey;"/>
-#ifdef MOZ_DEVTOOLS
- <menuitem id="menu_devtools_connect"
- observes="devtoolsMenuBroadcaster_connect"/>
-#endif
- <menuseparator id="devToolsEndSeparator"/>
- <menuitem id="getMoreDevtools"
- observes="devtoolsMenuBroadcaster_GetMoreTools"
- accesskey="&getMoreDevtoolsCmd.accesskey;"/>
</menupopup>
</menu>
<menuitem id="menu_pageInfo"
diff --git a/application/palemoon/base/content/browser-places.js b/application/palemoon/base/content/browser-places.js
index cf9c28597..590fe7ecd 100644
--- a/application/palemoon/base/content/browser-places.js
+++ b/application/palemoon/base/content/browser-places.js
@@ -189,11 +189,24 @@ var StarUI = {
this._itemId = aItemId !== undefined ? aItemId : this._itemId;
this.beginBatch();
- this.panel.openPopup(aAnchorElement, aPosition);
-
+ let onPanelReady = fn => {
+ let target = this.panel;
+ if (target.parentNode) {
+ // By targeting the panel's parent and using a capturing listener, we
+ // can have our listener called before others waiting for the panel to
+ // be shown (which probably expect the panel to be fully initialized)
+ target = target.parentNode;
+ }
+ target.addEventListener("popupshown", function(event) {
+ fn();
+ }, {"capture": true, "once": true});
+ };
gEditItemOverlay.initPanel(this._itemId,
- { hiddenRows: ["description", "location",
+ { onPanelReady,
+ hiddenRows: ["description", "location",
"loadInSidebar", "keyword"] });
+
+ this.panel.openPopup(aAnchorElement, aPosition);
},
panelShown:
@@ -959,7 +972,7 @@ var PlacesMenuDNDHandler = {
* This object handles the initialization and uninitialization of the bookmarks
* toolbar.
*/
-let PlacesToolbarHelper = {
+var PlacesToolbarHelper = {
_place: "place:folder=TOOLBAR",
get _viewElt() {
@@ -1006,7 +1019,7 @@ let PlacesToolbarHelper = {
* menu button.
*/
-let BookmarkingUI = {
+var BookmarkingUI = {
get button() {
if (!this._button) {
this._button = document.getElementById("bookmarks-menu-button");
diff --git a/application/palemoon/base/content/browser-sets.inc b/application/palemoon/base/content/browser-sets.inc
index 78cfb7faa..64228678e 100644
--- a/application/palemoon/base/content/browser-sets.inc
+++ b/application/palemoon/base/content/browser-sets.inc
@@ -92,24 +92,9 @@
<command id="Tools:Search" oncommand="BrowserSearch.webSearch();"/>
<command id="Tools:Downloads" oncommand="BrowserDownloadsUI();"/>
-#ifdef MOZ_DEVTOOLS
- <command id="Tools:DevToolbox" oncommand="gDevToolsBrowser.toggleToolboxCommand(gBrowser);"/>
- <command id="Tools:DevToolbar" oncommand="DeveloperToolbar.toggle();" disabled="true" hidden="true"/>
- <command id="Tools:DevToolbarFocus" oncommand="DeveloperToolbar.focusToggle();" disabled="true"/>
- <command id="Tools:DevAppMgr" oncommand="gDevToolsBrowser.openAppManager(gBrowser);" disabled="true" hidden="true"/>
- <command id="Tools:WebIDE" oncommand="gDevToolsBrowser.openWebIDE();" disabled="true" hidden="true"/>
- <command id="Tools:ChromeDebugger" oncommand="BrowserToolboxProcess.init();" disabled="true" hidden="true"/>
- <command id="Tools:BrowserConsole" oncommand="HUDService.openBrowserConsoleOrFocus();"/>
- <command id="Tools:Scratchpad" oncommand="Scratchpad.openScratchpad();" disabled="true" hidden="true"/>
- <command id="Tools:ResponsiveUI" oncommand="ResponsiveUI.toggle();" disabled="true" hidden="true"/>
- <command id="Tools:Eyedropper" oncommand="openEyedropper();"/>
-#endif
<command id="Tools:Addons" oncommand="BrowserOpenAddonsMgr();"/>
<command id="Tools:Permissions" oncommand="BrowserOpenPermissionsMgr();"/>
<command id="Tools:ErrorConsole" oncommand="toJavaScriptConsole()" disabled="true" hidden="true"/>
-#ifdef MOZ_DEVTOOLS
- <command id="Tools:DevToolsConnect" oncommand="gDevToolsBrowser.openConnectScreen(gBrowser)" disabled="true" hidden="true"/>
-#endif
<command id="Tools:Sanitize"
oncommand="Cc['@mozilla.org/browser/browserglue;1'].getService(Ci.nsIBrowserGlue).sanitize(window);"/>
<command id="Tools:PrivateBrowsing"
@@ -170,46 +155,6 @@
#endif
<broadcaster id="workOfflineMenuitemState"/>
-#ifdef MOZ_DEVTOOLS
- <!-- DevTools broadcasters -->
- <broadcaster id="devtoolsMenuBroadcaster_DevToolbox"
- label="&devToolboxMenuItem.label;"
- type="checkbox" autocheck="false"
- command="Tools:DevToolbox"
- key="key_devToolbox"/>
- <broadcaster id="devtoolsMenuBroadcaster_DevToolbar"
- label="&devToolbarMenu.label;"
- type="checkbox" autocheck="false"
- command="Tools:DevToolbar"
- key="key_devToolbar"/>
- <broadcaster id="devtoolsMenuBroadcaster_DevAppMgr"
- label="&devAppMgrMenu.label;"
- command="Tools:DevAppMgr"/>
- <broadcaster id="devtoolsMenuBroadcaster_webide"
- label="&webide.label;"
- command="Tools:WebIDE"
- key="key_webide"/>
- <broadcaster id="devtoolsMenuBroadcaster_ChromeDebugger"
- label="&chromeDebuggerMenu.label;"
- command="Tools:ChromeDebugger"/>
- <broadcaster id="devtoolsMenuBroadcaster_BrowserConsole"
- label="&browserConsoleCmd.label;"
- key="key_browserConsole"
- command="Tools:BrowserConsole"/>
- <broadcaster id="devtoolsMenuBroadcaster_Scratchpad"
- label="&scratchpad.label;"
- command="Tools:Scratchpad"
- key="key_scratchpad"/>
- <broadcaster id="devtoolsMenuBroadcaster_ResponsiveUI"
- label="&responsiveDesignTool.label;"
- type="checkbox" autocheck="false"
- command="Tools:ResponsiveUI"
- key="key_responsiveUI"/>
- <broadcaster id="devtoolsMenuBroadcaster_Eyedropper"
- label="&eyedropper.label;"
- type="checkbox" autocheck="false"
- command="Tools:Eyedropper"/>
-#endif
<broadcaster id="devtoolsMenuBroadcaster_PageSource"
label="&pageSourceCmd.label;"
key="key_viewSource"
@@ -217,14 +162,6 @@
<broadcaster id="devtoolsMenuBroadcaster_ErrorConsole"
label="&errorConsoleCmd.label;"
command="Tools:ErrorConsole"/>
- <broadcaster id="devtoolsMenuBroadcaster_GetMoreTools"
- label="&getMoreDevtoolsCmd.label;"
- oncommand="openUILinkIn(gPrefService.getCharPref('browser.getdevtools.url'), 'tab');"/>
-#ifdef MOZ_DEVTOOLS
- <broadcaster id="devtoolsMenuBroadcaster_connect"
- label="&devtoolsConnect.label;"
- command="Tools:DevToolsConnect"/>
-#endif
</broadcasterset>
<keyset id="mainKeyset">
@@ -271,21 +208,6 @@
<key id="key_openDownloads" key="&downloads.commandkey;" command="Tools:Downloads" modifiers="accel"/>
#endif
<key id="key_openAddons" key="&addons.commandkey;" command="Tools:Addons" modifiers="accel,shift"/>
-#ifdef MOZ_DEVTOOLS
- <key id="key_browserConsole" key="&browserConsoleCmd.commandkey;" command="Tools:BrowserConsole" modifiers="accel,shift"/>
- <key id="key_devToolbox" keycode="VK_F12" keytext="F12" command="Tools:DevToolbox"/>
- <key id="key_devToolbar" keycode="&devToolbar.keycode;" modifiers="shift"
- keytext="&devToolbar.keytext;" command="Tools:DevToolbarFocus"/>
- <key id="key_responsiveUI" key="&responsiveDesignTool.commandkey;" command="Tools:ResponsiveUI"
-#ifdef XP_MACOSX
- modifiers="accel,alt"
-#else
- modifiers="accel,shift"
-#endif
- />
- <key id="key_scratchpad" keycode="&scratchpad.keycode;" modifiers="shift"
- keytext="&scratchpad.keytext;" command="Tools:Scratchpad"/>
-#endif
<key id="openFileKb" key="&openFileCmd.commandkey;" command="Browser:OpenFile" modifiers="accel"/>
<key id="key_savePage" key="&savePageCmd.commandkey;" command="Browser:SavePage" modifiers="accel"/>
<key id="printKb" key="&printCmd.commandkey;" command="cmd_print" modifiers="accel"/>
diff --git a/application/palemoon/base/content/browser-syncui.js b/application/palemoon/base/content/browser-syncui.js
index fc8c7f016..67056e221 100644
--- a/application/palemoon/base/content/browser-syncui.js
+++ b/application/palemoon/base/content/browser-syncui.js
@@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
// gSyncUI handles updating the tools menu
-let gSyncUI = {
+var gSyncUI = {
_obs: ["weave:service:sync:start",
"weave:service:sync:delayed",
"weave:service:quota:remaining",
diff --git a/application/palemoon/base/content/browser-thumbnails.js b/application/palemoon/base/content/browser-thumbnails.js
index dbe33e3ed..079b0ac1b 100644
--- a/application/palemoon/base/content/browser-thumbnails.js
+++ b/application/palemoon/base/content/browser-thumbnails.js
@@ -7,7 +7,7 @@
/**
* Keeps thumbnails of open web pages up-to-date.
*/
-let gBrowserThumbnails = {
+var gBrowserThumbnails = {
/**
* Pref that controls whether we can store SSL content on disk
*/
@@ -92,7 +92,12 @@ let gBrowserThumbnails = {
filterForThumbnailExpiration:
function Thumbnails_filterForThumbnailExpiration(aCallback) {
- aCallback([browser.currentURI.spec for (browser of gBrowser.browsers)]);
+ // Tycho: aCallback([browser.currentURI.spec for (browser of gBrowser.browsers)]);
+ let result = [];
+ for (let browser of gBrowser.browsers) {
+ result.push(browser.currentURI.spec);
+ }
+ aCallback(result);
},
/**
@@ -137,7 +142,7 @@ let gBrowserThumbnails = {
// FIXME Bug 720575 - Don't capture thumbnails for SVG or XML documents as
// that currently regresses Talos SVG tests.
- if (doc instanceof SVGDocument || doc instanceof XMLDocument)
+ if (doc instanceof XMLDocument)
return false;
// There's no point in taking screenshot of loading pages.
diff --git a/application/palemoon/base/content/browser-uacompat.js b/application/palemoon/base/content/browser-uacompat.js
new file mode 100644
index 000000000..933aa55d1
--- /dev/null
+++ b/application/palemoon/base/content/browser-uacompat.js
@@ -0,0 +1,45 @@
+/* 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 UserAgentCompatibility = {
+ PREF_UA_COMPAT: "general.useragent.compatMode",
+ PREF_UA_COMPAT_GECKO: "general.useragent.compatMode.gecko",
+ PREF_UA_COMPAT_FIREFOX: "general.useragent.compatMode.firefox",
+
+ init: function() {
+ this.checkPreferences();
+ Services.prefs.addObserver(this.PREF_UA_COMPAT, this, false);
+ Services.prefs.addObserver(this.PREF_UA_COMPAT_GECKO, this, false);
+ Services.prefs.addObserver(this.PREF_UA_COMPAT_FIREFOX, this, false);
+ },
+
+ uninit: function() {
+ Services.prefs.removeObserver(this.PREF_UA_COMPAT, this, false);
+ Services.prefs.removeObserver(this.PREF_UA_COMPAT_GECKO, this, false);
+ Services.prefs.removeObserver(this.PREF_UA_COMPAT_FIREFOX, this, false);
+ },
+
+ observe: function() {
+ this.checkPreferences();
+ },
+
+ checkPreferences: function() {
+ var compatMode = Services.prefs.getIntPref(this.PREF_UA_COMPAT);
+
+ switch(compatMode) {
+ case 0:
+ Services.prefs.setBoolPref(this.PREF_UA_COMPAT_GECKO, false);
+ Services.prefs.setBoolPref(this.PREF_UA_COMPAT_FIREFOX, false);
+ break;
+ case 1:
+ Services.prefs.setBoolPref(this.PREF_UA_COMPAT_GECKO, true);
+ Services.prefs.setBoolPref(this.PREF_UA_COMPAT_FIREFOX, false);
+ break;
+ case 2:
+ Services.prefs.setBoolPref(this.PREF_UA_COMPAT_GECKO, true);
+ Services.prefs.setBoolPref(this.PREF_UA_COMPAT_FIREFOX, true);
+ break;
+ }
+ }
+};
diff --git a/application/palemoon/base/content/browser-webrtcUI.js b/application/palemoon/base/content/browser-webrtcUI.js
index a6c9008ca..d59134ce5 100644
--- a/application/palemoon/base/content/browser-webrtcUI.js
+++ b/application/palemoon/base/content/browser-webrtcUI.js
@@ -3,7 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-let WebrtcIndicator = {
+var WebrtcIndicator = {
init: function () {
let temp = {};
Cu.import("resource:///modules/webrtcUI.jsm", temp);
diff --git a/application/palemoon/base/content/browser.css b/application/palemoon/base/content/browser.css
index 2c8ba3e69..658655970 100644
--- a/application/palemoon/base/content/browser.css
+++ b/application/palemoon/base/content/browser.css
@@ -115,8 +115,17 @@ toolbar[printpreview="true"] {
#titlebar {
-moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
+ -moz-window-dragging: drag;
}
+%ifdef XP_WIN
+#main-window[tabsontop="true"] #TabsToolbar,
+#main-window[tabsontop="true"] #toolbar-menubar,
+#main-window[tabsontop="true"] #navigator-toolbox > toolbar:-moz-lwtheme {
+ -moz-window-dragging: drag;
+}
+%endif
+
#titlebar-spacer {
pointer-events: none;
}
@@ -271,6 +280,10 @@ panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .a
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#urlbar-rich-result-popup");
}
+#DateTimePickerPanel[active="true"] {
+ -moz-binding: url("chrome://global/content/bindings/datetimepopup.xml#datetime-popup");
+}
+
/* Pale Moon: Address bar: Feeds */
#ub-feed-button > .button-box > .box-inherit > .button-text,
#ub-feed-button > .button-box > .button-menu-dropmarker {
@@ -315,6 +328,66 @@ panel[noactions] > richlistbox > richlistitem[type~="action"] > .ac-url-box > .a
visibility: hidden;
}
+/* Private Autocomplete */
+textbox[type="private-autocomplete"] {
+ -moz-binding: url("chrome://browser/content/autocomplete.xml#autocomplete");
+}
+
+panel[type="private-autocomplete"] {
+ -moz-binding: url("chrome://browser/content/autocomplete.xml#autocomplete-result-popup");
+}
+
+panel[type="private-autocomplete-richlistbox"] {
+ -moz-binding: url("chrome://browser/content/autocomplete.xml#private-autocomplete-rich-result-popup");
+}
+
+.private-autocomplete-tree {
+ -moz-binding: url("chrome://browser/content/autocomplete.xml#private-autocomplete-tree");
+ -moz-user-focus: ignore;
+}
+
+.private-autocomplete-treebody {
+ -moz-binding: url("chrome://browser/content/autocomplete.xml#private-autocomplete-treebody");
+}
+
+.private-autocomplete-richlistbox {
+ -moz-binding: url("chrome://browser/content/autocomplete.xml#private-autocomplete-richlistbox");
+ -moz-user-focus: ignore;
+}
+
+.private-autocomplete-richlistbox > scrollbox {
+ overflow-x: hidden !important;
+}
+
+.private-autocomplete-richlistitem {
+ -moz-binding: url("chrome://browser/content/autocomplete.xml#private-autocomplete-richlistitem");
+ -moz-box-orient: vertical;
+ overflow: -moz-hidden-unscrollable;
+}
+
+.private-autocomplete-treerows {
+ -moz-binding: url("chrome://browser/content/autocomplete.xml#private-autocomplete-treerows");
+}
+
+.private-autocomplete-history-dropmarker {
+ display: none;
+}
+
+.private-autocomplete-history-dropmarker[enablehistory="true"] {
+ display: -moz-box;
+ -moz-binding: url("chrome://browser/content/autocomplete.xml#private-history-dropmarker");
+}
+
+.ac-ellipsis-after {
+ visibility: hidden;
+}
+
+.ac-url-text[type~="action"],
+.ac-action-text:not([type~="action"]) {
+ visibility: collapse;
+}
+
+
/* ::::: Unified Back-/Forward Button ::::: */
#back-button > .toolbarbutton-menu-dropmarker,
#forward-button > .toolbarbutton-menu-dropmarker {
@@ -533,11 +606,11 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(#nav-bar):not(
max-width: 280px;
}
-.form-validation-anchor {
+.popup-anchor {
/* should occupy space but not be visible */
opacity: 0;
- visibility: hidden;
pointer-events: none;
+ -moz-stack-sizing: ignore;
}
#addon-progress-notification {
@@ -618,10 +691,6 @@ statuspanel[inactive][previoustype=overLink] {
-moz-box-align: end;
}
-.panel-inner-arrowcontentfooter[footertype="promobox"] {
- -moz-binding: url("chrome://browser/content/urlbarBindings.xml#promobox");
-}
-
/* highlighter */
%include highlighter.css
@@ -681,7 +750,7 @@ toolbarbutton[type="badged"] {
}
/* Strict icon size for PMkit 'ui/button' */
-toolbarbutton[pmkit-button="true"] > .toolbarbutton-badge-container > .toolbarbutton-icon {
+toolbarbutton[pmkit-button="true"] > .toolbarbutton-badge-stack > .toolbarbutton-icon {
width: 16px;
height: 16px;
}
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index 34b91b6cb..c9f0aa4aa 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -3,10 +3,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/.
-let Ci = Components.interfaces;
-let Cu = Components.utils;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource:///modules/RecentWindow.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
@@ -65,6 +66,9 @@ XPCOMUtils.defineLazyGetter(window, "gFindBar", function() {
return findbar;
});
+XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
+ "resource://gre/modules/BrowserUtils.jsm");
+
XPCOMUtils.defineLazyGetter(this, "gPrefService", function() {
return Services.prefs;
});
@@ -109,20 +113,6 @@ XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () {
}
});
-#ifdef MOZ_DEVTOOLS
-XPCOMUtils.defineLazyGetter(this, "DeveloperToolbar", function() {
- let tmp = {};
- Cu.import("resource://gre/modules/devtools/DeveloperToolbar.jsm", tmp);
- return new tmp.DeveloperToolbar(window, document.getElementById("developer-toolbar"));
-});
-
-XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() {
- let tmp = {};
- Cu.import("resource://gre/modules/devtools/ToolboxProcess.jsm", tmp);
- return tmp.BrowserToolboxProcess;
-});
-#endif
-
XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
"resource://gre/modules/PageThumbs.jsm");
@@ -152,7 +142,12 @@ let gInitialPages = [
#include browser-plugins.js
#include browser-tabPreviews.js
#include browser-thumbnails.js
+#include browser-uacompat.js
+
+#ifdef MOZ_WEBRTC
#include browser-webrtcUI.js
+#endif
+
#include browser-gestureSupport.js
#ifdef MOZ_SERVICES_SYNC
@@ -336,6 +331,48 @@ const gSessionHistoryObserver = {
}
};
+var gURLBarSettings = {
+ prefSuggest: "browser.urlbar.suggest.",
+ /*
+ For searching in the source code:
+ browser.urlbar.suggest.bookmark
+ browser.urlbar.suggest.history
+ browser.urlbar.suggest.openpage
+ */
+ prefSuggests: [
+ "bookmark",
+ "history",
+ "openpage"
+ ],
+ prefKeyword: "keyword.enabled",
+
+ observe: function(aSubject, aTopic, aData) {
+ if (aTopic != "nsPref:changed")
+ return;
+
+ this.writePlaceholder();
+ },
+
+ writePlaceholder: function() {
+ let attribute = "placeholder";
+ let prefs = this.prefSuggests.map(pref => {
+ return this.prefSuggest + pref;
+ });
+ prefs.push(this.prefKeyword);
+ let placeholderDefault = prefs.some(pref => {
+ return gPrefService.getBoolPref(pref);
+ });
+
+ if (placeholderDefault) {
+ gURLBar.setAttribute(
+ attribute, gNavigatorBundle.getString("urlbar.placeholder"));
+ } else {
+ gURLBar.setAttribute(
+ attribute, gNavigatorBundle.getString("urlbar.placeholderURLOnly"));
+ }
+ }
+};
+
/**
* Given a starting docshell and a URI to look up, find the docshell the URI
* is loaded in.
@@ -663,6 +700,8 @@ const gXSSObserver = {
};
var gBrowserInit = {
+ delayedStartupFinished: false,
+
onLoad: function() {
gMultiProcessBrowser = gPrefService.getBoolPref("browser.tabs.remote");
@@ -685,6 +724,14 @@ var gBrowserInit = {
window.addEventListener("AppCommand", HandleAppCommandEvent, true);
+ // These routines add message listeners. They must run before
+ // loading the frame script to ensure that we don't miss any
+ // message sent between when the frame script is loaded and when
+ // the listener is registered.
+#ifdef MOZ_DEVTOOLS
+ DevToolsTheme.init();
+#endif
+
messageManager.loadFrameScript("chrome://browser/content/content.js", true);
messageManager.loadFrameScript("chrome://browser/content/content-sessionStore.js", true);
@@ -872,6 +919,7 @@ var gBrowserInit = {
TabsInTitlebar.init();
retrieveToolbarIconsizesFromTheme();
ToolbarIconColor.init();
+ UserAgentCompatibility.init();
#ifdef XP_WIN
if (window.matchMedia("(-moz-os-version: windows-win8)").matches &&
@@ -968,11 +1016,18 @@ var gBrowserInit = {
Services.obs.addObserver(gXPInstallObserver, "addon-install-complete", false);
Services.obs.addObserver(gXSSObserver, "xss-on-violate-policy", false);
+ gPrefService.addObserver(gURLBarSettings.prefSuggest, gURLBarSettings, false);
+ gPrefService.addObserver(gURLBarSettings.prefKeyword, gURLBarSettings, false);
+
+ gURLBarSettings.writePlaceholder();
+
BrowserOffline.init();
OfflineApps.init();
IndexedDBPromptHelper.init();
AddonManager.addAddonListener(AddonsMgrListener);
+#ifdef MOZ_WEBRTC
WebrtcIndicator.init();
+#endif
// Ensure login manager is up and running.
Services.logins;
@@ -1114,27 +1169,6 @@ var gBrowserInit = {
setUrlAndSearchBarWidthForConditionalForwardButton();
});
-#ifdef MOZ_DEVTOOLS
- // Enable Chrome Debugger?
- let chromeEnabled = gPrefService.getBoolPref("devtools.chrome.enabled");
- let remoteEnabled = chromeEnabled &&
- gPrefService.getBoolPref("devtools.debugger.chrome-enabled") &&
- gPrefService.getBoolPref("devtools.debugger.remote-enabled");
- if (remoteEnabled) {
- let cmd = document.getElementById("Tools:ChromeDebugger");
- cmd.removeAttribute("disabled");
- cmd.removeAttribute("hidden");
- }
-
- // Enable Scratchpad in the UI, if the preference allows this.
- let scratchpadEnabled = gPrefService.getBoolPref(Scratchpad.prefEnabledName);
- if (scratchpadEnabled) {
- let cmd = document.getElementById("Tools:Scratchpad");
- cmd.removeAttribute("disabled");
- cmd.removeAttribute("hidden");
- }
-#endif
-
// Enable Error Console?
let consoleEnabled = gPrefService.getBoolPref("devtools.errorconsole.enabled");
if (consoleEnabled) {
@@ -1152,19 +1186,6 @@ var gBrowserInit = {
document.getElementById("appmenu_charsetMenu").hidden = true;
#endif
-#ifdef MOZ_DEVTOOLS
- // Enable Responsive UI?
- let responsiveUIEnabled = gPrefService.getBoolPref("devtools.responsiveUI.enabled");
- if (responsiveUIEnabled) {
- let cmd = document.getElementById("Tools:ResponsiveUI");
- cmd.removeAttribute("disabled");
- cmd.removeAttribute("hidden");
- }
-
- // Add Devtools menuitems and listeners
- gDevToolsBrowser.registerBrowserWindow(window);
-#endif
-
let appMenuButton = document.getElementById("appmenu-button");
let appMenuPopup = document.getElementById("appmenu-popup");
if (appMenuButton && appMenuPopup) {
@@ -1205,6 +1226,8 @@ var gBrowserInit = {
setTimeout(function () { BrowserChromeTest.markAsReady(); }, 0);
});
+ this.delayedStartupFinished = true;
+
Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
},
@@ -1240,15 +1263,6 @@ var gBrowserInit = {
if (!this._loadHandled)
return;
-#ifdef MOZ_DEVTOOLS
- gDevToolsBrowser.forgetBrowserWindow(window);
-
- let desc = Object.getOwnPropertyDescriptor(window, "DeveloperToolbar");
- if (desc && !desc.get) {
- DeveloperToolbar.destroy();
- }
-#endif
-
// First clean up services initialized in gBrowserInit.onLoad (or those whose
// uninit methods don't depend on the services having been initialized).
@@ -1278,6 +1292,12 @@ var gBrowserInit = {
ToolbarIconColor.uninit();
+#ifdef MOZ_DEVTOOLS
+ DevToolsTheme.uninit();
+#endif
+
+ UserAgentCompatibility.uninit();
+
var enumerator = Services.wm.getEnumerator(null);
enumerator.getNext();
if (!enumerator.hasMoreElements()) {
@@ -1314,6 +1334,13 @@ var gBrowserInit = {
Services.obs.removeObserver(gXSSObserver, "xss-on-violate-policy");
try {
+ gPrefService.removeObserver(gURLBarSettings.prefSuggest, gURLBarSettings);
+ gPrefService.removeObserver(gURLBarSettings.prefKeyword, gURLBarSettings);
+ } catch (ex) {
+ Cu.reportError(ex);
+ }
+
+ try {
gPrefService.removeObserver(gHomeButton.prefDomain, gHomeButton);
} catch (ex) {
Cu.reportError(ex);
@@ -2010,49 +2037,43 @@ function readFromClipboard()
return url;
}
-function BrowserViewSourceOfDocument(aDocument)
+function BrowserViewSourceOfDocument(aArgsOrDocument)
{
- var pageCookie;
- var webNav;
-
- // Get the document charset
- var docCharset = "charset=" + aDocument.characterSet;
-
- // Get the nsIWebNavigation associated with the document
- try {
- var win;
- var ifRequestor;
-
- // Get the DOMWindow for the requested document. If the DOMWindow
- // cannot be found, then just use the content window...
- //
- // XXX: This is a bit of a hack...
- win = aDocument.defaultView;
- if (win == window) {
- win = content;
- }
- ifRequestor = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
-
- webNav = ifRequestor.getInterface(nsIWebNavigation);
- } catch(err) {
- // If nsIWebNavigation cannot be found, just get the one for the whole
- // window...
- webNav = gBrowser.webNavigation;
+ let args;
+
+ if (aArgsOrDocument instanceof Document) {
+ let doc = aArgsOrDocument;
+
+ let requestor = doc.defaultView
+ .QueryInterface(Ci.nsIInterfaceRequestor);
+ let browser = requestor.getInterface(Ci.nsIWebNavigation)
+ .QueryInterface(Ci.nsIDocShell)
+ .chromeEventHandler;
+ let outerWindowID = requestor.getInterface(Ci.nsIDOMWindowUtils)
+ .outerWindowID;
+ let URL = browser.currentURI.spec;
+ args = { browser, outerWindowID, URL };
+ } else {
+ args = aArgsOrDocument;
}
- //
- // Get the 'PageDescriptor' for the current document. This allows the
- // view-source to access the cached copy of the content rather than
- // refetching it from the network...
- //
- try{
- var PageLoader = webNav.QueryInterface(Components.interfaces.nsIWebPageDescriptor);
- pageCookie = PageLoader.currentDescriptor;
- } catch(err) {
- // If no page descriptor is available, just use the view-source URL...
+ let viewInternal = () => {
+ top.gViewSourceUtils.viewSource(args);
}
- top.gViewSourceUtils.viewSource(webNav.currentURI.spec, pageCookie, aDocument);
+ // Check if external view source is enabled. If so, try it. If it fails,
+ // fallback to internal view source.
+ if (Services.prefs.getBoolPref("view_source.editor.external")) {
+ top.gViewSourceUtils
+ .openInExternalEditor(args, null, null, null, result => {
+ if (!result) {
+ viewInternal();
+ }
+ });
+ } else {
+ // Display using internal view source
+ viewInternal();
+ }
}
// doc - document to use for source, or null for this window's document
@@ -2313,7 +2334,7 @@ function BrowserOnAboutPageLoad(doc) {
/**
* Handle command events bubbling up from error page content
*/
-let BrowserOnClick = {
+var BrowserOnClick = {
handleEvent: function BrowserOnClick_handleEvent(aEvent) {
if (!aEvent.isTrusted || // Don't trust synthetic events
aEvent.button == 2 || aEvent.target.localName != "button") {
@@ -2833,7 +2854,7 @@ const DOMLinkHandler = {
break;
let tab = gBrowser.tabs[browserIndex];
- gBrowser.setIcon(tab, uri.spec);
+ gBrowser.setIcon(tab, uri.spec, link.ownerDocument.nodePrincipal);
iconAdded = true;
}
break;
@@ -3425,26 +3446,6 @@ function updateCharacterEncodingMenuState()
}
}
-/**
- * Returns true if |aMimeType| is text-based, false otherwise.
- *
- * @param aMimeType
- * The MIME type to check.
- *
- * If adding types to this function, please also check the similar
- * function in findbar.xml
- */
-function mimeTypeIsTextBased(aMimeType)
-{
- return aMimeType.startsWith("text/") ||
- aMimeType.endsWith("+xml") ||
- aMimeType == "application/x-javascript" ||
- aMimeType == "application/javascript" ||
- aMimeType == "application/json" ||
- aMimeType == "application/xml" ||
- aMimeType == "mozilla.application/cached-xul";
-}
-
var XULBrowserWindow = {
// Stored Status, Link and Loading values
status: "",
@@ -3668,7 +3669,7 @@ var XULBrowserWindow = {
this.setDefaultStatus(msg);
// Disable menu entries for images, enable otherwise
- if (!gMultiProcessBrowser && content.document && mimeTypeIsTextBased(content.document.contentType))
+ if (!gMultiProcessBrowser && content.document && BrowserUtils.mimeTypeIsTextBased(content.document.contentType))
this.isImage.removeAttribute('disabled');
else
this.isImage.setAttribute('disabled', 'true');
@@ -3716,7 +3717,7 @@ var XULBrowserWindow = {
}
// Disable menu entries for images, enable otherwise
- if (!gMultiProcessBrowser && content.document && mimeTypeIsTextBased(content.document.contentType))
+ if (!gMultiProcessBrowser && content.document && BrowserUtils.mimeTypeIsTextBased(content.document.contentType))
this.isImage.removeAttribute('disabled');
else
this.isImage.setAttribute('disabled', 'true');
@@ -3814,11 +3815,16 @@ var XULBrowserWindow = {
gFindBar.close();
}
+ // XXX
+ // See: https://github.com/MoonchildProductions/Pale-Moon/issues/364
+ // An actual preference: findbar.highlightAll
+ /*
if (!(gPrefService.getBoolPref("accessibility.typeaheadfind.highlightallremember") ||
gPrefService.getBoolPref("accessibility.typeaheadfind.highlightallbydefault"))) {
// fix bug 253793 - turn off highlight when page changes
gFindBar.getElement("highlight").checked = false;
}
+ */
}
}
UpdateBackForwardCommands(gBrowser.webNavigation);
@@ -6825,20 +6831,9 @@ var TabContextMenu = {
};
#ifdef MOZ_DEVTOOLS
+// Note: Do not delete! It is used for: base/content/nsContextMenu.js
XPCOMUtils.defineLazyModuleGetter(this, "gDevTools",
- "resource://gre/modules/devtools/gDevTools.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "gDevToolsBrowser",
- "resource://gre/modules/devtools/gDevTools.jsm");
-
-Object.defineProperty(this, "HUDService", {
- get: function HUDService_getter() {
- let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
- return devtools.require("devtools/webconsole/hudservice").HUDService;
- },
- configurable: true,
- enumerable: true
-});
+ "resource://devtools/client/framework/gDevTools.jsm");
#endif
// Prompt user to restart the browser in safe mode or normally
@@ -6929,49 +6924,6 @@ function toggleAddonBar() {
setToolbarVisibility(addonBar, addonBar.collapsed);
}
-#ifdef MOZ_DEVTOOLS
-var Scratchpad = {
- prefEnabledName: "devtools.scratchpad.enabled",
-
- openScratchpad: function SP_openScratchpad() {
- return this.ScratchpadManager.openScratchpad();
- }
-};
-
-XPCOMUtils.defineLazyGetter(Scratchpad, "ScratchpadManager", function() {
- let tmp = {};
- Cu.import("resource://gre/modules/devtools/scratchpad-manager.jsm", tmp);
- return tmp.ScratchpadManager;
-});
-
-var ResponsiveUI = {
- toggle: function RUI_toggle() {
- this.ResponsiveUIManager.toggle(window, gBrowser.selectedTab);
- }
-};
-
-XPCOMUtils.defineLazyGetter(ResponsiveUI, "ResponsiveUIManager", function() {
- let tmp = {};
- Cu.import("resource://gre/modules/devtools/responsivedesign.jsm", tmp);
- return tmp.ResponsiveUIManager;
-});
-
-function openEyedropper() {
- var eyedropper = new this.Eyedropper(this, { context: "menu",
- copyOnSelect: true });
- eyedropper.open();
-}
-
-Object.defineProperty(this, "Eyedropper", {
- get: function() {
- let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
- return devtools.require("devtools/eyedropper/eyedropper").Eyedropper;
- },
- configurable: true,
- enumerable: true
-});
-#endif
-
XPCOMUtils.defineLazyGetter(window, "gShowPageResizers", function () {
#ifdef XP_WIN
// Only show resizers on Windows 2000 and XP
@@ -7051,7 +7003,8 @@ function focusNextFrame(event) {
if (element.ownerDocument == document)
focusAndSelectUrlBar();
}
-let BrowserChromeTest = {
+
+var BrowserChromeTest = {
_cb: null,
_ready: false,
markAsReady: function () {
@@ -7069,7 +7022,7 @@ let BrowserChromeTest = {
}
};
-let ToolbarIconColor = {
+var ToolbarIconColor = {
init: function () {
this._initialized = true;
diff --git a/application/palemoon/base/content/browser.xul b/application/palemoon/base/content/browser.xul
index f83010023..c2553f295 100644
--- a/application/palemoon/base/content/browser.xul
+++ b/application/palemoon/base/content/browser.xul
@@ -13,7 +13,7 @@
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
#ifdef MOZ_DEVTOOLS
-<?xml-stylesheet href="chrome://global/skin/devtools/common.css" type="text/css"?>
+<?xml-stylesheet href="chrome://devtools/skin/devtools-browser.css" type="text/css"?>
#endif
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
@@ -65,6 +65,9 @@
# wishes to include *must* go into the global-scripts.inc file
# so that they can be shared by macBrowserOverlay.xul.
#include global-scripts.inc
+#ifdef MOZ_DEVTOOLS
+#include global-devtools-theme-scripts.inc
+#endif
<script type="application/javascript" src="chrome://browser/content/nsContextMenu.js"/>
<script type="application/javascript" src="chrome://global/content/contentAreaUtils.js"/>
@@ -125,9 +128,25 @@
<!-- for search and content formfill/pw manager -->
<panel type="autocomplete" id="PopupAutoComplete" noautofocus="true" hidden="true"/>
+ <panel type="private-autocomplete" id="PopupAutoComplete" noautofocus="true" hidden="true"/>
<!-- for url bar autocomplete -->
<panel type="autocomplete-richlistbox" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/>
+ <panel type="private-autocomplete-richlistbox" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/>
+
+ <!-- for date/time picker. consumeoutsideclicks is set to never, so that
+ clicks on the anchored input box are never consumed. -->
+ <panel id="DateTimePickerPanel"
+ type="arrow"
+ hidden="true"
+ orient="vertical"
+ noautofocus="true"
+ norolluponanchor="true"
+ consumeoutsideclicks="never"
+ level="parent"
+ tabspecific="true">
+ <iframe id="dateTimePopupFrame"/>
+ </panel>
<!-- for invalid form error message -->
<panel id="invalid-form-popup" type="arrow" orient="vertical" noautofocus="true" hidden="true" level="parent">
@@ -136,7 +155,6 @@
<panel id="editBookmarkPanel"
type="arrow"
- footertype="promobox"
orient="vertical"
ignorekeys="true"
consumeoutsideclicks="true"
@@ -410,8 +428,8 @@
<toolbaritem id="urlbar-container" align="center" flex="400" persist="width" combined="true"
title="&locationItem.title;" class="chromeclass-location" removable="true">
<textbox id="urlbar" flex="1"
- placeholder="&urlbar.placeholder2;"
- type="autocomplete"
+ placeholder=""
+ type="private-autocomplete"
autocompletesearch="urlinline history"
autocompletesearchparam="enable-actions"
autocompletepopup="PopupAutoCompleteRichResult"
@@ -440,8 +458,10 @@
<image id="alert-plugins-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="blocked-plugins-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="mixed-content-blocked-notification-icon" class="notification-anchor-icon" role="button"/>
+#ifdef MOZ_WEBRTC
<image id="webRTC-shareDevices-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="webRTC-sharingDevices-notification-icon" class="notification-anchor-icon" role="button"/>
+#endif
<image id="pointerLock-notification-icon" class="notification-anchor-icon" role="button"/>
<image id="servicesInstall-notification-icon" class="notification-anchor-icon" role="button"/>
</box>
@@ -513,7 +533,7 @@
flex="100" persist="width" removable="true">
<searchbar id="searchbar" flex="1"/>
</toolbaritem>
-
+#ifdef MOZ_WEBRTC
<toolbarbutton id="webrtc-status-button"
class="toolbarbutton-1 chromeclass-toolbar-additional"
type="menu"
@@ -525,7 +545,7 @@
onpopuphiding="WebrtcIndicator.clearPopup(this);"
oncommand="WebrtcIndicator.menuCommand(event.target);"/>
</toolbarbutton>
-
+#endif
<toolbarbutton id="bookmarks-menu-button"
class="toolbarbutton-1 chromeclass-toolbar-additional"
persist="class"
@@ -941,7 +961,8 @@
flex="1" contenttooltip="aHTMLTooltip"
tabcontainer="tabbrowser-tabs"
contentcontextmenu="contentAreaContextMenu"
- autocompletepopup="PopupAutoComplete"/>
+ autocompletepopup="PopupAutoComplete"
+ datetimepicker="DateTimePickerPanel"/>
<chatbar id="pinnedchats" layer="true" mousethrough="always" hidden="true"/>
<statuspanel id="statusbar-display" inactive="true"/>
</vbox>
@@ -971,33 +992,6 @@
<vbox id="browser-bottombox" layer="true">
<notificationbox id="global-notificationbox"/>
-#ifdef MOZ_DEVTOOLS
- <toolbar id="developer-toolbar"
- class="devtools-toolbar"
- hidden="true">
-#ifdef XP_MACOSX
- <toolbarbutton id="developer-toolbar-closebutton"
- class="devtools-closebutton"
- oncommand="DeveloperToolbar.hide();"
- tooltiptext="&devToolbarCloseButton.tooltiptext;"/>
-#endif
- <stack class="gclitoolbar-stack-node" flex="1">
- <textbox class="gclitoolbar-input-node" rows="1"/>
- <hbox class="gclitoolbar-complete-node"/>
- </stack>
- <toolbarbutton id="developer-toolbar-toolbox-button"
- class="developer-toolbar-button"
- observes="devtoolsMenuBroadcaster_DevToolbox"
- tooltiptext="&devToolbarToolsButton.tooltip;"/>
-#ifndef XP_MACOSX
- <toolbarbutton id="developer-toolbar-closebutton"
- class="devtools-closebutton"
- oncommand="DeveloperToolbar.hide();"
- tooltiptext="&devToolbarCloseButton.tooltiptext;"/>
-#endif
- </toolbar>
-#endif
-
<toolbar id="addon-bar"
toolbarname="&statusBar.label;" accesskey="&statusBar.accesskey;"
collapsed="true"
diff --git a/application/palemoon/base/content/content.js b/application/palemoon/base/content/content.js
index 19032eb84..653dac3e3 100644
--- a/application/palemoon/base/content/content.js
+++ b/application/palemoon/base/content/content.js
@@ -3,9 +3,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-let Cu = Components.utils;
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -13,6 +13,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
"resource://gre/modules/BrowserUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerContent",
"resource://gre/modules/LoginManagerContent.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "LoginFormFactory",
+ "resource://gre/modules/LoginManagerContent.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "InsecurePasswordUtils",
"resource://gre/modules/InsecurePasswordUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FormSubmitObserver",
@@ -47,8 +49,9 @@ addMessageListener("Browser:HideSessionRestoreButton", function (message) {
});
addEventListener("DOMFormHasPassword", function(event) {
- InsecurePasswordUtils.checkForInsecurePasswords(event.target);
- LoginManagerContent.onFormPassword(event);
+ LoginManagerContent.onDOMFormHasPassword(event, content);
+ let formLike = LoginFormFactory.createFromForm(event.target);
+ InsecurePasswordUtils.reportInsecurePasswords(formLike);
});
addEventListener("DOMAutoComplete", function(event) {
LoginManagerContent.onUsernameInput(event);
@@ -57,8 +60,120 @@ addEventListener("blur", function(event) {
LoginManagerContent.onUsernameInput(event);
});
+// Provide gContextMenuContentData for 'sdk/context-menu'
+var handleContentContextMenu = function (event) {
+ let defaultPrevented = event.defaultPrevented;
+ if (!Services.prefs.getBoolPref("dom.event.contextmenu.enabled")) {
+ let plugin = null;
+ try {
+ plugin = event.target.QueryInterface(Ci.nsIObjectLoadingContent);
+ } catch (e) {}
+ if (plugin && plugin.displayedType == Ci.nsIObjectLoadingContent.TYPE_PLUGIN) {
+ // Don't open a context menu for plugins.
+ return;
+ }
+
+ defaultPrevented = false;
+ }
+
+ if (defaultPrevented)
+ return;
+
+ let addonInfo = {};
+ let subject = {
+ event: event,
+ addonInfo: addonInfo,
+ };
+ subject.wrappedJSObject = subject;
+ Services.obs.notifyObservers(subject, "content-contextmenu", null);
+
+ let doc = event.target.ownerDocument;
+ let docLocation = doc.mozDocumentURIIfNotForErrorPages;
+ docLocation = docLocation && docLocation.spec;
+ let charSet = doc.characterSet;
+ let baseURI = doc.baseURI;
+ let referrer = doc.referrer;
+ let referrerPolicy = doc.referrerPolicy;
+ let frameOuterWindowID = doc.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIDOMWindowUtils)
+ .outerWindowID;
+ let loginFillInfo = LoginManagerContent.getFieldContext(event.target);
+
+ // The same-origin check will be done in nsContextMenu.openLinkInTab.
+ let parentAllowsMixedContent = !!docShell.mixedContentChannel;
+
+ // get referrer attribute from clicked link and parse it
+ // if per element referrer is enabled, the element referrer overrules
+ // the document wide referrer
+ if (Services.prefs.getBoolPref("network.http.enablePerElementReferrer")) {
+ let referrerAttrValue = Services.netUtils.parseAttributePolicyString(event.target.
+ getAttribute("referrerpolicy"));
+ if (referrerAttrValue !== Ci.nsIHttpChannel.REFERRER_POLICY_UNSET) {
+ referrerPolicy = referrerAttrValue;
+ }
+ }
+
+ // Media related cache info parent needs for saving
+ let contentType = null;
+ let contentDisposition = null;
+ if (event.target.nodeType == Ci.nsIDOMNode.ELEMENT_NODE &&
+ event.target instanceof Ci.nsIImageLoadingContent &&
+ event.target.currentURI) {
+
+ try {
+ let imageCache =
+ Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools)
+ .getImgCacheForDocument(doc);
+ let props =
+ imageCache.findEntryProperties(event.target.currentURI, doc);
+ try {
+ contentType = props.get("type", Ci.nsISupportsCString).data;
+ } catch (e) {}
+ try {
+ contentDisposition =
+ props.get("content-disposition", Ci.nsISupportsCString).data;
+ } catch (e) {}
+ } catch (e) {}
+ }
+
+ let selectionInfo = BrowserUtils.getSelectionDetails(content);
+
+ let loadContext = docShell.QueryInterface(Ci.nsILoadContext);
+ let userContextId = loadContext.originAttributes.userContextId;
+
+ let browser = docShell.chromeEventHandler;
+ let mainWin = browser.ownerGlobal;
+
+ mainWin.gContextMenuContentData = {
+ isRemote: false,
+ event: event,
+ popupNode: event.target,
+ browser: browser,
+ addonInfo: addonInfo,
+ documentURIObject: doc.documentURIObject,
+ docLocation: docLocation,
+ charSet: charSet,
+ referrer: referrer,
+ referrerPolicy: referrerPolicy,
+ contentType: contentType,
+ contentDisposition: contentDisposition,
+ selectionInfo: selectionInfo,
+ loginFillInfo,
+ parentAllowsMixedContent,
+ userContextId,
+ };
+}
+
+Cc["@mozilla.org/eventlistenerservice;1"]
+ .getService(Ci.nsIEventListenerService)
+ .addSystemEventListener(global, "contextmenu", handleContentContextMenu, false);
+
// Lazily load the finder code
addMessageListener("Finder:Initialize", function () {
let {RemoteFinderListener} = Cu.import("resource://gre/modules/RemoteFinder.jsm", {});
new RemoteFinderListener(global);
-}); \ No newline at end of file
+});
+
+addEventListener("DOMWebNotificationClicked", function(event) {
+ sendAsyncMessage("DOMWebNotificationClicked", {});
+}, false);
diff --git a/application/palemoon/components/migration/jar.mn b/application/palemoon/base/content/global-devtools-theme-scripts.inc
index b369ee1dc..408728ed5 100644
--- a/application/palemoon/components/migration/jar.mn
+++ b/application/palemoon/base/content/global-devtools-theme-scripts.inc
@@ -1,7 +1,6 @@
+# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 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/.
-browser.jar:
-* content/browser/migration/migration.xul (content/migration.xul)
- content/browser/migration/migration.js (content/migration.js)
+<script type="application/javascript" src="chrome://browser/content/browser-devtools-theme.js"/>
diff --git a/application/palemoon/base/content/macBrowserOverlay.xul b/application/palemoon/base/content/macBrowserOverlay.xul
index a4d583e16..b1ae838d0 100644
--- a/application/palemoon/base/content/macBrowserOverlay.xul
+++ b/application/palemoon/base/content/macBrowserOverlay.xul
@@ -24,6 +24,9 @@
# wishes to include *must* go into the global-scripts.inc file
# so that they can be shared by this overlay.
#include global-scripts.inc
+#ifdef MOZ_DEVTOOLS
+#include global-devtools-theme-scripts.inc
+#endif
<script type="application/javascript">
function OpenBrowserWindowFromDockMenu(options) {
diff --git a/application/palemoon/base/content/newtab/drag.js b/application/palemoon/base/content/newtab/drag.js
index 8f0bf674e..fbd688faa 100644
--- a/application/palemoon/base/content/newtab/drag.js
+++ b/application/palemoon/base/content/newtab/drag.js
@@ -7,7 +7,7 @@
/**
* This singleton implements site dragging functionality.
*/
-let gDrag = {
+var gDrag = {
/**
* The site offset to the drag start point.
*/
diff --git a/application/palemoon/base/content/newtab/dragDataHelper.js b/application/palemoon/base/content/newtab/dragDataHelper.js
index a66e4e87e..54348ab14 100644
--- a/application/palemoon/base/content/newtab/dragDataHelper.js
+++ b/application/palemoon/base/content/newtab/dragDataHelper.js
@@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#endif
-let gDragDataHelper = {
+var gDragDataHelper = {
get mimeType() {
return "text/x-moz-url";
},
diff --git a/application/palemoon/base/content/newtab/drop.js b/application/palemoon/base/content/newtab/drop.js
index d7bf30506..748652455 100644
--- a/application/palemoon/base/content/newtab/drop.js
+++ b/application/palemoon/base/content/newtab/drop.js
@@ -11,7 +11,7 @@ const DELAY_REARRANGE_MS = 100;
/**
* This singleton implements site dropping functionality.
*/
-let gDrop = {
+var gDrop = {
/**
* The last drop target.
*/
diff --git a/application/palemoon/base/content/newtab/dropPreview.js b/application/palemoon/base/content/newtab/dropPreview.js
index 903762345..fd7587a35 100644
--- a/application/palemoon/base/content/newtab/dropPreview.js
+++ b/application/palemoon/base/content/newtab/dropPreview.js
@@ -9,7 +9,7 @@
* indicate the transformation that results from dropping a cell at a certain
* position.
*/
-let gDropPreview = {
+var gDropPreview = {
/**
* Rearranges the sites currently contained in the grid when a site would be
* dropped onto the given cell.
diff --git a/application/palemoon/base/content/newtab/dropTargetShim.js b/application/palemoon/base/content/newtab/dropTargetShim.js
index a85a6ccd6..046dbea1e 100644
--- a/application/palemoon/base/content/newtab/dropTargetShim.js
+++ b/application/palemoon/base/content/newtab/dropTargetShim.js
@@ -9,7 +9,7 @@
* the default DnD target detection relies on the cursor's position. We want
* to pick a drop target based on the dragged site's position.
*/
-let gDropTargetShim = {
+var gDropTargetShim = {
/**
* Cache for the position of all cells, cleaned after drag finished.
*/
diff --git a/application/palemoon/base/content/newtab/grid.js b/application/palemoon/base/content/newtab/grid.js
index 37559a063..46e0b804b 100644
--- a/application/palemoon/base/content/newtab/grid.js
+++ b/application/palemoon/base/content/newtab/grid.js
@@ -7,7 +7,7 @@
/**
* This singleton represents the grid that contains all sites.
*/
-let gGrid = {
+var gGrid = {
/**
* The DOM node of the grid.
*/
@@ -109,7 +109,12 @@ let gGrid = {
// (Re-)initialize all cells.
let cellElements = this.node.querySelectorAll(".newtab-cell");
- this._cells = [new Cell(this, cell) for (cell of cellElements)];
+ // Tycho: this._cells = [new Cell(this, cell) for (cell of cellElements)];
+ this.cells = [];
+
+ for (let cellItem of cellElements) {
+ this.cells.push(new Cell(this, cellItem));
+ }
},
/**
diff --git a/application/palemoon/base/content/newtab/newTab.js b/application/palemoon/base/content/newtab/newTab.js
index 77c929125..bba73fd7a 100644
--- a/application/palemoon/base/content/newtab/newTab.js
+++ b/application/palemoon/base/content/newtab/newTab.js
@@ -4,8 +4,8 @@
"use strict";
-let Cu = Components.utils;
-let Ci = Components.interfaces;
+var Cu = Components.utils;
+var Ci = Components.interfaces;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@@ -18,7 +18,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Rect",
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
-let {
+var {
links: gLinks,
allPages: gAllPages,
linkChecker: gLinkChecker,
diff --git a/application/palemoon/base/content/newtab/page.js b/application/palemoon/base/content/newtab/page.js
index afe5bfba8..fc836a55e 100644
--- a/application/palemoon/base/content/newtab/page.js
+++ b/application/palemoon/base/content/newtab/page.js
@@ -8,7 +8,7 @@
* This singleton represents the whole 'New Tab Page' and takes care of
* initializing all its components.
*/
-let gPage = {
+var gPage = {
/**
* Initializes the page.
*/
diff --git a/application/palemoon/base/content/newtab/transformations.js b/application/palemoon/base/content/newtab/transformations.js
index 6d1554f5f..0711d7d0a 100644
--- a/application/palemoon/base/content/newtab/transformations.js
+++ b/application/palemoon/base/content/newtab/transformations.js
@@ -9,7 +9,7 @@
* in the DOM and by showing or hiding the node. It additionally provides
* convenience methods to work with a site's DOM node.
*/
-let gTransformation = {
+var gTransformation = {
/**
* Returns the width of the left and top border of a cell. We need to take it
* into account when measuring and comparing site and cell positions.
diff --git a/application/palemoon/base/content/newtab/undo.js b/application/palemoon/base/content/newtab/undo.js
index 5f619e980..b856914d2 100644
--- a/application/palemoon/base/content/newtab/undo.js
+++ b/application/palemoon/base/content/newtab/undo.js
@@ -8,7 +8,7 @@
* Dialog allowing to undo the removal of single site or to completely restore
* the grid's original state.
*/
-let gUndoDialog = {
+var gUndoDialog = {
/**
* The undo dialog's timeout in miliseconds.
*/
diff --git a/application/palemoon/base/content/newtab/updater.js b/application/palemoon/base/content/newtab/updater.js
index 7b483e037..e6da37f87 100644
--- a/application/palemoon/base/content/newtab/updater.js
+++ b/application/palemoon/base/content/newtab/updater.js
@@ -8,7 +8,7 @@
* This singleton provides functionality to update the current grid to a new
* set of pinned and blocked sites. It adds, moves and removes sites.
*/
-let gUpdater = {
+var gUpdater = {
/**
* Updates the current grid according to its pinned and blocked sites.
* This removes old, moves existing and creates new sites to fill gaps.
diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js
index 8e6bc96c2..830c20998 100644
--- a/application/palemoon/base/content/nsContextMenu.js
+++ b/application/palemoon/base/content/nsContextMenu.js
@@ -4,6 +4,8 @@
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
+var gContextMenuContentData = null;
+
function nsContextMenu(aXulMenu, aIsShift) {
this.shouldDisplay = true;
this.initMenu(aXulMenu, aIsShift);
@@ -39,6 +41,7 @@ nsContextMenu.prototype = {
},
hiding: function CM_hiding() {
+ gContextMenuContentData = null;
InlineSpellCheckerUI.clearSuggestionsFromMenu();
InlineSpellCheckerUI.clearDictionaryListFromMenu();
InlineSpellCheckerUI.uninit();
@@ -265,7 +268,7 @@ nsContextMenu.prototype = {
// Hide menu entries for images, show otherwise
if (this.inFrame) {
- if (mimeTypeIsTextBased(this.target.ownerDocument.contentType))
+ if (BrowserUtils.mimeTypeIsTextBased(this.target.ownerDocument.contentType))
this.isFrameImage.removeAttribute('hidden');
else
this.isFrameImage.setAttribute('hidden', 'true');
@@ -422,12 +425,17 @@ nsContextMenu.prototype = {
},
inspectNode: function CM_inspectNode() {
- let {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
+ let {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
let gBrowser = this.browser.ownerDocument.defaultView.gBrowser;
- let tt = devtools.TargetFactory.forTab(gBrowser.selectedTab);
- return gDevTools.showToolbox(tt, "inspector").then(function(toolbox) {
+ let target = devtools.TargetFactory.forTab(gBrowser.selectedTab);
+
+ return gDevTools.showToolbox(target, "inspector").then(function(toolbox) {
let inspector = toolbox.getCurrentPanel();
- inspector.selection.setNode(this.target, "browser-context-menu");
+
+ this.browser.messageManager.sendAsyncMessage("debug:inspect", {}, {node: this.target});
+ inspector.walker.findInspectingNode().then(nodeFront => {
+ inspector.selection.setNodeFront(nodeFront, "browser-context-menu");
+ });
}.bind(this));
},
@@ -901,11 +909,15 @@ nsContextMenu.prototype = {
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
let doc = this.target.ownerDocument;
openUILink(viewURL, e, { disallowInheritPrincipal: true,
- referrerURI: doc.documentURIObject });
+ referrerURI: doc.documentURIObject,
+ forceAllowDataURI: true });
}
},
saveVideoFrameAsImage: function () {
+ let referrerURI = document.documentURIObject;
+ let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser);
+
urlSecurityCheck(this.mediaURL, this.browser.contentPrincipal,
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
let name = "";
@@ -923,7 +935,9 @@ nsContextMenu.prototype = {
canvas.height = video.videoHeight;
var ctxDraw = canvas.getContext("2d");
ctxDraw.drawImage(video, 0, 0);
- saveImageURL(canvas.toDataURL("image/jpeg", ""), name, "SaveImageTitle", true, false, document.documentURIObject, this.target.ownerDocument);
+ saveImageURL(canvas.toDataURL("image/jpeg", ""), name, "SaveImageTitle",
+ true, false, referrerURI, null, null, null,
+ isPrivate);
},
fullScreenVideo: function () {
@@ -1106,10 +1120,17 @@ nsContextMenu.prototype = {
}
}
- // set up a channel to do the saving
- var ioService = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var channel = ioService.newChannelFromURI(makeURI(linkURL));
+ // setting up a new channel for 'right click - save link as ...'
+ // ideally we should use:
+ // * doc - as the loadingNode, and/or
+ // * this.principal - as the loadingPrincipal
+ // for now lets use systemPrincipal to bypass mixedContentBlocker
+ // checks after redirects, see bug: 1136055
+ var channel = NetUtil.newChannel({
+ uri: makeURI(linkURL),
+ loadUsingSystemPrincipal: true
+ });
+
if (linkDownload)
channel.contentDispositionFilename = linkDownload;
if (channel instanceof Ci.nsIPrivateBrowsingChannel) {
@@ -1142,7 +1163,7 @@ nsContextMenu.prototype = {
timer.TYPE_ONE_SHOT);
// kick off the channel with our proxy object as the listener
- channel.asyncOpen(new saveAsListener(), null);
+ channel.asyncOpen2(new saveAsListener());
},
// Save URL of clicked-on link.
@@ -1174,6 +1195,8 @@ nsContextMenu.prototype = {
// Save URL of the clicked upon image, video, or audio.
saveMedia: function() {
var doc = this.target.ownerDocument;
+ let referrerURI = doc.documentURIObject;
+ let isPrivate = PrivateBrowsingUtils.isBrowserPrivate(this.browser);
if (this.onCanvas) {
// Bypass cache, since it's a blob: URL.
var target = this.target;
@@ -1189,14 +1212,16 @@ nsContextMenu.prototype = {
resolve(win.URL.createObjectURL(blob));
})
}}).then(function (blobURL) {
- saveImageURL(blobURL, "canvas.png", "SaveImageTitle", true,
- false, doc.documentURIObject, doc);
+ saveImageURL(blobURL, "canvas.png", "SaveImageTitle",
+ true, false, referrerURI, null, null, null,
+ isPrivate);
}, Components.utils.reportError);
}
} else if (this.onImage) {
urlSecurityCheck(this.mediaURL, doc.nodePrincipal);
- saveImageURL(this.mediaURL, null, "SaveImageTitle", false,
- false, doc.documentURIObject, doc);
+ saveImageURL(this.mediaURL, null, "SaveImageTitle",
+ false, false, referrerURI, doc, null, null,
+ isPrivate);
} else if (this.onVideo || this.onAudio) {
urlSecurityCheck(this.mediaURL, doc.nodePrincipal);
var dialogTitle = this.onVideo ? "SaveVideoTitle" : "SaveAudioTitle";
@@ -1373,9 +1398,8 @@ nsContextMenu.prototype = {
isDisabledForEvents: function(aNode) {
let ownerDoc = aNode.ownerDocument;
- return
- ownerDoc.defaultView &&
- ownerDoc.defaultView
+ return ownerDoc.defaultView &&
+ ownerDoc.defaultView
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindowUtils)
.isNodeDisabledForEvents(aNode);
diff --git a/application/palemoon/base/content/openLocation.js b/application/palemoon/base/content/openLocation.js
index 5b731c7e8..316dfac70 100644
--- a/application/palemoon/base/content/openLocation.js
+++ b/application/palemoon/base/content/openLocation.js
@@ -7,7 +7,7 @@
var browser;
var dialog = {};
var pref = null;
-let openLocationModule = {};
+var openLocationModule = {};
try {
pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
@@ -16,7 +16,7 @@ try {
}
Components.utils.import("resource:///modules/openLocationLastURL.jsm", openLocationModule);
-let gOpenLocationLastURL = new openLocationModule.OpenLocationLastURL(window.opener);
+var gOpenLocationLastURL = new openLocationModule.OpenLocationLastURL(window.opener);
function onLoad()
{
diff --git a/application/palemoon/base/content/padlock.js b/application/palemoon/base/content/padlock.js
index 53477fd17..9c29524ce 100644
--- a/application/palemoon/base/content/padlock.js
+++ b/application/palemoon/base/content/padlock.js
@@ -1,6 +1,6 @@
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-let Cu = Components.utils;
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
var padlock_PadLock =
diff --git a/application/palemoon/base/content/pageinfo/pageInfo.js b/application/palemoon/base/content/pageinfo/pageInfo.js
index ba93ee817..83f0ddb91 100644
--- a/application/palemoon/base/content/pageinfo/pageInfo.js
+++ b/application/palemoon/base/content/pageinfo/pageInfo.js
@@ -359,7 +359,7 @@ function loadPageInfo()
makeTabs(gDocument, gWindow);
initFeedTab();
- onLoadPermission();
+ onLoadPermission(gDocument.nodePrincipal);
/* Call registered overlay init functions */
onLoadRegistry.forEach(function(func) { func(); });
@@ -857,7 +857,7 @@ function onBlockImage()
if (checkbox.checked)
permissionManager.add(uri, "image", nsIPermissionManager.DENY_ACTION);
else
- permissionManager.remove(uri.host, "image");
+ permissionManager.remove(uri, "image");
}
function onImageSelect()
diff --git a/application/palemoon/base/content/pageinfo/permissions.js b/application/palemoon/base/content/pageinfo/permissions.js
index 7a0006b61..2fa0cc303 100644
--- a/application/palemoon/base/content/pageinfo/permissions.js
+++ b/application/palemoon/base/content/pageinfo/permissions.js
@@ -12,9 +12,10 @@ const IMAGE_DENY = 2;
const COOKIE_DENY = 2;
const COOKIE_SESSION = 2;
-const nsIQuotaManager = Components.interfaces.nsIQuotaManager;
+const nsIQuotaManagerService = Components.interfaces.nsIQuotaManagerService;
var gPermURI;
+var gPermPrincipal;
var gPrefs;
var gUsageRequest;
@@ -107,7 +108,7 @@ var permissionObserver = {
}
};
-function onLoadPermission()
+function onLoadPermission(principal)
{
gPrefs = Components.classes[PREFERENCES_CONTRACTID]
.getService(Components.interfaces.nsIPrefBranch);
@@ -116,6 +117,7 @@ function onLoadPermission()
var permTab = document.getElementById("permTab");
if (/^https?$/.test(uri.scheme)) {
gPermURI = uri;
+ gPermPrincipal = principal;
var hostText = document.getElementById("hostText");
hostText.value = gPermURI.host;
@@ -187,7 +189,7 @@ function onCheckboxClick(aPartId)
var command = document.getElementById("cmd_" + aPartId + "Toggle");
var checkbox = document.getElementById(aPartId + "Def");
if (checkbox.checked) {
- permissionManager.remove(gPermURI.host, aPartId);
+ permissionManager.remove(gPermURI, aPartId);
command.setAttribute("disabled", "true");
var perm = gPermObj[aPartId]();
setRadioState(aPartId, perm);
@@ -211,7 +213,7 @@ function onRadioClick(aPartId)
var id = radioGroup.selectedItem.id;
var permission = id.split('#')[1];
if (permission == UNKNOWN) {
- permissionManager.remove(gPermURI.host, aPartId);
+ permissionManager.remove(gPermURI, aPartId);
} else {
permissionManager.add(gPermURI, aPartId, permission);
}
@@ -230,10 +232,13 @@ function initIndexedDBRow()
row.appendChild(extras);
- var quotaManager = Components.classes["@mozilla.org/dom/quota/manager;1"]
- .getService(nsIQuotaManager);
+ var quotaManagerService =
+ Components.classes["@mozilla.org/dom/quota-manager-service;1"]
+ .getService(nsIQuotaManagerService);
+
gUsageRequest =
- quotaManager.getUsageForURI(gPermURI, onIndexedDBUsageCallback);
+ quotaManagerService.getUsageForPrincipal(gPermPrincipal,
+ onIndexedDBUsageCallback);
var status = document.getElementById("indexedDBStatus");
var button = document.getElementById("indexedDBClear");
@@ -245,22 +250,24 @@ function initIndexedDBRow()
function onIndexedDBClear()
{
- Components.classes["@mozilla.org/dom/quota/manager;1"]
- .getService(nsIQuotaManager)
- .clearStoragesForURI(gPermURI);
+ Components.classes["@mozilla.org/dom/quota-manager-service;1"]
+ .getService(nsIQuotaManagerService)
+ .clearStoragesForPrincipal(gPermPrincipal);
var permissionManager = Components.classes[PERMISSION_CONTRACTID]
.getService(nsIPermissionManager);
- permissionManager.remove(gPermURI.host, "indexedDB");
+ permissionManager.remove(gPermURI, "indexedDB");
initIndexedDBRow();
}
-function onIndexedDBUsageCallback(uri, usage, fileUsage)
+function onIndexedDBUsageCallback(request)
{
+ let uri = request.principal.URI;
if (!uri.equals(gPermURI)) {
- throw new Error("Callback received for bad URI: " + uri);
+ throw new Error("Callback received for bad URI: " + uri.spec);
}
+ let usage = request.result.usage;
if (usage) {
if (!("DownloadUtils" in window)) {
Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
@@ -355,20 +362,33 @@ function initPluginsRow() {
}
}
- let entries = [
- {
+ // Tycho:
+ // let entries = [
+ // {
+ // "permission": item[0],
+ // "obj": item[1],
+ // }
+ // for (item of permissionMap)
+ // ];
+ let entries = [];
+ for (let item of permissionMap) {
+ entries.push({
"permission": item[0],
- "obj": item[1],
- }
- for (item of permissionMap)
- ];
+ "obj": item[1]
+ });
+ }
entries.sort(function(a, b) {
return ((a.obj.name < b.obj.name) ? -1 : (a.obj.name == b.obj.name ? 0 : 1));
});
- let permissionEntries = [
- fillInPluginPermissionTemplate(p.permission, p.obj) for (p of entries)
- ];
+ // Tycho:
+ // let permissionEntries = [
+ // fillInPluginPermissionTemplate(p.permission, p.obj) for (p of entries)
+ // ];
+ let permissionEntries = [];
+ entries.forEach(function (p) {
+ permissionEntries.push(fillInPluginPermissionTemplate(p.permission, p.obj));
+ });
let permPluginsRow = document.getElementById("permPluginsRow");
clearPluginPermissionTemplate();
diff --git a/application/palemoon/base/content/popup-notifications.inc b/application/palemoon/base/content/popup-notifications.inc
index 04f4cb5b7..31a72b489 100644
--- a/application/palemoon/base/content/popup-notifications.inc
+++ b/application/palemoon/base/content/popup-notifications.inc
@@ -2,7 +2,6 @@
<panel id="notification-popup"
type="arrow"
- footertype="promobox"
position="after_start"
hidden="true"
orient="vertical"
@@ -54,7 +53,7 @@
</hbox>
</panel>
-
+#ifdef MOZ_WEBRTC
<popupnotification id="webRTC-shareDevices-notification" hidden="true">
<popupnotificationcontent id="webRTC-selectCamera" orient="vertical">
<separator class="thin"/>
@@ -75,7 +74,7 @@
</menulist>
</popupnotificationcontent>
</popupnotification>
-
+#endif
<popupnotification id="servicesInstall-notification" hidden="true">
<popupnotificationcontent orient="vertical" align="start">
<!-- XXX bug 974146, tests are looking for this, can't remove yet. -->
@@ -89,6 +88,14 @@
</popupnotificationcontent>
</popupnotification>
+ <popupnotification id="password-notification" hidden="true">
+ <popupnotificationcontent orient="vertical">
+ <textbox id="password-notification-username"/>
+ <textbox id="password-notification-password" type="password" show-content=""/>
+ <checkbox id="password-notification-visibilityToggle" hidden="true"/>
+ </popupnotificationcontent>
+ </popupnotification>
+
<popupnotification id="mixed-content-blocked-notification" hidden="true">
<popupnotificationcontent orient="vertical" align="start">
<separator/>
diff --git a/application/palemoon/base/content/sanitize.js b/application/palemoon/base/content/sanitize.js
index 89843c86d..f2eb24a55 100644
--- a/application/palemoon/base/content/sanitize.js
+++ b/application/palemoon/base/content/sanitize.js
@@ -15,7 +15,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Promise",
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
- "resource://gre/modules/devtools/Console.jsm");
+ "resource://gre/modules/Console.jsm");
function Sanitizer() {}
Sanitizer.prototype = {
@@ -148,7 +148,8 @@ Sanitizer.prototype = {
if (cookie.creationTime > this.range[0])
// This cookie was created after our cutoff, clear it
- cookieMgr.remove(cookie.host, cookie.name, cookie.path, false);
+ cookieMgr.remove(cookie.host, cookie.name, cookie.path,
+ false, cookie.originAttributes);
}
}
else {
@@ -213,10 +214,16 @@ Sanitizer.prototype = {
history: {
clear: function ()
{
- if (this.range)
- PlacesUtils.history.removeVisitsByTimeframe(this.range[0], this.range[1]);
- else
- PlacesUtils.history.removeAllPages();
+ if (this.range) {
+ PlacesUtils.history.removeVisitsByFilter({
+ beginDate: new Date(this.range[0] / 1000),
+ endDate: new Date(this.range[1] / 1000)
+ }).catch(Components.utils.reportError);;
+ } else {
+ // Remove everything.
+ PlacesUtils.history.clear()
+ .catch(Components.utils.reportError);
+ }
try {
var os = Components.classes["@mozilla.org/observer-service;1"]
diff --git a/application/palemoon/base/content/sync/aboutSyncTabs.js b/application/palemoon/base/content/sync/aboutSyncTabs.js
index 535c43e56..bc624a459 100644
--- a/application/palemoon/base/content/sync/aboutSyncTabs.js
+++ b/application/palemoon/base/content/sync/aboutSyncTabs.js
@@ -11,7 +11,7 @@ Cu.import("resource://gre/modules/PlacesUtils.jsm", this);
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-let RemoteTabViewer = {
+var RemoteTabViewer = {
_tabsList: null,
init: function () {
diff --git a/application/palemoon/base/content/sync/addDevice.js b/application/palemoon/base/content/sync/addDevice.js
index 556e75768..40862a791 100644
--- a/application/palemoon/base/content/sync/addDevice.js
+++ b/application/palemoon/base/content/sync/addDevice.js
@@ -15,7 +15,7 @@ const ADD_DEVICE_PAGE = 0;
const SYNC_KEY_PAGE = 1;
const DEVICE_CONNECTED_PAGE = 2;
-let gSyncAddDevice = {
+var gSyncAddDevice = {
init: function init() {
this.pin1.setAttribute("maxlength", PIN_PART_LENGTH);
diff --git a/application/palemoon/base/content/sync/genericChange.js b/application/palemoon/base/content/sync/genericChange.js
index 6d1ce9485..0c6dc145e 100644
--- a/application/palemoon/base/content/sync/genericChange.js
+++ b/application/palemoon/base/content/sync/genericChange.js
@@ -8,7 +8,7 @@ const Cc = Components.classes;
Components.utils.import("resource://services-sync/main.js");
Components.utils.import("resource://gre/modules/Services.jsm");
-let Change = {
+var Change = {
_dialog: null,
_dialogType: null,
_status: null,
diff --git a/application/palemoon/base/content/sync/progress.js b/application/palemoon/base/content/sync/progress.js
index 2063f612a..101160fa8 100644
--- a/application/palemoon/base/content/sync/progress.js
+++ b/application/palemoon/base/content/sync/progress.js
@@ -6,8 +6,8 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://services-sync/main.js");
-let gProgressBar;
-let gCounter = 0;
+var gProgressBar;
+var gCounter = 0;
function onLoad(event) {
Services.obs.addObserver(onEngineSync, "weave:engine:sync:finish", false);
diff --git a/application/palemoon/base/content/sync/quota.js b/application/palemoon/base/content/sync/quota.js
index 7117a2ddf..454052754 100644
--- a/application/palemoon/base/content/sync/quota.js
+++ b/application/palemoon/base/content/sync/quota.js
@@ -10,7 +10,7 @@ const Cu = Components.utils;
Cu.import("resource://services-sync/main.js");
Cu.import("resource://gre/modules/DownloadUtils.jsm");
-let gSyncQuota = {
+var gSyncQuota = {
init: function init() {
this.bundle = document.getElementById("quotaStrings");
@@ -86,7 +86,7 @@ let gSyncQuota = {
};
-let gUsageTreeView = {
+var gUsageTreeView = {
_ignored: {keys: true,
meta: true,
diff --git a/application/palemoon/base/content/sync/utils.js b/application/palemoon/base/content/sync/utils.js
index 0c02b5bc0..d41ecf18a 100644
--- a/application/palemoon/base/content/sync/utils.js
+++ b/application/palemoon/base/content/sync/utils.js
@@ -8,7 +8,7 @@
const PERMISSIONS_RWUSR = 0x180;
// Weave should always exist before before this file gets included.
-let gSyncUtils = {
+var gSyncUtils = {
get bundle() {
delete this.bundle;
return this.bundle = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties");
diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml
index b8d5f3e41..a7cc6deea 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"/>
+ xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,datetimepicker"/>
</xul:stack>
</xul:vbox>
</xul:hbox>
@@ -138,19 +138,19 @@
]]></getter>
</property>
- <property name="formValidationAnchor" readonly="true">
+ <property name="popupAnchor" readonly="true">
<getter><![CDATA[
- if (this.mCurrentTab._formValidationAnchor) {
- return this.mCurrentTab._formValidationAnchor;
+ if (this.mCurrentTab._popupAnchor) {
+ return this.mCurrentTab._popupAnchor;
}
let stack = this.mCurrentBrowser.parentNode;
- // Create an anchor for the form validation popup
+ // Create an anchor for the popup
const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- let formValidationAnchor = document.createElementNS(NS_XUL, "hbox");
- formValidationAnchor.className = "form-validation-anchor";
- formValidationAnchor.hidden = true;
- stack.appendChild(formValidationAnchor);
- return this.mCurrentTab._formValidationAnchor = formValidationAnchor;
+ let popupAnchor = document.createElementNS(NS_XUL, "hbox");
+ popupAnchor.className = "popup-anchor";
+ popupAnchor.hidden = true;
+ stack.appendChild(popupAnchor);
+ return this.mCurrentTab._popupAnchor = popupAnchor;
]]></getter>
</property>
@@ -302,6 +302,16 @@
</body>
</method>
+ <method name="getBrowserForContentWindow">
+ <parameter name="aWindow"/>
+ <body>
+ <![CDATA[
+ var tab = this._getTabForContentWindow(aWindow);
+ return tab ? tab.linkedBrowser : null;
+ ]]>
+ </body>
+ </method>
+
<method name="getBrowserForOuterWindowID">
<parameter name="aID"/>
<body>
@@ -707,7 +717,8 @@
let autocomplete = this.mTabBrowser._placesAutocomplete;
if (this.mBrowser.registeredOpenURI) {
- autocomplete.unregisterOpenPage(this.mBrowser.registeredOpenURI);
+ autocomplete.unregisterOpenPage(this.mBrowser.registeredOpenURI,
+ this.mBrowser.getAttribute("usercontextid") || 0);
delete this.mBrowser.registeredOpenURI;
}
// Tabs in private windows aren't registered as "Open" so
@@ -715,7 +726,8 @@
if (!isBlankPageURL(aLocation.spec) &&
(!PrivateBrowsingUtils.isWindowPrivate(window) ||
PrivateBrowsingUtils.permanentPrivateBrowsing)) {
- autocomplete.registerOpenPage(aLocation);
+ autocomplete.registerOpenPage(aLocation,
+ this.mBrowser.getAttribute("usercontextid") || 0);
this.mBrowser.registeredOpenURI = aLocation;
}
}
@@ -766,19 +778,28 @@
<method name="setIcon">
<parameter name="aTab"/>
<parameter name="aURI"/>
+ <parameter name="aLoadingPrincipal"/>
<body>
<![CDATA[
- var browser = this.getBrowserForTab(aTab);
+ let browser = this.getBrowserForTab(aTab);
browser.mIconURL = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
if (aURI && this.mFaviconService) {
- if (!(aURI instanceof Ci.nsIURI))
+ if (!(aURI instanceof Ci.nsIURI)) {
aURI = makeURI(aURI);
- this.mFaviconService.setAndFetchFaviconForPage(browser.currentURI,
- aURI, false,
- PrivateBrowsingUtils.isWindowPrivate(window) ?
- this.mFaviconService.FAVICON_LOAD_PRIVATE :
- this.mFaviconService.FAVICON_LOAD_NON_PRIVATE);
+ }
+ // We do not serialize the principal from within SessionStore.jsm,
+ // hence if aLoadingPrincipal is null we default to the
+ // systemPrincipal which will allow the favicon to load.
+ let loadingPrincipal = aLoadingPrincipal
+ ? aLoadingPrincipal
+ : Services.scriptSecurityManager.getSystemPrincipal();
+ let loadType = PrivateBrowsingUtils.isWindowPrivate(window)
+ ? this.mFaviconService.FAVICON_LOAD_PRIVATE
+ : this.mFaviconService.FAVICON_LOAD_NON_PRIVATE;
+
+ this.mFaviconService.setAndFetchFaviconForPage(
+ browser.currentURI, aURI, false, loadType, null, loadingPrincipal);
}
let sizedIconUrl = browser.mIconURL || "";
@@ -874,7 +895,7 @@
if (!this.isFailedIcon(url))
icon = url;
}
- this.setIcon(aTab, icon);
+ this.setIcon(aTab, icon, browser.contentPrincipal);
]]>
</body>
</method>
@@ -1430,6 +1451,10 @@
b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup"));
b.setAttribute("autoscrollpopup", this._autoScrollPopup.id);
+ if (this.hasAttribute("datetimepicker")) {
+ b.setAttribute("datetimepicker", this.getAttribute("datetimepicker"));
+ }
+
// Create the browserStack container
var stack = document.createElementNS(NS_XUL, "stack");
stack.className = "browserStack";
@@ -1566,7 +1591,7 @@
}
if (animate) {
- mozRequestAnimationFrame(function () {
+ requestAnimationFrame(function () {
this.tabContainer._handleTabTelemetryStart(t, aURI);
// kick the animation off
@@ -1865,7 +1890,8 @@
this.mTabListeners[aTab._tPos].destroy();
if (browser.registeredOpenURI && !aTabWillBeMoved) {
- this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
+ this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI,
+ browser.getAttribute("usercontextid") || 0);
delete browser.registeredOpenURI;
}
@@ -2133,7 +2159,7 @@
// Workarounds for bug 458697
// Icon might have been set on DOMLinkAdded, don't override that.
if (!ourBrowser.mIconURL && otherBrowser.mIconURL)
- this.setIcon(aOurTab, otherBrowser.mIconURL);
+ this.setIcon(aOurTab, otherBrowser.mIconURL, otherBrowser.contentPrincipal);
var isBusy = aOtherTab.hasAttribute("busy");
if (isBusy) {
aOurTab.setAttribute("busy", "true");
@@ -2209,7 +2235,8 @@
<![CDATA[
// If the current URI is registered as open remove it from the list.
if (aOurBrowser.registeredOpenURI) {
- this._placesAutocomplete.unregisterOpenPage(aOurBrowser.registeredOpenURI);
+ this._placesAutocomplete.unregisterOpenPage(aOurBrowser.registeredOpenURI,
+ aOurBrowser.getAttribute("usercontextid") || 0);
delete aOurBrowser.registeredOpenURI;
}
@@ -2716,6 +2743,9 @@
get finder() {
return this.mTabBrowser.mCurrentBrowser.finder;
},
+ destroy: function() {
+ this.finder.destroy();
+ },
addResultListener: function(aListener) {
this.mListeners.add(aListener);
this.finder.addResultListener(aListener);
@@ -2736,21 +2766,33 @@
set caseSensitive(val) {
return this.finder.caseSensitive = val;
},
- fastFind: function(aSearchString, aLinksOnly, aDrawOutline) {
- this.finder.fastFind(aSearchString, aLinksOnly, aDrawOutline);
+ set entireWord(val) {
+ return this.finder.entireWord = val;
+ },
+ get highlighter() {
+ return this.finder.highlighter;
},
- findAgain: function(aFindBackwards, aLinksOnly, aDrawOutline) {
- this.finder.findAgain(aFindBackwards, aLinksOnly, aDrawOutline);
+ get matchesCountLimit() {
+ return this.finder.matchesCountLimit;
+ },
+ fastFind: function(...args) {
+ this.finder.fastFind(...args);
+ },
+ findAgain: function(...args) {
+ this.finder.findAgain(...args);
},
setSearchStringToSelection: function() {
return this.finder.setSearchStringToSelection();
},
- highlight: function(aHighlight, aWord) {
- this.finder.highlight(aHighlight, aWord);
+ highlight: function(...args) {
+ this.finder.highlight(...args);
},
getInitialSelection: function() {
this.finder.getInitialSelection();
},
+ getActiveSelectionText: function() {
+ return this.finder.getActiveSelectionText();
+ },
enableSelection: function() {
this.finder.enableSelection();
},
@@ -2760,11 +2802,38 @@
focusContent: function() {
this.finder.focusContent();
},
+ onFindbarClose: function() {
+ this.finder.onFindbarClose();
+ },
+ onFindbarOpen: function() {
+ this.finder.onFindbarOpen();
+ },
+ onModalHighlightChange: function(...args) {
+ return this.finder.onModalHighlightChange(...args);
+ },
+ onHighlightAllChange: function(...args) {
+ return this.finder.onHighlightAllChange(...args);
+ },
keyPress: function(aEvent) {
this.finder.keyPress(aEvent);
},
- requestMatchesCount: function(aWord, aMatchLimit, aLinksOnly) {
- this.finder.requestMatchesCount(aWord, aMatchLimit, aLinksOnly);
+ requestMatchesCount: function(...args) {
+ this.finder.requestMatchesCount(...args);
+ },
+ onIteratorRangeFound: function(...args) {
+ this.finder.onIteratorRangeFound(...args);
+ },
+ onIteratorReset: function() {
+ this.finder.onIteratorReset();
+ },
+ onIteratorRestart: function(...args) {
+ this.finder.onIteratorRestart(...args);
+ },
+ onIteratorStart: function(...args) {
+ this.finder.onIteratorStart(...args);
+ },
+ onLocationChange: function(...args) {
+ this.finder.onLocationChange(...args);
}
})
]]></field>
@@ -2773,6 +2842,19 @@
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"/>
@@ -2789,6 +2871,10 @@
readonly="true"
onget="return this.mCurrentBrowser.contentWindow"/>
+ <property name="contentWindowAsCPOW"
+ readonly="true"
+ onget="return this.mCurrentBrowser.contentWindow;"/>
+
<property name="sessionHistory"
onget="return this.mCurrentBrowser.sessionHistory;"
readonly="true"/>
@@ -2809,6 +2895,10 @@
onget="return this.mCurrentBrowser.contentDocument;"
readonly="true"/>
+ <property name="contentDocumentAsCPOW"
+ onget="return this.mCurrentBrowser.contentDocument;"
+ readonly="true"/>
+
<property name="contentTitle"
onget="return this.mCurrentBrowser.contentTitle;"
readonly="true"/>
@@ -2859,23 +2949,6 @@
}
}
- // We need to take care of FAYT-watching as long as the findbar
- // isn't initialized. The checks on aEvent are copied from
- // _shouldFastFind (see findbar.xml).
- if (!gFindBarInitialized &&
- !(aEvent.ctrlKey || aEvent.metaKey) &&
- !aEvent.defaultPrevented) {
- let charCode = aEvent.charCode;
- if (charCode) {
- let char = String.fromCharCode(charCode);
- if (char == "'" || char == "/" ||
- Services.prefs.getBoolPref("accessibility.typeaheadfind")) {
- gFindBar._onBrowserKeypress(aEvent);
- return;
- }
- }
- }
-
#ifdef XP_MACOSX
if (!aEvent.metaKey)
return;
@@ -2950,13 +3023,31 @@
let browser = aMessage.target;
switch (aMessage.name) {
- case "DOMTitleChanged":
+ case "DOMTitleChanged": {
let tab = this.getTabForBrowser(browser);
if (!tab)
return;
let titleChanged = this.setTabTitle(tab);
if (titleChanged && !tab.selected && !tab.hasAttribute("busy"))
tab.setAttribute("titlechanged", "true");
+ break;
+ }
+ case "DOMWebNotificationClicked": {
+ let tab = this.getTabForBrowser(browser);
+ if (!tab)
+ return;
+ this.selectedTab = tab;
+ window.focus();
+ break;
+ }
+ case "Findbar:Keypress":
+ if (!gFindBarInitialized) {
+ // If the find bar for this tab is not yet alive, change that,
+ // and make sure we return the result:
+ return gFindBar.receiveMessage(aMessage);
+ }
+ break;
+
}
]]></body>
</method>
@@ -3022,6 +3113,8 @@
this._outerWindowIDBrowserMap.set(this.mCurrentBrowser.outerWindowID,
this.mCurrentBrowser);
}
+ messageManager.addMessageListener("DOMWebNotificationClicked", this);
+ messageManager.addMessageListener("Findbar:Keypress", this);
]]>
</constructor>
@@ -3055,7 +3148,8 @@
for (var i = 0; i < this.mTabListeners.length; ++i) {
let browser = this.getBrowserAtIndex(i);
if (browser.registeredOpenURI) {
- this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
+ this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI,
+ browser.getAttribute("usercontextid") || 0);
delete browser.registeredOpenURI;
}
browser.webProgress.removeProgressListener(this.mTabFilters[i]);
diff --git a/application/palemoon/base/content/urlbarBindings.xml b/application/palemoon/base/content/urlbarBindings.xml
index c99819f0d..bf59ea164 100644
--- a/application/palemoon/base/content/urlbarBindings.xml
+++ b/application/palemoon/base/content/urlbarBindings.xml
@@ -17,32 +17,32 @@
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
- <binding id="urlbar" extends="chrome://global/content/bindings/autocomplete.xml#autocomplete">
+ <binding id="urlbar" extends="chrome://browser/content/autocomplete.xml#private-autocomplete">
<content sizetopopup="pref">
<xul:hbox anonid="textbox-container"
- class="autocomplete-textbox-container urlbar-textbox-container"
+ class="private-autocomplete-textbox-container urlbar-textbox-container"
flex="1" xbl:inherits="focused">
<children includes="image|deck|stack|box">
- <xul:image class="autocomplete-icon" allowevents="true"/>
+ <xul:image class="private-autocomplete-icon" allowevents="true"/>
</children>
<xul:hbox anonid="textbox-input-box"
class="textbox-input-box urlbar-input-box"
flex="1" xbl:inherits="tooltiptext=inputtooltiptext">
<children/>
<html:input anonid="input"
- class="autocomplete-textbox urlbar-input textbox-input uri-element-right-align"
+ class="private-autocomplete-textbox urlbar-input textbox-input uri-element-right-align"
allowevents="true"
xbl:inherits="tooltiptext=inputtooltiptext,value,type,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey"/>
</xul:hbox>
<children includes="hbox"/>
</xul:hbox>
<xul:dropmarker anonid="historydropmarker"
- class="autocomplete-history-dropmarker urlbar-history-dropmarker"
+ class="private-autocomplete-history-dropmarker urlbar-history-dropmarker"
allowevents="true"
xbl:inherits="open,enablehistory,parentfocused=focused"/>
<xul:popupset anonid="popupset"
- class="autocomplete-result-popupset"/>
+ class="private-autocomplete-result-popupset"/>
<children includes="toolbarbutton"/>
</content>
@@ -823,7 +823,7 @@
</implementation>
</binding>
- <binding id="urlbar-rich-result-popup" extends="chrome://global/content/bindings/autocomplete.xml#autocomplete-rich-result-popup">
+ <binding id="urlbar-rich-result-popup" extends="chrome://browser/content/autocomplete.xml#private-autocomplete-rich-result-popup">
<implementation>
<field name="_maxResults">0</field>
@@ -990,9 +990,11 @@
document.getAnonymousElementByAttribute(this, "anonid", "cancel");
</field>
<field name="DownloadUtils" readonly="true">
- let utils = {};
- Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils);
- utils.DownloadUtils;
+ {
+ let utils = {};
+ Components.utils.import("resource://gre/modules/DownloadUtils.jsm", utils);
+ utils.DownloadUtils;
+ }
</field>
<method name="destroy">
@@ -1764,203 +1766,14 @@
</implementation>
</binding>
- <binding id="promobox">
- <content>
- <xul:hbox class="panel-promo-box" align="start" flex="1">
- <xul:hbox align="center" flex="1">
- <xul:image class="panel-promo-icon"/>
- <xul:description anonid="promo-message" class="panel-promo-message" flex="1">
- <xul:description anonid="promo-link"
- class="plain text-link inline-link"
- onclick="document.getBindingParent(this).onLinkClick();"/>
- </xul:description>
- </xul:hbox>
- <xul:toolbarbutton class="panel-promo-closebutton close-icon"
- oncommand="document.getBindingParent(this).onCloseButtonCommand();"
- tooltiptext="&closeNotification.tooltip;"/>
- </xul:hbox>
- </content>
-
- <implementation implements="nsIDOMEventListener">
- <constructor><![CDATA[
- this._panel.addEventListener("popupshowing", this, false);
- ]]></constructor>
-
- <destructor><![CDATA[
- this._panel.removeEventListener("popupshowing", this, false);
- ]]></destructor>
-
- <field name="_panel" readonly="true"><![CDATA[
- let node = this.parentNode;
- while(node && node.localName != "panel") {
- node = node.parentNode;
- }
- node;
- ]]></field>
- <field name="_promomessage" readonly="true">
- document.getAnonymousElementByAttribute(this, "anonid", "promo-message");
- </field>
- <field name="_promolink" readonly="true">
- document.getAnonymousElementByAttribute(this, "anonid", "promo-link");
- </field>
- <field name="_brandBundle" readonly="true">
- Services.strings.createBundle("chrome://branding/locale/brand.properties");
- </field>
- <property name="_viewsLeftMap">
- <getter><![CDATA[
- let viewsLeftMap = {};
- try {
- viewsLeftMap = JSON.parse(Services.prefs.getCharPref("browser.syncPromoViewsLeftMap"));
- } catch (ex) {
- // If the old preference exists, migrate it to the new one.
- try {
- let oldPref = Services.prefs.getIntPref("browser.syncPromoViewsLeft");
- Services.prefs.clearUserPref("browser.syncPromoViewsLeft");
- viewsLeftMap.bookmarks = oldPref;
- viewsLeftMap.passwords = oldPref;
- Services.prefs.setCharPref("browser.syncPromoViewsLeftMap",
- JSON.stringify(viewsLeftMap));
- } catch (ex2) {}
- }
- return viewsLeftMap;
- ]]></getter>
- </property>
- <property name="_viewsLeft">
- <getter><![CDATA[
- let views = 5;
- let map = this._viewsLeftMap;
- if (this._notificationType in map) {
- views = map[this._notificationType];
- }
- return views;
- ]]></getter>
- <setter><![CDATA[
- let map = this._viewsLeftMap;
- map[this._notificationType] = val;
- Services.prefs.setCharPref("browser.syncPromoViewsLeftMap",
- JSON.stringify(map));
- return val;
- ]]></setter>
- </property>
- <property name="_notificationType">
- <getter><![CDATA[
- // Use the popupid attribute to identify the notification type,
- // otherwise just rely on the panel id for common arrowpanels.
- let type = this._panel.firstChild.getAttribute("popupid") ||
- this._panel.id;
- if (type.startsWith("password-"))
- return "passwords";
- if (type == "editBookmarkPanel")
- return "bookmarks";
- if (type == "addon-install-complete") {
- if (!Services.prefs.prefHasUserValue("services.sync.username"))
- return "addons";
- if (!Services.prefs.getBoolPref("services.sync.engine.addons"))
- return "addons-sync-disabled";
- }
- return null;
- ]]></getter>
- </property>
- <property name="_notificationMessage">
- <getter><![CDATA[
- return gNavigatorBundle.getFormattedString(
- "syncPromoNotification." + this._notificationType + ".description",
- [this._brandBundle.GetStringFromName("syncBrandShortName")]
- );
- ]]></getter>
- </property>
- <property name="_notificationLink">
- <getter><![CDATA[
- if (this._notificationType == "addons-sync-disabled") {
- return "https://forum.palemoon.org/viewforum.php?f=52";
- }
- return "http://www.palemoon.org/sync/";
- ]]></getter>
- </property>
- <method name="onCloseButtonCommand">
- <body><![CDATA[
- this._viewsLeft = 0;
- this.hidden = true;
- ]]></body>
- </method>
- <method name="onLinkClick">
- <body><![CDATA[
- // Open a new selected tab and close the current panel.
- gBrowser.loadOneTab(this._promolink.getAttribute("href"),
- { inBackground: false });
- this._panel.hidePopup();
- ]]></body>
- </method>
- <method name="handleEvent">
- <parameter name="event"/>
- <body><![CDATA[
- if (event.type != "popupshowing" || event.target != this._panel)
- return;
-
- // A previous notification may have unhidden this.
- this.hidden = true;
-
- // Only handle supported notification panels.
- if (!this._notificationType) {
- return;
- }
-
- let viewsLeft = this._viewsLeft;
- if (viewsLeft) {
- // XXX: Short-circuit this for now.
- // TO-DO: Clean up this code for sync promotion
- this._viewsLeft = 0;
- viewsLeft = 0;
- return;
- // XXX
-
- if (Services.prefs.prefHasUserValue("services.sync.username") &&
- this._notificationType != "addons-sync-disabled") {
- // If the user has already setup Sync, don't show the notification.
- this._viewsLeft = 0;
- // Be sure to hide the panel, in case it was visible and the user
- // decided to setup Sync after noticing it.
- viewsLeft = 0;
- // The panel is still hidden, just bail out.
- return;
- }
- else {
- this._viewsLeft = viewsLeft - 1;
- }
-
- this._promolink.setAttribute("href", this._notificationLink);
- this._promolink.value = gNavigatorBundle.getString("syncPromoNotification.learnMoreLinkText");
-
- this.hidden = false;
-
- // HACK: The description element doesn't wrap correctly in panels,
- // thus set a width on it, based on the available space, before
- // setting its textContent. Then set its height as well, to
- // fix wrong height calculation on Linux (bug 659578).
- this._panel.addEventListener("popupshown", function panelShown() {
- this._panel.removeEventListener("popupshown", panelShown, true);
- // Previous popupShown events may close the panel or change
- // its contents, so ensure this is still valid.
- if (this._panel.state != "open" || !this._notificationType)
- return;
- this._promomessage.width = this._promomessage.getBoundingClientRect().width;
- this._promomessage.firstChild.textContent = this._notificationMessage;
- this._promomessage.height = this._promomessage.getBoundingClientRect().height;
- }.bind(this), true);
- }
- ]]></body>
- </method>
- </implementation>
- </binding>
-
<binding id="toolbarbutton-badged" display="xul:button"
extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton">
<content>
<children includes="observes|template|menupopup|panel|tooltip"/>
- <xul:hbox class="toolbarbutton-badge-container" align="start" pack="end" flex="1">
- <xul:hbox class="toolbarbutton-badge" xbl:inherits="badge"/>
+ <xul:stack class="toolbarbutton-badge-stack">
<xul:image class="toolbarbutton-icon" xbl:inherits="validate,src=image,label"/>
- </xul:hbox>
+ <xul:label class="toolbarbutton-badge" xbl:inherits="value=badge" top="0" end="0"/>
+ </xul:stack>
<xul:label class="toolbarbutton-text" crop="right" flex="1"
xbl:inherits="value=label,accesskey,crop"/>
</content>
diff --git a/application/palemoon/base/content/utilityOverlay.js b/application/palemoon/base/content/utilityOverlay.js
index b1e78d6a9..86cc5cea5 100644
--- a/application/palemoon/base/content/utilityOverlay.js
+++ b/application/palemoon/base/content/utilityOverlay.js
@@ -205,6 +205,7 @@ function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI
openLinkIn(url, where, params);
}
+/* eslint-disable complexity */
function openLinkIn(url, where, params) {
if (!where || !url)
return;
@@ -215,6 +216,7 @@ function openLinkIn(url, where, params) {
var aCharset = params.charset;
var aReferrerURI = params.referrerURI;
var aRelatedToCurrent = params.relatedToCurrent;
+ var aForceAllowDataURI = params.forceAllowDataURI;
var aInBackground = params.inBackground;
var aDisallowInheritPrincipal = params.disallowInheritPrincipal;
var aInitiatingDoc = params.initiatingDoc;
@@ -315,6 +317,9 @@ function openLinkIn(url, where, params) {
}
if (aDisallowInheritPrincipal)
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_OWNER;
+ if (aForceAllowDataURI) {
+ flags |= Ci.nsIWebNavigation.LOAD_FLAGS_FORCE_ALLOW_DATA_URI;
+ }
w.gBrowser.loadURIWithFlags(url, flags, aReferrerURI, null, aPostData);
break;
case "tabshifted":
diff --git a/application/palemoon/base/jar.mn b/application/palemoon/base/jar.mn
index 9031f3beb..fd2df79e1 100644
--- a/application/palemoon/base/jar.mn
+++ b/application/palemoon/base/jar.mn
@@ -53,6 +53,9 @@ browser.jar:
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)
+#endif
* content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml)
content/browser/content.js (content/content.js)
content/browser/padlock.xul (content/padlock.xul)
@@ -105,6 +108,8 @@ browser.jar:
* 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)
diff --git a/application/palemoon/branding/official/moz.build b/application/palemoon/branding/official/moz.build
index 847510ec0..8cb90130f 100644
--- a/application/palemoon/branding/official/moz.build
+++ b/application/palemoon/branding/official/moz.build
@@ -4,4 +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/.
+DIRS += ['content', 'locales']
+
+DIST_SUBDIR = 'browser'
+export('DIST_SUBDIR')
+
include('../shared/branding.mozbuild')
+ApplicationBranding()
diff --git a/application/palemoon/branding/official/pref/palemoon-branding.js b/application/palemoon/branding/official/pref/palemoon-branding.js
index 4f5d196d7..8e8703fb7 100644
--- a/application/palemoon/branding/official/pref/palemoon-branding.js
+++ b/application/palemoon/branding/official/pref/palemoon-branding.js
@@ -8,6 +8,8 @@ pref("app.releaseNotesURL", "http://www.palemoon.org/releasenotes.shtml");
// Enable Firefox compatmode by default.
pref("general.useragent.compatMode", 2);
+pref("general.useragent.compatMode.gecko", true);
+pref("general.useragent.compatMode.firefox", true);
// ========================= updates ========================
#if defined(XP_WIN)
diff --git a/application/palemoon/branding/shared/branding.mozbuild b/application/palemoon/branding/shared/branding.mozbuild
index 0636be64a..284520add 100644
--- a/application/palemoon/branding/shared/branding.mozbuild
+++ b/application/palemoon/branding/shared/branding.mozbuild
@@ -4,52 +4,55 @@
# 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 += ['content', 'locales']
-
-DIST_SUBDIR = 'browser'
-export('DIST_SUBDIR')
-
-JS_PREFERENCE_FILES += [
- 'pref/palemoon-branding.js',
-]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
- FINAL_TARGET_FILES['..'] += [
- 'palemoon.VisualElementsManifest.xml',
- ]
- FINAL_TARGET_FILES.VisualElements += [
- 'VisualElements_150.png',
- 'VisualElements_70.png',
- ]
- BRANDING_FILES += [
- '../shared/newtab.ico',
- '../shared/newwindow.ico',
- '../shared/pbmode.ico',
- 'appname.bmp',
- 'branding.nsi',
- 'document.ico',
- 'firefox.ico',
- 'wizHeader.bmp',
- 'wizHeaderRTL.bmp',
- 'wizWatermark.bmp',
- ]
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- BRANDING_FILES += [
- '../shared/background.png',
- 'disk.icns',
- 'document.icns',
- 'dsstore',
- 'firefox.icns',
- ]
-elif CONFIG['MOZ_WIDGET_GTK']:
- BRANDING_FILES += [
- 'default16.png',
- 'default32.png',
- 'default48.png',
- 'mozicon128.png',
+@template
+def ApplicationBranding():
+ JS_PREFERENCE_PP_FILES += [
+ 'pref/palemoon-branding.js',
]
-DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
-DEFINES['MOZ_BRANDING_DIRECTORY'] = CONFIG['MOZ_BRANDING_DIRECTORY']
-DEFINES['MOZILLA_UAVERSION_U'] = CONFIG['MOZILLA_UAVERSION_U']
-DEFINES['MOZILLA_COMPATVERSION_U'] = CONFIG['MOZILLA_COMPATVERSION_U'] \ No newline at end of file
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+ FINAL_TARGET_FILES['..'] += [
+ 'palemoon.VisualElementsManifest.xml',
+ ]
+ FINAL_TARGET_FILES.VisualElements += [
+ 'VisualElements_150.png',
+ 'VisualElements_70.png',
+ ]
+ BRANDING_FILES += [
+ '../shared/newtab.ico',
+ '../shared/newwindow.ico',
+ '../shared/pbmode.ico',
+ 'appname.bmp',
+ 'branding.nsi',
+ 'document.ico',
+ 'firefox.ico',
+ 'wizHeader.bmp',
+ 'wizHeaderRTL.bmp',
+ 'wizWatermark.bmp',
+ ]
+ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+ BRANDING_FILES += [
+ '../shared/background.png',
+ 'disk.icns',
+ 'document.icns',
+ 'dsstore',
+ 'firefox.icns',
+ ]
+ elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+ BRANDING_FILES += [
+ 'default16.png',
+ 'default32.png',
+ 'default48.png',
+ 'mozicon128.png',
+ ]
+ FINAL_TARGET_FILES.icons += ['mozicon128.png']
+ FINAL_TARGET_FILES.chrome.icons.default += [
+ 'default16.png',
+ 'default32.png',
+ 'default48.png',
+ ]
+
+ DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
+ DEFINES['MOZ_BRANDING_DIRECTORY'] = CONFIG['MOZ_BRANDING_DIRECTORY']
+ DEFINES['MOZILLA_UAVERSION_U'] = CONFIG['MOZILLA_UAVERSION_U']
+ DEFINES['MOZILLA_COMPATVERSION_U'] = "52.9"
diff --git a/application/palemoon/branding/shared/pref/preferences.inc b/application/palemoon/branding/shared/pref/preferences.inc
index a45870b01..a3cfcd138 100644
--- a/application/palemoon/branding/shared/pref/preferences.inc
+++ b/application/palemoon/branding/shared/pref/preferences.inc
@@ -119,3 +119,11 @@ pref("browser.sessionstore.interval",60000); //every minute instead of every 10
pref("accessibility.force_disabled", 1);
// ============================================================================
+
+// ===| DevTools |=============================================================
+
+// Number of usages of the web console or scratchpad.
+// If this is less than 5, then pasting code into the web console or scratchpad is disabled
+pref("devtools.selfxss.count", 100);
+
+// ============================================================================
diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc
index 20cc3ab86..db9ccaffa 100644
--- a/application/palemoon/branding/shared/pref/uaoverrides.inc
+++ b/application/palemoon/branding/shared/pref/uaoverrides.inc
@@ -36,6 +36,7 @@ pref("@GUAO_PREF@.yahoo.com","Mozilla/5.0 (@OS_SLICE@ rv:99.9) @GK_SLICE@ Firefo
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 (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...
@@ -60,7 +61,6 @@ pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (@OS_SLICE@ rv:52.0) @GK_SLICE@
// The following requires native mode. Or it blocks.. "too old firefox", breakage, etc.
pref("@GUAO_PREF@.deviantart.com","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
pref("@GUAO_PREF@.deviantart.net","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
-pref("@GUAO_PREF@.dropbox.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)");
diff --git a/application/palemoon/branding/unofficial/moz.build b/application/palemoon/branding/unofficial/moz.build
index 847510ec0..8cb90130f 100644
--- a/application/palemoon/branding/unofficial/moz.build
+++ b/application/palemoon/branding/unofficial/moz.build
@@ -4,4 +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/.
+DIRS += ['content', 'locales']
+
+DIST_SUBDIR = 'browser'
+export('DIST_SUBDIR')
+
include('../shared/branding.mozbuild')
+ApplicationBranding()
diff --git a/application/palemoon/branding/unstable/moz.build b/application/palemoon/branding/unstable/moz.build
index 847510ec0..8cb90130f 100644
--- a/application/palemoon/branding/unstable/moz.build
+++ b/application/palemoon/branding/unstable/moz.build
@@ -4,4 +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/.
+DIRS += ['content', 'locales']
+
+DIST_SUBDIR = 'browser'
+export('DIST_SUBDIR')
+
include('../shared/branding.mozbuild')
+ApplicationBranding()
diff --git a/application/palemoon/branding/unstable/pref/palemoon-branding.js b/application/palemoon/branding/unstable/pref/palemoon-branding.js
index 4c088f76d..dda6f86a5 100644
--- a/application/palemoon/branding/unstable/pref/palemoon-branding.js
+++ b/application/palemoon/branding/unstable/pref/palemoon-branding.js
@@ -8,6 +8,8 @@ pref("app.releaseNotesURL", "http://www.palemoon.org/unstable/releasenotes.shtml
// Enable Firefox compatmode by default.
pref("general.useragent.compatMode", 2);
+pref("general.useragent.compatMode.gecko", true);
+pref("general.useragent.compatMode.firefox", true);
// ========================= updates ========================
#if defined(XP_WIN)
diff --git a/application/palemoon/build.mk b/application/palemoon/build.mk
index fc692eda5..ae490aca7 100644
--- a/application/palemoon/build.mk
+++ b/application/palemoon/build.mk
@@ -3,40 +3,40 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
installer:
- @$(MAKE) -C browser/installer installer
+ @$(MAKE) -C application/palemoon/installer installer
package:
- @$(MAKE) -C browser/installer
+ @$(MAKE) -C application/palemoon/installer
package-compare:
- @$(MAKE) -C browser/installer package-compare
+ @$(MAKE) -C application/palemoon/installer package-compare
stage-package:
- @$(MAKE) -C browser/installer stage-package
+ @$(MAKE) -C application/palemoon/installer stage-package
install::
- @$(MAKE) -C browser/installer install
+ @$(MAKE) -C application/palemoon/installer install
clean::
- @$(MAKE) -C browser/installer clean
+ @$(MAKE) -C application/palemoon/installer clean
distclean::
- @$(MAKE) -C browser/installer distclean
+ @$(MAKE) -C application/palemoon/installer distclean
source-package::
- @$(MAKE) -C browser/installer source-package
+ @$(MAKE) -C application/palemoon/installer source-package
upload::
- @$(MAKE) -C browser/installer upload
+ @$(MAKE) -C application/palemoon/installer upload
source-upload::
- @$(MAKE) -C browser/installer source-upload
+ @$(MAKE) -C application/palemoon/installer source-upload
hg-bundle::
- @$(MAKE) -C browser/installer hg-bundle
+ @$(MAKE) -C application/palemoon/installer hg-bundle
l10n-check::
- @$(MAKE) -C browser/locales l10n-check
+ @$(MAKE) -C application/palemoon/locales l10n-check
ifdef ENABLE_TESTS
# Implemented in testing/testsuite-targets.mk
diff --git a/application/palemoon/components/about/AboutRedirector.cpp b/application/palemoon/components/about/AboutRedirector.cpp
index d927b7936..d52b873b9 100644
--- a/application/palemoon/components/about/AboutRedirector.cpp
+++ b/application/palemoon/components/about/AboutRedirector.cpp
@@ -9,8 +9,6 @@
#include "nsNetUtil.h"
#include "nsIScriptSecurityManager.h"
#include "mozilla/ArrayUtils.h"
-#include "nsDOMString.h"
-
namespace mozilla {
namespace browser {
@@ -21,7 +19,6 @@ struct RedirEntry {
const char* id;
const char* url;
uint32_t flags;
- const char* idbOriginPostfix;
};
/*
@@ -33,17 +30,47 @@ struct RedirEntry {
URI_SAFE_FOR_UNTRUSTED_CONTENT.
*/
static RedirEntry kRedirMap[] = {
- { "certerror", "chrome://browser/content/certerror/aboutCertError.xhtml",
+ {
+ "certerror", "chrome://browser/content/certerror/aboutCertError.xhtml",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::ALLOW_SCRIPT |
- nsIAboutModule::HIDE_FROM_ABOUTABOUT },
- { "feeds", "chrome://browser/content/feeds/subscribe.xhtml",
+ 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 },
- { "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml",
- nsIAboutModule::ALLOW_SCRIPT },
- { "rights",
+ 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.xul",
+ nsIAboutModule::ALLOW_SCRIPT
+ },
+ {
+ "palemoon", "chrome://global/content/memoriam.xhtml",
+ nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
+ nsIAboutModule::HIDE_FROM_ABOUTABOUT
+ },
+ {
+ "permissions", "chrome://browser/content/preferences/aboutPermissions.xul",
+ nsIAboutModule::ALLOW_SCRIPT
+ },
+ {
+ "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml",
+ nsIAboutModule::ALLOW_SCRIPT
+ },
+ {
+ "rights",
#ifdef MOZ_OFFICIAL_BRANDING
"chrome://global/content/aboutRights.xhtml",
#else
@@ -51,34 +78,27 @@ static RedirEntry kRedirMap[] = {
#endif
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::MAKE_LINKABLE |
- nsIAboutModule::ALLOW_SCRIPT },
- { "palemoon", "chrome://global/content/palemoon.xhtml",
+ nsIAboutModule::ALLOW_SCRIPT
+ },
+ {
+ "robots", "chrome://browser/content/aboutRobots.xhtml",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
- nsIAboutModule::HIDE_FROM_ABOUTABOUT },
- { "logopage", "chrome://global/content/logopage.xhtml",
- nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
- nsIAboutModule::HIDE_FROM_ABOUTABOUT },
- { "robots", "chrome://browser/content/aboutRobots.xhtml",
- nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
- nsIAboutModule::ALLOW_SCRIPT },
- { "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml",
- nsIAboutModule::ALLOW_SCRIPT },
+ 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 },
+ {
+ "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::MAKE_LINKABLE |
- nsIAboutModule::ALLOW_SCRIPT },
- { "newtab", "chrome://browser/content/newtab/newTab.xul",
- nsIAboutModule::ALLOW_SCRIPT },
- { "permissions", "chrome://browser/content/preferences/aboutPermissions.xul",
- nsIAboutModule::ALLOW_SCRIPT },
- { "downloads", "chrome://browser/content/downloads/contentAreaDownloadsView.xul",
- nsIAboutModule::ALLOW_SCRIPT },
};
static const int kRedirTotal = ArrayLength(kRedirMap);
@@ -148,30 +168,6 @@ AboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result)
return NS_ERROR_ILLEGAL_VALUE;
}
-NS_IMETHODIMP
-AboutRedirector::GetIndexedDBOriginPostfix(nsIURI *aURI, nsAString &result)
-{
- NS_ENSURE_ARG_POINTER(aURI);
-
- nsAutoCString name = GetAboutModuleName(aURI);
-
- for (int i = 0; i < kRedirTotal; i++) {
- if (name.Equals(kRedirMap[i].id)) {
- const char* postfix = kRedirMap[i].idbOriginPostfix;
- if (!postfix) {
- break;
- }
-
- result.AssignASCII(postfix);
- return NS_OK;
- }
- }
-
- SetDOMStringToNull(result);
- return NS_ERROR_ILLEGAL_VALUE;
-}
-
-
nsresult
AboutRedirector::Create(nsISupports *aOuter, REFNSIID aIID, void **result)
{
diff --git a/application/palemoon/components/build/moz.build b/application/palemoon/components/build/moz.build
index f8073907e..c85723e16 100644
--- a/application/palemoon/components/build/moz.build
+++ b/application/palemoon/components/build/moz.build
@@ -18,17 +18,22 @@ LOCAL_INCLUDES += [
'../about',
'../dirprovider',
'../feeds',
- '../migration',
'../shell',
]
if CONFIG['OS_ARCH'] == 'WINNT':
OS_LIBS += [
+ 'esent',
+ 'netapi32',
'ole32',
'shell32',
'shlwapi',
'version',
]
+ DELAYLOAD_DLLS += [
+ 'esent.dll',
+ 'netapi32.dll',
+ ]
# Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code)
# GTK2: Need to link with glib for GNOME shell service
diff --git a/application/palemoon/components/build/nsBrowserCompsCID.h b/application/palemoon/components/build/nsBrowserCompsCID.h
index e325e43d4..23670ae80 100644
--- a/application/palemoon/components/build/nsBrowserCompsCID.h
+++ b/application/palemoon/components/build/nsBrowserCompsCID.h
@@ -4,14 +4,6 @@
/////////////////////////////////////////////////////////////////////////////
-#ifdef XP_WIN
-#define NS_WINIEHISTORYENUMERATOR_CID \
-{ 0x93480624, 0x806e, 0x4756, { 0xb7, 0xcb, 0x0f, 0xb7, 0xdd, 0x74, 0x6a, 0x8f } }
-
-#define NS_IEHISTORYENUMERATOR_CONTRACTID \
- "@mozilla.org/profile/migrator/iehistoryenumerator;1"
-#endif
-
#define NS_SHELLSERVICE_CID \
{ 0x63c7b9f4, 0xcc8, 0x43f8, { 0xb6, 0x66, 0xa, 0x66, 0x16, 0x55, 0xcb, 0x73 } }
diff --git a/application/palemoon/components/build/nsModule.cpp b/application/palemoon/components/build/nsModule.cpp
index d5b79b455..304280ca9 100644
--- a/application/palemoon/components/build/nsModule.cpp
+++ b/application/palemoon/components/build/nsModule.cpp
@@ -16,10 +16,6 @@
#include "nsGNOMEShellService.h"
#endif
-#if defined(XP_WIN)
-#include "nsIEHistoryEnumerator.h"
-#endif
-
#include "rdf.h"
#include "nsFeedSniffer.h"
#include "AboutRedirector.h"
@@ -40,10 +36,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
#endif
-#if defined(XP_WIN)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEHistoryEnumerator)
-#endif
-
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
NS_DEFINE_NAMED_CID(NS_BROWSERDIRECTORYPROVIDER_CID);
@@ -54,9 +46,7 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
#endif
NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID);
-#if defined(XP_WIN)
-NS_DEFINE_NAMED_CID(NS_WINIEHISTORYENUMERATOR_CID);
-#elif defined(XP_MACOSX)
+#ifdef XP_MACOSX
NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
#endif
@@ -69,9 +59,7 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
#endif
{ &kNS_FEEDSNIFFER_CID, false, nullptr, nsFeedSnifferConstructor },
{ &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, nullptr, AboutRedirector::Create },
-#if defined(XP_WIN)
- { &kNS_WINIEHISTORYENUMERATOR_CID, false, nullptr, nsIEHistoryEnumeratorConstructor },
-#elif defined(XP_MACOSX)
+#ifdef XP_MACOSX
{ &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor },
#endif
{ nullptr }
@@ -91,7 +79,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
{ 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 "logopage", &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
@@ -102,9 +89,7 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
{ 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 },
-#if defined(XP_WIN)
- { NS_IEHISTORYENUMERATOR_CONTRACTID, &kNS_WINIEHISTORYENUMERATOR_CID },
-#elif defined(XP_MACOSX)
+#ifdef XP_MACOSX
{ NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID },
#endif
{ nullptr }
diff --git a/application/palemoon/components/dirprovider/DirectoryProvider.cpp b/application/palemoon/components/dirprovider/DirectoryProvider.cpp
index 4d3993b7f..85728b351 100644
--- a/application/palemoon/components/dirprovider/DirectoryProvider.cpp
+++ b/application/palemoon/components/dirprovider/DirectoryProvider.cpp
@@ -34,57 +34,7 @@ NS_IMPL_ISUPPORTS(DirectoryProvider,
NS_IMETHODIMP
DirectoryProvider::GetFile(const char *aKey, bool *aPersist, nsIFile* *aResult)
{
- nsresult rv;
-
- *aResult = nullptr;
-
- // NOTE: This function can be reentrant through the NS_GetSpecialDirectory
- // call, so be careful not to cause infinite recursion.
-
- nsCOMPtr<nsIFile> file;
-
- char const* leafName = nullptr;
-
- if (!strcmp(aKey, NS_APP_BOOKMARKS_50_FILE)) {
- leafName = "bookmarks.html";
-
- nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
- if (prefs) {
- nsCString path;
- rv = prefs->GetCharPref("browser.bookmarks.file", getter_Copies(path));
- if (NS_SUCCEEDED(rv)) {
- NS_NewNativeLocalFile(path, true, getter_AddRefs(file));
- }
- }
- }
- else {
- return NS_ERROR_FAILURE;
- }
-
- nsDependentCString leafstr(leafName);
-
- nsCOMPtr<nsIFile> parentDir;
- if (file) {
- rv = file->GetParent(getter_AddRefs(parentDir));
- if (NS_FAILED(rv))
- return rv;
- }
- else {
- rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(parentDir));
- if (NS_FAILED(rv))
- return rv;
-
- rv = parentDir->Clone(getter_AddRefs(file));
- if (NS_FAILED(rv))
- return rv;
-
- file->AppendNative(leafstr);
- }
-
- *aPersist = true;
- NS_ADDREF(*aResult = file);
-
- return NS_OK;
+ return NS_ERROR_FAILURE;
}
static void
diff --git a/application/palemoon/components/downloads/DownloadsCommon.jsm b/application/palemoon/components/downloads/DownloadsCommon.jsm
index b90baaf9c..c6614e780 100644
--- a/application/palemoon/components/downloads/DownloadsCommon.jsm
+++ b/application/palemoon/components/downloads/DownloadsCommon.jsm
@@ -104,7 +104,7 @@ const kPartialDownloadSuffix = ".part";
const kPrefBranch = Services.prefs.getBranch("browser.download.");
-let PrefObserver = {
+var PrefObserver = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
getPref: function PO_getPref(name) {
@@ -867,9 +867,19 @@ DownloadsDataCtor.prototype = {
// Sort backwards by start time, ensuring that the most recent
// downloads are added first regardless of their state.
- let loadedItemsArray = [dataItem
- for each (dataItem in this.dataItems)
- if (dataItem)];
+ // Tycho:
+ //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)
diff --git a/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js b/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js
index e1d0e75d4..46e867068 100644
--- a/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js
+++ b/application/palemoon/components/downloads/content/allDownloadsViewOverlay.js
@@ -8,9 +8,9 @@
* ON IT AS AN API.
*/
-let Cu = Components.utils;
-let Ci = Components.interfaces;
-let Cc = Components.classes;
+var Cu = Components.utils;
+var Ci = Components.interfaces;
+var Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@@ -1408,7 +1408,12 @@ DownloadsPlacesView.prototype = {
_copySelectedDownloadsToClipboard:
function DPV__copySelectedDownloadsToClipboard() {
let selectedElements = this._richlistbox.selectedItems;
- let urls = [e._shell.downloadURI for each (e in selectedElements)];
+ // Tycho: let urls = [e._shell.downloadURI for each (e in selectedElements)];
+ let urls = [];
+
+ for each (e in selectedElements) {
+ urls.push(e._shell.downloadURI);
+ }
Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper).copyString(urls.join("\n"), document);
@@ -1471,11 +1476,11 @@ DownloadsPlacesView.prototype = {
goUpdateCommand("downloadsCmd_clearDownloads");
break;
default: {
- // Slicing the array to get a freezed list of selected items. Otherwise,
- // the selectedItems array is live and doCommand may alter the selection
- // while we are trying to do one particular action, like removing items
- // from history.
- let selectedElements = this._richlistbox.selectedItems.slice();
+ // Cloning the nodelist into an array to get a frozen list of selected items.
+ // Otherwise, the selectedItems nodelist is live and doCommand may alter the
+ // selection while we are trying to do one particular action, like removing
+ // items from history.
+ let selectedElements = [...this._richlistbox.selectedItems];
for (let element of selectedElements) {
element._shell.doCommand(aCommand);
}
diff --git a/application/palemoon/components/downloads/content/contentAreaDownloadsView.js b/application/palemoon/components/downloads/content/contentAreaDownloadsView.js
index 29e2e368c..fbb18ab04 100644
--- a/application/palemoon/components/downloads/content/contentAreaDownloadsView.js
+++ b/application/palemoon/components/downloads/content/contentAreaDownloadsView.js
@@ -4,7 +4,7 @@
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
-let ContentAreaDownloadsView = {
+var ContentAreaDownloadsView = {
init: function CADV_init() {
let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox"));
// Do not display the Places downloads in private windows
diff --git a/application/palemoon/components/downloads/content/downloads.js b/application/palemoon/components/downloads/content/downloads.js
index 1a2288041..0412344bc 100644
--- a/application/palemoon/components/downloads/content/downloads.js
+++ b/application/palemoon/components/downloads/content/downloads.js
@@ -590,6 +590,8 @@ const DownloadsPanel = {
}
};
+XPCOMUtils.defineConstant(this, "DownloadsPanel", DownloadsPanel);
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsOverlayLoader
@@ -677,6 +679,8 @@ const DownloadsOverlayLoader = {
}
};
+XPCOMUtils.defineConstant(this, "DownloadsOverlayLoader", DownloadsOverlayLoader);
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsView
@@ -1053,6 +1057,8 @@ const DownloadsView = {
}
}
+XPCOMUtils.defineConstant(this, "DownloadsView", DownloadsView);
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsViewItem
@@ -1414,6 +1420,8 @@ const DownloadsViewController = {
}
};
+XPCOMUtils.defineConstant(this, "DownloadsViewController", DownloadsViewController);
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsViewItemController
@@ -1754,7 +1762,9 @@ const DownloadsSummary = {
delete this._detailsNode;
return this._detailsNode = node;
}
-}
+};
+
+XPCOMUtils.defineConstant(this, "DownloadsSummary", DownloadsSummary);
////////////////////////////////////////////////////////////////////////////////
//// DownloadsFooter
@@ -1811,3 +1821,5 @@ const DownloadsFooter = {
return this._footerNode = node;
}
};
+
+XPCOMUtils.defineConstant(this, "DownloadsFooter", DownloadsFooter);
diff --git a/application/palemoon/components/downloads/content/indicator.js b/application/palemoon/components/downloads/content/indicator.js
index b0e3217e5..e6a5bd012 100644
--- a/application/palemoon/components/downloads/content/indicator.js
+++ b/application/palemoon/components/downloads/content/indicator.js
@@ -254,6 +254,12 @@ const DownloadsButton = {
}
};
+Object.defineProperty(this, "DownloadsButton", {
+ value: DownloadsButton,
+ enumerable: true,
+ writable: false
+});
+
////////////////////////////////////////////////////////////////////////////////
//// DownloadsIndicatorView
@@ -592,3 +598,9 @@ const DownloadsIndicatorView = {
document.getElementById("downloads-indicator-progress");
}
};
+
+Object.defineProperty(this, "DownloadsIndicatorView", {
+ value: DownloadsIndicatorView,
+ enumerable: true,
+ writable: false
+});
diff --git a/application/palemoon/components/feeds/FeedConverter.js b/application/palemoon/components/feeds/FeedConverter.js
index 75115cc94..d0f573774 100644
--- a/application/palemoon/components/feeds/FeedConverter.js
+++ b/application/palemoon/components/feeds/FeedConverter.js
@@ -260,7 +260,7 @@ FeedConverter.prototype = {
}
chromeChannel.loadGroup = this._request.loadGroup;
- chromeChannel.asyncOpen(this._listener, null);
+ chromeChannel.asyncOpen2(this._listener);
}
finally {
this._releaseHandles();
diff --git a/application/palemoon/components/feeds/FeedWriter.js b/application/palemoon/components/feeds/FeedWriter.js
index 2afa35a5b..cbb146564 100644
--- a/application/palemoon/components/feeds/FeedWriter.js
+++ b/application/palemoon/components/feeds/FeedWriter.js
@@ -9,6 +9,7 @@ const Cr = Components.results;
const Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/NetUtil.jsm");
const FEEDWRITER_CID = Components.ID("{49bb6593-3aff-4eb3-a068-2712c28bd58e}");
const FEEDWRITER_CONTRACTID = "@mozilla.org/browser/feeds/result-writer;1";
@@ -1137,16 +1138,14 @@ FeedWriter.prototype = {
var nullPrincipal = Cc["@mozilla.org/nullprincipal;1"].
createInstance(Ci.nsIPrincipal);
- var resolvedURI = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService).
- newChannel2("about:feeds",
- null,
- null,
- null, // aLoadingNode
- nullPrincipal,
- null, // aTriggeringPrincipal
- Ci.nsILoadInfo.SEC_NORMAL,
- Ci.nsIContentPolicy.TYPE_OTHER).URI;
+ // this channel is not going to be openend, use a nullPrincipal
+ // and the most restrctive securityFlag.
+ let resolvedURI = NetUtil.newChannel({
+ uri: "about:feeds",
+ loadingPrincipal: nullPrincipal,
+ securityFlags: Ci.nsILoadInfo.SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
+ contentPolicyType: Ci.nsIContentPolicy.TYPE_OTHER
+ }).URI;
if (resolvedURI.equals(chan.URI))
return chan.originalURI;
@@ -1395,6 +1394,8 @@ FeedWriter.prototype = {
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsILoadContext)
.usePrivateBrowsing;
+ var nullPrincipal = Cc["@mozilla.org/nullprincipal;1"]
+ .createInstance(Ci.nsIPrincipal);
this._faviconService.setAndFetchFaviconForPage(readerURI, faviconURI, false,
usePrivateBrowsing ? this._faviconService.FAVICON_LOAD_PRIVATE
: this._faviconService.FAVICON_LOAD_NON_PRIVATE,
@@ -1409,7 +1410,7 @@ FeedWriter.prototype = {
self._contentSandbox.menuItem = null;
self._contentSandbox.dataURL = null;
}
- });
+ }, nullPrincipal);
},
classID: FEEDWRITER_CID,
diff --git a/application/palemoon/components/feeds/moz.build b/application/palemoon/components/feeds/moz.build
index 1dea0ce77..7ae9141aa 100644
--- a/application/palemoon/components/feeds/moz.build
+++ b/application/palemoon/components/feeds/moz.build
@@ -35,5 +35,3 @@ for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'):
LOCAL_INCLUDES += [
'../build',
]
-
-FAIL_ON_WARNINGS = True
diff --git a/application/palemoon/components/feeds/nsFeedSniffer.cpp b/application/palemoon/components/feeds/nsFeedSniffer.cpp
index 61cc77bdd..f314d3d3b 100644
--- a/application/palemoon/components/feeds/nsFeedSniffer.cpp
+++ b/application/palemoon/components/feeds/nsFeedSniffer.cpp
@@ -135,7 +135,7 @@ FindChar(char c, const char *begin, const char *end)
* it's possible that someone embedded one of these tags inside a document of
* another type, e.g. a HTML document, and we don't want to show the preview
* page if the document isn't actually a feed.
- *
+ *
* @param start
* The beginning of the data being sniffed
* @param end
@@ -331,7 +331,7 @@ nsFeedSniffer::OnStartRequest(nsIRequest* request, nsISupports* context)
return NS_OK;
}
-NS_METHOD
+nsresult
nsFeedSniffer::AppendSegmentToString(nsIInputStream* inputStream,
void* closure,
const char* rawSegment,
diff --git a/application/palemoon/components/feeds/nsFeedSniffer.h b/application/palemoon/components/feeds/nsFeedSniffer.h
index 57e10d954..a0eb9862c 100644
--- a/application/palemoon/components/feeds/nsFeedSniffer.h
+++ b/application/palemoon/components/feeds/nsFeedSniffer.h
@@ -10,7 +10,7 @@
#include "mozilla/Attributes.h"
class nsFeedSniffer final : public nsIContentSniffer,
- nsIStreamListener
+ nsIStreamListener
{
public:
NS_DECL_ISUPPORTS
@@ -18,12 +18,12 @@ public:
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
- static NS_METHOD AppendSegmentToString(nsIInputStream* inputStream,
- void* closure,
- const char* rawSegment,
- uint32_t toOffset,
- uint32_t count,
- uint32_t* writeCount);
+ static nsresult AppendSegmentToString(nsIInputStream* inputStream,
+ void* closure,
+ const char* rawSegment,
+ uint32_t toOffset,
+ uint32_t count,
+ uint32_t* writeCount);
protected:
~nsFeedSniffer() {}
diff --git a/application/palemoon/components/fuel/fuelApplication.js b/application/palemoon/components/fuel/fuelApplication.js
index 89d568ae1..017813143 100644
--- a/application/palemoon/components/fuel/fuelApplication.js
+++ b/application/palemoon/components/fuel/fuelApplication.js
@@ -729,7 +729,7 @@ var ApplicationFactory = {
};
-#include ../../../toolkit/components/exthelper/extApplication.js
+#include ../../../../toolkit/components/exthelper/extApplication.js
//=================================================
// Application constructor
diff --git a/application/palemoon/components/migration/BrowserProfileMigrators.manifest b/application/palemoon/components/migration/BrowserProfileMigrators.manifest
deleted file mode 100644
index d7fec75e3..000000000
--- a/application/palemoon/components/migration/BrowserProfileMigrators.manifest
+++ /dev/null
@@ -1,14 +0,0 @@
-component {6F8BB968-C14F-4D6F-9733-6C6737B35DCE} ProfileMigrator.js
-contract @mozilla.org/toolkit/profile-migrator;1 {6F8BB968-C14F-4D6F-9733-6C6737B35DCE}
-component {4cec1de4-1671-4fc3-a53e-6c539dc77a26} ChromeProfileMigrator.js
-contract @mozilla.org/profile/migrator;1?app=browser&type=chrome {4cec1de4-1671-4fc3-a53e-6c539dc77a26}
-component {91185366-ba97-4438-acba-48deaca63386} FirefoxProfileMigrator.js
-contract @mozilla.org/profile/migrator;1?app=browser&type=firefox {91185366-ba97-4438-acba-48deaca63386}
-#ifdef HAS_IE_MIGRATOR
-component {3d2532e3-4932-4774-b7ba-968f5899d3a4} IEProfileMigrator.js
-contract @mozilla.org/profile/migrator;1?app=browser&type=ie {3d2532e3-4932-4774-b7ba-968f5899d3a4}
-#endif
-#ifdef HAS_SAFARI_MIGRATOR
-component {4b609ecf-60b2-4655-9df4-dc149e474da1} SafariProfileMigrator.js
-contract @mozilla.org/profile/migrator;1?app=browser&type=safari {4b609ecf-60b2-4655-9df4-dc149e474da1}
-#endif
diff --git a/application/palemoon/components/migration/ChromeProfileMigrator.js b/application/palemoon/components/migration/ChromeProfileMigrator.js
deleted file mode 100644
index 61955fbb4..000000000
--- a/application/palemoon/components/migration/ChromeProfileMigrator.js
+++ /dev/null
@@ -1,463 +0,0 @@
-/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim: sw=2 ts=2 sts=2 et */
-/* 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 Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-const FILE_INPUT_STREAM_CID = "@mozilla.org/network/file-input-stream;1";
-
-const S100NS_FROM1601TO1970 = 0x19DB1DED53E8000;
-const S100NS_PER_MS = 10;
-
-const AUTH_TYPE = {
- SCHEME_HTML: 0,
- SCHEME_BASIC: 1,
- SCHEME_DIGEST: 2
-};
-
-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/FileUtils.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
- "resource://gre/modules/PlacesUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OSCrypto",
- "resource://gre/modules/OSCrypto.jsm");
-
-/**
- * Convert Chrome time format to Date object
- *
- * @param aTime
- * Chrome time
- * @return converted Date object
- * @note Google Chrome uses FILETIME / 10 as time.
- * FILETIME is based on same structure of Windows.
- */
-function chromeTimeToDate(aTime)
-{
- return new Date((aTime * S100NS_PER_MS - S100NS_FROM1601TO1970 ) / 10000);
-}
-
-/**
- * Insert bookmark items into specific folder.
- *
- * @param aFolderId
- * id of folder where items will be inserted
- * @param aItems
- * bookmark items to be inserted
- */
-function insertBookmarkItems(aFolderId, aItems)
-{
- for (let i = 0; i < aItems.length; i++) {
- let item = aItems[i];
-
- try {
- if (item.type == "url") {
- PlacesUtils.bookmarks.insertBookmark(aFolderId,
- NetUtil.newURI(item.url),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- item.name);
- } else if (item.type == "folder") {
- let newFolderId =
- PlacesUtils.bookmarks.createFolder(aFolderId,
- item.name,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
-
- insertBookmarkItems(newFolderId, item.children);
- }
- } catch (e) {
- Cu.reportError(e);
- }
- }
-}
-
-
-function ChromeProfileMigrator() {
- let chromeUserDataFolder = FileUtils.getDir(
-#ifdef XP_WIN
- "LocalAppData", ["Google", "Chrome", "User Data"]
-#elifdef XP_MACOSX
- "ULibDir", ["Application Support", "Google", "Chrome"]
-#else
- "Home", [".config", "google-chrome"]
-#endif
- , false);
- this._chromeUserDataFolder = chromeUserDataFolder.exists() ?
- chromeUserDataFolder : null;
-}
-
-ChromeProfileMigrator.prototype = Object.create(MigratorPrototype);
-
-ChromeProfileMigrator.prototype.getResources =
- function Chrome_getResources(aProfile) {
- if (this._chromeUserDataFolder) {
- let profileFolder = this._chromeUserDataFolder.clone();
- profileFolder.append(aProfile.id);
- if (profileFolder.exists()) {
- let possibleResources = [GetBookmarksResource(profileFolder),
- GetHistoryResource(profileFolder),
- GetCookiesResource(profileFolder),
-#ifdef XP_WIN
- GetWindowsPasswordsResource(profileFolder)
-#endif
- ];
- return [r for each (r in possibleResources) if (r != null)];
- }
- }
- return [];
- };
-
-Object.defineProperty(ChromeProfileMigrator.prototype, "sourceProfiles", {
- get: function Chrome_sourceProfiles() {
- if ("__sourceProfiles" in this)
- return this.__sourceProfiles;
-
- if (!this._chromeUserDataFolder)
- return [];
-
- let profiles = [];
- try {
- // Local State is a JSON file that contains profile info.
- let localState = this._chromeUserDataFolder.clone();
- localState.append("Local State");
- if (!localState.exists())
- throw new Error("Chrome's 'Local State' file does not exist.");
- if (!localState.isReadable())
- throw new Error("Chrome's 'Local State' file could not be read.");
-
- let fstream = Cc[FILE_INPUT_STREAM_CID].createInstance(Ci.nsIFileInputStream);
- fstream.init(localState, -1, 0, 0);
- let inputStream = NetUtil.readInputStreamToString(fstream, fstream.available(),
- { charset: "UTF-8" });
- let info_cache = JSON.parse(inputStream).profile.info_cache;
- for (let profileFolderName in info_cache) {
- let profileFolder = this._chromeUserDataFolder.clone();
- profileFolder.append(profileFolderName);
- profiles.push({
- id: profileFolderName,
- name: info_cache[profileFolderName].name || profileFolderName,
- });
- }
- } catch (e) {
- Cu.reportError("Error detecting Chrome profiles: " + e);
- // If we weren't able to detect any profiles above, fallback to the Default profile.
- let defaultProfileFolder = this._chromeUserDataFolder.clone();
- defaultProfileFolder.append("Default");
- if (defaultProfileFolder.exists()) {
- profiles = [{
- id: "Default",
- name: "Default",
- }];
- }
- }
-
- // Only list profiles from which any data can be imported
- return this.__sourceProfiles = profiles.filter(function(profile) {
- let resources = this.getResources(profile);
- return resources && resources.length > 0;
- }, this);
- }
-});
-
-Object.defineProperty(ChromeProfileMigrator.prototype, "sourceHomePageURL", {
- get: function Chrome_sourceHomePageURL() {
- let prefsFile = this._chromeUserDataFolder.clone();
- prefsFile.append("Preferences");
- if (prefsFile.exists()) {
- // XXX reading and parsing JSON is synchronous.
- let fstream = Cc[FILE_INPUT_STREAM_CID].
- createInstance(Ci.nsIFileInputStream);
- fstream.init(file, -1, 0, 0);
- try {
- return JSON.parse(
- NetUtil.readInputStreamToString(fstream, fstream.available(),
- { charset: "UTF-8" })
- ).homepage;
- }
- catch(e) {
- Cu.reportError("Error parsing Chrome's preferences file: " + e);
- }
- }
- return "";
- }
-});
-
-function GetBookmarksResource(aProfileFolder) {
- let bookmarksFile = aProfileFolder.clone();
- bookmarksFile.append("Bookmarks");
- if (!bookmarksFile.exists())
- return null;
-
- return {
- type: MigrationUtils.resourceTypes.BOOKMARKS,
-
- migrate: function(aCallback) {
- NetUtil.asyncFetch(bookmarksFile, MigrationUtils.wrapMigrateFunction(
- function(aInputStream, aResultCode) {
- if (!Components.isSuccessCode(aResultCode))
- throw new Error("Could not read Bookmarks file");
-
- // Parse Chrome bookmark file that is JSON format
- let bookmarkJSON = NetUtil.readInputStreamToString(
- aInputStream, aInputStream.available(), { charset : "UTF-8" });
- let roots = JSON.parse(bookmarkJSON).roots;
- PlacesUtils.bookmarks.runInBatchMode({
- runBatched: function() {
- // Importing bookmark bar items
- if (roots.bookmark_bar.children &&
- roots.bookmark_bar.children.length > 0) {
- // Toolbar
- let parentId = PlacesUtils.toolbarFolderId;
- if (!MigrationUtils.isStartupMigration) {
- parentId = MigrationUtils.createImportedBookmarksFolder(
- "Chrome", parentId);
- }
- insertBookmarkItems(parentId, roots.bookmark_bar.children);
- }
-
- // Importing bookmark menu items
- if (roots.other.children &&
- roots.other.children.length > 0) {
- // Bookmark menu
- let parentId = PlacesUtils.bookmarksMenuFolderId;
- if (!MigrationUtils.isStartupMigration) {
- parentId = MigrationUtils.createImportedBookmarksFolder(
- "Chrome", parentId);
- }
- insertBookmarkItems(parentId, roots.other.children);
- }
- }
- }, null);
- }, aCallback));
- }
- };
-}
-
-function GetHistoryResource(aProfileFolder) {
- let historyFile = aProfileFolder.clone();
- historyFile.append("History");
- if (!historyFile.exists())
- return null;
-
- return {
- type: MigrationUtils.resourceTypes.HISTORY,
-
- migrate: function(aCallback) {
- let dbConn = Services.storage.openUnsharedDatabase(historyFile);
- let stmt = dbConn.createAsyncStatement(
- "SELECT url, title, last_visit_time, typed_count FROM urls WHERE hidden = 0");
-
- stmt.executeAsync({
- handleResult : function(aResults) {
- let places = [];
- for (let row = aResults.getNextRow(); row; row = aResults.getNextRow()) {
- try {
- // if having typed_count, we changes transition type to typed.
- let transType = PlacesUtils.history.TRANSITION_LINK;
- if (row.getResultByName("typed_count") > 0)
- transType = PlacesUtils.history.TRANSITION_TYPED;
-
- places.push({
- uri: NetUtil.newURI(row.getResultByName("url")),
- title: row.getResultByName("title"),
- visits: [{
- transitionType: transType,
- visitDate: chromeTimeToDate(
- row.getResultByName(
- "last_visit_time")) * 1000,
- }],
- });
- } catch (e) {
- Cu.reportError(e);
- }
- }
-
- try {
- PlacesUtils.asyncHistory.updatePlaces(places);
- } catch (e) {
- Cu.reportError(e);
- }
- },
-
- handleError : function(aError) {
- Cu.reportError("Async statement execution returned with '" +
- aError.result + "', '" + aError.message + "'");
- },
-
- handleCompletion : function(aReason) {
- dbConn.asyncClose();
- aCallback(aReason == Ci.mozIStorageStatementCallback.REASON_FINISHED);
- }
- });
- stmt.finalize();
- }
- };
-}
-
-function GetCookiesResource(aProfileFolder) {
- let cookiesFile = aProfileFolder.clone();
- cookiesFile.append("Cookies");
- if (!cookiesFile.exists())
- return null;
-
- return {
- type: MigrationUtils.resourceTypes.COOKIES,
-
- migrate: function(aCallback) {
- let dbConn = Services.storage.openUnsharedDatabase(cookiesFile);
- let stmt = dbConn.createAsyncStatement(
- "SELECT host_key, path, name, value, secure, httponly, expires_utc FROM cookies");
-
- stmt.executeAsync({
- handleResult : function(aResults) {
- for (let row = aResults.getNextRow(); row; row = aResults.getNextRow()) {
- let host_key = row.getResultByName("host_key");
- if (host_key.match(/^\./)) {
- // 1st character of host_key may be ".", so we have to remove it
- host_key = host_key.substr(1);
- }
-
- try {
- let expiresUtc =
- chromeTimeToDate(row.getResultByName("expires_utc")) / 1000;
- Services.cookies.add(host_key,
- row.getResultByName("path"),
- row.getResultByName("name"),
- row.getResultByName("value"),
- row.getResultByName("secure"),
- row.getResultByName("httponly"),
- false,
- parseInt(expiresUtc));
- } catch (e) {
- Cu.reportError(e);
- }
- }
- },
-
- handleError : function(aError) {
- Cu.reportError("Async statement execution returned with '" +
- aError.result + "', '" + aError.message + "'");
- },
-
- handleCompletion : function(aReason) {
- dbConn.asyncClose();
- aCallback(aReason == Ci.mozIStorageStatementCallback.REASON_FINISHED);
- },
- });
- stmt.finalize();
- }
- }
-}
-
-function GetWindowsPasswordsResource(aProfileFolder) {
- let loginFile = aProfileFolder.clone();
- loginFile.append("Login Data");
- if (!loginFile.exists())
- return null;
-
- return {
- type: MigrationUtils.resourceTypes.PASSWORDS,
-
- migrate(aCallback) {
- let dbConn = Services.storage.openUnsharedDatabase(loginFile);
- let stmt = dbConn.createAsyncStatement(`
- SELECT origin_url, action_url, username_element, username_value,
- password_element, password_value, signon_realm, scheme, date_created,
- times_used FROM logins WHERE blacklisted_by_user = 0`);
- let crypto = new OSCrypto();
- let utf8Converter = Cc["@mozilla.org/intl/utf8converterservice;1"].getService(Ci.nsIUTF8ConverterService);
-
- stmt.executeAsync({
- _rowToLoginInfo(row) {
- let loginInfo = {
- username: utf8Converter.convertURISpecToUTF8(row.getResultByName("username_value"), "UTF-8"),
- password: utf8Converter.convertURISpecToUTF8(
- crypto.decryptData(crypto.arrayToString(row.getResultByName("password_value")), null),
- "UTF-8"),
- hostName: NetUtil.newURI(row.getResultByName("origin_url")).prePath,
- submitURL: null,
- httpRealm: null,
- usernameElement: row.getResultByName("username_element"),
- passwordElement: row.getResultByName("password_element"),
- timeCreated: chromeTimeToDate(row.getResultByName("date_created") + 0).getTime(),
- timesUsed: row.getResultByName("times_used") + 0,
- };
-
- switch (row.getResultByName("scheme")) {
- case AUTH_TYPE.SCHEME_HTML:
- loginInfo.submitURL = NetUtil.newURI(row.getResultByName("action_url")).prePath;
- break;
- case AUTH_TYPE.SCHEME_BASIC:
- case AUTH_TYPE.SCHEME_DIGEST:
- // signon_realm format is URIrealm, so we need remove URI
- loginInfo.httpRealm = row.getResultByName("signon_realm")
- .substring(loginInfo.hostName.length + 1);
- break;
- default:
- throw new Error("Login data scheme type not supported: " +
- row.getResultByName("scheme"));
- }
-
- return loginInfo;
- },
-
- handleResult(aResults) {
- for (let row = aResults.getNextRow(); row; row = aResults.getNextRow()) {
- try {
- let loginInfo = this._rowToLoginInfo(row);
- let login = Cc["@mozilla.org/login-manager/loginInfo;1"].createInstance(Ci.nsILoginInfo);
-
- login.init(loginInfo.hostName, loginInfo.submitURL, loginInfo.httpRealm,
- loginInfo.username, loginInfo.password, loginInfo.usernameElement,
- loginInfo.passwordElement);
- login.QueryInterface(Ci.nsILoginMetaInfo);
- login.timeCreated = loginInfo.timeCreated;
- login.timeLastUsed = loginInfo.timeCreated;
- login.timePasswordChanged = loginInfo.timeCreated;
- login.timesUsed = loginInfo.timesUsed;
-
- // Add the login only if there's not an existing entry
- let logins = Services.logins.findLogins({}, login.hostname,
- login.formSubmitURL,
- login.httpRealm);
-
- // Bug 1187190: Password changes should be propagated depending on timestamps.
- if (!logins.some(l => login.matches(l, true))) {
- Services.logins.addLogin(login);
- }
- } catch (e) {
- Cu.reportError(e);
- }
- }
- },
-
- handleError(aError) {
- Cu.reportError("Async statement execution returned with '" +
- aError.result + "', '" + aError.message + "'");
- },
-
- handleCompletion(aReason) {
- dbConn.asyncClose();
- aCallback(aReason == Ci.mozIStorageStatementCallback.REASON_FINISHED);
- crypto.finalize();
- },
- });
- stmt.finalize();
- }
- };
-}
-
-ChromeProfileMigrator.prototype.classDescription = "Chrome Profile Migrator";
-ChromeProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chrome";
-ChromeProfileMigrator.prototype.classID = Components.ID("{4cec1de4-1671-4fc3-a53e-6c539dc77a26}");
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]);
diff --git a/application/palemoon/components/migration/FirefoxProfileMigrator.js b/application/palemoon/components/migration/FirefoxProfileMigrator.js
deleted file mode 100644
index ab4ae55fb..000000000
--- a/application/palemoon/components/migration/FirefoxProfileMigrator.js
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim: sw=2 ts=2 sts=2 et */
- /* 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";
-
-/*
- * Migrates from a Pale Moon profile in a lossy manner in order to clean up a
- * user's profile. Data is only migrated where the benefits outweigh the
- * potential problems caused by importing undesired/invalid configurations
- * from the source profile.
- */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource:///modules/MigrationUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesBackups",
- "resource://gre/modules/PlacesBackups.jsm");
-
-function FirefoxProfileMigrator() { }
-
-FirefoxProfileMigrator.prototype = Object.create(MigratorPrototype);
-
-FirefoxProfileMigrator.prototype._getAllProfiles = function () {
- let allProfiles = new Map();
- let profiles =
- Components.classes["@mozilla.org/toolkit/profile-service;1"]
- .getService(Components.interfaces.nsIToolkitProfileService)
- .profiles;
- while (profiles.hasMoreElements()) {
- let profile = profiles.getNext().QueryInterface(Components.interfaces.nsIToolkitProfile);
- let rootDir = profile.rootDir;
-
- if (rootDir.exists() && rootDir.isReadable() &&
- !rootDir.equals(MigrationUtils.profileStartup.directory)) {
- allProfiles.set(profile.name, rootDir);
- }
- }
- return allProfiles;
-};
-
-function sorter(a, b) {
- return a.id.toLocaleLowerCase().localeCompare(b.id.toLocaleLowerCase());
-}
-
-Object.defineProperty(FirefoxProfileMigrator.prototype, "sourceProfiles", {
- get: function() {
- return [{id: x, name: x} for (x of this._getAllProfiles().keys())].sort(sorter);
- }
-});
-
-FirefoxProfileMigrator.prototype.getResources = function(aProfile) {
- let sourceProfileDir = aProfile ? this._getAllProfiles().get(aProfile.id) :
- Components.classes["@mozilla.org/toolkit/profile-service;1"]
- .getService(Components.interfaces.nsIToolkitProfileService)
- .selectedProfile.rootDir;
- if (!sourceProfileDir || !sourceProfileDir.exists() ||
- !sourceProfileDir.isReadable())
- return null;
-
- // Being a startup-only migrator, we can rely on
- // MigrationUtils.profileStartup being set.
- let currentProfileDir = MigrationUtils.profileStartup.directory;
-
- // Surely data cannot be imported from the current profile.
- if (sourceProfileDir.equals(currentProfileDir))
- return null;
-
- let getFileResource = function(aMigrationType, aFileNames) {
- let files = [];
- for (let fileName of aFileNames) {
- let file = sourceProfileDir.clone();
- file.append(fileName);
-
- if (file.exists()) {
- files.push(file);
- }
- }
- if (!files.length) {
- return null;
- }
- return {
- type: aMigrationType,
- migrate: function(aCallback) {
- for (let file of files) {
- file.copyTo(currentProfileDir, "");
- }
- aCallback(true);
- }
- };
- };
-
- let types = MigrationUtils.resourceTypes;
- let places = getFileResource(types.HISTORY, ["places.sqlite", "places.sqlite-wal"]);
- let cookies = getFileResource(types.COOKIES, ["cookies.sqlite", "cookies.sqlite-wal"]);
- let passwords = getFileResource(types.PASSWORDS,
- ["signons.sqlite", "logins.json", "key3.db"]);
- let formData = getFileResource(types.FORMDATA, ["formhistory.sqlite"]);
- let bookmarksBackups = getFileResource(types.OTHERDATA,
- [PlacesBackups.profileRelativeFolderPath]);
- let dictionary = getFileResource(types.OTHERDATA, ["persdict.dat"]);
-
- return [r for each (r in [places, cookies, passwords, formData,
- dictionary, bookmarksBackups]) if (r)];
-}
-
-Object.defineProperty(FirefoxProfileMigrator.prototype, "startupOnlyMigrator", {
- get: function() true
-});
-
-
-FirefoxProfileMigrator.prototype.classDescription = "Firefox Profile Migrator";
-FirefoxProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=firefox";
-FirefoxProfileMigrator.prototype.classID = Components.ID("{91185366-ba97-4438-acba-48deaca63386}");
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]);
diff --git a/application/palemoon/components/migration/IEProfileMigrator.js b/application/palemoon/components/migration/IEProfileMigrator.js
deleted file mode 100644
index a46deae68..000000000
--- a/application/palemoon/components/migration/IEProfileMigrator.js
+++ /dev/null
@@ -1,521 +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 Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-const kMainKey = "Software\\Microsoft\\Internet Explorer\\Main";
-const kRegMultiSz = 7;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
- "resource://gre/modules/PlacesUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ctypes",
- "resource://gre/modules/ctypes.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
- "resource://gre/modules/WindowsRegistry.jsm");
-
-Cu.importGlobalProperties(["File"]);
-
-////////////////////////////////////////////////////////////////////////////////
-//// Helpers.
-
-let CtypesHelpers = {
- _structs: {},
- _functions: {},
- _libs: {},
-
- /**
- * Must be invoked once before first use of any of the provided helpers.
- */
- initialize: function CH_initialize() {
- const WORD = ctypes.uint16_t;
- const DWORD = ctypes.uint32_t;
- const BOOL = ctypes.int;
-
- this._structs.SYSTEMTIME = new ctypes.StructType('SYSTEMTIME', [
- {wYear: WORD},
- {wMonth: WORD},
- {wDayOfWeek: WORD},
- {wDay: WORD},
- {wHour: WORD},
- {wMinute: WORD},
- {wSecond: WORD},
- {wMilliseconds: WORD}
- ]);
-
- this._structs.FILETIME = new ctypes.StructType('FILETIME', [
- {dwLowDateTime: DWORD},
- {dwHighDateTime: DWORD}
- ]);
-
- try {
- this._libs.kernel32 = ctypes.open("Kernel32");
- this._functions.FileTimeToSystemTime =
- this._libs.kernel32.declare("FileTimeToSystemTime",
- ctypes.default_abi,
- BOOL,
- this._structs.FILETIME.ptr,
- this._structs.SYSTEMTIME.ptr);
- } catch (ex) {
- this.finalize();
- }
- },
-
- /**
- * Must be invoked once after last use of any of the provided helpers.
- */
- finalize: function CH_finalize() {
- this._structs = {};
- this._functions = {};
- for each (let lib in this._libs) {
- try {
- lib.close();
- } catch (ex) {}
- }
- this._libs = {};
- },
-
- /**
- * Converts a FILETIME struct (2 DWORDS), to a SYSTEMTIME struct.
- *
- * @param aTimeHi
- * Least significant DWORD.
- * @param aTimeLo
- * Most significant DWORD.
- * @return a Date object representing the converted datetime.
- */
- fileTimeToDate: function CH_fileTimeToDate(aTimeHi, aTimeLo) {
- let fileTime = this._structs.FILETIME();
- fileTime.dwLowDateTime = aTimeLo;
- fileTime.dwHighDateTime = aTimeHi;
- let systemTime = this._structs.SYSTEMTIME();
- let result = this._functions.FileTimeToSystemTime(fileTime.address(),
- systemTime.address());
- if (result == 0)
- throw new Error(ctypes.winLastError);
-
- return new Date(systemTime.wYear,
- systemTime.wMonth - 1,
- systemTime.wDay,
- systemTime.wHour,
- systemTime.wMinute,
- systemTime.wSecond,
- systemTime.wMilliseconds);
- }
-};
-
-/**
- * Checks whether an host is an IP (v4 or v6) address.
- *
- * @param aHost
- * The host to check.
- * @return whether aHost is an IP address.
- */
-function hostIsIPAddress(aHost) {
- try {
- Services.eTLD.getBaseDomainFromHost(aHost);
- } catch (e if e.result == Cr.NS_ERROR_HOST_IS_IP_ADDRESS) {
- return true;
- } catch (e) {}
- return false;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//// Resources
-
-function Bookmarks() {
-}
-
-Bookmarks.prototype = {
- type: MigrationUtils.resourceTypes.BOOKMARKS,
-
- get exists() !!this._favoritesFolder,
-
- __favoritesFolder: null,
- get _favoritesFolder() {
- if (!this.__favoritesFolder) {
- let favoritesFolder = Services.dirsvc.get("Favs", Ci.nsIFile);
- if (favoritesFolder.exists() && favoritesFolder.isReadable())
- this.__favoritesFolder = favoritesFolder;
- }
- return this.__favoritesFolder;
- },
-
- __toolbarFolderName: null,
- get _toolbarFolderName() {
- if (!this.__toolbarFolderName) {
- // Retrieve the name of IE's favorites subfolder that holds the bookmarks
- // in the toolbar. This was previously stored in the registry and changed
- // in IE7 to always be called "Links".
- let folderName = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- "Software\\Microsoft\\Internet Explorer\\Toolbar",
- "LinksFolderName");
- this.__toolbarFolderName = folderName || "Links";
- }
- return this.__toolbarFolderName;
- },
-
- migrate: function B_migrate(aCallback) {
- PlacesUtils.bookmarks.runInBatchMode({
- runBatched: (function migrateBatched() {
- // Import to the bookmarks menu.
- let destFolderId = PlacesUtils.bookmarksMenuFolderId;
- if (!MigrationUtils.isStartupMigration) {
- destFolderId =
- MigrationUtils.createImportedBookmarksFolder("IE", destFolderId);
- }
-
- this._migrateFolder(this._favoritesFolder, destFolderId);
-
- aCallback(true);
- }).bind(this)
- }, null);
- },
-
- _migrateFolder: function B__migrateFolder(aSourceFolder, aDestFolderId) {
- // TODO (bug 741993): the favorites order is stored in the Registry, at
- // HCU\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Favorites
- // Until we support it, bookmarks are imported in alphabetical order.
- let entries = aSourceFolder.directoryEntries;
- while (entries.hasMoreElements()) {
- let entry = entries.getNext().QueryInterface(Ci.nsIFile);
-
- // Make sure that entry.path == entry.target to not follow .lnk folder
- // shortcuts which could lead to infinite cycles.
- if (entry.isDirectory() && entry.path == entry.target) {
- let destFolderId;
- if (entry.leafName == this._toolbarFolderName &&
- entry.parent.equals(this._favoritesFolder)) {
- // Import to the bookmarks toolbar.
- destFolderId = PlacesUtils.toolbarFolderId;
- if (!MigrationUtils.isStartupMigration) {
- destFolderId =
- MigrationUtils.createImportedBookmarksFolder("IE", destFolderId);
- }
- }
- else {
- // Import to a new folder.
- destFolderId =
- PlacesUtils.bookmarks.createFolder(aDestFolderId, entry.leafName,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- }
-
- if (entry.isReadable()) {
- // Recursively import the folder.
- this._migrateFolder(entry, destFolderId);
- }
- }
- else {
- // Strip the .url extension, to both check this is a valid link file,
- // and get the associated title.
- let matches = entry.leafName.match(/(.+)\.url$/i);
- if (matches) {
- let fileHandler = Cc["@mozilla.org/network/protocol;1?name=file"].
- getService(Ci.nsIFileProtocolHandler);
- let uri = fileHandler.readURLFile(entry);
- let title = matches[1];
-
- PlacesUtils.bookmarks.insertBookmark(aDestFolderId,
- uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- title);
- }
- }
- }
- }
-};
-
-function History() {
-}
-
-History.prototype = {
- type: MigrationUtils.resourceTypes.HISTORY,
-
- get exists() true,
-
- __typedURLs: null,
- get _typedURLs() {
- if (!this.__typedURLs) {
- // The list of typed URLs is a sort of annotation stored in the registry.
- // Currently, IE stores 25 entries and this value is not configurable,
- // but we just keep reading up to the first non-existing entry to support
- // possible future bumps of this limit.
- this.__typedURLs = {};
- let registry = Cc["@mozilla.org/windows-registry-key;1"].
- createInstance(Ci.nsIWindowsRegKey);
- try {
- registry.open(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- "Software\\Microsoft\\Internet Explorer\\TypedURLs",
- Ci.nsIWindowsRegKey.ACCESS_READ);
- for (let entry = 1; registry.hasValue("url" + entry); entry++) {
- let url = registry.readStringValue("url" + entry);
- this.__typedURLs[url] = true;
- }
- } catch (ex) {
- } finally {
- registry.close();
- }
- }
- return this.__typedURLs;
- },
-
- migrate: function H_migrate(aCallback) {
- let places = [];
- let historyEnumerator = Cc["@mozilla.org/profile/migrator/iehistoryenumerator;1"].
- createInstance(Ci.nsISimpleEnumerator);
- while (historyEnumerator.hasMoreElements()) {
- let entry = historyEnumerator.getNext().QueryInterface(Ci.nsIPropertyBag2);
- let uri = entry.get("uri").QueryInterface(Ci.nsIURI);
- // MSIE stores some types of URLs in its history that we don't handle,
- // like HTMLHelp and others. Since we don't properly map handling for
- // all of them we just avoid importing them.
- if (["http", "https", "ftp", "file"].indexOf(uri.scheme) == -1) {
- continue;
- }
-
- let title = entry.get("title");
- // Embed visits have no title and don't need to be imported.
- if (title.length == 0) {
- continue;
- }
-
- // The typed urls are already fixed-up, so we can use them for comparison.
- let transitionType = this._typedURLs[uri.spec] ?
- Ci.nsINavHistoryService.TRANSITION_TYPED :
- Ci.nsINavHistoryService.TRANSITION_LINK;
- let lastVisitTime = entry.get("time");
-
- places.push(
- { uri: uri,
- title: title,
- visits: [{ transitionType: transitionType,
- visitDate: lastVisitTime }]
- }
- );
- }
-
- // Check whether there is any history to import.
- if (places.length == 0) {
- aCallback(true);
- return;
- }
-
- PlacesUtils.asyncHistory.updatePlaces(places, {
- _success: false,
- handleResult: function() {
- // Importing any entry is considered a successful import.
- this._success = true;
- },
- handleError: function() {},
- handleCompletion: function() {
- aCallback(this._success);
- }
- });
- }
-};
-
-function Cookies() {
-}
-
-Cookies.prototype = {
- type: MigrationUtils.resourceTypes.COOKIES,
-
- get exists() !!this._cookiesFolder,
-
- __cookiesFolder: null,
- get _cookiesFolder() {
- // Cookies are stored in txt files, in a Cookies folder whose path varies
- // across the different OS versions. CookD takes care of most of these
- // cases, though, in Windows Vista/7, UAC makes a difference.
- // If UAC is enabled, the most common destination is CookD/Low. Though,
- // if the user runs the application in administrator mode or disables UAC,
- // cookies are stored in the original CookD destination. Cause running the
- // browser in administrator mode is unsafe and discouraged, we just care
- // about the UAC state.
- if (!this.__cookiesFolder) {
- let cookiesFolder = Services.dirsvc.get("CookD", Ci.nsIFile);
- if (cookiesFolder.exists() && cookiesFolder.isReadable()) {
- // Check if UAC is enabled.
- if (Services.appinfo.QueryInterface(Ci.nsIWinAppHelper).userCanElevate) {
- cookiesFolder.append("Low");
- }
- this.__cookiesFolder = cookiesFolder;
- }
- }
- return this.__cookiesFolder;
- },
-
- migrate: function C_migrate(aCallback) {
- CtypesHelpers.initialize();
-
- let cookiesGenerator = (function genCookie() {
- let success = false;
- let entries = this._cookiesFolder.directoryEntries;
- while (entries.hasMoreElements()) {
- let entry = entries.getNext().QueryInterface(Ci.nsIFile);
- // Skip eventual bogus entries.
- if (!entry.isFile() || !/\.txt$/.test(entry.leafName))
- continue;
-
- this._readCookieFile(entry, function(aSuccess) {
- // Importing even a single cookie file is considered a success.
- if (aSuccess)
- success = true;
- try {
- cookiesGenerator.next();
- } catch (ex) {}
- });
-
- yield;
- }
-
- CtypesHelpers.finalize();
-
- aCallback(success);
- }).apply(this);
- cookiesGenerator.next();
- },
-
- _readCookieFile: function C__readCookieFile(aFile, aCallback) {
- let fileReader = Cc["@mozilla.org/files/filereader;1"].
- createInstance(Ci.nsIDOMFileReader);
- fileReader.addEventListener("loadend", (function onLoadEnd() {
- fileReader.removeEventListener("loadend", onLoadEnd, false);
-
- if (fileReader.readyState != fileReader.DONE) {
- Cu.reportError("Could not read cookie contents: " + fileReader.error);
- aCallback(false);
- return;
- }
-
- let success = true;
- try {
- this._parseCookieBuffer(fileReader.result);
- } catch (ex) {
- Components.utils.reportError("Unable to migrate cookie: " + ex);
- success = false;
- } finally {
- aCallback(success);
- }
- }).bind(this), false);
- fileReader.readAsText(new File(aFile));
- },
-
- /**
- * Parses a cookie file buffer and returns an array of the contained cookies.
- *
- * The cookie file format is a newline-separated-values with a "*" used as
- * delimeter between multiple records.
- * Each cookie has the following fields:
- * - name
- * - value
- * - host/path
- * - flags
- * - Expiration time most significant integer
- * - Expiration time least significant integer
- * - Creation time most significant integer
- * - Creation time least significant integer
- * - Record delimiter "*"
- *
- * @note All the times are in FILETIME format.
- */
- _parseCookieBuffer: function C__parseCookieBuffer(aTextBuffer) {
- // Note the last record is an empty string.
- let records = [r for each (r in aTextBuffer.split("*\n")) if (r)];
- for (let record of records) {
- let [name, value, hostpath, flags,
- expireTimeLo, expireTimeHi] = record.split("\n");
-
- // IE stores deleted cookies with a zero-length value, skip them.
- if (value.length == 0)
- continue;
-
- let hostLen = hostpath.indexOf("/");
- let host = hostpath.substr(0, hostLen);
- let path = hostpath.substr(hostLen);
-
- // For a non-null domain, assume it's what Mozilla considers
- // a domain cookie. See bug 222343.
- if (host.length > 0) {
- // Fist delete any possible extant matching host cookie.
- Services.cookies.remove(host, name, path, false);
- // Now make it a domain cookie.
- if (host[0] != "." && !hostIsIPAddress(host))
- host = "." + host;
- }
-
- let expireTime = CtypesHelpers.fileTimeToDate(Number(expireTimeHi),
- Number(expireTimeLo));
- Services.cookies.add(host,
- path,
- name,
- value,
- Number(flags) & 0x1, // secure
- false, // httpOnly
- false, // session
- expireTime);
- }
- }
-};
-
-
-////////////////////////////////////////////////////////////////////////////////
-//// Migrator
-
-function IEProfileMigrator()
-{
-}
-
-IEProfileMigrator.prototype = Object.create(MigratorPrototype);
-
-IEProfileMigrator.prototype.getResources = function IE_getResources() {
- let resources = [
- new Bookmarks()
- , new History()
- , new Cookies()
- ];
- return [r for each (r in resources) if (r.exists)];
-};
-
-Object.defineProperty(IEProfileMigrator.prototype, "sourceHomePageURL", {
- get: function IE_get_sourceHomePageURL() {
- let defaultStartPage = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
- kMainKey, "Default_Page_URL");
- let startPage = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- kMainKey, "Start Page");
- // If the user didn't customize the Start Page, he is still on the default
- // page, that may be considered the equivalent of our about:home. There's
- // no reason to retain it, since it is heavily targeted to IE.
- let homepage = startPage != defaultStartPage ? startPage : "";
-
- // IE7+ supports secondary home pages located in a REG_MULTI_SZ key. These
- // are in addition to the Start Page, and no empty entries are possible,
- // thus a Start Page is always defined if any of these exists, though it
- // may be the default one.
- let secondaryPages = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- kMainKey, "Secondary Start Pages");
- if (secondaryPages) {
- if (homepage)
- secondaryPages.unshift(homepage);
- homepage = secondaryPages.join("|");
- }
-
- return homepage;
- }
-});
-
-IEProfileMigrator.prototype.classDescription = "IE Profile Migrator";
-IEProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=ie";
-IEProfileMigrator.prototype.classID = Components.ID("{3d2532e3-4932-4774-b7ba-968f5899d3a4}");
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]);
diff --git a/application/palemoon/components/migration/MigrationUtils.jsm b/application/palemoon/components/migration/MigrationUtils.jsm
deleted file mode 100644
index fcd73a798..000000000
--- a/application/palemoon/components/migration/MigrationUtils.jsm
+++ /dev/null
@@ -1,644 +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 = ["MigrationUtils", "MigratorPrototype"];
-
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-
-const TOPIC_WILL_IMPORT_BOOKMARKS = "initial-migration-will-import-default-bookmarks";
-const TOPIC_DID_IMPORT_BOOKMARKS = "initial-migration-did-import-default-bookmarks";
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Dict",
- "resource://gre/modules/Dict.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
- "resource://gre/modules/PlacesUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "BookmarkHTMLUtils",
- "resource://gre/modules/BookmarkHTMLUtils.jsm");
-
-let gMigrators = null;
-let gProfileStartup = null;
-let gMigrationBundle = null;
-
-function getMigrationBundle() {
- if (!gMigrationBundle) {
- gMigrationBundle = Services.strings.createBundle(
- "chrome://browser/locale/migration/migration.properties");
- }
- return gMigrationBundle;
-}
-
-/**
- * Figure out what is the default browser, and if there is a migrator
- * for it, return that migrator's internal name.
- * For the time being, the "internal name" of a migraotr is its contract-id
- * trailer (e.g. ie for @mozilla.org/profile/migrator;1?app=browser&type=ie),
- * but it will soon be exposed properly.
- */
-function getMigratorKeyForDefaultBrowser() {
- const APP_DESC_TO_KEY = {
- "Internet Explorer": "ie",
- "Safari": "safari",
- "Pale Moon web browser": "firefox",
- "Google Chrome": "chrome", // Windows, Linux
- "Chrome": "chrome", // OS X
- };
-
- let browserDesc = "";
- try {
- let browserDesc =
- Cc["@mozilla.org/uriloader/external-protocol-service;1"].
- getService(Ci.nsIExternalProtocolService).
- getApplicationDescription("http");
- return APP_DESC_TO_KEY[browserDesc] || "";
- }
- catch(ex) {
- Cu.reportError("Could not detect default browser: " + ex);
- }
- return "";
-}
-
-/**
- * Shared prototype for migrators, implementing nsIBrowserProfileMigrator.
- *
- * To implement a migrator:
- * 1. Import this module.
- * 2. Create the prototype for the migrator, extending MigratorPrototype.
- * Namely: MosaicMigrator.prototype = Object.create(MigratorPrototype);
- * 3. Set classDescription, contractID and classID for your migrator, and set
- * NSGetFactory appropriately.
- * 4. If the migrator supports multiple profiles, override the sourceProfiles
- * Here we default for single-profile migrator.
- * 5. Implement getResources(aProfile) (see below).
- * 6. If the migrator supports reading the home page of the source browser,
- * override |sourceHomePageURL| getter.
- * 7. For startup-only migrators, override |startupOnlyMigrator|.
- */
-this.MigratorPrototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserProfileMigrator]),
-
- /**
- * OVERRIDE IF AND ONLY IF the source supports multiple profiles.
- *
- * Returns array of profile objects from which data may be imported. The object
- * should have the following keys:
- * id - a unique string identifier for the profile
- * name - a pretty name to display to the user in the UI
- *
- * Only profiles from which data can be imported should be listed. Otherwise
- * the behavior of the migration wizard isn't well-defined.
- *
- * For a single-profile source (e.g. safari, ie), this returns null,
- * and not an empty array. That is the default implementation.
- */
- get sourceProfiles() null,
-
- /**
- * MUST BE OVERRIDDEN.
- *
- * Returns an array of "migration resources" objects for the given profile,
- * or for the "default" profile, if the migrator does not support multiple
- * profiles.
- *
- * Each migration resource should provide:
- * - a |type| getter, retunring any of the migration types (see
- * nsIBrowserProfileMigrator).
- *
- * - a |migrate| method, taking a single argument, aCallback(bool success),
- * for migrating the data for this resource. It may do its job
- * synchronously or asynchronously. Either way, it must call
- * aCallback(bool aSuccess) when it's done. In the case of an exception
- * thrown from |migrate|, it's taken as if aCallback(false) is called.
- *
- * Note: In the case of a simple asynchronous implementation, you may find
- * MigrationUtils.wrapMigrateFunction handy for handling aCallback easily.
- *
- * For each migration type listed in nsIBrowserProfileMigrator, multiple
- * migration resources may be provided. This practice is useful when the
- * data for a certain migration type is independently stored in few
- * locations. For example, the mac version of Safari stores its "reading list"
- * bookmarks in a separate property list.
- *
- * Note that the importation of a particular migration type is reported as
- * successful if _any_ of its resources succeeded to import (that is, called,
- * |aCallback(true)|). However, completion-status for a particular migration
- * type is reported to the UI only once all of its migrators have called
- * aCallback.
- *
- * @note The returned array should only include resources from which data
- * can be imported. So, for example, before adding a resource for the
- * BOOKMARKS migration type, you should check if you should check that the
- * bookmarks file exists.
- *
- * @param aProfile
- * The profile from which data may be imported, or an empty string
- * in the case of a single-profile migrator.
- * In the case of multiple-profiles migrator, it is guaranteed that
- * aProfile is a value returned by the sourceProfiles getter (see
- * above).
- */
- getResources: function MP_getResources(aProfile) {
- throw new Error("getResources must be overridden");
- },
-
- /**
- * OVERRIDE IF AND ONLY IF the migrator is a startup-only migrator (For now,
- * that is just the Firefox migrator, see bug 737381). Default: false.
- *
- * Startup-only migrators are different in two ways:
- * - they may only be used during startup.
- * - the user-profile is half baked during migration. The folder exists,
- * but it's only accessible through MigrationUtils.profileStartup.
- * The migrator can call MigrationUtils.profileStartup.doStartup
- * at any point in order to initialize the profile.
- */
- get startupOnlyMigrator() false,
-
- /**
- * OVERRIDE IF AND ONLY IF your migrator supports importing the homepage.
- * @see nsIBrowserProfileMigrator
- */
- get sourceHomePageURL() "",
-
- /**
- * DO NOT OVERRIDE - After deCOMing migration, the UI will just call
- * getResources.
- *
- * @see nsIBrowserProfileMigrator
- */
- getMigrateData: function MP_getMigrateData(aProfile) {
- let types = [r.type for each (r in this._getMaybeCachedResources(aProfile))];
- return types.reduce(function(a, b) a |= b, 0);
- },
-
- /**
- * DO NOT OVERRIDE - After deCOMing migration, the UI will just call
- * migrate for each resource.
- *
- * @see nsIBrowserProfileMigrator
- */
- migrate: function MP_migrate(aItems, aStartup, aProfile) {
- let resources = this._getMaybeCachedResources(aProfile);
- if (resources.length == 0)
- throw new Error("migrate called for a non-existent source");
-
- if (aItems != Ci.nsIBrowserProfileMigrator.ALL)
- resources = [r for each (r in resources) if (aItems & r.type)];
-
- // Called either directly or through the bookmarks import callback.
- function doMigrate() {
- // TODO: use Map (for the items) and Set (for the resources)
- // once they are iterable.
- let resourcesGroupedByItems = new Dict();
- resources.forEach(function(resource) {
- if (resourcesGroupedByItems.has(resource.type))
- resourcesGroupedByItems.get(resource.type).push(resource);
- else
- resourcesGroupedByItems.set(resource.type, [resource]);
- });
-
- if (resourcesGroupedByItems.count == 0)
- throw new Error("No items to import");
-
- let notify = function(aMsg, aItemType) {
- Services.obs.notifyObservers(null, aMsg, aItemType);
- }
-
- notify("Migration:Started");
- resourcesGroupedByItems.listkeys().forEach(function(migrationType) {
- let migrationTypeA = migrationType;
- let itemResources = resourcesGroupedByItems.get(migrationType);
- notify("Migration:ItemBeforeMigrate", migrationType);
-
- let itemSuccess = false;
- itemResources.forEach(function(resource) {
- let resourceDone = function(aSuccess) {
- let resourceIndex = itemResources.indexOf(resource);
- if (resourceIndex != -1) {
- itemResources.splice(resourceIndex, 1);
- itemSuccess |= aSuccess;
- if (itemResources.length == 0) {
- resourcesGroupedByItems.del(migrationType);
- notify(itemSuccess ?
- "Migration:ItemAfterMigrate" : "Migration:ItemError",
- migrationType);
- if (resourcesGroupedByItems.count == 0)
- notify("Migration:Ended");
- }
- }
- };
-
- Services.tm.mainThread.dispatch(function() {
- // If migrate throws, an error occurred, and the callback
- // (itemMayBeDone) might haven't been called.
- try {
- resource.migrate(resourceDone);
- }
- catch(ex) {
- Cu.reportError(ex);
- resourceDone(false);
- }
- }, Ci.nsIThread.DISPATCH_NORMAL);
- });
- });
- }
-
- if (MigrationUtils.isStartupMigration && !this.startupOnlyMigrator) {
- MigrationUtils.profileStartup.doStartup();
-
- // If we're about to migrate bookmarks, first import the default bookmarks.
- // Note We do not need to do so for the Firefox migrator
- // (=startupOnlyMigrator), as it just copies over the places database
- // from another profile.
- const BOOKMARKS = MigrationUtils.resourceTypes.BOOKMARKS;
- let migratingBookmarks = resources.some(function(r) r.type == BOOKMARKS);
- if (migratingBookmarks) {
- let browserGlue = Cc["@mozilla.org/browser/browserglue;1"].
- getService(Ci.nsIObserver);
- browserGlue.observe(null, TOPIC_WILL_IMPORT_BOOKMARKS, "");
-
- // Note doMigrate doesn't care about the success of the import.
- let onImportComplete = function() {
- browserGlue.observe(null, TOPIC_DID_IMPORT_BOOKMARKS, "");
- doMigrate();
- };
- BookmarkHTMLUtils.importFromURL(
- "resource:///defaults/profile/bookmarks.html", true).then(
- onImportComplete, onImportComplete);
- return;
- }
- }
- doMigrate();
- },
-
- /**
- * DO NOT OVERRIDE - After deCOMing migration, this code
- * won't be part of the migrator itself.
- *
- * @see nsIBrowserProfileMigrator
- */
- get sourceExists() {
- if (this.startupOnlyMigrator && !MigrationUtils.isStartupMigration)
- return false;
-
- // For a single-profile source, check if any data is available.
- // For multiple-profiles source, make sure that at least one
- // profile is available.
- let exists = false;
- try {
- let profiles = this.sourceProfiles;
- if (!profiles) {
- let resources = this._getMaybeCachedResources("");
- if (resources && resources.length > 0)
- exists = true;
- }
- else {
- exists = profiles.length > 0;
- }
- }
- catch(ex) {
- Cu.reportError(ex);
- }
- return exists;
- },
-
- /*** PRIVATE STUFF - DO NOT OVERRIDE ***/
- _getMaybeCachedResources: function PMB__getMaybeCachedResources(aProfile) {
- let profileKey = aProfile ? aProfile.id : "";
- if (this._resourcesByProfile) {
- if (profileKey in this._resourcesByProfile)
- return this._resourcesByProfile[profileKey];
- }
- else {
- this._resourcesByProfile = { };
- }
- return this._resourcesByProfile[profileKey] = this.getResources(aProfile);
- }
-};
-
-this.MigrationUtils = Object.freeze({
- resourceTypes: {
- SETTINGS: Ci.nsIBrowserProfileMigrator.SETTINGS,
- COOKIES: Ci.nsIBrowserProfileMigrator.COOKIES,
- HISTORY: Ci.nsIBrowserProfileMigrator.HISTORY,
- FORMDATA: Ci.nsIBrowserProfileMigrator.FORMDATA,
- PASSWORDS: Ci.nsIBrowserProfileMigrator.PASSWORDS,
- BOOKMARKS: Ci.nsIBrowserProfileMigrator.BOOKMARKS,
- OTHERDATA: Ci.nsIBrowserProfileMigrator.OTHERDATA
- },
-
- /**
- * Helper for implementing simple asynchronous cases of migration resources'
- * |migrate(aCallback)| (see MigratorPrototype). If your |migrate| method
- * just waits for some file to be read, for example, and then migrates
- * everything right away, you can wrap the async-function with this helper
- * and not worry about notifying the callback.
- *
- * For example, instead of writing:
- * setTimeout(function() {
- * try {
- * ....
- * aCallback(true);
- * }
- * catch() {
- * aCallback(false);
- * }
- * }, 0);
- *
- * You may write:
- * setTimeout(MigrationUtils.wrapMigrateFunction(function() {
- * if (importingFromMosaic)
- * throw Cr.NS_ERROR_UNEXPECTED;
- * }, aCallback), 0);
- *
- * ... and aCallback will be called with aSuccess=false when importing
- * from Mosaic, or with aSuccess=true otherwise.
- *
- * @param aFunction
- * the function that will be called sometime later. If aFunction
- * throws when it's called, aCallback(false) is called, otherwise
- * aCallback(true) is called.
- * @param aCallback
- * the callback function passed to |migrate|.
- * @return the wrapped function.
- */
- wrapMigrateFunction: function MU_wrapMigrateFunction(aFunction, aCallback) {
- return function() {
- let success = false;
- try {
- aFunction.apply(null, arguments);
- success = true;
- }
- catch(ex) {
- Cu.reportError(ex);
- }
- // Do not change this to call aCallback directly in try try & catch
- // blocks, because if aCallback throws, we may end up calling aCallback
- // twice.
- aCallback(success);
- }
- },
-
- /**
- * Gets a string from the migration bundle. Shorthand for
- * nsIStringBundle.GetStringFromName, if aReplacements isn't passed, or for
- * nsIStringBundle.formatStringFromName if it is.
- *
- * This method also takes care of "bumped" keys (See bug 737381 comment 8 for
- * details).
- *
- * @param aKey
- * The key of the string to retrieve.
- * @param aReplacemts
- * [optioanl] Array of replacements to run on the retrieved string.
- * @return the retrieved string.
- *
- * @see nsIStringBundle
- */
- getLocalizedString: function MU_getLocalizedString(aKey, aReplacements) {
- const OVERRIDES = {
- "4_firefox": "4_firefox_history_and_bookmarks",
- "64_firefox": "64_firefox_other"
- };
- aKey = OVERRIDES[aKey] || aKey;
-
- if (aReplacements === undefined)
- return getMigrationBundle().GetStringFromName(aKey);
- return getMigrationBundle().formatStringFromName(
- aKey, aReplacements, aReplacements.length);
- },
-
- /**
- * Helper for creating a folder for imported bookmarks from a particular
- * migration source. The folder is created at the end of the given folder.
- *
- * @param aSourceNameStr
- * the source name (first letter capitalized). This is used
- * for reading the localized source name from the migration
- * bundle (e.g. if aSourceNameStr is Mosaic, this will try to read
- * sourceNameMosaic from the migration bundle).
- * @param aParentId
- * the item-id of the folder in which the new folder should be
- * created.
- * @return the item-id of the new folder.
- */
- createImportedBookmarksFolder:
- function MU_createImportedBookmarksFolder(aSourceNameStr, aParentId) {
- let source = this.getLocalizedString("sourceName" + aSourceNameStr);
- let label = this.getLocalizedString("importedBookmarksFolder", [source]);
- return PlacesUtils.bookmarks.createFolder(
- aParentId, label, PlacesUtils.bookmarks.DEFAULT_INDEX);
- },
-
- get _migrators() gMigrators ? gMigrators : gMigrators = new Dict(),
-
- /*
- * Returns the migrator for the given source, if any data is available
- * for this source, or null otherwise.
- *
- * @param aKey internal name of the migration source.
- * Supported values: ie (windows),
- * safari (mac/windows),
- * chrome (mac/windows/linux),
- * firefox.
- *
- * If null is returned, either no data can be imported
- * for the given migrator, or aMigratorKey is invalid (e.g. ie on mac,
- * or mosaic everywhere). This method should be used rather than direct
- * getService for future compatibility (see bug 718280).
- *
- * @return profile migrator implementing nsIBrowserProfileMigrator, if it can
- * import any data, null otherwise.
- */
- getMigrator: function MU_getMigrator(aKey) {
- let migrator = null;
- if (this._migrators.has(aKey)) {
- migrator = this._migrators.get(aKey);
- }
- else {
- try {
- migrator = Cc["@mozilla.org/profile/migrator;1?app=browser&type=" +
- aKey].createInstance(Ci.nsIBrowserProfileMigrator);
- }
- catch(ex) { }
- this._migrators.set(aKey, migrator);
- }
-
- return migrator && migrator.sourceExists ? migrator : null;
- },
-
- // Iterates the available migrators, in the most suitable
- // order for the running platform.
- get migrators() {
- let migratorKeysOrdered = [
-#ifdef XP_WIN
- "firefox", "ie", "chrome", "safari"
-#elifdef XP_MACOSX
- "firefox", "safari", "chrome"
-#elifdef XP_UNIX
- "firefox", "chrome"
-#endif
- ];
-
- // If a supported default browser is found check it first
- // so that the wizard defaults to import from that browser.
- let defaultBrowserKey = getMigratorKeyForDefaultBrowser();
- if (defaultBrowserKey)
- migratorKeysOrdered.sort(function (a, b) b == defaultBrowserKey ? 1 : 0);
-
- for (let migratorKey of migratorKeysOrdered) {
- let migrator = this.getMigrator(migratorKey);
- if (migrator)
- yield migrator;
- }
- },
-
- // Whether or not we're in the process of startup migration
- get isStartupMigration() gProfileStartup != null,
-
- /**
- * In the case of startup migration, this is set to the nsIProfileStartup
- * instance passed to ProfileMigrator's migrate.
- *
- * @see showMigrationWizard
- */
- get profileStartup() gProfileStartup,
-
- /**
- * Show the migration wizard. On mac, this may just focus the wizard if it's
- * already running, in which case aOpener and aParams are ignored.
- *
- * @param [optional] aOpener
- * the window that asks to open the wizard.
- * @param [optional] aParams
- * arguments for the migration wizard, in the form of an nsIArray.
- * This is passed as-is for the params argument of
- * nsIWindowWatcher.openWindow.
- */
- showMigrationWizard:
- function MU_showMigrationWizard(aOpener, aParams) {
- let features = "chrome,dialog,modal,centerscreen,titlebar,resizable=no";
-#ifdef XP_MACOSX
- if (!this.isStartupMigration) {
- let win = Services.wm.getMostRecentWindow("Browser:MigrationWizard");
- if (win) {
- win.focus();
- return;
- }
- // On mac, the migration wiazrd should only be modal in the case of
- // startup-migration.
- features = "centerscreen,chrome,resizable=no";
- }
-#endif
-
- Services.ww.openWindow(aOpener,
- "chrome://browser/content/migration/migration.xul",
- "_blank",
- features,
- aParams);
- },
-
- /**
- * Show the migration wizard for startup-migration. This should only be
- * called by ProfileMigrator (see ProfileMigrator.js), which implements
- * nsIProfileMigrator.
- *
- * @param aProfileStartup
- * the nsIProfileStartup instance provided to ProfileMigrator.migrate.
- * @param [optional] aMigratorKey
- * If set, the migration wizard will import from the corresponding
- * migrator, bypassing the source-selection page. Otherwise, the
- * source-selection page will be displayed, either with the default
- * browser selected, if it could be detected and if there is a
- * migrator for it, or with the first option selected as a fallback
- * (The first option is hardcoded to be the most common browser for
- * the OS we run on. See migration.xul).
- * @param [optional] aProfileToMigrate
- * If set, the migration wizard will import from the profile indicated.
- *
- * @throws if aMigratorKey is invalid or if it points to a non-existent
- * source.
- */
- startupMigration:
- function MU_startupMigrator(aProfileStartup, aMigratorKey, aProfileToMigrate) {
- if (!aProfileStartup) {
- throw new Error("a profile-startup instance is required for startup-migration");
- }
- gProfileStartup = aProfileStartup;
-
- let skipSourcePage = false, migrator = null, migratorKey = "";
- if (aMigratorKey) {
- migrator = this.getMigrator(aMigratorKey);
- if (!migrator) {
- // aMigratorKey must point to a valid source, so, if it doesn't
- // cleanup and throw.
- this.finishMigration();
- throw new Error("startMigration was asked to open auto-migrate from " +
- "a non-existent source: " + aMigratorKey);
- }
- migratorKey = aMigratorKey;
- skipSourcePage = true;
- }
- else {
- let defaultBrowserKey = getMigratorKeyForDefaultBrowser();
- if (defaultBrowserKey) {
- migrator = this.getMigrator(defaultBrowserKey);
- if (migrator)
- migratorKey = defaultBrowserKey;
- }
- }
-
- if (!migrator) {
- // If there's no migrator set so far, ensure that there is at least one
- // migrator available before opening the wizard.
- try {
- this.migrators.next();
- }
- catch(ex) {
- this.finishMigration();
- if (!(ex instanceof StopIteration))
- throw ex;
- return;
- }
- }
-
- let params = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
- let keyCSTR = Cc["@mozilla.org/supports-cstring;1"].
- createInstance(Ci.nsISupportsCString);
- keyCSTR.data = migratorKey;
- let skipImportSourcePageBool = Cc["@mozilla.org/supports-PRBool;1"].
- createInstance(Ci.nsISupportsPRBool);
- skipImportSourcePageBool.data = skipSourcePage;
- let profileToMigrate = null;
- if (aProfileToMigrate) {
- profileToMigrate = Cc["@mozilla.org/supports-string;1"].
- createInstance(Ci.nsISupportsString);
- profileToMigrate.data = aProfileToMigrate;
- }
- params.appendElement(keyCSTR, false);
- params.appendElement(migrator, false);
- params.appendElement(aProfileStartup, false);
- params.appendElement(skipImportSourcePageBool, false);
- params.appendElement(profileToMigrate, false);
-
- this.showMigrationWizard(null, params);
- },
-
- /**
- * Cleans up references to migrators and nsIProfileInstance instances.
- */
- finishMigration: function MU_finishMigration() {
- gMigrators = null;
- gProfileStartup = null;
- gMigrationBundle = null;
- }
-});
diff --git a/application/palemoon/components/migration/ProfileMigrator.js b/application/palemoon/components/migration/ProfileMigrator.js
deleted file mode 100644
index f67823bae..000000000
--- a/application/palemoon/components/migration/ProfileMigrator.js
+++ /dev/null
@@ -1,21 +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/XPCOMUtils.jsm");
-Components.utils.import("resource:///modules/MigrationUtils.jsm");
-
-function ProfileMigrator() {
-}
-
-ProfileMigrator.prototype = {
- migrate: MigrationUtils.startupMigration.bind(MigrationUtils),
- QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProfileMigrator]),
- classDescription: "Profile Migrator",
- contractID: "@mozilla.org/toolkit/profile-migrator;1",
- classID: Components.ID("6F8BB968-C14F-4D6F-9733-6C6737B35DCE")
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]);
diff --git a/application/palemoon/components/migration/SafariProfileMigrator.js b/application/palemoon/components/migration/SafariProfileMigrator.js
deleted file mode 100644
index 70804793d..000000000
--- a/application/palemoon/components/migration/SafariProfileMigrator.js
+++ /dev/null
@@ -1,416 +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";
-
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-let Cu = Components.utils;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource:///modules/MigrationUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PropertyListUtils",
- "resource://gre/modules/PropertyListUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
- "resource://gre/modules/PlacesUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
- "resource://gre/modules/FormHistory.jsm");
-
-function Bookmarks(aBookmarksFile) {
- this._file = aBookmarksFile;
-}
-Bookmarks.prototype = {
- type: MigrationUtils.resourceTypes.BOOKMARKS,
-
- migrate: function B_migrate(aCallback) {
- PropertyListUtils.read(this._file,
- MigrationUtils.wrapMigrateFunction(function migrateBookmarks(aDict) {
- if (!aDict)
- throw new Error("Could not read Bookmarks.plist");
-
- let children = aDict.get("Children");;
- if (!children)
- throw new Error("Invalid Bookmarks.plist format");
-
- PlacesUtils.bookmarks.runInBatchMode({
- runBatched: function() {
- let collection = aDict.get("Title") == "com.apple.ReadingList" ?
- this.READING_LIST_COLLECTION : this.ROOT_COLLECTION;
- this._migrateCollection(children, collection);
- }.bind(this)
- }, null);
- }.bind(this), aCallback));
- },
-
- // Bookmarks collections in Safari. Constants for migrateCollection.
- ROOT_COLLECTION: 0,
- MENU_COLLECTION: 1,
- TOOLBAR_COLLECTION: 2,
- READING_LIST_COLLECTION: 3,
-
- /**
- * Recursively migrate a Safari collection of bookmarks.
- *
- * @param aEntries
- * the collection's children
- * @param aCollection
- * one of the values above.
- */
- _migrateCollection: function B__migrateCollection(aEntries, aCollection) {
- // A collection of bookmarks in Safari resembles places roots. In the
- // property list files (Bookmarks.plist, ReadingList.plist) they are
- // stored as regular bookmarks folders, and thus can only be distinguished
- // from by their names and places in the hierarchy.
-
- let entriesFiltered = [];
- if (aCollection == this.ROOT_COLLECTION) {
- for (let entry of aEntries) {
- let type = entry.get("WebBookmarkType");
- if (type == "WebBookmarkTypeList" && entry.has("Children")) {
- let title = entry.get("Title");
- let children = entry.get("Children");
- if (title == "BookmarksBar")
- this._migrateCollection(children, this.TOOLBAR_COLLECTION);
- else if (title == "BookmarksMenu")
- this._migrateCollection(children, this.MENU_COLLECTION);
- else if (title == "com.apple.ReadingList")
- this._migrateCollection(children, this.READING_LIST_COLLECTION);
- else if (entry.get("ShouldOmitFromUI") !== true)
- entriesFiltered.push(entry);
- }
- else if (type == "WebBookmarkTypeLeaf") {
- entriesFiltered.push(entry);
- }
- }
- }
- else {
- entriesFiltered = aEntries;
- }
-
- if (entriesFiltered.length == 0)
- return;
-
- let folder = -1;
- switch (aCollection) {
- case this.ROOT_COLLECTION: {
- // In Safari, it is possible (though quite cumbersome) to move
- // bookmarks to the bookmarks root, which is the parent folder of
- // all bookmarks "collections". That is somewhat in parallel with
- // both the places root and the unfiled-bookmarks root.
- // Because the former is only an implementation detail in our UI,
- // the unfiled root seems to be the best choice.
- folder = PlacesUtils.unfiledBookmarksFolderId;
- break;
- }
- case this.MENU_COLLECTION: {
- folder = PlacesUtils.bookmarksMenuFolderId;
- if (!MigrationUtils.isStartupMigration) {
- folder = MigrationUtils.createImportedBookmarksFolder("Safari",
- folder);
- }
- break;
- }
- case this.TOOLBAR_COLLECTION: {
- folder = PlacesUtils.toolbarFolderId;
- if (!MigrationUtils.isStartupMigration) {
- folder = MigrationUtils.createImportedBookmarksFolder("Safari",
- folder);
- }
- break;
- }
- case this.READING_LIST_COLLECTION: {
- // Reading list items are imported as regular bookmarks.
- // They are imported under their own folder, created either under the
- // bookmarks menu (in the case of startup migration).
- folder = PlacesUtils.bookmarks.createFolder(
- PlacesUtils.bookmarksMenuFolderId,
- MigrationUtils.getLocalizedString("importedSafariReadingList"),
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- break;
- }
- default:
- throw new Error("Unexpected value for aCollection!");
- }
-
- this._migrateEntries(entriesFiltered, folder);
- },
-
- // migrate the given array of safari bookmarks to the given places
- // folder.
- _migrateEntries: function B__migrateEntries(aEntries, aFolderId) {
- for (let entry of aEntries) {
- let type = entry.get("WebBookmarkType");
- if (type == "WebBookmarkTypeList" && entry.has("Children")) {
- let title = entry.get("Title");
- let folderId = PlacesUtils.bookmarks.createFolder(
- aFolderId, title, PlacesUtils.bookmarks.DEFAULT_INDEX);
-
- // Empty folders may not have a children array.
- if (entry.has("Children"))
- this._migrateEntries(entry.get("Children"), folderId, false);
- }
- else if (type == "WebBookmarkTypeLeaf" && entry.has("URLString")) {
- let title, uri;
- if (entry.has("URIDictionary"))
- title = entry.get("URIDictionary").get("title");
-
- try {
- uri = NetUtil.newURI(entry.get("URLString"));
- }
- catch(ex) {
- Cu.reportError("Invalid uri set for Safari bookmark: " + entry.get("URLString"));
- }
- if (uri) {
- PlacesUtils.bookmarks.insertBookmark(aFolderId, uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX, title);
- }
- }
- }
- }
-};
-
-function History(aHistoryFile) {
- this._file = aHistoryFile;
-}
-History.prototype = {
- type: MigrationUtils.resourceTypes.HISTORY,
-
- // Helper method for converting the visit date property to a PRTime value.
- // The visit date is stored as a string, so it's not read as a Date
- // object by PropertyListUtils.
- _parseCocoaDate: function H___parseCocoaDate(aCocoaDateStr) {
- let asDouble = parseFloat(aCocoaDateStr);
- if (!isNaN(asDouble)) {
- // reference date of NSDate.
- let date = new Date("1 January 2001, GMT");
- date.setMilliseconds(asDouble * 1000);
- return date * 1000;
- }
- return 0;
- },
-
- migrate: function H_migrate(aCallback) {
- PropertyListUtils.read(this._file, function migrateHistory(aDict) {
- try {
- if (!aDict)
- throw new Error("Could not read history property list");
- if (!aDict.has("WebHistoryDates"))
- throw new Error("Unexpected history-property list format");
-
- // Safari's History file contains only top-level urls. It does not
- // distinguish between typed urls and linked urls.
- let transType = PlacesUtils.history.TRANSITION_LINK;
-
- let places = [];
- let entries = aDict.get("WebHistoryDates");
- for (let entry of entries) {
- if (entry.has("lastVisitedDate")) {
- let visitDate = this._parseCocoaDate(entry.get("lastVisitedDate"));
- places.push({ uri: NetUtil.newURI(entry.get("")),
- title: entry.get("title"),
- visits: [{ transitionType: transType,
- visitDate: visitDate }] });
- }
- }
- if (places.length > 0) {
- PlacesUtils.asyncHistory.updatePlaces(places, {
- _success: false,
- handleResult: function() {
- // Importing any entry is considered a successful import.
- this._success = true;
- },
- handleError: function() {},
- handleCompletion: function() {
- aCallback(this._success);
- }
- });
- }
- else {
- aCallback(false);
- }
- }
- catch(ex) {
- Cu.reportError(ex);
- aCallback(false);
- }
- }.bind(this));
- }
-};
-
-/**
- * Safari's preferences property list is independently used for three purposes:
- * (a) importation of preferences
- * (b) importation of search strings
- * (c) retrieving the home page.
- *
- * So, rather than reading it three times, it's cached and managed here.
- */
-function MainPreferencesPropertyList(aPreferencesFile) {
- this._file = aPreferencesFile;
- this._callbacks = [];
-}
-MainPreferencesPropertyList.prototype = {
- /**
- * @see PropertyListUtils.read
- */
- read: function MPPL_read(aCallback) {
- if ("_dict" in this) {
- aCallback(this._dict);
- return;
- }
-
- let alreadyReading = this._callbacks.length > 0;
- this._callbacks.push(aCallback);
- if (!alreadyReading) {
- PropertyListUtils.read(this._file, function readPrefs(aDict) {
- this._dict = aDict;
- for (let callback of this._callbacks) {
- try {
- callback(aDict);
- }
- catch(ex) {
- Cu.reportError(ex);
- }
- }
- this._callbacks.splice(0);
- }.bind(this));
- }
- },
-
- // Workaround for nsIBrowserProfileMigrator.sourceHomePageURL until
- // it's replaced with an async method.
- _readSync: function MPPL__readSync() {
- if ("_dict" in this)
- return this._dict;
-
- let inputStream = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- inputStream.init(this._file, -1, -1, 0);
- let binaryStream = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- binaryStream.setInputStream(inputStream);
- let bytes = binaryStream.readByteArray(inputStream.available());
- this._dict = PropertyListUtils._readFromArrayBufferSync(
- Uint8Array(bytes).buffer);
- return this._dict;
- }
-};
-
-function SearchStrings(aMainPreferencesPropertyListInstance) {
- this._mainPreferencesPropertyList = aMainPreferencesPropertyListInstance;
-}
-SearchStrings.prototype = {
- type: MigrationUtils.resourceTypes.OTHERDATA,
-
- migrate: function SS_migrate(aCallback) {
- this._mainPreferencesPropertyList.read(MigrationUtils.wrapMigrateFunction(
- function migrateSearchStrings(aDict) {
- if (!aDict)
- throw new Error("Could not get preferences dictionary");
-
- if (aDict.has("RecentSearchStrings")) {
- let recentSearchStrings = aDict.get("RecentSearchStrings");
- if (recentSearchStrings && recentSearchStrings.length > 0) {
- let changes = [{op: "add",
- fieldname: "searchbar-history",
- value: searchString}
- for (searchString of recentSearchStrings)];
- FormHistory.update(changes);
- }
- }
- }.bind(this), aCallback));
- }
-};
-
-function SafariProfileMigrator() {
-}
-
-SafariProfileMigrator.prototype = Object.create(MigratorPrototype);
-
-SafariProfileMigrator.prototype.getResources = function SM_getResources() {
- let profileDir =
-#ifdef XP_MACOSX
- FileUtils.getDir("ULibDir", ["Safari"], false);
-#else
- FileUtils.getDir("AppData", ["Apple Computer", "Safari"], false);
-#endif
- if (!profileDir.exists())
- return null;
-
- let resources = [];
- let pushProfileFileResource = function(aFileName, aConstructor) {
- let file = profileDir.clone();
- file.append(aFileName);
- if (file.exists())
- resources.push(new aConstructor(file));
- };
-
- pushProfileFileResource("History.plist", History);
- pushProfileFileResource("Bookmarks.plist", Bookmarks);
-
- // The Reading List feature was introduced at the same time in Windows and
- // Mac versions of Safari. Not surprisingly, they are stored in the same
- // format in both versions. Surpsingly, only on Windows there is a
- // separate property list for it. This isn't #ifdefed out on mac, because
- // Apple may fix this at some point.
- pushProfileFileResource("ReadingList.plist", Bookmarks);
-
- let prefsDir =
-#ifdef XP_MACOSX
- FileUtils.getDir("UsrPrfs", [], false);
-#else
- FileUtils.getDir("AppData", ["Apple Computer", "Preferences"], false);
-#endif
-
- let prefs = this.mainPreferencesPropertyList;
- if (prefs) {
- resources.push(new SearchStrings(prefs));
- }
-
- return resources;
-};
-
-Object.defineProperty(SafariProfileMigrator.prototype, "mainPreferencesPropertyList", {
- get: function get_mainPreferencesPropertyList() {
- if (this._mainPreferencesPropertyList === undefined) {
- let file =
-#ifdef XP_MACOSX
- FileUtils.getDir("UsrPrfs", [], false);
-#else
- FileUtils.getDir("AppData", ["Apple Computer", "Preferences"], false);
-#endif
- if (file.exists()) {
- file.append("com.apple.Safari.plist");
- if (file.exists()) {
- return this._mainPreferencesPropertyList =
- new MainPreferencesPropertyList(file);
- }
- }
- return this._mainPreferencesPropertyList = null;
- }
- return this._mainPreferencesPropertyList;
- }
-});
-
-Object.defineProperty(SafariProfileMigrator.prototype, "sourceHomePageURL", {
- get: function get_sourceHomePageURL() {
- if (this.mainPreferencesPropertyList) {
- let dict = this.mainPreferencesPropertyList._readSync();
- if (dict.has("HomePage"))
- return dict.get("HomePage");
- }
- return "";
- }
-});
-
-SafariProfileMigrator.prototype.classDescription = "Safari Profile Migrator";
-SafariProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=safari";
-SafariProfileMigrator.prototype.classID = Components.ID("{4b609ecf-60b2-4655-9df4-dc149e474da1}");
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]);
diff --git a/application/palemoon/components/migration/content/migration.js b/application/palemoon/components/migration/content/migration.js
deleted file mode 100644
index 512197b8b..000000000
--- a/application/palemoon/components/migration/content/migration.js
+++ /dev/null
@@ -1,474 +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/. */
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-const kIMig = Ci.nsIBrowserProfileMigrator;
-const kIPStartup = Ci.nsIProfileStartup;
-
-Cu.import("resource:///modules/MigrationUtils.jsm");
-
-var MigrationWizard = {
- _source: "", // Source Profile Migrator ContractID suffix
- _itemsFlags: kIMig.ALL, // Selected Import Data Sources (16-bit bitfield)
- _selectedProfile: null, // Selected Profile name to import from
- _wiz: null,
- _migrator: null,
- _autoMigrate: null,
-
- init: function ()
- {
- var os = Components.classes["@mozilla.org/observer-service;1"]
- .getService(Components.interfaces.nsIObserverService);
- os.addObserver(this, "Migration:Started", false);
- os.addObserver(this, "Migration:ItemBeforeMigrate", false);
- os.addObserver(this, "Migration:ItemAfterMigrate", false);
- os.addObserver(this, "Migration:ItemError", false);
- os.addObserver(this, "Migration:Ended", false);
-
- this._wiz = document.documentElement;
-
- if ("arguments" in window && window.arguments.length > 1) {
- this._source = window.arguments[0];
- this._migrator = window.arguments[1] instanceof kIMig ?
- window.arguments[1] : null;
- this._autoMigrate = window.arguments[2].QueryInterface(kIPStartup);
- this._skipImportSourcePage = window.arguments[3];
- if (this._migrator && window.arguments[4]) {
- let sourceProfiles = this._migrator.sourceProfiles;
- this._selectedProfile = sourceProfiles.find(profile => profile.id == window.arguments[4]);
- }
-
- if (this._autoMigrate) {
- // Show the "nothing" option in the automigrate case to provide an
- // easily identifiable way to avoid migration and create a new profile.
- var nothing = document.getElementById("nothing");
- nothing.hidden = false;
- }
- }
-
- this.onImportSourcePageShow();
- },
-
- uninit: function ()
- {
- var os = Components.classes["@mozilla.org/observer-service;1"]
- .getService(Components.interfaces.nsIObserverService);
- os.removeObserver(this, "Migration:Started");
- os.removeObserver(this, "Migration:ItemBeforeMigrate");
- os.removeObserver(this, "Migration:ItemAfterMigrate");
- os.removeObserver(this, "Migration:ItemError");
- os.removeObserver(this, "Migration:Ended");
- MigrationUtils.finishMigration();
- },
-
- // 1 - Import Source
- onImportSourcePageShow: function ()
- {
- this._wiz.canRewind = false;
-
- var selectedMigrator = null;
-
- // Figure out what source apps are are available to import from:
- var group = document.getElementById("importSourceGroup");
- for (var i = 0; i < group.childNodes.length; ++i) {
- var migratorKey = group.childNodes[i].id;
- if (migratorKey != "nothing") {
- var migrator = MigrationUtils.getMigrator(migratorKey);
- if (migrator) {
- // Save this as the first selectable item, if we don't already have
- // one, or if it is the migrator that was passed to us.
- if (!selectedMigrator || this._source == migratorKey)
- selectedMigrator = group.childNodes[i];
- } else {
- // Hide this option
- group.childNodes[i].hidden = true;
- }
- }
- }
-
- if (selectedMigrator)
- group.selectedItem = selectedMigrator;
- else {
- // We didn't find a migrator, notify the user
- document.getElementById("noSources").hidden = false;
-
- this._wiz.canAdvance = false;
-
- document.getElementById("importBookmarks").hidden = true;
- document.getElementById("importAll").hidden = true;
- }
-
- // Advance to the next page if the caller told us to.
- if (this._migrator && this._skipImportSourcePage) {
- this._wiz.advance();
- this._wiz.canRewind = false;
- }
- },
-
- onImportSourcePageAdvanced: function ()
- {
- var newSource = document.getElementById("importSourceGroup").selectedItem.id;
-
- if (newSource == "nothing") {
- document.documentElement.cancel();
- return false;
- }
-
- if (!this._migrator || (newSource != this._source)) {
- // Create the migrator for the selected source.
- this._migrator = MigrationUtils.getMigrator(newSource);
-
- this._itemsFlags = kIMig.ALL;
- this._selectedProfile = null;
- }
- this._source = newSource;
-
- // check for more than one source profile
- var sourceProfiles = this._migrator.sourceProfiles;
- if (this._skipImportSourcePage) {
- this._wiz.currentPage.next = "homePageImport";
- }
- else if (sourceProfiles && sourceProfiles.length > 1) {
- this._wiz.currentPage.next = "selectProfile";
- }
- else {
- if (this._autoMigrate)
- this._wiz.currentPage.next = "homePageImport";
- else
- this._wiz.currentPage.next = "importItems";
-
- if (sourceProfiles && sourceProfiles.length == 1)
- this._selectedProfile = sourceProfiles[0];
- else
- this._selectedProfile = null;
- }
- },
-
- // 2 - [Profile Selection]
- onSelectProfilePageShow: function ()
- {
- // Disabling this for now, since we ask about import sources in automigration
- // too and don't want to disable the back button
- // if (this._autoMigrate)
- // document.documentElement.getButton("back").disabled = true;
-
- var profiles = document.getElementById("profiles");
- while (profiles.hasChildNodes())
- profiles.removeChild(profiles.firstChild);
-
- // Note that this block is still reached even if the user chose 'From File'
- // and we canceled the dialog. When that happens, _migrator will be null.
- if (this._migrator) {
- var sourceProfiles = this._migrator.sourceProfiles;
-
- for (let profile of sourceProfiles) {
- var item = document.createElement("radio");
- item.id = profile.id;
- item.setAttribute("label", profile.name);
- profiles.appendChild(item);
- }
- }
-
- profiles.selectedItem = this._selectedProfile ? document.getElementById(this._selectedProfile.id) : profiles.firstChild;
- },
-
- onSelectProfilePageRewound: function ()
- {
- var profiles = document.getElementById("profiles");
- this._selectedProfile = this._migrator.sourceProfiles.find(
- profile => profile.id == profiles.selectedItem.id
- ) || null;
- },
-
- onSelectProfilePageAdvanced: function ()
- {
- var profiles = document.getElementById("profiles");
- this._selectedProfile = this._migrator.sourceProfiles.find(
- profile => profile.id == profiles.selectedItem.id
- ) || null;
-
- // If we're automigrating or just doing bookmarks don't show the item selection page
- if (this._autoMigrate)
- this._wiz.currentPage.next = "homePageImport";
- },
-
- // 3 - ImportItems
- onImportItemsPageShow: function ()
- {
- var dataSources = document.getElementById("dataSources");
- while (dataSources.hasChildNodes())
- dataSources.removeChild(dataSources.firstChild);
-
- var items = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
- for (var i = 0; i < 16; ++i) {
- var itemID = (items >> i) & 0x1 ? Math.pow(2, i) : 0;
- if (itemID > 0) {
- var checkbox = document.createElement("checkbox");
- checkbox.id = itemID;
- checkbox.setAttribute("label",
- MigrationUtils.getLocalizedString(itemID + "_" + this._source));
- dataSources.appendChild(checkbox);
- if (!this._itemsFlags || this._itemsFlags & itemID)
- checkbox.checked = true;
- }
- }
- },
-
- onImportItemsPageRewound: function ()
- {
- this._wiz.canAdvance = true;
- this.onImportItemsPageAdvanced();
- },
-
- onImportItemsPageAdvanced: function ()
- {
- var dataSources = document.getElementById("dataSources");
- this._itemsFlags = 0;
- for (var i = 0; i < dataSources.childNodes.length; ++i) {
- var checkbox = dataSources.childNodes[i];
- if (checkbox.localName == "checkbox" && checkbox.checked)
- this._itemsFlags |= parseInt(checkbox.id);
- }
- },
-
- onImportItemCommand: function (aEvent)
- {
- var items = document.getElementById("dataSources");
- var checkboxes = items.getElementsByTagName("checkbox");
-
- var oneChecked = false;
- for (var i = 0; i < checkboxes.length; ++i) {
- if (checkboxes[i].checked) {
- oneChecked = true;
- break;
- }
- }
-
- this._wiz.canAdvance = oneChecked;
- },
-
- // 4 - Home Page Selection
- onHomePageMigrationPageShow: function ()
- {
- // only want this on the first run
- if (!this._autoMigrate) {
- this._wiz.advance();
- return;
- }
-
- var brandBundle = document.getElementById("brandBundle");
- // These strings don't exist when not using official branding. If that's
- // the case, just skip this page.
- try {
- var pageTitle = brandBundle.getString("homePageMigrationPageTitle");
- var pageDesc = brandBundle.getString("homePageMigrationDescription");
- var mainStr = brandBundle.getString("homePageSingleStartMain");
- }
- catch (e) {
- this._wiz.advance();
- return;
- }
-
- document.getElementById("homePageImport").setAttribute("label", pageTitle);
- document.getElementById("homePageImportDesc").setAttribute("value", pageDesc);
-
- this._wiz._adjustWizardHeader();
-
- var singleStart = document.getElementById("homePageSingleStart");
- singleStart.setAttribute("label", mainStr);
- singleStart.setAttribute("value", "DEFAULT");
-
- var source = null;
- switch (this._source) {
- case "ie":
- source = "sourceNameIE";
- break;
- case "safari":
- source = "sourceNameSafari";
- break;
- case "chrome":
- source = "sourceNameChrome";
- break;
- case "firefox":
- source = "sourceNameFirefox";
- break;
- }
-
- // semi-wallpaper for crash when multiple profiles exist, since we haven't initialized mSourceProfile in places
- this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
-
- var oldHomePageURL = this._migrator.sourceHomePageURL;
-
- if (oldHomePageURL && source) {
- var appName = MigrationUtils.getLocalizedString(source);
- var oldHomePageLabel =
- brandBundle.getFormattedString("homePageImport", [appName]);
- var oldHomePage = document.getElementById("oldHomePage");
- oldHomePage.setAttribute("label", oldHomePageLabel);
- oldHomePage.setAttribute("value", oldHomePageURL);
- oldHomePage.removeAttribute("hidden");
- }
- else {
- // if we don't have at least two options, just advance
- this._wiz.advance();
- }
- },
-
- onHomePageMigrationPageAdvanced: function ()
- {
- // we might not have a selectedItem if we're in fallback mode
- try {
- var radioGroup = document.getElementById("homePageRadiogroup");
-
- this._newHomePage = radioGroup.selectedItem.value;
- } catch(ex) {}
- },
-
- // 5 - Migrating
- onMigratingPageShow: function ()
- {
- this._wiz.getButton("cancel").disabled = true;
- this._wiz.canRewind = false;
- this._wiz.canAdvance = false;
-
- // When automigrating, show all of the data that can be received from this source.
- if (this._autoMigrate)
- this._itemsFlags = this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate);
-
- this._listItems("migratingItems");
- setTimeout(this.onMigratingMigrate, 0, this);
- },
-
- onMigratingMigrate: function (aOuter)
- {
- aOuter._migrator.migrate(aOuter._itemsFlags, aOuter._autoMigrate, aOuter._selectedProfile);
- },
-
- _listItems: function (aID)
- {
- var items = document.getElementById(aID);
- while (items.hasChildNodes())
- items.removeChild(items.firstChild);
-
- var brandBundle = document.getElementById("brandBundle");
- var itemID;
- for (var i = 0; i < 16; ++i) {
- var itemID = (this._itemsFlags >> i) & 0x1 ? Math.pow(2, i) : 0;
- if (itemID > 0) {
- var label = document.createElement("label");
- label.id = itemID + "_migrated";
- try {
- label.setAttribute("value",
- MigrationUtils.getLocalizedString(itemID + "_" + this._source));
- items.appendChild(label);
- }
- catch (e) {
- // if the block above throws, we've enumerated all the import data types we
- // currently support and are now just wasting time, break.
- break;
- }
- }
- }
- },
-
- observe: function (aSubject, aTopic, aData)
- {
- switch (aTopic) {
- case "Migration:Started":
- break;
- case "Migration:ItemBeforeMigrate":
- var label = document.getElementById(aData + "_migrated");
- if (label)
- label.setAttribute("style", "font-weight: bold");
- break;
- case "Migration:ItemAfterMigrate":
- var label = document.getElementById(aData + "_migrated");
- if (label)
- label.removeAttribute("style");
- break;
- case "Migration:Ended":
- if (this._autoMigrate) {
- if (this._newHomePage) {
- try {
- // set homepage properly
- var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService);
- var prefBranch = prefSvc.getBranch(null);
-
- if (this._newHomePage == "DEFAULT") {
- prefBranch.clearUserPref("browser.startup.homepage");
- }
- else {
- var str = Components.classes["@mozilla.org/supports-string;1"]
- .createInstance(Components.interfaces.nsISupportsString);
- str.data = this._newHomePage;
- prefBranch.setComplexValue("browser.startup.homepage",
- Components.interfaces.nsISupportsString,
- str);
- }
-
- var dirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties);
- var prefFile = dirSvc.get("ProfDS", Components.interfaces.nsIFile);
- prefFile.append("prefs.js");
- prefSvc.savePrefFile(prefFile);
- } catch(ex) {
- dump(ex);
- }
- }
-
- // We're done now.
- this._wiz.canAdvance = true;
- this._wiz.advance();
-
- setTimeout(close, 5000);
- }
- else {
- this._wiz.canAdvance = true;
- var nextButton = this._wiz.getButton("next");
- nextButton.click();
- }
- break;
- case "Migration:ItemError":
- var type = "undefined";
- switch (parseInt(aData)) {
- case Ci.nsIBrowserProfileMigrator.SETTINGS:
- type = "settings";
- break;
- case Ci.nsIBrowserProfileMigrator.COOKIES:
- type = "cookies";
- break;
- case Ci.nsIBrowserProfileMigrator.HISTORY:
- type = "history";
- break;
- case Ci.nsIBrowserProfileMigrator.FORMDATA:
- type = "form data";
- break;
- case Ci.nsIBrowserProfileMigrator.PASSWORDS:
- type = "passwords";
- break;
- case Ci.nsIBrowserProfileMigrator.BOOKMARKS:
- type = "bookmarks";
- break;
- case Ci.nsIBrowserProfileMigrator.OTHERDATA:
- type = "misc. data";
- break;
- }
- Cc["@mozilla.org/consoleservice;1"]
- .getService(Ci.nsIConsoleService)
- .logStringMessage("some " + type + " did not successfully migrate.");
- break;
- }
- },
-
- onDonePageShow: function ()
- {
- this._wiz.getButton("cancel").disabled = true;
- this._wiz.canRewind = false;
- this._listItems("doneItems");
- }
-};
diff --git a/application/palemoon/components/migration/content/migration.xul b/application/palemoon/components/migration/content/migration.xul
deleted file mode 100644
index 2c8df7b3e..000000000
--- a/application/palemoon/components/migration/content/migration.xul
+++ /dev/null
@@ -1,96 +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"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/migration/migration.dtd" >
-
-<wizard id="migrationWizard"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- windowtype="Browser:MigrationWizard"
- title="&migrationWizard.title;"
- onload="MigrationWizard.init()"
- onunload="MigrationWizard.uninit()"
- style="width: 40em;"
- buttons="accept,cancel"
- branded="true">
-
- <script type="application/javascript" src="chrome://browser/content/migration/migration.js"/>
-
- <stringbundle id="brandBundle" src="chrome://branding/locale/brand.properties"/>
-
- <wizardpage id="importSource" pageid="importSource" next="selectProfile"
- label="&importSource.title;"
- onpageadvanced="return MigrationWizard.onImportSourcePageAdvanced();">
- <description id="importAll" control="importSourceGroup">&importFrom.label;</description>
- <description id="importBookmarks" control="importSourceGroup" hidden="true">&importFromBookmarks.label;</description>
-
- <radiogroup id="importSourceGroup" align="start">
- <radio id="firefox" label="&importFromFirefox.label;" accesskey="&importFromFirefox.accesskey;"/>
-#ifdef XP_WIN
- <radio id="ie" label="&importFromIE.label;" accesskey="&importFromIE.accesskey;"/>
- <radio id="chrome" label="&importFromChrome.label;" accesskey="&importFromChrome.accesskey;"/>
- <radio id="safari" label="&importFromSafari.label;" accesskey="&importFromSafari.accesskey;"/>
-#elifdef XP_MACOSX
- <radio id="safari" label="&importFromSafari.label;" accesskey="&importFromSafari.accesskey;"/>
- <radio id="chrome" label="&importFromChrome.label;" accesskey="&importFromChrome.accesskey;"/>
-#elifdef XP_UNIX
- <radio id="chrome" label="&importFromChrome.label;" accesskey="&importFromChrome.accesskey;"/>
-#endif
- <radio id="nothing" label="&importFromNothing.label;" accesskey="&importFromNothing.accesskey;" hidden="true"/>
- </radiogroup>
- <label id="noSources" hidden="true">&noMigrationSources.label;</label>
- </wizardpage>
-
- <wizardpage id="selectProfile" pageid="selectProfile" label="&selectProfile.title;"
- next="importItems"
- onpageshow="return MigrationWizard.onSelectProfilePageShow();"
- onpagerewound="return MigrationWizard.onSelectProfilePageRewound();"
- onpageadvanced="return MigrationWizard.onSelectProfilePageAdvanced();">
- <description control="profiles">&selectProfile.label;</description>
-
- <radiogroup id="profiles" align="left"/>
- </wizardpage>
-
- <wizardpage id="importItems" pageid="importItems" label="&importItems.title;"
- next="homePageImport"
- onpageshow="return MigrationWizard.onImportItemsPageShow();"
- onpagerewound="return MigrationWizard.onImportItemsPageRewound();"
- onpageadvanced="return MigrationWizard.onImportItemsPageAdvanced();"
- oncommand="MigrationWizard.onImportItemCommand();">
- <description control="dataSources">&importItems.label;</description>
-
- <vbox id="dataSources" style="overflow: auto; -moz-appearance: listbox" align="left" flex="1" role="group"/>
- </wizardpage>
-
- <wizardpage id="homePageImport" pageid="homePageImport"
- next="migrating"
- onpageshow="return MigrationWizard.onHomePageMigrationPageShow();"
- onpageadvanced="return MigrationWizard.onHomePageMigrationPageAdvanced();">
-
- <description id="homePageImportDesc" control="homePageRadioGroup"/>
- <radiogroup id="homePageRadiogroup">
- <radio id="homePageSingleStart" selected="true" />
- <radio id="oldHomePage" hidden="true" />
- </radiogroup>
- </wizardpage>
-
- <wizardpage id="migrating" pageid="migrating" label="&migrating.title;"
- next="done"
- onpageshow="MigrationWizard.onMigratingPageShow();">
- <description control="migratingItems">&migrating.label;</description>
-
- <vbox id="migratingItems" style="overflow: auto;" align="left" role="group"/>
- </wizardpage>
-
- <wizardpage id="done" pageid="done" label="&done.title;"
- onpageshow="MigrationWizard.onDonePageShow();">
- <description control="doneItems">&done.label;</description>
-
- <vbox id="doneItems" style="overflow: auto;" align="left" role="group"/>
- </wizardpage>
-
-</wizard>
-
diff --git a/application/palemoon/components/migration/moz.build b/application/palemoon/components/migration/moz.build
deleted file mode 100644
index 4cbf7b8ea..000000000
--- a/application/palemoon/components/migration/moz.build
+++ /dev/null
@@ -1,53 +0,0 @@
-# -*- 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']
-
-XPIDL_SOURCES += [
- 'nsIBrowserProfileMigrator.idl',
-]
-
-XPIDL_MODULE = 'migration'
-
-if CONFIG['OS_ARCH'] == 'WINNT':
- SOURCES += [
- 'nsIEHistoryEnumerator.cpp',
- ]
-
-EXTRA_COMPONENTS += [
- 'FirefoxProfileMigrator.js',
- 'ProfileMigrator.js',
-]
-
-if CONFIG['OS_ARCH'] == 'WINNT':
- EXTRA_COMPONENTS += [
- 'IEProfileMigrator.js',
- ]
- DEFINES['HAS_IE_MIGRATOR'] = True
-
-EXTRA_PP_COMPONENTS += [
- 'BrowserProfileMigrators.manifest',
- 'ChromeProfileMigrator.js',
-]
-
-if CONFIG['OS_ARCH'] == 'WINNT':
- EXTRA_PP_COMPONENTS += [
- 'SafariProfileMigrator.js',
- ]
- DEFINES['HAS_SAFARI_MIGRATOR'] = True
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- EXTRA_PP_COMPONENTS += [
- 'SafariProfileMigrator.js',
- ]
- DEFINES['HAS_SAFARI_MIGRATOR'] = True
-
-EXTRA_PP_JS_MODULES += [
- 'MigrationUtils.jsm',
-]
-
-FINAL_LIBRARY = 'browsercomps'
-
diff --git a/application/palemoon/components/migration/nsIBrowserProfileMigrator.idl b/application/palemoon/components/migration/nsIBrowserProfileMigrator.idl
deleted file mode 100644
index ebff4628c..000000000
--- a/application/palemoon/components/migration/nsIBrowserProfileMigrator.idl
+++ /dev/null
@@ -1,63 +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/. */
-
-#include "nsISupports.idl"
-
-interface nsIArray;
-interface nsIProfileStartup;
-
-[scriptable, uuid(30e5a7ec-f71e-4f41-9dbd-7429c02132ec)]
-interface nsIBrowserProfileMigrator : nsISupports
-{
- /**
- * profile items to migrate. use with migrate().
- */
- const unsigned short ALL = 0x0000;
- const unsigned short SETTINGS = 0x0001;
- const unsigned short COOKIES = 0x0002;
- const unsigned short HISTORY = 0x0004;
- const unsigned short FORMDATA = 0x0008;
- const unsigned short PASSWORDS = 0x0010;
- const unsigned short BOOKMARKS = 0x0020;
- const unsigned short OTHERDATA = 0x0040;
-
- /**
- * Copy user profile information to the current active profile.
- * @param aItems list of data items to migrate. see above for values.
- * @param aStartup helper interface which is non-null if called during startup.
- * @param aProfile profile to migrate from, if there is more than one.
- */
- void migrate(in unsigned short aItems, in nsIProfileStartup aStartup, in jsval aProfile);
-
- /**
- * A bit field containing profile items that this migrator
- * offers for import.
- * @param aProfile the profile that we are looking for available data
- * to import
- * @param aDoingStartup "true" if the profile is not currently being used.
- * @return bit field containing profile items (see above)
- * @note a return value of 0 represents no items rather than ALL.
- */
- unsigned short getMigrateData(in jsval aProfile, in boolean aDoingStartup);
-
- /**
- * Whether or not there is any data that can be imported from this
- * browser (i.e. whether or not it is installed, and there exists
- * a user profile)
- */
- readonly attribute boolean sourceExists;
-
-
- /**
- * An enumeration of available profiles. If the import source does
- * not support profiles, this attribute is null.
- */
- readonly attribute jsval sourceProfiles;
-
- /**
- * The import source homepage. Returns null if not present/available
- */
- readonly attribute AUTF8String sourceHomePageURL;
-};
diff --git a/application/palemoon/components/migration/nsIEHistoryEnumerator.cpp b/application/palemoon/components/migration/nsIEHistoryEnumerator.cpp
deleted file mode 100644
index 7fe31a666..000000000
--- a/application/palemoon/components/migration/nsIEHistoryEnumerator.cpp
+++ /dev/null
@@ -1,139 +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 "nsIEHistoryEnumerator.h"
-
-#include <urlhist.h>
-#include <shlguid.h>
-
-#include "nsStringAPI.h"
-#include "nsNetUtil.h"
-#include "nsIVariant.h"
-#include "nsCOMArray.h"
-#include "nsArrayEnumerator.h"
-
-namespace {
-
- PRTime FileTimeToPRTime(FILETIME* filetime)
- {
- SYSTEMTIME st;
- ::FileTimeToSystemTime(filetime, &st);
- PRExplodedTime prt;
- prt.tm_year = st.wYear;
- // SYSTEMTIME's day-of-month parameter is 1-based,
- // PRExplodedTime's is 0-based.
- prt.tm_month = st.wMonth - 1;
- prt.tm_mday = st.wDay;
- prt.tm_hour = st.wHour;
- prt.tm_min = st.wMinute;
- prt.tm_sec = st.wSecond;
- prt.tm_usec = st.wMilliseconds * 1000;
- prt.tm_wday = 0;
- prt.tm_yday = 0;
- prt.tm_params.tp_gmt_offset = 0;
- prt.tm_params.tp_dst_offset = 0;
- return PR_ImplodeTime(&prt);
- }
-
-} // Anonymous namespace.
-
-////////////////////////////////////////////////////////////////////////////////
-//// nsIEHistoryEnumerator
-
-NS_IMPL_ISUPPORTS(nsIEHistoryEnumerator, nsISimpleEnumerator)
-
-nsIEHistoryEnumerator::nsIEHistoryEnumerator()
-{
- ::CoInitialize(nullptr);
-}
-
-nsIEHistoryEnumerator::~nsIEHistoryEnumerator()
-{
- ::CoUninitialize();
-}
-
-void
-nsIEHistoryEnumerator::EnsureInitialized()
-{
- if (mURLEnumerator)
- return;
-
- HRESULT hr = ::CoCreateInstance(CLSID_CUrlHistory,
- nullptr,
- CLSCTX_INPROC_SERVER,
- IID_IUrlHistoryStg2,
- getter_AddRefs(mIEHistory));
- if (FAILED(hr))
- return;
-
- hr = mIEHistory->EnumUrls(getter_AddRefs(mURLEnumerator));
- if (FAILED(hr))
- return;
-}
-
-NS_IMETHODIMP
-nsIEHistoryEnumerator::HasMoreElements(bool* _retval)
-{
- *_retval = false;
-
- EnsureInitialized();
- MOZ_ASSERT(mURLEnumerator, "Should have instanced an IE History URLEnumerator");
- if (!mURLEnumerator)
- return NS_OK;
-
- STATURL statURL;
- ULONG fetched;
-
- // First argument is not implemented, so doesn't matter what we pass.
- HRESULT hr = mURLEnumerator->Next(1, &statURL, &fetched);
- if (FAILED(hr) || fetched != 1UL) {
- // Reached the last entry.
- return NS_OK;
- }
-
- nsCOMPtr<nsIURI> uri;
- if (statURL.pwcsUrl) {
- nsDependentString url(statURL.pwcsUrl);
- nsresult rv = NS_NewURI(getter_AddRefs(uri), url);
- ::CoTaskMemFree(statURL.pwcsUrl);
- if (NS_FAILED(rv)) {
- // Got a corrupt or invalid URI, continue to the next entry.
- return HasMoreElements(_retval);
- }
- }
-
- nsDependentString title(statURL.pwcsTitle);
-
- PRTime lastVisited = FileTimeToPRTime(&(statURL.ftLastVisited));
-
- mCachedNextEntry = do_CreateInstance("@mozilla.org/hash-property-bag;1");
- MOZ_ASSERT(mCachedNextEntry, "Should have instanced a new property bag");
- if (mCachedNextEntry) {
- mCachedNextEntry->SetPropertyAsInterface(NS_LITERAL_STRING("uri"), uri);
- mCachedNextEntry->SetPropertyAsAString(NS_LITERAL_STRING("title"), title);
- mCachedNextEntry->SetPropertyAsInt64(NS_LITERAL_STRING("time"), lastVisited);
-
- *_retval = true;
- }
-
- if (statURL.pwcsTitle)
- ::CoTaskMemFree(statURL.pwcsTitle);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsIEHistoryEnumerator::GetNext(nsISupports** _retval)
-{
- *_retval = nullptr;
-
- if (!mCachedNextEntry)
- return NS_ERROR_FAILURE;
-
- NS_ADDREF(*_retval = mCachedNextEntry);
- // Release the cached entry, so it can't be returned twice.
- mCachedNextEntry = nullptr;
-
- return NS_OK;
-}
diff --git a/application/palemoon/components/migration/nsIEHistoryEnumerator.h b/application/palemoon/components/migration/nsIEHistoryEnumerator.h
deleted file mode 100644
index fc1419859..000000000
--- a/application/palemoon/components/migration/nsIEHistoryEnumerator.h
+++ /dev/null
@@ -1,37 +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/. */
-
-#ifndef iehistoryenumerator___h___
-#define iehistoryenumerator___h___
-
-#include <urlhist.h>
-
-#include "mozilla/Attributes.h"
-#include "nsISimpleEnumerator.h"
-#include "nsIWritablePropertyBag2.h"
-#include "nsAutoPtr.h"
-
-class nsIEHistoryEnumerator final : public nsISimpleEnumerator
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSISIMPLEENUMERATOR
-
- nsIEHistoryEnumerator();
-
-private:
- ~nsIEHistoryEnumerator();
-
- /**
- * Initializes the history reader, if needed.
- */
- void EnsureInitialized();
-
- nsRefPtr<IUrlHistoryStg2> mIEHistory;
- nsRefPtr<IEnumSTATURL> mURLEnumerator;
-
- nsCOMPtr<nsIWritablePropertyBag2> mCachedNextEntry;
-};
-
-#endif
diff --git a/application/palemoon/components/moz.build b/application/palemoon/components/moz.build
index 1c1098f0a..6e83936a9 100644
--- a/application/palemoon/components/moz.build
+++ b/application/palemoon/components/moz.build
@@ -17,7 +17,6 @@ DIRS += [
'search',
'sessionstore',
'shell',
- 'migration',
]
if CONFIG['MOZ_BROWSER_STATUSBAR']:
diff --git a/application/palemoon/components/nsBrowserContentHandler.js b/application/palemoon/components/nsBrowserContentHandler.js
index 13ea9da12..6a75b40f2 100644
--- a/application/palemoon/components/nsBrowserContentHandler.js
+++ b/application/palemoon/components/nsBrowserContentHandler.js
@@ -518,16 +518,16 @@ nsBrowserContentHandler.prototype = {
#endif
},
- helpInfo : " -browser Open a browser window.\n" +
- " -new-window <url> Open <url> in a new window.\n" +
- " -new-tab <url> Open <url> in a new tab.\n" +
- " -private-window <url> Open <url> in a new private window.\n" +
+ helpInfo : " --browser Open a browser window.\n" +
+ " --new-window <url> Open <url> in a new window.\n" +
+ " --new-tab <url> Open <url> in a new tab.\n" +
+ " --private-window <url> Open <url> in a new private window.\n" +
#ifdef XP_WIN
- " -preferences Open Options dialog.\n" +
+ " --preferences Open Options dialog.\n" +
#else
- " -preferences Open Preferences dialog.\n" +
+ " --preferences Open Preferences dialog.\n" +
#endif
- " -search <term> Search <term> with your default search engine.\n",
+ " --search <term> Search <term> with your default search engine.\n",
/* nsIBrowserHandler */
diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js
index 705593b59..225cddd52 100644
--- a/application/palemoon/components/nsBrowserGlue.js
+++ b/application/palemoon/components/nsBrowserGlue.js
@@ -13,59 +13,31 @@ const XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "UserAgentOverrides",
- "resource://gre/modules/UserAgentOverrides.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
- "resource://gre/modules/PlacesUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "BookmarkHTMLUtils",
- "resource://gre/modules/BookmarkHTMLUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "BookmarkJSONUtils",
- "resource://gre/modules/BookmarkJSONUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PageThumbs",
- "resource://gre/modules/PageThumbs.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "NewTabUtils",
- "resource://gre/modules/NewTabUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "BrowserNewTabPreloader",
- "resource:///modules/BrowserNewTabPreloader.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "webrtcUI",
- "resource:///modules/webrtcUI.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
- "resource://gre/modules/PrivateBrowsingUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
- "resource:///modules/RecentWindow.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesBackups",
- "resource://gre/modules/PlacesBackups.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "LoginManagerParent",
- "resource://gre/modules/LoginManagerParent.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "FormValidationHandler",
- "resource:///modules/FormValidationHandler.jsm");
+// Define Lazy Module Gitters
+[
+ ["AddonManager", "resource://gre/modules/AddonManager.jsm"],
+ ["NetUtil", "resource://gre/modules/NetUtil.jsm"],
+ ["UserAgentOverrides", "resource://gre/modules/UserAgentOverrides.jsm"],
+ ["FileUtils", "resource://gre/modules/FileUtils.jsm"],
+ ["PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"],
+ ["BookmarkHTMLUtils", "resource://gre/modules/BookmarkHTMLUtils.jsm"],
+ ["BookmarkJSONUtils", "resource://gre/modules/BookmarkJSONUtils.jsm"],
+ ["PageThumbs", "resource://gre/modules/PageThumbs.jsm"],
+ ["NewTabUtils", "resource://gre/modules/NewTabUtils.jsm"],
+ ["BrowserNewTabPreloader", "resource:///modules/BrowserNewTabPreloader.jsm"],
+#ifdef MOZ_WEBRTC
+ ["webrtcUI", "resource:///modules/webrtcUI.jsm"],
+#endif
+ ["PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"],
+ ["RecentWindow", "resource:///modules/RecentWindow.jsm"],
+ ["Task", "resource://gre/modules/Task.jsm"],
+ ["PlacesBackups", "resource://gre/modules/PlacesBackups.jsm"],
+ ["OS", "resource://gre/modules/osfile.jsm"],
+ ["LoginManagerParent", "resource://gre/modules/LoginManagerParent.jsm"],
+ ["FormValidationHandler", "resource:///modules/FormValidationHandler.jsm"],
+ ["AutoCompletePopup", "resource:///modules/AutoCompletePopup.jsm"],
+ ["DateTimePickerHelper", "resource://gre/modules/DateTimePickerHelper.jsm"],
+].forEach(([name, resource]) => XPCOMUtils.defineLazyModuleGetter(this, name, resource));
const PREF_PLUGINS_NOTIFYUSER = "plugins.update.notifyUser";
const PREF_PLUGINS_UPDATEURL = "plugins.update.url";
@@ -197,6 +169,7 @@ BrowserGlue.prototype = {
} catch (e) {
Cu.reportError("Could not end startup crash tracking in quit-application-granted: " + e);
}
+ DateTimePickerHelper.uninit();
break;
#ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS
case "browser-lastwindow-close-requested":
@@ -284,7 +257,8 @@ BrowserGlue.prototype = {
if (!linkHandled.data) {
let win = this.getMostRecentBrowserWindow();
if (win) {
- win.openUILinkIn(data, "tab");
+ data = JSON.parse(data);
+ win.openUILinkIn(data.href, "tab");
linkHandled.data = true;
}
}
@@ -427,16 +401,15 @@ BrowserGlue.prototype = {
PageThumbs.init();
NewTabUtils.init();
BrowserNewTabPreloader.init();
+#ifdef MOZ_WEBRTC
webrtcUI.init();
+#endif
FormValidationHandler.init();
+ AutoCompletePopup.init();
+
LoginManagerParent.init();
- // Make sure conflicting MSE prefs don't coexist
- if (Services.prefs.getBoolPref('media.mediasource.format-reader', true)) {
- Services.prefs.setBoolPref('media.mediasource.webm.enabled', false);
- }
-
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
},
@@ -528,6 +501,8 @@ BrowserGlue.prototype = {
}
#endif
+ DateTimePickerHelper.init();
+
this._trackSlowStartup();
},
@@ -539,8 +514,11 @@ BrowserGlue.prototype = {
_onProfileShutdown: function BG__onProfileShutdown() {
BrowserNewTabPreloader.uninit();
UserAgentOverrides.uninit();
+#ifdef MOZ_WEBRTC
webrtcUI.uninit();
+#endif
FormValidationHandler.uninit();
+ AutoCompletePopup.uninit();
this._dispose();
},
@@ -1213,7 +1191,7 @@ BrowserGlue.prototype = {
},
_migrateUI: function BG__migrateUI() {
- const UI_VERSION = 14;
+ const UI_VERSION = 15;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul#";
let currentUIVersion = 0;
try {
@@ -1395,7 +1373,7 @@ BrowserGlue.prototype = {
}
}
- if (currentUIVersion < 14) {
+ if (currentUIVersion < 16) {
// Migrate Sync from pmsync.palemoon.net to pmsync.palemoon.org
try {
let syncURL = Services.prefs.getCharPref("services.sync.clusterURL");
diff --git a/application/palemoon/components/places/BrowserPlaces.manifest b/application/palemoon/components/places/BrowserPlaces.manifest
deleted file mode 100644
index 3b25f50f4..000000000
--- a/application/palemoon/components/places/BrowserPlaces.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {6bcb9bde-9018-4443-a071-c32653469597} PlacesProtocolHandler.js
-contract @mozilla.org/network/protocol;1?name=place {6bcb9bde-9018-4443-a071-c32653469597}
diff --git a/application/palemoon/components/places/PlacesProtocolHandler.js b/application/palemoon/components/places/PlacesProtocolHandler.js
deleted file mode 100644
index ebffd2e28..000000000
--- a/application/palemoon/components/places/PlacesProtocolHandler.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim: sw=2 ts=2 sts=2 et
- * 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 Cc = Components.classes;
-const Ci = Components.interfaces;
-
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const SCHEME = "place";
-const URL = "chrome://browser/content/places/content-ui/controller.xhtml";
-
-function PlacesProtocolHandler() {}
-
-PlacesProtocolHandler.prototype = {
- scheme: SCHEME,
- defaultPort: -1,
- protocolFlags: Ci.nsIProtocolHandler.URI_DANGEROUS_TO_LOAD |
- Ci.nsIProtocolHandler.URI_IS_LOCAL_RESOURCE |
- Ci.nsIProtocolHandler.URI_NORELATIVE |
- Ci.nsIProtocolHandler.URI_NOAUTH,
-
- newURI: function PPH_newURI(aSpec, aOriginCharset, aBaseUri) {
- let uri = Cc["@mozilla.org/network/simple-uri;1"].createInstance(Ci.nsIURI);
- uri.spec = aSpec;
- return uri;
- },
-
- newChannel: function PPH_newChannel(aUri) {
- let chan = NetUtil.newChannel(URL);
- chan.originalURI = aUri;
- return chan;
- },
-
- allowPort: function PPH_allowPort(aPort, aScheme) {
- return false;
- },
-
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsIProtocolHandler
- ]),
-
- classID: Components.ID("{6bcb9bde-9018-4443-a071-c32653469597}")
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PlacesProtocolHandler]);
diff --git a/application/palemoon/components/places/content/controller.js b/application/palemoon/components/places/content/controller.js
index 4d3773905..e2ae2afb0 100644
--- a/application/palemoon/components/places/content/controller.js
+++ b/application/palemoon/components/places/content/controller.js
@@ -1603,7 +1603,7 @@ PlacesController.prototype = {
* the view that the item(s) have been dropped on was not necessarily active.
* Drop functions are passed the view that is being dropped on.
*/
-let PlacesControllerDragHelper = {
+var PlacesControllerDragHelper = {
/**
* DOM Element currently being dragged over
*/
diff --git a/application/palemoon/components/places/content/editBookmarkOverlay.js b/application/palemoon/components/places/content/editBookmarkOverlay.js
index 98bfcccd7..43645cc73 100644
--- a/application/palemoon/components/places/content/editBookmarkOverlay.js
+++ b/application/palemoon/components/places/content/editBookmarkOverlay.js
@@ -16,6 +16,7 @@ var gEditItemOverlay = {
_itemType: -1,
_readOnly: false,
_hiddenRows: [],
+ _onPanelReady: false,
_observersAdded: false,
_staticFoldersListBuilt: false,
_initialized: false,
@@ -50,6 +51,7 @@ var gEditItemOverlay = {
this._readOnly = aInfo && aInfo.forceReadOnly;
this._titleOverride = aInfo && aInfo.titleOverride ? aInfo.titleOverride
: "";
+ this._onPanelReady = aInfo && aInfo.onPanelReady;
},
_showHideRows: function EIO__showHideRows() {
@@ -219,7 +221,15 @@ var gEditItemOverlay = {
this._observersAdded = true;
}
- this._initialized = true;
+ let focusElement = () => {
+ this._initialized = true;
+ };
+
+ if (this._onPanelReady) {
+ this._onPanelReady(focusElement);
+ } else {
+ focusElement();
+ }
},
/**
@@ -243,11 +253,7 @@ var gEditItemOverlay = {
if (field.value != aValue) {
field.value = aValue;
-
- // clear the undo stack
- var editor = field.editor;
- if (editor)
- editor.transactionManager.clear();
+ this._editorTransactionManagerClear(field);
}
},
@@ -352,6 +358,26 @@ var gEditItemOverlay = {
return document.getElementById("editBMPanel_" + aID);
},
+ _editorTransactionManagerClear: function EIO__editorTransactionManagerClear(aItem) {
+ // Clear the editor's undo stack
+ let transactionManager;
+ try {
+ transactionManager = aItem.editor.transactionManager;
+ } catch (e) {
+ // When retrieving the transaction manager, editor may be null resulting
+ // in a TypeError. Additionally, the transaction manager may not
+ // exist yet, which causes access to it to throw NS_ERROR_FAILURE.
+ // In either event, the transaction manager doesn't exist it, so we
+ // don't need to worry about clearing it.
+ if (!(e instanceof TypeError) && e.result != Cr.NS_ERROR_FAILURE) {
+ throw e;
+ }
+ }
+ if (transactionManager) {
+ transactionManager.clear();
+ }
+ },
+
_getItemStaticTitle: function EIO__getItemStaticTitle() {
if (this._titleOverride)
return this._titleOverride;
@@ -370,11 +396,7 @@ var gEditItemOverlay = {
var namePicker = this._element("namePicker");
namePicker.value = this._getItemStaticTitle();
namePicker.readOnly = this._readOnly;
-
- // clear the undo stack
- var editor = namePicker.editor;
- if (editor)
- editor.transactionManager.clear();
+ this._editorTransactionManagerClear(namePicker);
},
uninitPanel: function EIO_uninitPanel(aHideCollapsibleElements) {
@@ -963,8 +985,7 @@ var gEditItemOverlay = {
var namePicker = this._element("namePicker");
if (namePicker.value != aValue) {
namePicker.value = aValue;
- // clear undo stack
- namePicker.editor.transactionManager.clear();
+ this._editorTransactionManagerClear(namePicker);
}
break;
case "uri":
diff --git a/application/palemoon/components/places/content/places.js b/application/palemoon/components/places/content/places.js
index af254a7fb..a94193823 100644
--- a/application/palemoon/components/places/content/places.js
+++ b/application/palemoon/components/places/content/places.js
@@ -4,7 +4,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource:///modules/MigrationUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "BookmarkJSONUtils",
@@ -335,14 +334,6 @@ var PlacesOrganizer = {
},
/**
- * Show the migration wizard for importing passwords,
- * cookies, history, preferences, and bookmarks.
- */
- importFromBrowser: function PO_importFromBrowser() {
- MigrationUtils.showMigrationWizard(window);
- },
-
- /**
* Open a file-picker and import the selected file into the bookmarks store
*/
importFromFile: function PO_importFromFile() {
@@ -1386,7 +1377,7 @@ var ViewMenu = {
}
}
-let ContentArea = {
+var ContentArea = {
_specialViews: new Map(),
init: function CA_init() {
@@ -1520,7 +1511,7 @@ let ContentArea = {
}
};
-let ContentTree = {
+var ContentTree = {
init: function CT_init() {
this._view = document.getElementById("placeContent");
},
diff --git a/application/palemoon/components/places/content/places.xul b/application/palemoon/components/places/content/places.xul
index ee1f2ff48..92e8a70e9 100644
--- a/application/palemoon/components/places/content/places.xul
+++ b/application/palemoon/components/places/content/places.xul
@@ -68,8 +68,6 @@
oncommand="PlacesOrganizer.exportBookmarks();"/>
<command id="OrganizerCommand_import"
oncommand="PlacesOrganizer.importFromFile();"/>
- <command id="OrganizerCommand_browserImport"
- oncommand="PlacesOrganizer.importFromBrowser();"/>
<command id="OrganizerCommand_backup"
oncommand="PlacesOrganizer.backupBookmarks();"/>
<command id="OrganizerCommand_restoreFromFile"
@@ -312,11 +310,6 @@
command="OrganizerCommand_export"
label="&exportBookmarksToHTML.label;"
accesskey="&exportBookmarksToHTML.accesskey;"/>
- <menuseparator/>
- <menuitem id="browserImport"
- command="OrganizerCommand_browserImport"
- label="&importOtherBrowser.label;"
- accesskey="&importOtherBrowser.accesskey;"/>
</menupopup>
#ifdef XP_MACOSX
</toolbarbutton>
diff --git a/application/palemoon/components/places/content/treeView.js b/application/palemoon/components/places/content/treeView.js
index c1879aacf..aba731470 100644
--- a/application/palemoon/components/places/content/treeView.js
+++ b/application/palemoon/components/places/content/treeView.js
@@ -144,7 +144,12 @@ PlacesTreeView.prototype = {
// A node is removed form the view either if it has no parent or if its
// root-ancestor is not the root node (in which case that's the node
// for which nodeRemoved was called).
- let ancestors = [x for (x of PlacesUtils.nodeAncestors(aNode))];
+ // Tycho: let ancestors = [x for (x of PlacesUtils.nodeAncestors(aNode))];
+ let ancestors = [];
+ for (let x of PlacesUtils.nodeAncestors(aNode)) {
+ ancestors.push(x);
+ }
+
if (ancestors.length == 0 ||
ancestors[ancestors.length - 1] != this._rootNode) {
throw new Error("Removed node passed to _getRowForNode");
diff --git a/application/palemoon/components/places/moz.build b/application/palemoon/components/places/moz.build
index fc69beed9..2e35e1951 100644
--- a/application/palemoon/components/places/moz.build
+++ b/application/palemoon/components/places/moz.build
@@ -6,9 +6,5 @@
JAR_MANIFESTS += ['jar.mn']
-EXTRA_COMPONENTS += [
- 'BrowserPlaces.manifest',
- 'PlacesProtocolHandler.js',
-]
EXTRA_JS_MODULES += [ 'PlacesUIUtils.jsm' ]
diff --git a/application/palemoon/components/preferences/aboutPermissions.js b/application/palemoon/components/preferences/aboutPermissions.js
index 4d803145d..31b48f88e 100644
--- a/application/palemoon/components/preferences/aboutPermissions.js
+++ b/application/palemoon/components/preferences/aboutPermissions.js
@@ -2,9 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-let Ci = Components.interfaces;
-let Cc = Components.classes;
-let Cu = Components.utils;
+var Ci = Components.interfaces;
+var Cc = Components.classes;
+var Cu = Components.utils;
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/PluralForm.jsm");
@@ -13,15 +13,15 @@ Cu.import("resource://gre/modules/AddonManager.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/ForgetAboutSite.jsm");
-let gFaviconService = Cc["@mozilla.org/browser/favicon-service;1"].
+var gFaviconService = Cc["@mozilla.org/browser/favicon-service;1"].
getService(Ci.nsIFaviconService);
-let gPlacesDatabase = Cc["@mozilla.org/browser/nav-history-service;1"].
+var gPlacesDatabase = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsPIPlacesDatabase).
DBConnection.
clone(true);
-let gSitesStmt = gPlacesDatabase.createAsyncStatement(
+var gSitesStmt = gPlacesDatabase.createAsyncStatement(
"SELECT get_unreversed_host(rev_host) AS host " +
"FROM moz_places " +
"WHERE rev_host > '.' " +
@@ -30,12 +30,12 @@ let gSitesStmt = gPlacesDatabase.createAsyncStatement(
"ORDER BY MAX(frecency) DESC " +
"LIMIT :limit");
-let gVisitStmt = gPlacesDatabase.createAsyncStatement(
+var gVisitStmt = gPlacesDatabase.createAsyncStatement(
"SELECT SUM(visit_count) AS count " +
"FROM moz_places " +
"WHERE rev_host = :rev_host");
-let gFlash = {
+var gFlash = {
name: "Shockwave Flash",
betterName: "Adobe Flash",
type: "application/x-shockwave-flash",
@@ -290,7 +290,7 @@ Site.prototype = {
*
* Inspired by pageinfo/permissions.js
*/
-let PermissionDefaults = {
+var PermissionDefaults = {
UNKNOWN: Ci.nsIPermissionManager.UNKNOWN_ACTION, // 0
ALLOW: Ci.nsIPermissionManager.ALLOW_ACTION, // 1
DENY: Ci.nsIPermissionManager.DENY_ACTION, // 2
@@ -449,7 +449,7 @@ let PermissionDefaults = {
/**
* AboutPermissions manages the about:permissions page.
*/
-let AboutPermissions = {
+var AboutPermissions = {
/**
* Maximum number of sites to return from the places database.
*/
diff --git a/application/palemoon/components/preferences/cookies.js b/application/palemoon/components/preferences/cookies.js
index 5316c106e..543aeb186 100644
--- a/application/palemoon/components/preferences/cookies.js
+++ b/application/palemoon/components/preferences/cookies.js
@@ -70,7 +70,9 @@ var gCookiesWindow = {
_cookieEquals: function (aCookieA, aCookieB, aStrippedHost) {
return aCookieA.rawHost == aStrippedHost &&
aCookieA.name == aCookieB.name &&
- aCookieA.path == aCookieB.path;
+ aCookieA.path == aCookieB.path &&
+ ChromeUtils.isOriginAttributesEqual(aCookieA.originAttributes,
+ aCookieB.originAttributes);
},
observe: function (aCookie, aTopic, aData) {
@@ -275,15 +277,19 @@ var gCookiesWindow = {
var item = this._getItemAtIndex(aIndex);
if (!item) return;
this._invalidateCache(aIndex - 1);
- if (item.container)
+ if (item.container) {
gCookiesWindow._hosts[item.rawHost] = null;
- else {
+ } else {
var parent = this._getItemAtIndex(item.parentIndex);
for (var i = 0; i < parent.cookies.length; ++i) {
var cookie = parent.cookies[i];
if (item.rawHost == cookie.rawHost &&
- item.name == cookie.name && item.path == cookie.path)
+ item.name == cookie.name &&
+ item.path == cookie.path &&
+ ChromeUtils.isOriginAttributesEqual(item.originAttributes,
+ cookie.originAttributes)) {
parent.cookies.splice(i, removeCount);
+ }
}
}
},
@@ -458,16 +464,17 @@ var gCookiesWindow = {
_makeCookieObject: function (aStrippedHost, aCookie) {
var host = aCookie.host;
var formattedHost = host.charAt(0) == "." ? host.substring(1, host.length) : host;
- var c = { name : aCookie.name,
- value : aCookie.value,
- isDomain : aCookie.isDomain,
- host : aCookie.host,
- rawHost : aStrippedHost,
- path : aCookie.path,
- isSecure : aCookie.isSecure,
- expires : aCookie.expires,
- level : 1,
- container : false };
+ var c = { name : aCookie.name,
+ value : aCookie.value,
+ isDomain : aCookie.isDomain,
+ host : aCookie.host,
+ rawHost : aStrippedHost,
+ path : aCookie.path,
+ isSecure : aCookie.isSecure,
+ expires : aCookie.expires,
+ level : 1,
+ container : false,
+ originAttributes: aCookie.originAttributes };
return c;
},
@@ -574,7 +581,8 @@ var gCookiesWindow = {
blockFutureCookies = psvc.getBoolPref("network.cookie.blockFutureCookies");
for (var i = 0; i < deleteItems.length; ++i) {
var item = deleteItems[i];
- this._cm.remove(item.host, item.name, item.path, blockFutureCookies);
+ this._cm.remove(item.host, item.name, item.path,
+ blockFutureCookies, item.originAttributes);
}
},
diff --git a/application/palemoon/components/preferences/sanitize.js b/application/palemoon/components/preferences/sanitize.js
index 893155e62..15e6f58f4 100644
--- a/application/palemoon/components/preferences/sanitize.js
+++ b/application/palemoon/components/preferences/sanitize.js
@@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-let gSanitizeDialog = Object.freeze({
+var gSanitizeDialog = Object.freeze({
onClearHistoryChanged: function () {
let downloadsPref = document.getElementById("privacy.clearOnShutdown.downloads");
let historyPref = document.getElementById("privacy.clearOnShutdown.history");
diff --git a/application/palemoon/components/preferences/security.js b/application/palemoon/components/preferences/security.js
index a337f398c..56664bf66 100644
--- a/application/palemoon/components/preferences/security.js
+++ b/application/palemoon/components/preferences/security.js
@@ -3,6 +3,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
+ "resource://gre/modules/LoginHelper.jsm");
+
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
var gSecurityPane = {
@@ -141,7 +144,7 @@ var gSecurityPane = {
*/
_initMasterPasswordUI: function ()
{
- var noMP = !this._masterPasswordSet();
+ var noMP = !LoginHelper.isMasterPasswordSet();
var button = document.getElementById("changeMasterPassword");
button.disabled = noMP;
@@ -151,26 +154,6 @@ var gSecurityPane = {
},
/**
- * Returns true if the user has a master password set and false otherwise.
- */
- _masterPasswordSet: function ()
- {
- const Cc = Components.classes, Ci = Components.interfaces;
- var secmodDB = Cc["@mozilla.org/security/pkcs11moduledb;1"].
- getService(Ci.nsIPKCS11ModuleDB);
- var slot = secmodDB.findSlotByName("");
- if (slot) {
- var status = slot.status;
- var hasMP = status != Ci.nsIPKCS11Slot.SLOT_UNINITIALIZED &&
- status != Ci.nsIPKCS11Slot.SLOT_READY;
- return hasMP;
- } else {
- // XXX I have no bloody idea what this means
- return false;
- }
- },
-
- /**
* Enables/disables the master password button depending on the state of the
* "use master password" checkbox, and prompts for master password removal if
* one is set.
diff --git a/application/palemoon/components/preferences/sync.js b/application/palemoon/components/preferences/sync.js
index 9c7f1aa1f..f29728dbf 100644
--- a/application/palemoon/components/preferences/sync.js
+++ b/application/palemoon/components/preferences/sync.js
@@ -9,7 +9,7 @@ const PAGE_NO_ACCOUNT = 0;
const PAGE_HAS_ACCOUNT = 1;
const PAGE_NEEDS_UPDATE = 2;
-let gSyncPane = {
+var gSyncPane = {
_stringBundle: null,
prefArray: ["engine.bookmarks", "engine.passwords", "engine.prefs",
"engine.tabs", "engine.history"],
diff --git a/application/palemoon/components/search/content/engineManager.js b/application/palemoon/components/search/content/engineManager.js
index 92b6d59b7..993d48b06 100644
--- a/application/palemoon/components/search/content/engineManager.js
+++ b/application/palemoon/components/search/content/engineManager.js
@@ -2,7 +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/. */
+Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
+ "resource://gre/modules/PlacesUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "Task",
+ "resource://gre/modules/Task.jsm");
const Ci = Components.interfaces;
const Cc = Components.classes;
@@ -105,7 +110,7 @@ var gEngineManagerDialog = {
document.getElementById("engineList").focus();
},
- editKeyword: function engineManager_editKeyword() {
+ editKeyword: Task.async(function* engineManager_editKeyword() {
var selectedEngine = gEngineView.selectedEngine;
if (!selectedEngine)
return;
@@ -121,12 +126,8 @@ var gEngineManagerDialog = {
var dupName = "";
if (alias.value != "") {
- try {
- let bmserv = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
- if (bmserv.getURIForKeyword(alias.value))
- bduplicate = true;
- } catch(ex) {}
+ // Check for duplicates in Places keywords.
+ bduplicate = !!(yield PlacesUtils.keywords.fetch(alias.value));
// Check for duplicates in changes we haven't committed yet
let engines = gEngineView._engineStore.engines;
@@ -154,7 +155,7 @@ var gEngineManagerDialog = {
break;
}
}
- },
+ }),
onSelect: function engineManager_onSelect() {
// Buttons only work if an engine is selected and it's not the last engine,
diff --git a/application/palemoon/components/search/content/engineManager.xul b/application/palemoon/components/search/content/engineManager.xul
index 50181c066..1152ef8db 100644
--- a/application/palemoon/components/search/content/engineManager.xul
+++ b/application/palemoon/components/search/content/engineManager.xul
@@ -36,7 +36,7 @@
oncommand="gEngineManagerDialog.bump(-1);"
disabled="true"/>
<command id="cmd_editkeyword"
- oncommand="gEngineManagerDialog.editKeyword();"
+ oncommand="gEngineManagerDialog.editKeyword().catch(Components.utils.reportError);"
disabled="true"/>
</commandset>
diff --git a/application/palemoon/components/sessionstore/SessionStorage.jsm b/application/palemoon/components/sessionstore/SessionStorage.jsm
index 192352c49..64aef35a5 100644
--- a/application/palemoon/components/sessionstore/SessionStorage.jsm
+++ b/application/palemoon/components/sessionstore/SessionStorage.jsm
@@ -38,7 +38,7 @@ this.SessionStorage = {
Object.freeze(SessionStorage);
-let DomStorage = {
+var DomStorage = {
/**
* Reads all session storage data from the given docShell.
* @param aDocShell
@@ -142,7 +142,7 @@ let DomStorage = {
}
};
-let History = {
+var History = {
/**
* Returns a given history entry's URI.
* @param aHistory
diff --git a/application/palemoon/components/sessionstore/SessionStore.jsm b/application/palemoon/components/sessionstore/SessionStore.jsm
index b74e68a2f..f7c495be8 100644
--- a/application/palemoon/components/sessionstore/SessionStore.jsm
+++ b/application/palemoon/components/sessionstore/SessionStore.jsm
@@ -88,7 +88,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "gScreenManager",
// retrieved from a given docShell if not already collected before.
// This is made so they're automatically in sync with all nsIDocShell.allow*
// properties.
-let gDocShellCapabilities = (function () {
+var gDocShellCapabilities = (function () {
let caps;
return docShell => {
@@ -106,12 +106,12 @@ XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
#ifdef MOZ_DEVTOOLS
XPCOMUtils.defineLazyModuleGetter(this, "ScratchpadManager",
- "resource://gre/modules/devtools/scratchpad-manager.jsm");
+ "resource://devtools/client/scratchpad/scratchpad-manager.jsm");
Object.defineProperty(this, "HUDService", {
get: function HUDService_getter() {
- let devtools = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}).devtools;
- return devtools.require("devtools/webconsole/hudservice").HUDService;
+ let devtools = Cu.import("resource://devtools/shared/Loader.jsm", {}).devtools;
+ return devtools.require("devtools/client/webconsole/hudservice").HUDService;
},
configurable: true,
enumerable: true
@@ -247,7 +247,7 @@ this.SessionStore = {
// Freeze the SessionStore object. We don't want anyone to modify it.
Object.freeze(SessionStore);
-let SessionStoreInternal = {
+var SessionStoreInternal = {
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIDOMEventListener,
Ci.nsIObserver,
@@ -2404,7 +2404,7 @@ let SessionStoreInternal = {
for (var [host, isPinned] in Iterator(internalWindow.hosts)) {
let list;
try {
- list = Services.cookies.getCookiesFromHost(host);
+ list = Services.cookies.getCookiesFromHost(host, {});
}
catch (ex) {
debug("getCookiesFromHost failed. Host: " + host);
@@ -3131,7 +3131,11 @@ let SessionStoreInternal = {
// Restore the tab icon.
if ("image" in tabData) {
- aWindow.gBrowser.setIcon(tab, tabData.image);
+ // Using null as the loadingPrincipal because serializing
+ // the principal would be overkill. Within SetIcon we
+ // default to the systemPrincipal if aLoadingPrincipal is
+ // null which will allow the favicon to load.
+ aWindow.gBrowser.setIcon(tab, tabData.image, null);
}
if (tabData.storage && browser.docShell instanceof Ci.nsIDocShell)
@@ -3651,7 +3655,7 @@ let SessionStoreInternal = {
try {
Services.cookies.add(cookie.host, cookie.path || "", cookie.name || "",
cookie.value, !!cookie.secure, !!cookie.httponly, true,
- "expiry" in cookie ? cookie.expiry : MAX_EXPIRY);
+ "expiry" in cookie ? cookie.expiry : MAX_EXPIRY, {});
}
catch (ex) { Cu.reportError(ex); } // don't let a single cookie stop recovering
}
@@ -4467,7 +4471,7 @@ let SessionStoreInternal = {
* pinned, visible and hidden tabs in that and FIFO order. Hidden tabs are only
* restored with restore_hidden_tabs=true.
*/
-let TabRestoreQueue = {
+var TabRestoreQueue = {
// The separate buckets used to store tabs.
tabs: {priority: [], visible: [], hidden: []},
@@ -4604,7 +4608,7 @@ let TabRestoreQueue = {
// A map storing a closed window's state data until it goes aways (is GC'ed).
// This ensures that API clients can still read (but not write) states of
// windows they still hold a reference to but we don't.
-let DyingWindowCache = {
+var DyingWindowCache = {
_data: new WeakMap(),
has: function (window) {
@@ -4627,7 +4631,7 @@ let DyingWindowCache = {
// 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
// the given tab data is restored to a new tab.
-let TabAttributes = {
+var TabAttributes = {
_attrs: new Set(),
// We never want to directly read or write those attributes.
@@ -4673,7 +4677,7 @@ let TabAttributes = {
// This is used to help meter the number of restoring tabs. This is the control
// point for telling the next tab to restore. It gets attached to each gBrowser
// via gBrowser.addTabsProgressListener
-let gRestoreTabsProgressListener = {
+var gRestoreTabsProgressListener = {
onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
// Ignore state changes on browsers that we've already restored and state
// changes that aren't applicable.
diff --git a/application/palemoon/components/sessionstore/_SessionFile.jsm b/application/palemoon/components/sessionstore/_SessionFile.jsm
index 7e1b05f74..62b4d1687 100644
--- a/application/palemoon/components/sessionstore/_SessionFile.jsm
+++ b/application/palemoon/components/sessionstore/_SessionFile.jsm
@@ -41,7 +41,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "console",
- "resource://gre/modules/devtools/Console.jsm");
+ "resource://gre/modules/Console.jsm");
// An encoder to UTF-8.
XPCOMUtils.defineLazyGetter(this, "gEncoder", function () {
@@ -130,7 +130,7 @@ const TaskUtils = {
}
};
-let SessionFileInternal = {
+var SessionFileInternal = {
/**
* A promise fulfilled once initialization is complete
*/
@@ -156,7 +156,10 @@ let SessionFileInternal = {
let text;
try {
let file = new FileUtils.File(aPath);
- let chan = NetUtil.newChannel(file);
+ let chan = NetUtil.newChannel({
+ uri: NetUtil.newURI(file),
+ loadUsingSystemPrincipal: true
+ });
let stream = chan.open();
text = NetUtil.readInputStreamToString(stream, stream.available(),
{charset: "utf-8"});
diff --git a/application/palemoon/components/sessionstore/nsSessionStartup.js b/application/palemoon/components/sessionstore/nsSessionStartup.js
index 024246619..04037c10e 100644
--- a/application/palemoon/components/sessionstore/nsSessionStartup.js
+++ b/application/palemoon/components/sessionstore/nsSessionStartup.js
@@ -50,7 +50,7 @@ function debug(aMsg) {
Services.console.logStringMessage(aMsg);
}
-let gOnceInitializedDeferred = Promise.defer();
+var gOnceInitializedDeferred = Promise.defer();
/* :::::::: The Service ::::::::::::::: */
@@ -77,9 +77,14 @@ SessionStartup.prototype = {
return;
}
- _SessionFile.read().then(
- this._onSessionFileRead.bind(this)
- );
+ if (Services.prefs.getBoolPref("browser.sessionstore.resume_session_once") ||
+ Services.prefs.getIntPref("browser.startup.page") == 3) {
+ this._ensureInitialized();
+ } else {
+ _SessionFile.read().then(
+ this._onSessionFileRead.bind(this)
+ );
+ }
},
// Wrap a string as a nsISupports
diff --git a/application/palemoon/components/shell/ShellService.jsm b/application/palemoon/components/shell/ShellService.jsm
new file mode 100644
index 000000000..74632b692
--- /dev/null
+++ b/application/palemoon/components/shell/ShellService.jsm
@@ -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/. */
+
+"use strict";
+
+this.EXPORTED_SYMBOLS = ["ShellService"];
+
+const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
+
+Cu.import("resource://gre/modules/AppConstants.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
+ "resource://gre/modules/WindowsRegistry.jsm");
+
+/**
+ * Internal functionality to save and restore the docShell.allow* properties.
+ */
+var ShellServiceInternal = {
+ /**
+ * Used to determine whether or not to offer "Set as desktop background"
+ * functionality. Even if shell service is available it is not
+ * guaranteed that it is able to set the background for every desktop
+ * which is especially true for Linux with its many different desktop
+ * environments.
+ */
+ get canSetDesktopBackground() {
+ if (AppConstants.platform == "win" ||
+ AppConstants.platform == "macosx") {
+ return true;
+ }
+
+ if (AppConstants.platform == "linux") {
+ if (this.shellService) {
+ let linuxShellService = this.shellService
+ .QueryInterface(Ci.nsIGNOMEShellService);
+ return linuxShellService.canSetDesktopBackground;
+ }
+ }
+
+ return false;
+ },
+
+ /**
+ * Used to determine whether or not to show a "Set Default Browser"
+ * query dialog. This attribute is true if the application is starting
+ * up and "browser.shell.checkDefaultBrowser" is true, otherwise it
+ * is false.
+ */
+ _checkedThisSession: false,
+ get shouldCheckDefaultBrowser() {
+ // If we've already checked, the browser has been started and this is a
+ // new window open, and we don't want to check again.
+ if (this._checkedThisSession) {
+ return false;
+ }
+
+ if (!Services.prefs.getBoolPref("browser.shell.checkDefaultBrowser")) {
+ return false;
+ }
+
+ if (AppConstants.platform == "win") {
+ let optOutValue = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "Software\\Mozilla\\PaleMoon",
+ "DefaultBrowserOptOut");
+ WindowsRegistry.removeRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "Software\\Mozilla\\PaleMoon",
+ "DefaultBrowserOptOut");
+ if (optOutValue == "True") {
+ Services.prefs.setBoolPref("browser.shell.checkDefaultBrowser", false);
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ set shouldCheckDefaultBrowser(shouldCheck) {
+ Services.prefs.setBoolPref("browser.shell.checkDefaultBrowser", !!shouldCheck);
+ },
+
+ isDefaultBrowser(startupCheck, forAllTypes) {
+ // If this is the first browser window, maintain internal state that we've
+ // checked this session (so that subsequent window opens don't show the
+ // default browser dialog).
+ if (startupCheck) {
+ this._checkedThisSession = true;
+ }
+ if (this.shellService) {
+ return this.shellService.isDefaultBrowser(startupCheck, forAllTypes);
+ }
+ return false;
+ }
+};
+
+XPCOMUtils.defineLazyServiceGetter(ShellServiceInternal, "shellService",
+ "@mozilla.org/browser/shell-service;1", Ci.nsIShellService);
+
+/**
+ * The external API exported by this module.
+ */
+this.ShellService = new Proxy(ShellServiceInternal, {
+ get(target, name) {
+ if (name in target) {
+ return target[name];
+ }
+ if (target.shellService) {
+ return target.shellService[name];
+ }
+ Services.console.logStringMessage(`${name} not found in ShellService: ${target.shellService}`);
+ return undefined;
+ }
+});
diff --git a/application/palemoon/components/shell/content/setDesktopBackground.js b/application/palemoon/components/shell/content/setDesktopBackground.js
index e90a32d03..53cc70db0 100644
--- a/application/palemoon/components/shell/content/setDesktopBackground.js
+++ b/application/palemoon/components/shell/content/setDesktopBackground.js
@@ -1,16 +1,14 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+/* 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");
var Ci = Components.interfaces;
var gSetBackground = {
-#ifndef XP_MACOSX
- _position : "",
- _backgroundColor : 0,
-#else
- _position : "STRETCH",
-#endif
+ _position : AppConstants.platform == "macosx" ? "STRETCH" : "",
+ _backgroundColor : AppConstants.platform != "macosx" ? 0 : undefined,
_screenWidth : 0,
_screenHeight : 0,
_image : null,
@@ -27,23 +25,23 @@ var gSetBackground = {
this._canvas = document.getElementById("screen");
this._screenWidth = screen.width;
this._screenHeight = screen.height;
-#ifdef XP_MACOSX
- document.documentElement.getButton("accept").hidden = true;
-#endif
+ if (AppConstants.platform == "macosx") {
+ document.documentElement.getButton("accept").hidden = true;
+ }
if (this._screenWidth / this._screenHeight >= 1.6)
document.getElementById("monitor").setAttribute("aspectratio", "16:10");
-#ifdef XP_WIN
- // hide fill + fit options if <win7 since don't work
- var version = Components.classes["@mozilla.org/system-info;1"]
- .getService(Ci.nsIPropertyBag2)
- .getProperty("version");
- var isWindows7OrHigher = (parseFloat(version) >= 6.1);
- if (!isWindows7OrHigher) {
- document.getElementById("fillPosition").hidden = true;
- document.getElementById("fitPosition").hidden = true;
+ if (AppConstants.platform == "win") {
+ // Hide fill + fit options if < Win7 since they don't work.
+ var version = Components.classes["@mozilla.org/system-info;1"]
+ .getService(Ci.nsIPropertyBag2)
+ .getProperty("version");
+ var isWindows7OrHigher = (parseFloat(version) >= 6.1);
+ if (!isWindows7OrHigher) {
+ document.getElementById("fillPosition").hidden = true;
+ document.getElementById("fitPosition").hidden = true;
+ }
}
-#endif
// make sure that the correct dimensions will be used
setTimeout(function(self) {
@@ -62,92 +60,37 @@ var gSetBackground = {
var ctx = this._canvas.getContext("2d");
ctx.scale(this._canvas.clientWidth / this._screenWidth, this._canvas.clientHeight / this._screenHeight);
-#ifndef XP_MACOSX
- this._initColor();
-#else
- // Make sure to reset the button state in case the user has already
- // set an image as their desktop background.
- var setDesktopBackground = document.getElementById("setDesktopBackground");
- setDesktopBackground.hidden = false;
- var bundle = document.getElementById("backgroundBundle");
- setDesktopBackground.label = bundle.getString("DesktopBackgroundSet");
- setDesktopBackground.disabled = false;
-
- document.getElementById("showDesktopPreferences").hidden = true;
-#endif
+ if (AppConstants.platform != "macosx") {
+ this._initColor();
+ } else {
+ // Make sure to reset the button state in case the user has already
+ // set an image as their desktop background.
+ var setDesktopBackground = document.getElementById("setDesktopBackground");
+ setDesktopBackground.hidden = false;
+ var bundle = document.getElementById("backgroundBundle");
+ setDesktopBackground.label = bundle.getString("DesktopBackgroundSet");
+ setDesktopBackground.disabled = false;
+
+ document.getElementById("showDesktopPreferences").hidden = true;
+ }
this.updatePosition();
},
-#ifndef XP_MACOSX
- _initColor: function ()
- {
- var color = this._shell.desktopBackgroundColor;
-
- const rMask = 4294901760;
- const gMask = 65280;
- const bMask = 255;
- var r = (color & rMask) >> 16;
- var g = (color & gMask) >> 8;
- var b = (color & bMask);
- this.updateColor(this._rgbToHex(r, g, b));
-
- var colorpicker = document.getElementById("desktopColor");
- colorpicker.color = this._backgroundColor;
- },
-
- updateColor: function (aColor)
- {
- this._backgroundColor = aColor;
- this._canvas.style.backgroundColor = aColor;
- },
-
- // Converts a color string in the format "#RRGGBB" to an integer.
- _hexStringToLong: function (aString)
- {
- return parseInt(aString.substring(1,3), 16) << 16 |
- parseInt(aString.substring(3,5), 16) << 8 |
- parseInt(aString.substring(5,7), 16);
- },
-
- _rgbToHex: function (aR, aG, aB)
- {
- return "#" + [aR, aG, aB].map(function(aInt) aInt.toString(16).replace(/^(.)$/, "0$1"))
- .join("").toUpperCase();
- },
-#else
- observe: function (aSubject, aTopic, aData)
+ setDesktopBackground: function ()
{
- if (aTopic == "shell:desktop-background-changed") {
- document.getElementById("setDesktopBackground").hidden = true;
- document.getElementById("showDesktopPreferences").hidden = false;
-
+ if (AppConstants.platform != "macosx") {
+ document.persist("menuPosition", "value");
+ this._shell.desktopBackgroundColor = this._hexStringToLong(this._backgroundColor);
+ } else {
Components.classes["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService)
- .removeObserver(this, "shell:desktop-background-changed");
- }
- },
-
- showDesktopPrefs: function()
- {
- this._shell.openApplication(Ci.nsIMacShellService.APPLICATION_DESKTOP);
- },
-#endif
+ .addObserver(this, "shell:desktop-background-changed", false);
- setDesktopBackground: function ()
- {
-#ifndef XP_MACOSX
- document.persist("menuPosition", "value");
- this._shell.desktopBackgroundColor = this._hexStringToLong(this._backgroundColor);
-#else
- Components.classes["@mozilla.org/observer-service;1"]
- .getService(Ci.nsIObserverService)
- .addObserver(this, "shell:desktop-background-changed", false);
-
- var bundle = document.getElementById("backgroundBundle");
- var setDesktopBackground = document.getElementById("setDesktopBackground");
- setDesktopBackground.disabled = true;
- setDesktopBackground.label = bundle.getString("DesktopBackgroundDownloading");
-#endif
+ var bundle = document.getElementById("backgroundBundle");
+ var setDesktopBackground = document.getElementById("setDesktopBackground");
+ setDesktopBackground.disabled = true;
+ setDesktopBackground.label = bundle.getString("DesktopBackgroundDownloading");
+ }
this._shell.setDesktopBackground(this._image,
Ci.nsIShellService["BACKGROUND_" + this._position]);
},
@@ -157,9 +100,9 @@ var gSetBackground = {
var ctx = this._canvas.getContext("2d");
ctx.clearRect(0, 0, this._screenWidth, this._screenHeight);
-#ifndef XP_MACOSX
- this._position = document.getElementById("menuPosition").value;
-#endif
+ if (AppConstants.platform != "macosx") {
+ this._position = document.getElementById("menuPosition").value;
+ }
switch (this._position) {
case "TILE":
@@ -171,43 +114,101 @@ var gSetBackground = {
case "STRETCH":
ctx.drawImage(this._image, 0, 0, this._screenWidth, this._screenHeight);
break;
- case "CENTER":
- var x = (this._screenWidth - this._image.naturalWidth) / 2;
- var y = (this._screenHeight - this._image.naturalHeight) / 2;
+ case "CENTER": {
+ let x = (this._screenWidth - this._image.naturalWidth) / 2;
+ let y = (this._screenHeight - this._image.naturalHeight) / 2;
ctx.drawImage(this._image, x, y);
break;
- case "FILL":
- //Try maxing width first, overflow height
- var widthRatio = this._screenWidth / this._image.naturalWidth;
- var width = this._image.naturalWidth * widthRatio;
- var height = this._image.naturalHeight * widthRatio;
+ }
+ case "FILL": {
+ // Try maxing width first, overflow height.
+ let widthRatio = this._screenWidth / this._image.naturalWidth;
+ let width = this._image.naturalWidth * widthRatio;
+ let height = this._image.naturalHeight * widthRatio;
if (height < this._screenHeight) {
- //height less than screen, max height and overflow width
- var heightRatio = this._screenHeight / this._image.naturalHeight;
+ // Height less than screen, max height and overflow width.
+ let heightRatio = this._screenHeight / this._image.naturalHeight;
width = this._image.naturalWidth * heightRatio;
height = this._image.naturalHeight * heightRatio;
}
- var x = (this._screenWidth - width) / 2;
- var y = (this._screenHeight - height) / 2;
+ let x = (this._screenWidth - width) / 2;
+ let y = (this._screenHeight - height) / 2;
ctx.drawImage(this._image, x, y, width, height);
break;
- case "FIT":
- //Try maxing width first, top and bottom borders
- var widthRatio = this._screenWidth / this._image.naturalWidth;
- var width = this._image.naturalWidth * widthRatio;
- var height = this._image.naturalHeight * widthRatio;
- var x = 0;
- var y = (this._screenHeight - height) / 2;
+ }
+ case "FIT": {
+ // Try maxing width first, top and bottom borders.
+ let widthRatio = this._screenWidth / this._image.naturalWidth;
+ let width = this._image.naturalWidth * widthRatio;
+ let height = this._image.naturalHeight * widthRatio;
+ let x = 0;
+ let y = (this._screenHeight - height) / 2;
if (height > this._screenHeight) {
- //height overflow, maximise height, side borders
- var heightRatio = this._screenHeight / this._image.naturalHeight;
+ // Height overflow, maximise height, side borders.
+ let heightRatio = this._screenHeight / this._image.naturalHeight;
width = this._image.naturalWidth * heightRatio;
height = this._image.naturalHeight * heightRatio;
x = (this._screenWidth - width) / 2;
y = 0;
}
ctx.drawImage(this._image, x, y, width, height);
- break;
+ break;
+ }
}
}
};
+
+if (AppConstants.platform != "macosx") {
+ gSetBackground["_initColor"] = function ()
+ {
+ var color = this._shell.desktopBackgroundColor;
+
+ const rMask = 4294901760;
+ const gMask = 65280;
+ const bMask = 255;
+ var r = (color & rMask) >> 16;
+ var g = (color & gMask) >> 8;
+ var b = (color & bMask);
+ this.updateColor(this._rgbToHex(r, g, b));
+
+ var colorpicker = document.getElementById("desktopColor");
+ colorpicker.color = this._backgroundColor;
+ };
+
+ gSetBackground["updateColor"] = function (aColor)
+ {
+ this._backgroundColor = aColor;
+ this._canvas.style.backgroundColor = aColor;
+ };
+
+ // Converts a color string in the format "#RRGGBB" to an integer.
+ gSetBackground["_hexStringToLong"] = function (aString)
+ {
+ return parseInt(aString.substring(1, 3), 16) << 16 |
+ parseInt(aString.substring(3, 5), 16) << 8 |
+ parseInt(aString.substring(5, 7), 16);
+ };
+
+ gSetBackground["_rgbToHex"] = function (aR, aG, aB)
+ {
+ return "#" + [aR, aG, aB].map(aInt => aInt.toString(16).replace(/^(.)$/, "0$1"))
+ .join("").toUpperCase();
+ };
+} else {
+ gSetBackground["observe"] = function (aSubject, aTopic, aData)
+ {
+ if (aTopic == "shell:desktop-background-changed") {
+ document.getElementById("setDesktopBackground").hidden = true;
+ document.getElementById("showDesktopPreferences").hidden = false;
+
+ Components.classes["@mozilla.org/observer-service;1"]
+ .getService(Ci.nsIObserverService)
+ .removeObserver(this, "shell:desktop-background-changed");
+ }
+ };
+
+ gSetBackground["showDesktopPrefs"] = function()
+ {
+ this._shell.openApplication(Ci.nsIMacShellService.APPLICATION_DESKTOP);
+ };
+}
diff --git a/application/palemoon/components/shell/jar.mn b/application/palemoon/components/shell/jar.mn
index eed15c397..1f33b5d56 100644
--- a/application/palemoon/components/shell/jar.mn
+++ b/application/palemoon/components/shell/jar.mn
@@ -4,4 +4,4 @@
browser.jar:
* content/browser/setDesktopBackground.xul (content/setDesktopBackground.xul)
-* content/browser/setDesktopBackground.js (content/setDesktopBackground.js)
+ content/browser/setDesktopBackground.js (content/setDesktopBackground.js)
diff --git a/application/palemoon/components/shell/moz.build b/application/palemoon/components/shell/moz.build
index 38965c5d7..94ec88571 100644
--- a/application/palemoon/components/shell/moz.build
+++ b/application/palemoon/components/shell/moz.build
@@ -1,4 +1,4 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# -*- 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
@@ -18,6 +18,10 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
XPIDL_SOURCES += [
'nsIMacShellService.idl',
]
+elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
+ XPIDL_SOURCES += [
+ 'nsIGNOMEShellService.idl',
+ ]
XPIDL_MODULE = 'shellservice'
@@ -29,7 +33,7 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
SOURCES += [
'nsMacShellService.cpp',
]
-elif CONFIG['MOZ_WIDGET_GTK']:
+elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
SOURCES += [
'nsGNOMEShellService.cpp',
]
@@ -42,6 +46,10 @@ EXTRA_COMPONENTS += [
'nsSetDefaultBrowser.manifest',
]
+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/shell/nsGNOMEShellService.cpp b/application/palemoon/components/shell/nsGNOMEShellService.cpp
index 14510d111..9bc5f5913 100644
--- a/application/palemoon/components/shell/nsGNOMEShellService.cpp
+++ b/application/palemoon/components/shell/nsGNOMEShellService.cpp
@@ -21,12 +21,13 @@
#include "nsIStringBundle.h"
#include "nsIOutputStream.h"
#include "nsIProcess.h"
-#include "nsNetUtil.h"
+#include "nsServiceManagerUtils.h"
+#include "nsComponentManagerUtils.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsIImageLoadingContent.h"
#include "imgIRequest.h"
#include "imgIContainer.h"
-#include "prprf.h"
+#include "mozilla/Sprintf.h"
#if defined(MOZ_WIDGET_GTK)
#include "nsIImageToPixbuf.h"
#endif
@@ -116,7 +117,7 @@ nsGNOMEShellService::Init()
return appPath->GetNativePath(mAppPath);
}
-NS_IMPL_ISUPPORTS(nsGNOMEShellService, nsIShellService)
+NS_IMPL_ISUPPORTS(nsGNOMEShellService, nsIGNOMEShellService, nsIShellService)
bool
nsGNOMEShellService::GetAppPathFromLauncher()
@@ -152,7 +153,8 @@ nsGNOMEShellService::KeyMatchesAppName(const char *aKeyValue) const
gchar *commandPath;
if (mUseLocaleFilenames) {
- gchar *nativePath = g_filename_from_utf8(aKeyValue, -1, nullptr, nullptr, nullptr);
+ gchar *nativePath = g_filename_from_utf8(aKeyValue, -1,
+ nullptr, nullptr, nullptr);
if (!nativePath) {
NS_ERROR("Error converting path to filesystem encoding");
return false;
@@ -199,8 +201,6 @@ nsGNOMEShellService::IsDefaultBrowser(bool aStartupCheck,
bool* aIsDefaultBrowser)
{
*aIsDefaultBrowser = false;
- if (aStartupCheck)
- mCheckedThisSession = true;
nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
@@ -284,7 +284,7 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes,
NS_ENSURE_SUCCESS(rv, rv);
nsString brandShortName;
- brandBundle->GetStringFromName(MOZ_UTF16("brandShortName"),
+ brandBundle->GetStringFromName(u"brandShortName",
getter_Copies(brandShortName));
// use brandShortName as the application id.
@@ -312,41 +312,14 @@ nsGNOMEShellService::SetDefaultBrowser(bool aClaimAllTypes,
}
}
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGNOMEShellService::GetShouldCheckDefaultBrowser(bool* aResult)
-{
- // If we've already checked, the browser has been started and this is a
- // new window open, and we don't want to check again.
- if (mCheckedThisSession) {
- *aResult = false;
- return NS_OK;
+ nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
+ if (prefs) {
+ (void) prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, true);
+ // Reset the number of times the dialog should be shown
+ // before it is silenced.
+ (void) prefs->SetIntPref(PREF_DEFAULTBROWSERCHECKCOUNT, 0);
}
- nsCOMPtr<nsIPrefBranch> prefs;
- nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID));
- if (pserve)
- pserve->GetBranch("", getter_AddRefs(prefs));
-
- if (prefs)
- prefs->GetBoolPref(PREF_CHECKDEFAULTBROWSER, aResult);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsGNOMEShellService::SetShouldCheckDefaultBrowser(bool aShouldCheck)
-{
- nsCOMPtr<nsIPrefBranch> prefs;
- nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID));
- if (pserve)
- pserve->GetBranch("", getter_AddRefs(prefs));
-
- if (prefs)
- prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, aShouldCheck);
-
return NS_OK;
}
@@ -386,7 +359,7 @@ WriteImage(const nsCString& aPath, imgIContainer* aImage)
return res ? NS_OK : NS_ERROR_FAILURE;
#endif
}
-
+
NS_IMETHODIMP
nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
int32_t aPosition)
@@ -407,15 +380,15 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
// Set desktop wallpaper filling style
nsAutoCString options;
if (aPosition == BACKGROUND_TILE)
- options.Assign("wallpaper");
+ options.AssignLiteral("wallpaper");
else if (aPosition == BACKGROUND_STRETCH)
- options.Assign("stretched");
+ options.AssignLiteral("stretched");
else if (aPosition == BACKGROUND_FILL)
- options.Assign("zoom");
+ options.AssignLiteral("zoom");
else if (aPosition == BACKGROUND_FIT)
- options.Assign("scaled");
+ options.AssignLiteral("scaled");
else
- options.Assign("centered");
+ options.AssignLiteral("centered");
// Write the background file to the home directory.
nsAutoCString filePath(PR_GetEnv("HOME"));
@@ -429,7 +402,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
rv = bundleService->CreateBundle(BRAND_PROPERTIES,
getter_AddRefs(brandBundle));
if (NS_SUCCEEDED(rv) && brandBundle) {
- rv = brandBundle->GetStringFromName(MOZ_UTF16("brandShortName"),
+ rv = brandBundle->GetStringFromName(u"brandShortName",
getter_Copies(brandName));
NS_ENSURE_SUCCESS(rv, rv);
}
@@ -438,7 +411,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
// build the file name
filePath.Append('/');
filePath.Append(NS_ConvertUTF16toUTF8(brandName));
- filePath.Append("_wallpaper.png");
+ filePath.AppendLiteral("_wallpaper.png");
// write the image to a file in the home dir
rv = WriteImage(filePath, container);
@@ -478,7 +451,7 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
// Set the image to an empty string first to force a refresh
// (since we could be writing a new image on top of an existing
- // Firefox_wallpaper.png and nautilus doesn't monitor the file for changes)
+ // PaleMoon_wallpaper.png and nautilus doesn't monitor the file for changes)
gconf->SetString(NS_LITERAL_CSTRING(kDesktopImageKey),
EmptyCString());
@@ -543,7 +516,7 @@ ColorToCString(uint32_t aColor, nsCString& aResult)
uint16_t green = COLOR_8_TO_16_BIT((aColor >> 8) & 0xff);
uint16_t blue = COLOR_8_TO_16_BIT(aColor & 0xff);
- PR_snprintf(buf, 14, "#%04x%04x%04x", red, green, blue);
+ snprintf(buf, 14, "#%04x%04x%04x", red, green, blue);
}
NS_IMETHODIMP
@@ -580,9 +553,9 @@ nsGNOMEShellService::OpenApplication(int32_t aApplication)
{
nsAutoCString scheme;
if (aApplication == APPLICATION_MAIL)
- scheme.Assign("mailto");
+ scheme.AssignLiteral("mailto");
else if (aApplication == APPLICATION_NEWS)
- scheme.Assign("news");
+ scheme.AssignLiteral("news");
else
return NS_ERROR_NOT_AVAILABLE;
diff --git a/application/palemoon/components/shell/nsGNOMEShellService.h b/application/palemoon/components/shell/nsGNOMEShellService.h
index 36a4a0c42..a7b003802 100644
--- a/application/palemoon/components/shell/nsGNOMEShellService.h
+++ b/application/palemoon/components/shell/nsGNOMEShellService.h
@@ -6,28 +6,28 @@
#ifndef nsgnomeshellservice_h____
#define nsgnomeshellservice_h____
-#include "nsIShellService.h"
+#include "nsIGNOMEShellService.h"
#include "nsStringAPI.h"
#include "mozilla/Attributes.h"
-class nsGNOMEShellService final : public nsIShellService
+class nsGNOMEShellService final : public nsIGNOMEShellService
{
public:
- nsGNOMEShellService() : mCheckedThisSession(false), mAppIsInPath(false) { }
+ nsGNOMEShellService() : mAppIsInPath(false) { }
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE
+ NS_DECL_NSIGNOMESHELLSERVICE
- nsresult Init() NS_HIDDEN;
+ nsresult Init();
private:
~nsGNOMEShellService() {}
- NS_HIDDEN_(bool) KeyMatchesAppName(const char *aKeyValue) const;
- NS_HIDDEN_(bool) CheckHandlerMatchesAppName(const nsACString& handler) const;
+ bool KeyMatchesAppName(const char *aKeyValue) const;
+ bool CheckHandlerMatchesAppName(const nsACString& handler) const;
- NS_HIDDEN_(bool) GetAppPathFromLauncher();
- bool mCheckedThisSession;
+ bool GetAppPathFromLauncher();
bool mUseLocaleFilenames;
nsCString mAppPath;
bool mAppIsInPath;
diff --git a/application/palemoon/components/shell/nsIGNOMEShellService.idl b/application/palemoon/components/shell/nsIGNOMEShellService.idl
new file mode 100644
index 000000000..842ce5e8a
--- /dev/null
+++ b/application/palemoon/components/shell/nsIGNOMEShellService.idl
@@ -0,0 +1,19 @@
+/* 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 "nsIShellService.idl"
+
+[scriptable, uuid(2ce5c803-edcd-443d-98eb-ceba86d02d13)]
+interface nsIGNOMEShellService : nsIShellService
+{
+ /**
+ * Used to determine whether or not to offer "Set as desktop background"
+ * functionality. Even if shell service is available it is not
+ * guaranteed that it is able to set the background for every desktop
+ * which is especially true for Linux with its many different desktop
+ * environments.
+ */
+ readonly attribute boolean canSetDesktopBackground;
+};
+
diff --git a/application/palemoon/components/shell/nsIMacShellService.idl b/application/palemoon/components/shell/nsIMacShellService.idl
index 3c2f42315..6a532bbd0 100644
--- a/application/palemoon/components/shell/nsIMacShellService.idl
+++ b/application/palemoon/components/shell/nsIMacShellService.idl
@@ -5,7 +5,7 @@
#include "nsIShellService.idl"
-[scriptable, uuid(7f8ca08e-1df4-4735-86e9-50dedb48e5e8)]
+[scriptable, uuid(387fdc80-0077-4b60-a0d9-d9e80a83ba64)]
interface nsIMacShellService : nsIShellService
{
const long APPLICATION_KEYCHAIN_ACCESS = 2;
diff --git a/application/palemoon/components/shell/nsIShellService.idl b/application/palemoon/components/shell/nsIShellService.idl
index 4825741b3..3e7e94b00 100644
--- a/application/palemoon/components/shell/nsIShellService.idl
+++ b/application/palemoon/components/shell/nsIShellService.idl
@@ -8,7 +8,7 @@
interface nsIDOMElement;
interface nsIFile;
-[scriptable, uuid(99d2e9f1-3c86-40f7-81fd-3060c18489f0)]
+[scriptable, uuid(2d1a95e4-5bd8-4eeb-b0a8-c1455fd2a357)]
interface nsIShellService : nsISupports
{
/**
@@ -39,23 +39,6 @@ interface nsIShellService : nsISupports
void setDefaultBrowser(in boolean aClaimAllTypes, in boolean aForAllUsers);
/**
- * Used to determine whether or not to show a "Set Default Browser"
- * query dialog. This attribute is true if the application is starting
- * up and "browser.shell.checkDefaultBrowser" is true, otherwise it
- * is false.
- */
- attribute boolean shouldCheckDefaultBrowser;
-
- /**
- * Used to determine whether or not to offer "Set as desktop background"
- * functionality. Even if shell service is available it is not
- * guaranteed that it is able to set the background for every desktop
- * which is especially true for Linux with its many different desktop
- * environments.
- */
- readonly attribute boolean canSetDesktopBackground;
-
- /**
* Flags for positioning/sizing of the Desktop Background image.
*/
const long BACKGROUND_TILE = 1;
diff --git a/application/palemoon/components/shell/nsIWindowsShellService.idl b/application/palemoon/components/shell/nsIWindowsShellService.idl
index 913eb4292..57ed37055 100644
--- a/application/palemoon/components/shell/nsIWindowsShellService.idl
+++ b/application/palemoon/components/shell/nsIWindowsShellService.idl
@@ -5,7 +5,7 @@
#include "nsIShellService.idl"
-[scriptable, uuid(89b0a761-d9a0-4c39-ab83-d81566459a31)]
+[scriptable, uuid(f8a26b94-49e5-4441-8fbc-315e0b4f22ef)]
interface nsIWindowsShellService : nsIShellService
{
/**
diff --git a/application/palemoon/components/shell/nsMacShellService.cpp b/application/palemoon/components/shell/nsMacShellService.cpp
index 914b9ae65..d8d64039d 100644
--- a/application/palemoon/components/shell/nsMacShellService.cpp
+++ b/application/palemoon/components/shell/nsMacShellService.cpp
@@ -17,13 +17,13 @@
#include "nsIURL.h"
#include "nsIWebBrowserPersist.h"
#include "nsMacShellService.h"
-#include "nsNetUtil.h"
+#include "nsIProperties.h"
+#include "nsServiceManagerUtils.h"
#include "nsShellService.h"
#include "nsStringAPI.h"
#include "nsIDocShell.h"
#include "nsILoadContext.h"
-
#include <CoreFoundation/CoreFoundation.h>
#include <ApplicationServices/ApplicationServices.h>
@@ -49,19 +49,14 @@ nsMacShellService::IsDefaultBrowser(bool aStartupCheck,
return NS_ERROR_FAILURE;
}
- // Get the default http handler's bundle ID (or nullptr if it has not been explicitly set)
+ // Get the default http handler's bundle ID (or nullptr if it has not been
+ // explicitly set)
CFStringRef defaultBrowserID = ::LSCopyDefaultHandlerForURLScheme(CFSTR("http"));
if (defaultBrowserID) {
*aIsDefaultBrowser = ::CFStringCompare(firefoxID, defaultBrowserID, 0) == kCFCompareEqualTo;
::CFRelease(defaultBrowserID);
}
- // If this is the first browser window, maintain internal state that we've
- // checked this session (so that subsequent window opens don't show the
- // default browser dialog).
- if (aStartupCheck)
- mCheckedThisSession = true;
-
return NS_OK;
}
@@ -90,47 +85,15 @@ nsMacShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers)
return NS_ERROR_FAILURE;
}
}
-
- return NS_OK;
-}
-NS_IMETHODIMP
-nsMacShellService::GetShouldCheckDefaultBrowser(bool* aResult)
-{
- // If we've already checked, the browser has been started and this is a
- // new window open, and we don't want to check again.
- if (mCheckedThisSession) {
- *aResult = false;
- return NS_OK;
+ nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
+ if (prefs) {
+ (void) prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, true);
+ // Reset the number of times the dialog should be shown
+ // before it is silenced.
+ (void) prefs->SetIntPref(PREF_DEFAULTBROWSERCHECKCOUNT, 0);
}
- nsCOMPtr<nsIPrefBranch> prefs;
- nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID));
- if (pserve)
- pserve->GetBranch("", getter_AddRefs(prefs));
-
- prefs->GetBoolPref(PREF_CHECKDEFAULTBROWSER, aResult);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMacShellService::SetShouldCheckDefaultBrowser(bool aShouldCheck)
-{
- nsCOMPtr<nsIPrefBranch> prefs;
- nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID));
- if (pserve)
- pserve->GetBranch("", getter_AddRefs(prefs));
-
- prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, aShouldCheck);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMacShellService::GetCanSetDesktopBackground(bool* aResult)
-{
- *aResult = true;
return NS_OK;
}
@@ -202,8 +165,10 @@ nsMacShellService::SetDesktopBackground(nsIDOMElement* aElement,
loadContext = do_QueryInterface(docShell);
}
- return wbp->SaveURI(imageURI, nullptr, docURI, content->OwnerDoc()->GetReferrerPolicy(),
- nullptr, nullptr, mBackgroundFile, loadContext);
+ return wbp->SaveURI(imageURI, nullptr,
+ docURI, content->OwnerDoc()->GetReferrerPolicy(),
+ nullptr, nullptr,
+ mBackgroundFile, loadContext);
}
NS_IMETHODIMP
@@ -269,7 +234,8 @@ nsMacShellService::OnStateChange(nsIWebProgress* aWebProgress,
OSStatus status;
// Convert the path into a FSRef
- status = ::FSPathMakeRef((const UInt8*)nativePath.get(), &pictureRef, nullptr);
+ status = ::FSPathMakeRef((const UInt8*)nativePath.get(), &pictureRef,
+ nullptr);
if (status == noErr) {
err = ::FSNewAlias(nil, &pictureRef, &aliasHandle);
if (err == noErr && aliasHandle == nil)
@@ -336,8 +302,8 @@ nsMacShellService::OpenApplication(int32_t aApplication)
}
break;
case nsIMacShellService::APPLICATION_KEYCHAIN_ACCESS:
- err = ::LSGetApplicationForInfo('APPL', 'kcmr', nullptr, kLSRolesAll, nullptr,
- &appURL);
+ err = ::LSGetApplicationForInfo('APPL', 'kcmr', nullptr, kLSRolesAll,
+ nullptr, &appURL);
break;
case nsIMacShellService::APPLICATION_NETWORK:
{
@@ -349,8 +315,7 @@ nsMacShellService::OpenApplication(int32_t aApplication)
if (!exists)
return NS_ERROR_FILE_NOT_FOUND;
return lf->Launch();
- }
- break;
+ }
case nsIMacShellService::APPLICATION_DESKTOP:
{
nsCOMPtr<nsIFile> lf;
@@ -361,8 +326,7 @@ nsMacShellService::OpenApplication(int32_t aApplication)
if (!exists)
return NS_ERROR_FILE_NOT_FOUND;
return lf->Launch();
- }
- break;
+ }
}
if (appURL && err == noErr) {
diff --git a/application/palemoon/components/shell/nsMacShellService.h b/application/palemoon/components/shell/nsMacShellService.h
index 7ca1c71ac..db9527809 100644
--- a/application/palemoon/components/shell/nsMacShellService.h
+++ b/application/palemoon/components/shell/nsMacShellService.h
@@ -15,7 +15,7 @@ class nsMacShellService : public nsIMacShellService,
public nsIWebProgressListener
{
public:
- nsMacShellService() : mCheckedThisSession(false) {};
+ nsMacShellService() {};
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE
@@ -27,8 +27,6 @@ protected:
private:
nsCOMPtr<nsIFile> mBackgroundFile;
-
- bool mCheckedThisSession;
};
#endif // nsmacshellservice_h____
diff --git a/application/palemoon/components/shell/nsSetDefaultBrowser.js b/application/palemoon/components/shell/nsSetDefaultBrowser.js
index d1d1e72cb..c7a78c538 100644
--- a/application/palemoon/components/shell/nsSetDefaultBrowser.js
+++ b/application/palemoon/components/shell/nsSetDefaultBrowser.js
@@ -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/. */
-/*
- * -setDefaultBrowser commandline handler
+/*
+ * --setDefaultBrowser commandline handler
* Makes the current executable the "default browser".
*/
const Cc = Components.classes;
const Ci = Components.interfaces;
+Components.utils.import("resource:///modules/ShellService.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
function nsSetDefaultBrowser() {}
@@ -16,13 +17,11 @@ function nsSetDefaultBrowser() {}
nsSetDefaultBrowser.prototype = {
handle: function nsSetDefault_handle(aCmdline) {
if (aCmdline.handleFlag("setDefaultBrowser", false)) {
- var shell = Cc["@mozilla.org/browser/shell-service;1"].
- getService(Ci.nsIShellService);
- shell.setDefaultBrowser(true, true);
+ ShellService.setDefaultBrowser(true, true);
}
},
- helpInfo: " -setDefaultBrowser Set this app as the default browser.\n",
+ helpInfo: " --setDefaultBrowser Set this app as the default browser.\n",
classID: Components.ID("{F57899D0-4E2C-4ac6-9E29-50C736103B0C}"),
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
diff --git a/application/palemoon/components/shell/nsShellService.h b/application/palemoon/components/shell/nsShellService.h
index d5fade37b..516a8423a 100644
--- a/application/palemoon/components/shell/nsShellService.h
+++ b/application/palemoon/components/shell/nsShellService.h
@@ -4,6 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#define PREF_CHECKDEFAULTBROWSER "browser.shell.checkDefaultBrowser"
+#define PREF_SKIPDEFAULTBROWSERCHECK "browser.shell.skipDefaultBrowserCheck"
+#define PREF_DEFAULTBROWSERCHECKCOUNT "browser.shell.defaultBrowserCheckCount"
#define SHELLSERVICE_PROPERTIES "chrome://browser/locale/shellservice.properties"
#define BRAND_PROPERTIES "chrome://branding/locale/brand.properties"
diff --git a/application/palemoon/components/shell/nsWindowsShellService.cpp b/application/palemoon/components/shell/nsWindowsShellService.cpp
index 813ec4fe1..c4039b95a 100644
--- a/application/palemoon/components/shell/nsWindowsShellService.cpp
+++ b/application/palemoon/components/shell/nsWindowsShellService.cpp
@@ -3,6 +3,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "nsWindowsShellService.h"
+
#include "imgIContainer.h"
#include "imgIRequest.h"
#include "mozilla/gfx/2D.h"
@@ -15,8 +17,8 @@
#include "nsIServiceManager.h"
#include "nsIStringBundle.h"
#include "nsNetUtil.h"
+#include "nsServiceManagerUtils.h"
#include "nsShellService.h"
-#include "nsWindowsShellService.h"
#include "nsIProcess.h"
#include "nsICategoryManager.h"
#include "nsBrowserCompsCID.h"
@@ -27,6 +29,7 @@
#include "nsUnicharUtils.h"
#include "nsIWinTaskbar.h"
#include "nsISupportsPrimitives.h"
+#include "nsIURLFormatter.h"
#include "nsThreadUtils.h"
#include "nsXULAppAPI.h"
#include "mozilla/WindowsVersion.h"
@@ -47,6 +50,9 @@
#include <mbstring.h>
#include <shlwapi.h>
+#include <lm.h>
+#undef ACCESS_READ
+
#ifndef MAX_BUF
#define MAX_BUF 4096
#endif
@@ -129,7 +135,7 @@ OpenKeyForReading(HKEY aKeyRoot, const nsAString& aKeyName, HKEY* aKey)
// The following keys are set to make PaleMoon appear in the Start Menu as the
// browser:
//
-// HKCU\SOFTWARE\Clients\StartMenuInternet\FIREFOX.EXE\
+// HKCU\SOFTWARE\Clients\StartMenuInternet\PaleMoon.EXE\
// (default) REG_SZ <appname>
// DefaultIcon (default) REG_SZ <apppath>,0
// InstallInfo HideIconsCommand REG_SZ <uninstpath> /HideShortcuts
@@ -278,20 +284,15 @@ nsWindowsShellService::ShortcutMaintenance()
return NS_ERROR_UNEXPECTED;
NS_NAMED_LITERAL_CSTRING(prefName, "browser.taskbar.lastgroupid");
- nsCOMPtr<nsIPrefService> prefs =
+ nsCOMPtr<nsIPrefBranch> prefs =
do_GetService(NS_PREFSERVICE_CONTRACTID);
if (!prefs)
return NS_ERROR_UNEXPECTED;
- nsCOMPtr<nsIPrefBranch> prefBranch;
- prefs->GetBranch(nullptr, getter_AddRefs(prefBranch));
- if (!prefBranch)
- return NS_ERROR_UNEXPECTED;
-
nsCOMPtr<nsISupportsString> prefString;
- rv = prefBranch->GetComplexValue(prefName.get(),
- NS_GET_IID(nsISupportsString),
- getter_AddRefs(prefString));
+ rv = prefs->GetComplexValue(prefName.get(),
+ NS_GET_IID(nsISupportsString),
+ getter_AddRefs(prefString));
if (NS_SUCCEEDED(rv)) {
nsAutoString version;
prefString->GetData(version);
@@ -307,9 +308,9 @@ nsWindowsShellService::ShortcutMaintenance()
return rv;
prefString->SetData(appId);
- rv = prefBranch->SetComplexValue(prefName.get(),
- NS_GET_IID(nsISupportsString),
- prefString);
+ rv = prefs->SetComplexValue(prefName.get(),
+ NS_GET_IID(nsISupportsString),
+ prefString);
if (NS_FAILED(rv)) {
NS_WARNING("Couldn't set last user model id!");
return NS_ERROR_UNEXPECTED;
@@ -325,38 +326,47 @@ nsWindowsShellService::ShortcutMaintenance()
}
static bool
-IsAARDefaultHTTP(IApplicationAssociationRegistration* pAAR,
- bool* aIsDefaultBrowser)
+IsAARDefault(const RefPtr<IApplicationAssociationRegistration>& pAAR,
+ LPCWSTR aClassName)
{
// Make sure the Prog ID matches what we have
LPWSTR registeredApp;
- HRESULT hr = pAAR->QueryCurrentDefault(L"http", AT_URLPROTOCOL, AL_EFFECTIVE,
+ bool isProtocol = *aClassName != L'.';
+ ASSOCIATIONTYPE queryType = isProtocol ? AT_URLPROTOCOL : AT_FILEEXTENSION;
+ HRESULT hr = pAAR->QueryCurrentDefault(aClassName, queryType, AL_EFFECTIVE,
&registeredApp);
- if (SUCCEEDED(hr)) {
- LPCWSTR firefoxHTTPProgID = L"PaleMoonURL";
- *aIsDefaultBrowser = !wcsicmp(registeredApp, firefoxHTTPProgID);
- CoTaskMemFree(registeredApp);
- } else {
- *aIsDefaultBrowser = false;
+ if (FAILED(hr)) {
+ return false;
}
- return SUCCEEDED(hr);
+
+ LPCWSTR progID = isProtocol ? L"PaleMoonURL" : L"PaleMoonHTML";
+ bool isDefault = !wcsicmp(registeredApp, progID);
+ CoTaskMemFree(registeredApp);
+
+ return isDefault;
}
-static bool
-IsAARDefaultHTML(IApplicationAssociationRegistration* pAAR,
- bool* aIsDefaultBrowser)
+static void
+IsDefaultBrowserWin8(bool aCheckAllTypes, bool* aIsDefaultBrowser)
{
- LPWSTR registeredApp;
- HRESULT hr = pAAR->QueryCurrentDefault(L".html", AT_FILEEXTENSION, AL_EFFECTIVE,
- &registeredApp);
- if (SUCCEEDED(hr)) {
- LPCWSTR firefoxHTMLProgID = L"PaleMoonHTML";
- *aIsDefaultBrowser = !wcsicmp(registeredApp, firefoxHTMLProgID);
- CoTaskMemFree(registeredApp);
- } else {
- *aIsDefaultBrowser = false;
+ RefPtr<IApplicationAssociationRegistration> pAAR;
+ HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
+ nullptr,
+ CLSCTX_INPROC,
+ IID_IApplicationAssociationRegistration,
+ getter_AddRefs(pAAR));
+ if (FAILED(hr)) {
+ return;
+ }
+
+ bool res = IsAARDefault(pAAR, L"http");
+ if (*aIsDefaultBrowser) {
+ *aIsDefaultBrowser = res;
+ }
+ res = IsAARDefault(pAAR, L".html");
+ if (*aIsDefaultBrowser && aCheckAllTypes) {
+ *aIsDefaultBrowser = res;
}
- return SUCCEEDED(hr);
}
/*
@@ -369,37 +379,27 @@ bool
nsWindowsShellService::IsDefaultBrowserVista(bool aCheckAllTypes,
bool* aIsDefaultBrowser)
{
- IApplicationAssociationRegistration* pAAR;
+ RefPtr<IApplicationAssociationRegistration> pAAR;
HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistration,
nullptr,
CLSCTX_INPROC,
IID_IApplicationAssociationRegistration,
- (void**)&pAAR);
-
- if (SUCCEEDED(hr)) {
- if (aCheckAllTypes) {
- BOOL res;
- hr = pAAR->QueryAppIsDefaultAll(AL_EFFECTIVE,
- APP_REG_NAME,
- &res);
- *aIsDefaultBrowser = res;
-
- // If we have all defaults, let's make sure that our ProgID
- // is explicitly returned as well. Needed only for Windows 8.
- if (*aIsDefaultBrowser && IsWin8OrLater()) {
- IsAARDefaultHTTP(pAAR, aIsDefaultBrowser);
- if (*aIsDefaultBrowser) {
- IsAARDefaultHTML(pAAR, aIsDefaultBrowser);
- }
- }
- } else {
- IsAARDefaultHTTP(pAAR, aIsDefaultBrowser);
- }
+ getter_AddRefs(pAAR));
+ if (FAILED(hr)) {
+ return false;
+ }
- pAAR->Release();
- return true;
+ if (aCheckAllTypes) {
+ BOOL res;
+ hr = pAAR->QueryAppIsDefaultAll(AL_EFFECTIVE,
+ APP_REG_NAME,
+ &res);
+ *aIsDefaultBrowser = res;
+ } else if (!IsWin8OrLater()) {
+ *aIsDefaultBrowser = IsAARDefault(pAAR, L"http");
}
- return false;
+
+ return true;
}
NS_IMETHODIMP
@@ -407,12 +407,6 @@ nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck,
bool aForAllTypes,
bool* aIsDefaultBrowser)
{
- // If this is the first browser window, maintain internal state that we've
- // checked this session (so that subsequent window opens don't show the
- // default browser dialog).
- if (aStartupCheck)
- mCheckedThisSession = true;
-
// Assume we're the default unless one of the several checks below tell us
// otherwise.
*aIsDefaultBrowser = true;
@@ -499,6 +493,9 @@ nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck,
// previous checks show that PaleMoon is the default browser.
if (*aIsDefaultBrowser) {
IsDefaultBrowserVista(aForAllTypes, aIsDefaultBrowser);
+ if (IsWin8OrLater()) {
+ IsDefaultBrowserWin8(aForAllTypes, aIsDefaultBrowser);
+ }
}
// To handle the case where DDE isn't disabled due for a user because there
@@ -603,13 +600,6 @@ nsWindowsShellService::IsDefaultBrowser(bool aStartupCheck,
return NS_OK;
}
-NS_IMETHODIMP
-nsWindowsShellService::GetCanSetDesktopBackground(bool* aResult)
-{
- *aResult = true;
- return NS_OK;
-}
-
static nsresult
DynSHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
{
@@ -628,14 +618,34 @@ DynSHOpenWithDialog(HWND hwndParent, const OPENASINFO *poainfo)
return NS_ERROR_FAILURE;
}
- nsresult rv =
- SUCCEEDED(SHOpenWithDialogFn(hwndParent, poainfo)) ? NS_OK :
- NS_ERROR_FAILURE;
+ nsresult rv;
+ HRESULT hr = SHOpenWithDialogFn(hwndParent, poainfo);
+ if (SUCCEEDED(hr) || (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED))) {
+ rv = NS_OK;
+ } else {
+ rv = NS_ERROR_FAILURE;
+ }
FreeLibrary(shellDLL);
return rv;
}
nsresult
+nsWindowsShellService::LaunchControlPanelDefaultsSelectionUI()
+{
+ IApplicationAssociationRegistrationUI* pAARUI;
+ HRESULT hr = CoCreateInstance(CLSID_ApplicationAssociationRegistrationUI,
+ NULL,
+ CLSCTX_INPROC,
+ IID_IApplicationAssociationRegistrationUI,
+ (void**)&pAARUI);
+ if (SUCCEEDED(hr)) {
+ hr = pAARUI->LaunchAdvancedAssociationUI(APP_REG_NAME);
+ pAARUI->Release();
+ }
+ return SUCCEEDED(hr) ? NS_OK : NS_ERROR_FAILURE;
+}
+
+nsresult
nsWindowsShellService::LaunchControlPanelDefaultPrograms()
{
// Build the path control.exe path safely
@@ -651,7 +661,8 @@ nsWindowsShellService::LaunchControlPanelDefaultPrograms()
return NS_ERROR_FAILURE;
}
- WCHAR params[] = L"control.exe /name Microsoft.DefaultPrograms /page pageDefaultProgram";
+ WCHAR params[] = L"control.exe /name Microsoft.DefaultPrograms /page "
+ "pageDefaultProgram\\pageAdvancedSettings?pszAppName=" APP_REG_NAME;
STARTUPINFOW si = {sizeof(si), 0};
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOWDEFAULT;
@@ -666,9 +677,62 @@ nsWindowsShellService::LaunchControlPanelDefaultPrograms()
return NS_OK;
}
+static bool
+IsWindowsLogonConnected()
+{
+ WCHAR userName[UNLEN + 1];
+ DWORD size = ArrayLength(userName);
+ if (!GetUserNameW(userName, &size)) {
+ return false;
+ }
+
+ LPUSER_INFO_24 info;
+ if (NetUserGetInfo(nullptr, userName, 24, (LPBYTE *)&info)
+ != NERR_Success) {
+ return false;
+ }
+ bool connected = info->usri24_internet_identity;
+ NetApiBufferFree(info);
+
+ return connected;
+}
+
+static bool
+SettingsAppBelievesConnected()
+{
+ nsresult rv;
+ nsCOMPtr<nsIWindowsRegKey> regKey =
+ do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv);
+ if (NS_FAILED(rv)) {
+ return false;
+ }
+
+ rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
+ NS_LITERAL_STRING("SOFTWARE\\Microsoft\\Windows\\Shell\\Associations"),
+ nsIWindowsRegKey::ACCESS_READ);
+ if (NS_FAILED(rv)) {
+ return false;
+ }
+
+ uint32_t value;
+ rv = regKey->ReadIntValue(NS_LITERAL_STRING("IsConnectedAtLogon"), &value);
+ if (NS_FAILED(rv)) {
+ return false;
+ }
+
+ return !!value;
+}
+
nsresult
nsWindowsShellService::LaunchModernSettingsDialogDefaultApps()
{
+ if (!IsWindowsBuildOrLater(14965) &&
+ !IsWindowsLogonConnected() && SettingsAppBelievesConnected()) {
+ // Use the classic Control Panel to work around a bug of older
+ // builds of Windows 10.
+ return LaunchControlPanelDefaultPrograms();
+ }
+
IApplicationActivationManager* pActivator;
HRESULT hr = CoCreateInstance(CLSID_ApplicationActivationManager,
nullptr,
@@ -682,6 +746,15 @@ nsWindowsShellService::LaunchModernSettingsDialogDefaultApps()
L"windows.immersivecontrolpanel_cw5n1h2txyewy"
L"!microsoft.windows.immersivecontrolpanel",
L"page=SettingsPageAppsDefaults", AO_NONE, &pid);
+ if (SUCCEEDED(hr)) {
+ // Do not check error because we could at least open
+ // the "Default apps" setting.
+ pActivator->ActivateApplication(
+ L"windows.immersivecontrolpanel_cw5n1h2txyewy"
+ L"!microsoft.windows.immersivecontrolpanel",
+ L"page=SettingsPageAppsDefaults"
+ L"&target=SystemSettings_DefaultApps_Browser", AO_NONE, &pid);
+ }
pActivator->Release();
return SUCCEEDED(hr) ? NS_OK : NS_ERROR_FAILURE;
}
@@ -689,6 +762,36 @@ nsWindowsShellService::LaunchModernSettingsDialogDefaultApps()
}
nsresult
+nsWindowsShellService::InvokeHTTPOpenAsVerb()
+{
+ nsCOMPtr<nsIURLFormatter> formatter(
+ do_GetService("@mozilla.org/toolkit/URLFormatterService;1"));
+ if (!formatter) {
+ return NS_ERROR_UNEXPECTED;
+ }
+
+ nsString urlStr;
+ nsresult rv = formatter->FormatURLPref(
+ NS_LITERAL_STRING("app.support.baseURL"), urlStr);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+ if (!StringBeginsWith(urlStr, NS_LITERAL_STRING("https://"))) {
+ return NS_ERROR_FAILURE;
+ }
+ urlStr.AppendLiteral("win10-default-browser");
+
+ SHELLEXECUTEINFOW seinfo = { sizeof(SHELLEXECUTEINFOW) };
+ seinfo.lpVerb = L"openas";
+ seinfo.lpFile = urlStr.get();
+ seinfo.nShow = SW_SHOWNORMAL;
+ if (!ShellExecuteExW(&seinfo)) {
+ return NS_ERROR_FAILURE;
+ }
+ return NS_OK;
+}
+
+nsresult
nsWindowsShellService::LaunchHTTPHandlerPane()
{
OPENASINFO info;
@@ -716,16 +819,23 @@ nsWindowsShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers)
nsresult rv = LaunchHelper(appHelperPath);
if (NS_SUCCEEDED(rv) && IsWin8OrLater()) {
if (aClaimAllTypes) {
- rv = LaunchControlPanelDefaultPrograms();
+ if (IsWin10OrLater()) {
+ rv = LaunchModernSettingsDialogDefaultApps();
+ } else {
+ rv = LaunchControlPanelDefaultsSelectionUI();
+ }
// The above call should never really fail, but just in case
// fall back to showing the HTTP association screen only.
if (NS_FAILED(rv)) {
- rv = LaunchHTTPHandlerPane();
+ if (IsWin10OrLater()) {
+ rv = InvokeHTTPOpenAsVerb();
+ } else {
+ rv = LaunchHTTPHandlerPane();
+ }
}
} else {
- // Windows 10 blocks attempts to load the HTTP Handler
- // association dialog, so the modern Settings dialog
- // is opened with the Default Apps view loaded.
+ // Windows 10 blocks attempts to load the
+ // HTTP Handler association dialog.
if (IsWin10OrLater()) {
rv = LaunchModernSettingsDialogDefaultApps();
} else {
@@ -735,50 +845,20 @@ nsWindowsShellService::SetDefaultBrowser(bool aClaimAllTypes, bool aForAllUsers)
// The above call should never really fail, but just in case
// fall back to showing control panel for all defaults
if (NS_FAILED(rv)) {
- rv = LaunchControlPanelDefaultPrograms();
+ rv = LaunchControlPanelDefaultsSelectionUI();
}
}
}
- return rv;
-}
-
-NS_IMETHODIMP
-nsWindowsShellService::GetShouldCheckDefaultBrowser(bool* aResult)
-{
- NS_ENSURE_ARG_POINTER(aResult);
-
- // If we've already checked, the browser has been started and this is a
- // new window open, and we don't want to check again.
- if (mCheckedThisSession) {
- *aResult = false;
- return NS_OK;
+ nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
+ if (prefs) {
+ (void) prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, true);
+ // Reset the number of times the dialog should be shown
+ // before it is silenced.
+ (void) prefs->SetIntPref(PREF_DEFAULTBROWSERCHECKCOUNT, 0);
}
- nsCOMPtr<nsIPrefBranch> prefs;
- nsresult rv;
- nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = pserve->GetBranch("", getter_AddRefs(prefs));
- NS_ENSURE_SUCCESS(rv, rv);
-
- return prefs->GetBoolPref(PREF_CHECKDEFAULTBROWSER, aResult);
-}
-
-NS_IMETHODIMP
-nsWindowsShellService::SetShouldCheckDefaultBrowser(bool aShouldCheck)
-{
- nsCOMPtr<nsIPrefBranch> prefs;
- nsresult rv;
-
- nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = pserve->GetBranch("", getter_AddRefs(prefs));
- NS_ENSURE_SUCCESS(rv, rv);
-
- return prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, aShouldCheck);
+ return rv;
}
static nsresult
@@ -912,7 +992,7 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
// e.g. "Desktop Background.bmp"
nsString fileLeafName;
rv = shellBundle->GetStringFromName
- (MOZ_UTF16("desktopBackgroundLeafNameWin"),
+ (u"desktopBackgroundLeafNameWin",
getter_Copies(fileLeafName));
NS_ENSURE_SUCCESS(rv, rv);
@@ -948,24 +1028,24 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
nsAutoString style;
switch (aPosition) {
case BACKGROUND_TILE:
- style.AssignLiteral("0");
- tile.AssignLiteral("1");
+ style.Assign('0');
+ tile.Assign('1');
break;
case BACKGROUND_CENTER:
- style.AssignLiteral("0");
- tile.AssignLiteral("0");
+ style.Assign('0');
+ tile.Assign('0');
break;
case BACKGROUND_STRETCH:
- style.AssignLiteral("2");
- tile.AssignLiteral("0");
+ style.Assign('2');
+ tile.Assign('0');
break;
case BACKGROUND_FILL:
style.AssignLiteral("10");
- tile.AssignLiteral("0");
+ tile.Assign('0');
break;
case BACKGROUND_FIT:
- style.AssignLiteral("6");
- tile.AssignLiteral("0");
+ style.Assign('6');
+ tile.Assign('0');
break;
}
@@ -1023,7 +1103,7 @@ nsWindowsShellService::OpenApplication(int32_t aApplication)
::RegCloseKey(theKey);
// Find the "open" command
- application.AppendLiteral("\\");
+ application.Append('\\');
application.Append(buf);
application.AppendLiteral("\\shell\\open\\command");
@@ -1122,8 +1202,7 @@ nsWindowsShellService::SetDesktopBackgroundColor(uint32_t aColor)
return regKey->Close();
}
-nsWindowsShellService::nsWindowsShellService() :
- mCheckedThisSession(false)
+nsWindowsShellService::nsWindowsShellService()
{
}
diff --git a/application/palemoon/components/shell/nsWindowsShellService.h b/application/palemoon/components/shell/nsWindowsShellService.h
index f856ffd35..06c6c3c9b 100644
--- a/application/palemoon/components/shell/nsWindowsShellService.h
+++ b/application/palemoon/components/shell/nsWindowsShellService.h
@@ -16,9 +16,10 @@
class nsWindowsShellService : public nsIWindowsShellService
{
+ virtual ~nsWindowsShellService();
+
public:
nsWindowsShellService();
- virtual ~nsWindowsShellService();
NS_DECL_ISUPPORTS
NS_DECL_NSISHELLSERVICE
@@ -26,12 +27,11 @@ public:
protected:
bool IsDefaultBrowserVista(bool aCheckAllTypes, bool* aIsDefaultBrowser);
+ nsresult LaunchControlPanelDefaultsSelectionUI();
nsresult LaunchControlPanelDefaultPrograms();
nsresult LaunchModernSettingsDialogDefaultApps();
+ nsresult InvokeHTTPOpenAsVerb();
nsresult LaunchHTTPHandlerPane();
-
-private:
- bool mCheckedThisSession;
};
#endif // nswindowsshellservice_h____
diff --git a/application/palemoon/components/statusbar/Downloads.jsm b/application/palemoon/components/statusbar/Downloads.jsm
index 74bc42144..091fdad2e 100644
--- a/application/palemoon/components/statusbar/Downloads.jsm
+++ b/application/palemoon/components/statusbar/Downloads.jsm
@@ -18,657 +18,657 @@ CU.import("resource://gre/modules/XPCOMUtils.jsm");
function S4EDownloadService(window, gBrowser, service, getters)
{
- this._window = window;
- this._gBrowser = gBrowser;
- this._service = service;
- this._getters = getters;
+ this._window = window;
+ this._gBrowser = gBrowser;
+ this._service = service;
+ this._getters = getters;
- this._handler = new JSTransferHandler(this._window, this);
+ this._handler = new JSTransferHandler(this._window, this);
}
S4EDownloadService.prototype =
{
- _window: null,
- _gBrowser: null,
- _service: null,
- _getters: null,
-
- _handler: null,
- _listening: false,
-
- _binding: false,
- _customizing: false,
-
- _lastTime: Infinity,
-
- _dlActive: false,
- _dlPaused: false,
- _dlFinished: false,
-
- _dlCountStr: null,
- _dlTimeStr: null,
-
- _dlProgressAvg: 0,
- _dlProgressMax: 0,
- _dlProgressMin: 0,
- _dlProgressType: "active",
-
- _dlNotifyTimer: 0,
- _dlNotifyGlowTimer: 0,
-
- init: function()
- {
- if(!this._getters.downloadButton)
- {
- this.uninit();
- return;
- }
-
- if(this._listening)
- {
- return;
- }
-
- this._handler.start();
- this._listening = true;
-
- this._lastTime = Infinity;
-
- this.updateBinding();
- this.updateStatus();
- },
-
- uninit: function()
- {
- if(!this._listening)
- {
- return;
- }
-
- this._listening = false;
- this._handler.stop();
-
- this.releaseBinding();
- },
-
- destroy: function()
- {
- this.uninit();
- this._handler.destroy();
-
- ["_window", "_gBrowser", "_service", "_getters", "_handler"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- updateBinding: function()
- {
- if(!this._listening)
- {
- this.releaseBinding();
- return;
- }
-
- switch(this._service.downloadButtonAction)
- {
- case 1: // Default
- this.attachBinding();
- break;
- default:
- this.releaseBinding();
- break;
- }
- },
-
- attachBinding: function()
- {
- if(this._binding)
- {
- return;
- }
-
- let db = this._window.DownloadsButton;
-
- db._getAnchorS4EBackup = db.getAnchor;
- db.getAnchor = this.getAnchor.bind(this);
-
- db._releaseAnchorS4EBackup = db.releaseAnchor;
- db.releaseAnchor = function() {};
-
- this._binding = true;
- },
-
- releaseBinding: function()
- {
- if(!this._binding)
- {
- return;
- }
-
- let db = this._window.DownloadsButton;
-
- db.getAnchor = db._getAnchorS4EBackup;
- db.releaseAnchor = db._releaseAnchorS4EBackup;
-
- this._binding = false;
- },
-
- customizing: function(val)
- {
- this._customizing = val;
- },
-
- updateStatus: function(lastFinished)
- {
- if(!this._getters.downloadButton)
- {
- this.uninit();
- return;
- }
-
- let numActive = 0;
- let numPaused = 0;
- let activeTotalSize = 0;
- let activeTransferred = 0;
- let activeMaxProgress = -Infinity;
- let activeMinProgress = Infinity;
- let pausedTotalSize = 0;
- let pausedTransferred = 0;
- let pausedMaxProgress = -Infinity;
- let pausedMinProgress = Infinity;
- let maxTime = -Infinity;
-
- let dls = ((this.isPrivateWindow) ? this._handler.activePrivateEntries() : this._handler.activeEntries());
- for(let dl of dls)
- {
- if(dl.state == CI.nsIDownloadManager.DOWNLOAD_DOWNLOADING)
- {
- numActive++;
- if(dl.size > 0)
- {
- if(dl.speed > 0)
- {
- maxTime = Math.max(maxTime, (dl.size - dl.transferred) / dl.speed);
- }
-
- activeTotalSize += dl.size;
- activeTransferred += dl.transferred;
-
- let currentProgress = ((dl.transferred * 100) / dl.size);
- activeMaxProgress = Math.max(activeMaxProgress, currentProgress);
- activeMinProgress = Math.min(activeMinProgress, currentProgress);
- }
- }
- else if(dl.state == CI.nsIDownloadManager.DOWNLOAD_PAUSED)
- {
- numPaused++;
- if(dl.size > 0)
- {
- pausedTotalSize += dl.size;
- pausedTransferred += dl.transferred;
-
- let currentProgress = ((dl.transferred * 100) / dl.size);
- pausedMaxProgress = Math.max(pausedMaxProgress, currentProgress);
- pausedMinProgress = Math.min(pausedMinProgress, currentProgress);
- }
- }
- }
-
- if((numActive + numPaused) == 0)
- {
- this._dlActive = false;
- this._dlFinished = lastFinished;
- this.updateButton();
- this._lastTime = Infinity;
- return;
- }
-
- let dlPaused = (numActive == 0);
- let dlStatus = ((dlPaused) ? this._getters.strings.getString("pausedDownloads")
- : this._getters.strings.getString("activeDownloads"));
- let dlCount = ((dlPaused) ? numPaused : numActive);
- let dlTotalSize = ((dlPaused) ? pausedTotalSize : activeTotalSize);
- let dlTransferred = ((dlPaused) ? pausedTransferred : activeTransferred);
- let dlMaxProgress = ((dlPaused) ? pausedMaxProgress : activeMaxProgress);
- let dlMinProgress = ((dlPaused) ? pausedMinProgress : activeMinProgress);
- let dlProgressType = ((dlPaused) ? "paused" : "active");
-
- [this._dlTimeStr, this._lastTime] = DownloadUtils.getTimeLeft(maxTime, this._lastTime);
- this._dlCountStr = PluralForm.get(dlCount, dlStatus).replace("#1", dlCount);
- this._dlProgressAvg = ((dlTotalSize == 0) ? 100 : ((dlTransferred * 100) / dlTotalSize));
- this._dlProgressMax = ((dlTotalSize == 0) ? 100 : dlMaxProgress);
- this._dlProgressMin = ((dlTotalSize == 0) ? 100 : dlMinProgress);
- this._dlProgressType = dlProgressType + ((dlTotalSize == 0) ? "-unknown" : "");
- this._dlPaused = dlPaused;
- this._dlActive = true;
- this._dlFinished = false;
-
- this.updateButton();
- },
-
- updateButton: function()
- {
- let download_button = this._getters.downloadButton;
- let download_tooltip = this._getters.downloadButtonTooltip;
- let download_progress = this._getters.downloadButtonProgress;
- let download_label = this._getters.downloadButtonLabel;
- if(!download_button)
- {
- return;
- }
-
- if(!this._dlActive)
- {
- download_button.collapsed = true;
- download_label.value = download_tooltip.label = this._getters.strings.getString("noDownloads");
-
- download_progress.collapsed = true;
- download_progress.value = 0;
-
- if(this._dlFinished && this._handler.hasPBAPI && !this.isUIShowing)
- {
- this.callAttention(download_button);
- }
- return;
- }
-
- switch(this._service.downloadProgress)
- {
- case 2:
- download_progress.value = this._dlProgressMax;
- break;
- case 3:
- download_progress.value = this._dlProgressMin;
- break;
- default:
- download_progress.value = this._dlProgressAvg;
- break;
- }
- download_progress.setAttribute("pmType", this._dlProgressType);
- download_progress.collapsed = (this._service.downloadProgress == 0);
-
- download_label.value = this.buildString(this._service.downloadLabel);
- download_tooltip.label = this.buildString(this._service.downloadTooltip);
-
- this.clearAttention(download_button);
- download_button.collapsed = false;
- },
-
- callAttention: function(download_button)
- {
- if(this._dlNotifyGlowTimer != 0)
- {
- this._window.clearTimeout(this._dlNotifyGlowTimer);
- this._dlNotifyGlowTimer = 0;
- }
-
- download_button.setAttribute("attention", "true");
-
- if(this._service.downloadNotifyTimeout)
- {
- this._dlNotifyGlowTimer = this._window.setTimeout(function(self, button)
- {
- self._dlNotifyGlowTimer = 0;
- button.removeAttribute("attention");
- }, this._service.downloadNotifyTimeout, this, download_button);
- }
- },
-
- clearAttention: function(download_button)
- {
- if(this._dlNotifyGlowTimer != 0)
- {
- this._window.clearTimeout(this._dlNotifyGlowTimer);
- this._dlNotifyGlowTimer = 0;
- }
-
- download_button.removeAttribute("attention");
- },
-
- notify: function()
- {
- if(this._dlNotifyTimer == 0 && this._service.downloadNotifyAnimate)
- {
- let download_button_anchor = this._getters.downloadButtonAnchor;
- let download_notify_anchor = this._getters.downloadNotifyAnchor;
- if(download_button_anchor)
- {
- if(!download_notify_anchor.style.transform)
- {
- let bAnchorRect = download_button_anchor.getBoundingClientRect();
- let nAnchorRect = download_notify_anchor.getBoundingClientRect();
-
- let translateX = bAnchorRect.left - nAnchorRect.left;
- translateX += .5 * (bAnchorRect.width - nAnchorRect.width);
-
- let translateY = bAnchorRect.top - nAnchorRect.top;
- translateY += .5 * (bAnchorRect.height - nAnchorRect.height);
-
- download_notify_anchor.style.transform = "translate(" + translateX + "px, " + translateY + "px)";
- }
-
- download_notify_anchor.setAttribute("notification", "finish");
- this._dlNotifyTimer = this._window.setTimeout(function(self, anchor)
- {
- self._dlNotifyTimer = 0;
- anchor.removeAttribute("notification");
- anchor.style.transform = "";
- }, 1000, this, download_notify_anchor);
- }
- }
- },
-
- clearFinished: function()
- {
- this._dlFinished = false;
- let download_button = this._getters.downloadButton;
- if(download_button)
- {
- this.clearAttention(download_button);
- }
- },
-
- getAnchor: function(aCallback)
- {
- if(this._customizing)
- {
- aCallback(null);
- return;
- }
-
- aCallback(this._getters.downloadButtonAnchor);
- },
-
- openUI: function(aEvent)
- {
- this.clearFinished();
-
- switch(this._service.downloadButtonAction)
- {
- case 1: // Firefox Default
- this._handler.openUINative();
- break;
- case 2: // Show Library
- this._window.PlacesCommandHook.showPlacesOrganizer("Downloads");
- break;
- case 3: // Show Tab
- let found = this._gBrowser.browsers.some(function(browser, index)
- {
- if("about:downloads" == browser.currentURI.spec)
- {
- this._gBrowser.selectedTab = this._gBrowser.tabContainer.childNodes[index];
- return true;
- }
- }, this);
-
- if(!found)
- {
- this._window.openUILinkIn("about:downloads", "tab");
- }
- break;
- case 4: // External Command
- let command = this._service.downloadButtonActionCommand;
- if(commend)
- {
- this._window.goDoCommand(command);
- }
- break;
- default: // Nothing
- break;
- }
-
- aEvent.stopPropagation();
- },
-
- get isPrivateWindow()
- {
- return this._handler.hasPBAPI && PrivateBrowsingUtils.isWindowPrivate(this._window);
- },
-
- get isUIShowing()
- {
- switch(this._service.downloadButtonAction)
- {
- case 1: // Firefox Default
- return this._handler.isUIShowingNative;
- case 2: // Show Library
- var organizer = Services.wm.getMostRecentWindow("Places:Organizer");
- if(organizer)
- {
- let selectedNode = organizer.PlacesOrganizer._places.selectedNode;
- let downloadsItemId = organizer.PlacesUIUtils.leftPaneQueries["Downloads"];
- return selectedNode && selectedNode.itemId === downloadsItemId;
- }
- return false;
- case 3: // Show tab
- let currentURI = this._gBrowser.currentURI;
- return currentURI && currentURI.spec == "about:downloads";
- default: // Nothing
- return false;
- }
- },
-
- buildString: function(mode)
- {
- switch(mode)
- {
- case 0:
- return this._dlCountStr;
- case 1:
- return ((this._dlPaused) ? this._dlCountStr : this._dlTimeStr);
- default:
- let compStr = this._dlCountStr;
- if(!this._dlPaused)
- {
- compStr += " (" + this._dlTimeStr + ")";
- }
- return compStr;
- }
- }
+ _window: null,
+ _gBrowser: null,
+ _service: null,
+ _getters: null,
+
+ _handler: null,
+ _listening: false,
+
+ _binding: false,
+ _customizing: false,
+
+ _lastTime: Infinity,
+
+ _dlActive: false,
+ _dlPaused: false,
+ _dlFinished: false,
+
+ _dlCountStr: null,
+ _dlTimeStr: null,
+
+ _dlProgressAvg: 0,
+ _dlProgressMax: 0,
+ _dlProgressMin: 0,
+ _dlProgressType: "active",
+
+ _dlNotifyTimer: 0,
+ _dlNotifyGlowTimer: 0,
+
+ init: function()
+ {
+ if(!this._getters.downloadButton)
+ {
+ this.uninit();
+ return;
+ }
+
+ if(this._listening)
+ {
+ return;
+ }
+
+ this._handler.start();
+ this._listening = true;
+
+ this._lastTime = Infinity;
+
+ this.updateBinding();
+ this.updateStatus();
+ },
+
+ uninit: function()
+ {
+ if(!this._listening)
+ {
+ return;
+ }
+
+ this._listening = false;
+ this._handler.stop();
+
+ this.releaseBinding();
+ },
+
+ destroy: function()
+ {
+ this.uninit();
+ this._handler.destroy();
+
+ ["_window", "_gBrowser", "_service", "_getters", "_handler"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ updateBinding: function()
+ {
+ if(!this._listening)
+ {
+ this.releaseBinding();
+ return;
+ }
+
+ switch(this._service.downloadButtonAction)
+ {
+ case 1: // Default
+ this.attachBinding();
+ break;
+ default:
+ this.releaseBinding();
+ break;
+ }
+ },
+
+ attachBinding: function()
+ {
+ if(this._binding)
+ {
+ return;
+ }
+
+ let db = this._window.DownloadsButton;
+
+ db._getAnchorS4EBackup = db.getAnchor;
+ db.getAnchor = this.getAnchor.bind(this);
+
+ db._releaseAnchorS4EBackup = db.releaseAnchor;
+ db.releaseAnchor = function() {};
+
+ this._binding = true;
+ },
+
+ releaseBinding: function()
+ {
+ if(!this._binding)
+ {
+ return;
+ }
+
+ let db = this._window.DownloadsButton;
+
+ db.getAnchor = db._getAnchorS4EBackup;
+ db.releaseAnchor = db._releaseAnchorS4EBackup;
+
+ this._binding = false;
+ },
+
+ customizing: function(val)
+ {
+ this._customizing = val;
+ },
+
+ updateStatus: function(lastFinished)
+ {
+ if(!this._getters.downloadButton)
+ {
+ this.uninit();
+ return;
+ }
+
+ let numActive = 0;
+ let numPaused = 0;
+ let activeTotalSize = 0;
+ let activeTransferred = 0;
+ let activeMaxProgress = -Infinity;
+ let activeMinProgress = Infinity;
+ let pausedTotalSize = 0;
+ let pausedTransferred = 0;
+ let pausedMaxProgress = -Infinity;
+ let pausedMinProgress = Infinity;
+ let maxTime = -Infinity;
+
+ let dls = ((this.isPrivateWindow) ? this._handler.activePrivateEntries() : this._handler.activeEntries());
+ for(let dl of dls)
+ {
+ if(dl.state == CI.nsIDownloadManager.DOWNLOAD_DOWNLOADING)
+ {
+ numActive++;
+ if(dl.size > 0)
+ {
+ if(dl.speed > 0)
+ {
+ maxTime = Math.max(maxTime, (dl.size - dl.transferred) / dl.speed);
+ }
+
+ activeTotalSize += dl.size;
+ activeTransferred += dl.transferred;
+
+ let currentProgress = ((dl.transferred * 100) / dl.size);
+ activeMaxProgress = Math.max(activeMaxProgress, currentProgress);
+ activeMinProgress = Math.min(activeMinProgress, currentProgress);
+ }
+ }
+ else if(dl.state == CI.nsIDownloadManager.DOWNLOAD_PAUSED)
+ {
+ numPaused++;
+ if(dl.size > 0)
+ {
+ pausedTotalSize += dl.size;
+ pausedTransferred += dl.transferred;
+
+ let currentProgress = ((dl.transferred * 100) / dl.size);
+ pausedMaxProgress = Math.max(pausedMaxProgress, currentProgress);
+ pausedMinProgress = Math.min(pausedMinProgress, currentProgress);
+ }
+ }
+ }
+
+ if((numActive + numPaused) == 0)
+ {
+ this._dlActive = false;
+ this._dlFinished = lastFinished;
+ this.updateButton();
+ this._lastTime = Infinity;
+ return;
+ }
+
+ let dlPaused = (numActive == 0);
+ let dlStatus = ((dlPaused) ? this._getters.strings.getString("pausedDownloads")
+ : this._getters.strings.getString("activeDownloads"));
+ let dlCount = ((dlPaused) ? numPaused : numActive);
+ let dlTotalSize = ((dlPaused) ? pausedTotalSize : activeTotalSize);
+ let dlTransferred = ((dlPaused) ? pausedTransferred : activeTransferred);
+ let dlMaxProgress = ((dlPaused) ? pausedMaxProgress : activeMaxProgress);
+ let dlMinProgress = ((dlPaused) ? pausedMinProgress : activeMinProgress);
+ let dlProgressType = ((dlPaused) ? "paused" : "active");
+
+ [this._dlTimeStr, this._lastTime] = DownloadUtils.getTimeLeft(maxTime, this._lastTime);
+ this._dlCountStr = PluralForm.get(dlCount, dlStatus).replace("#1", dlCount);
+ this._dlProgressAvg = ((dlTotalSize == 0) ? 100 : ((dlTransferred * 100) / dlTotalSize));
+ this._dlProgressMax = ((dlTotalSize == 0) ? 100 : dlMaxProgress);
+ this._dlProgressMin = ((dlTotalSize == 0) ? 100 : dlMinProgress);
+ this._dlProgressType = dlProgressType + ((dlTotalSize == 0) ? "-unknown" : "");
+ this._dlPaused = dlPaused;
+ this._dlActive = true;
+ this._dlFinished = false;
+
+ this.updateButton();
+ },
+
+ updateButton: function()
+ {
+ let download_button = this._getters.downloadButton;
+ let download_tooltip = this._getters.downloadButtonTooltip;
+ let download_progress = this._getters.downloadButtonProgress;
+ let download_label = this._getters.downloadButtonLabel;
+ if(!download_button)
+ {
+ return;
+ }
+
+ if(!this._dlActive)
+ {
+ download_button.collapsed = true;
+ download_label.value = download_tooltip.label = this._getters.strings.getString("noDownloads");
+
+ download_progress.collapsed = true;
+ download_progress.value = 0;
+
+ if(this._dlFinished && this._handler.hasPBAPI && !this.isUIShowing)
+ {
+ this.callAttention(download_button);
+ }
+ return;
+ }
+
+ switch(this._service.downloadProgress)
+ {
+ case 2:
+ download_progress.value = this._dlProgressMax;
+ break;
+ case 3:
+ download_progress.value = this._dlProgressMin;
+ break;
+ default:
+ download_progress.value = this._dlProgressAvg;
+ break;
+ }
+ download_progress.setAttribute("pmType", this._dlProgressType);
+ download_progress.collapsed = (this._service.downloadProgress == 0);
+
+ download_label.value = this.buildString(this._service.downloadLabel);
+ download_tooltip.label = this.buildString(this._service.downloadTooltip);
+
+ this.clearAttention(download_button);
+ download_button.collapsed = false;
+ },
+
+ callAttention: function(download_button)
+ {
+ if(this._dlNotifyGlowTimer != 0)
+ {
+ this._window.clearTimeout(this._dlNotifyGlowTimer);
+ this._dlNotifyGlowTimer = 0;
+ }
+
+ download_button.setAttribute("attention", "true");
+
+ if(this._service.downloadNotifyTimeout)
+ {
+ this._dlNotifyGlowTimer = this._window.setTimeout(function(self, button)
+ {
+ self._dlNotifyGlowTimer = 0;
+ button.removeAttribute("attention");
+ }, this._service.downloadNotifyTimeout, this, download_button);
+ }
+ },
+
+ clearAttention: function(download_button)
+ {
+ if(this._dlNotifyGlowTimer != 0)
+ {
+ this._window.clearTimeout(this._dlNotifyGlowTimer);
+ this._dlNotifyGlowTimer = 0;
+ }
+
+ download_button.removeAttribute("attention");
+ },
+
+ notify: function()
+ {
+ if(this._dlNotifyTimer == 0 && this._service.downloadNotifyAnimate)
+ {
+ let download_button_anchor = this._getters.downloadButtonAnchor;
+ let download_notify_anchor = this._getters.downloadNotifyAnchor;
+ if(download_button_anchor)
+ {
+ if(!download_notify_anchor.style.transform)
+ {
+ let bAnchorRect = download_button_anchor.getBoundingClientRect();
+ let nAnchorRect = download_notify_anchor.getBoundingClientRect();
+
+ let translateX = bAnchorRect.left - nAnchorRect.left;
+ translateX += .5 * (bAnchorRect.width - nAnchorRect.width);
+
+ let translateY = bAnchorRect.top - nAnchorRect.top;
+ translateY += .5 * (bAnchorRect.height - nAnchorRect.height);
+
+ download_notify_anchor.style.transform = "translate(" + translateX + "px, " + translateY + "px)";
+ }
+
+ download_notify_anchor.setAttribute("notification", "finish");
+ this._dlNotifyTimer = this._window.setTimeout(function(self, anchor)
+ {
+ self._dlNotifyTimer = 0;
+ anchor.removeAttribute("notification");
+ anchor.style.transform = "";
+ }, 1000, this, download_notify_anchor);
+ }
+ }
+ },
+
+ clearFinished: function()
+ {
+ this._dlFinished = false;
+ let download_button = this._getters.downloadButton;
+ if(download_button)
+ {
+ this.clearAttention(download_button);
+ }
+ },
+
+ getAnchor: function(aCallback)
+ {
+ if(this._customizing)
+ {
+ aCallback(null);
+ return;
+ }
+
+ aCallback(this._getters.downloadButtonAnchor);
+ },
+
+ openUI: function(aEvent)
+ {
+ this.clearFinished();
+
+ switch(this._service.downloadButtonAction)
+ {
+ case 1: // Firefox Default
+ this._handler.openUINative();
+ break;
+ case 2: // Show Library
+ this._window.PlacesCommandHook.showPlacesOrganizer("Downloads");
+ break;
+ case 3: // Show Tab
+ let found = this._gBrowser.browsers.some(function(browser, index)
+ {
+ if("about:downloads" == browser.currentURI.spec)
+ {
+ this._gBrowser.selectedTab = this._gBrowser.tabContainer.childNodes[index];
+ return true;
+ }
+ }, this);
+
+ if(!found)
+ {
+ this._window.openUILinkIn("about:downloads", "tab");
+ }
+ break;
+ case 4: // External Command
+ let command = this._service.downloadButtonActionCommand;
+ if(commend)
+ {
+ this._window.goDoCommand(command);
+ }
+ break;
+ default: // Nothing
+ break;
+ }
+
+ aEvent.stopPropagation();
+ },
+
+ get isPrivateWindow()
+ {
+ return this._handler.hasPBAPI && PrivateBrowsingUtils.isWindowPrivate(this._window);
+ },
+
+ get isUIShowing()
+ {
+ switch(this._service.downloadButtonAction)
+ {
+ case 1: // Firefox Default
+ return this._handler.isUIShowingNative;
+ case 2: // Show Library
+ var organizer = Services.wm.getMostRecentWindow("Places:Organizer");
+ if(organizer)
+ {
+ let selectedNode = organizer.PlacesOrganizer._places.selectedNode;
+ let downloadsItemId = organizer.PlacesUIUtils.leftPaneQueries["Downloads"];
+ return selectedNode && selectedNode.itemId === downloadsItemId;
+ }
+ return false;
+ case 3: // Show tab
+ let currentURI = this._gBrowser.currentURI;
+ return currentURI && currentURI.spec == "about:downloads";
+ default: // Nothing
+ return false;
+ }
+ },
+
+ buildString: function(mode)
+ {
+ switch(mode)
+ {
+ case 0:
+ return this._dlCountStr;
+ case 1:
+ return ((this._dlPaused) ? this._dlCountStr : this._dlTimeStr);
+ default:
+ let compStr = this._dlCountStr;
+ if(!this._dlPaused)
+ {
+ compStr += " (" + this._dlTimeStr + ")";
+ }
+ return compStr;
+ }
+ }
};
function JSTransferHandler(window, downloadService)
{
- this._window = window;
+ this._window = window;
- let api = CU.import("resource://gre/modules/Downloads.jsm", {}).Downloads;
+ let api = CU.import("resource://gre/modules/Downloads.jsm", {}).Downloads;
- this._activePublic = new JSTransferListener(downloadService, api.getList(api.PUBLIC), false);
- this._activePrivate = new JSTransferListener(downloadService, api.getList(api.PRIVATE), true);
+ this._activePublic = new JSTransferListener(downloadService, api.getList(api.PUBLIC), false);
+ this._activePrivate = new JSTransferListener(downloadService, api.getList(api.PRIVATE), true);
}
JSTransferHandler.prototype =
{
- _window: null,
- _activePublic: null,
- _activePrivate: null,
-
- destroy: function()
- {
- this._activePublic.destroy();
- this._activePrivate.destroy();
-
- ["_window", "_activePublic", "_activePrivate"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- start: function()
- {
- this._activePublic.start();
- this._activePrivate.start();
- },
-
- stop: function()
- {
- this._activePublic.stop();
- this._activePrivate.stop();
- },
-
- get hasPBAPI()
- {
- return true;
- },
-
- openUINative: function()
- {
- this._window.DownloadsPanel.showPanel();
- },
-
- get isUIShowingNative()
- {
- return this._window.DownloadsPanel.isPanelShowing;
- },
-
- activeEntries: function()
- {
- return this._activePublic.downloads();
- },
-
- activePrivateEntries: function()
- {
- return this._activePrivate.downloads();
- }
+ _window: null,
+ _activePublic: null,
+ _activePrivate: null,
+
+ destroy: function()
+ {
+ this._activePublic.destroy();
+ this._activePrivate.destroy();
+
+ ["_window", "_activePublic", "_activePrivate"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ start: function()
+ {
+ this._activePublic.start();
+ this._activePrivate.start();
+ },
+
+ stop: function()
+ {
+ this._activePublic.stop();
+ this._activePrivate.stop();
+ },
+
+ get hasPBAPI()
+ {
+ return true;
+ },
+
+ openUINative: function()
+ {
+ this._window.DownloadsPanel.showPanel();
+ },
+
+ get isUIShowingNative()
+ {
+ return this._window.DownloadsPanel.isPanelShowing;
+ },
+
+ activeEntries: function()
+ {
+ return this._activePublic.downloads();
+ },
+
+ activePrivateEntries: function()
+ {
+ return this._activePrivate.downloads();
+ }
};
function JSTransferListener(downloadService, listPromise, isPrivate)
{
- this._downloadService = downloadService;
- this._isPrivate = isPrivate;
- this._downloads = new Map();
+ this._downloadService = downloadService;
+ this._isPrivate = isPrivate;
+ this._downloads = new Map();
- listPromise.then(this.initList.bind(this)).then(null, CU.reportError);
+ listPromise.then(this.initList.bind(this)).then(null, CU.reportError);
}
JSTransferListener.prototype =
{
- _downloadService: null,
- _list: null,
- _downloads: null,
- _isPrivate: false,
- _wantsStart: false,
-
- initList: function(list)
- {
- this._list = list;
- if(this._wantsStart) {
- this.start();
- }
-
- this._list.getAll().then(this.initDownloads.bind(this)).then(null, CU.reportError);
- },
-
- initDownloads: function(downloads)
- {
- downloads.forEach(function(download)
- {
- this.onDownloadAdded(download);
- }, this);
- },
-
- destroy: function()
- {
- this._downloads.clear();
-
- ["_downloadService", "_list", "_downloads"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- start: function()
- {
- if(!this._list)
- {
- this._wantsStart = true;
- return;
- }
-
- this._list.addView(this);
- },
-
- stop: function()
- {
- if(!this._list)
- {
- this._wantsStart = false;
- return;
- }
-
- this._list.removeView(this);
- },
-
- downloads: function()
- {
- return this._downloads.values();
- },
-
- convertToState: function(dl)
- {
- if(dl.succeeded)
- {
- return CI.nsIDownloadManager.DOWNLOAD_FINISHED;
- }
- if(dl.error && dl.error.becauseBlockedByParentalControls)
- {
- return CI.nsIDownloadManager.DOWNLOAD_BLOCKED_PARENTAL;
- }
- if(dl.error)
- {
- return CI.nsIDownloadManager.DOWNLOAD_FAILED;
- }
- if(dl.canceled && dl.hasPartialData)
- {
- return CI.nsIDownloadManager.DOWNLOAD_PAUSED;
- }
- if(dl.canceled)
- {
- return CI.nsIDownloadManager.DOWNLOAD_CANCELED;
- }
- if(dl.stopped)
- {
- return CI.nsIDownloadManager.DOWNLOAD_NOTSTARTED;
- }
- return CI.nsIDownloadManager.DOWNLOAD_DOWNLOADING;
- },
-
- onDownloadAdded: function(aDownload)
- {
- let dl = this._downloads.get(aDownload);
- if(!dl)
- {
- dl = {};
- this._downloads.set(aDownload, dl);
- }
-
- dl.state = this.convertToState(aDownload);
- dl.size = aDownload.totalBytes;
- dl.speed = aDownload.speed;
- dl.transferred = aDownload.currentBytes;
- },
-
- onDownloadChanged: function(aDownload)
- {
- this.onDownloadAdded(aDownload);
-
- if(this._isPrivate != this._downloadService.isPrivateWindow)
- {
- return;
- }
-
- this._downloadService.updateStatus(aDownload.succeeded);
-
- if(aDownload.succeeded)
- {
- this._downloadService.notify()
- }
- },
-
- onDownloadRemoved: function(aDownload)
- {
- this._downloads.delete(aDownload);
- }
+ _downloadService: null,
+ _list: null,
+ _downloads: null,
+ _isPrivate: false,
+ _wantsStart: false,
+
+ initList: function(list)
+ {
+ this._list = list;
+ if(this._wantsStart) {
+ this.start();
+ }
+
+ this._list.getAll().then(this.initDownloads.bind(this)).then(null, CU.reportError);
+ },
+
+ initDownloads: function(downloads)
+ {
+ downloads.forEach(function(download)
+ {
+ this.onDownloadAdded(download);
+ }, this);
+ },
+
+ destroy: function()
+ {
+ this._downloads.clear();
+
+ ["_downloadService", "_list", "_downloads"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ start: function()
+ {
+ if(!this._list)
+ {
+ this._wantsStart = true;
+ return;
+ }
+
+ this._list.addView(this);
+ },
+
+ stop: function()
+ {
+ if(!this._list)
+ {
+ this._wantsStart = false;
+ return;
+ }
+
+ this._list.removeView(this);
+ },
+
+ downloads: function()
+ {
+ return this._downloads.values();
+ },
+
+ convertToState: function(dl)
+ {
+ if(dl.succeeded)
+ {
+ return CI.nsIDownloadManager.DOWNLOAD_FINISHED;
+ }
+ if(dl.error && dl.error.becauseBlockedByParentalControls)
+ {
+ return CI.nsIDownloadManager.DOWNLOAD_BLOCKED_PARENTAL;
+ }
+ if(dl.error)
+ {
+ return CI.nsIDownloadManager.DOWNLOAD_FAILED;
+ }
+ if(dl.canceled && dl.hasPartialData)
+ {
+ return CI.nsIDownloadManager.DOWNLOAD_PAUSED;
+ }
+ if(dl.canceled)
+ {
+ return CI.nsIDownloadManager.DOWNLOAD_CANCELED;
+ }
+ if(dl.stopped)
+ {
+ return CI.nsIDownloadManager.DOWNLOAD_NOTSTARTED;
+ }
+ return CI.nsIDownloadManager.DOWNLOAD_DOWNLOADING;
+ },
+
+ onDownloadAdded: function(aDownload)
+ {
+ let dl = this._downloads.get(aDownload);
+ if(!dl)
+ {
+ dl = {};
+ this._downloads.set(aDownload, dl);
+ }
+
+ dl.state = this.convertToState(aDownload);
+ dl.size = aDownload.totalBytes;
+ dl.speed = aDownload.speed;
+ dl.transferred = aDownload.currentBytes;
+ },
+
+ onDownloadChanged: function(aDownload)
+ {
+ this.onDownloadAdded(aDownload);
+
+ if(this._isPrivate != this._downloadService.isPrivateWindow)
+ {
+ return;
+ }
+
+ this._downloadService.updateStatus(aDownload.succeeded);
+
+ if(aDownload.succeeded)
+ {
+ this._downloadService.notify()
+ }
+ },
+
+ onDownloadRemoved: function(aDownload)
+ {
+ this._downloads.delete(aDownload);
+ }
};
diff --git a/application/palemoon/components/statusbar/Progress.jsm b/application/palemoon/components/statusbar/Progress.jsm
index c03a25450..69d55db49 100644
--- a/application/palemoon/components/statusbar/Progress.jsm
+++ b/application/palemoon/components/statusbar/Progress.jsm
@@ -12,172 +12,172 @@ const CU = Components.utils;
CU.import("resource://gre/modules/XPCOMUtils.jsm");
function S4EProgressService(gBrowser, service, getters, statusService) {
- this._gBrowser = gBrowser;
- this._service = service;
- this._getters = getters;
- this._statusService = statusService;
+ this._gBrowser = gBrowser;
+ this._service = service;
+ this._getters = getters;
+ this._statusService = statusService;
- this._gBrowser.addProgressListener(this);
+ this._gBrowser.addProgressListener(this);
}
S4EProgressService.prototype =
{
- _gBrowser: null,
- _service: null,
- _getters: null,
- _statusService: null,
-
- _busyUI: false,
-
- set value(val)
- {
- let toolbar_progress = this._getters.toolbarProgress;
- if(toolbar_progress)
- {
- toolbar_progress.value = val;
- }
-
- let throbber_progress = this._getters.throbberProgress;
- if(throbber_progress)
- {
- if(val)
- {
- throbber_progress.setAttribute("progress", val);
- }
- else
- {
- throbber_progress.removeAttribute("progress");
- }
- }
- },
-
- set collapsed(val)
- {
- let toolbar_progress = this._getters.toolbarProgress;
- if(toolbar_progress)
- {
- toolbar_progress.collapsed = val;
- }
-
- let throbber_progress = this._getters.throbberProgress;
- if(throbber_progress)
- {
- if(val)
- {
- throbber_progress.removeAttribute("busy");
- }
- else
- {
- throbber_progress.setAttribute("busy", true);
- }
- }
- },
-
- destroy: function()
- {
- this._gBrowser.removeProgressListener(this);
-
- ["_gBrowser", "_service", "_getters", "_statusService"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage)
- {
- this._statusService.setNetworkStatus(aMessage, this._busyUI);
- },
-
- onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus)
- {
- let nsIWPL = CI.nsIWebProgressListener;
-
- if(!this._busyUI
- && aStateFlags & nsIWPL.STATE_START
- && aStateFlags & nsIWPL.STATE_IS_NETWORK
- && !(aStateFlags & nsIWPL.STATE_RESTORING))
- {
- this._busyUI = true;
- this.value = 0;
- this.collapsed = false;
- }
- else if(aStateFlags & nsIWPL.STATE_STOP)
- {
- if(aRequest)
- {
- let msg = "";
- let location;
- if(aRequest instanceof CI.nsIChannel || "URI" in aRequest)
- {
- location = aRequest.URI;
- if(location.spec != "about:blank")
- {
- switch (aStatus)
- {
- case Components.results.NS_BINDING_ABORTED:
- msg = this._getters.strings.getString("nv_stopped");
- break;
- case Components.results.NS_ERROR_NET_TIMEOUT:
- msg = this._getters.strings.getString("nv_timeout");
- break;
- }
- }
- }
-
- if(!msg && (!location || location.spec != "about:blank"))
- {
- msg = this._getters.strings.getString("nv_done");
- }
-
- this._statusService.setDefaultStatus(msg);
- this._statusService.setNetworkStatus("", this._busyUI);
- }
-
- if(this._busyUI)
- {
- this._busyUI = false;
- this.collapsed = true;
- this.value = 0;
- }
- }
- },
-
- onUpdateCurrentBrowser: function(aStateFlags, aStatus, aMessage, aTotalProgress)
- {
- let nsIWPL = CI.nsIWebProgressListener;
- let loadingDone = aStateFlags & nsIWPL.STATE_STOP;
-
- this.onStateChange(
- this._gBrowser.webProgress,
- { URI: this._gBrowser.currentURI },
- ((loadingDone ? nsIWPL.STATE_STOP : nsIWPL.STATE_START) | (aStateFlags & nsIWPL.STATE_IS_NETWORK)),
- aStatus
- );
-
- if(!loadingDone)
- {
- this.onProgressChange(this._gBrowser.webProgress, null, 0, 0, aTotalProgress, 1);
- this.onStatusChange(this._gBrowser.webProgress, null, 0, aMessage);
- }
- },
-
- onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
- {
- if (aMaxTotalProgress > 0 && this._busyUI)
- {
- // This is highly optimized. Don't touch this code unless
- // you are intimately familiar with the cost of setting
- // attrs on XUL elements. -- hyatt
- let percentage = (aCurTotalProgress * 100) / aMaxTotalProgress;
- this.value = percentage;
- }
- },
-
- onProgressChange64: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
- {
- return this.onProgressChange(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress);
- },
-
- QueryInterface: XPCOMUtils.generateQI([ CI.nsIWebProgressListener, CI.nsIWebProgressListener2 ])
+ _gBrowser: null,
+ _service: null,
+ _getters: null,
+ _statusService: null,
+
+ _busyUI: false,
+
+ set value(val)
+ {
+ let toolbar_progress = this._getters.toolbarProgress;
+ if(toolbar_progress)
+ {
+ toolbar_progress.value = val;
+ }
+
+ let throbber_progress = this._getters.throbberProgress;
+ if(throbber_progress)
+ {
+ if(val)
+ {
+ throbber_progress.setAttribute("progress", val);
+ }
+ else
+ {
+ throbber_progress.removeAttribute("progress");
+ }
+ }
+ },
+
+ set collapsed(val)
+ {
+ let toolbar_progress = this._getters.toolbarProgress;
+ if(toolbar_progress)
+ {
+ toolbar_progress.collapsed = val;
+ }
+
+ let throbber_progress = this._getters.throbberProgress;
+ if(throbber_progress)
+ {
+ if(val)
+ {
+ throbber_progress.removeAttribute("busy");
+ }
+ else
+ {
+ throbber_progress.setAttribute("busy", true);
+ }
+ }
+ },
+
+ destroy: function()
+ {
+ this._gBrowser.removeProgressListener(this);
+
+ ["_gBrowser", "_service", "_getters", "_statusService"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ onStatusChange: function(aWebProgress, aRequest, aStatus, aMessage)
+ {
+ this._statusService.setNetworkStatus(aMessage, this._busyUI);
+ },
+
+ onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus)
+ {
+ let nsIWPL = CI.nsIWebProgressListener;
+
+ if(!this._busyUI
+ && aStateFlags & nsIWPL.STATE_START
+ && aStateFlags & nsIWPL.STATE_IS_NETWORK
+ && !(aStateFlags & nsIWPL.STATE_RESTORING))
+ {
+ this._busyUI = true;
+ this.value = 0;
+ this.collapsed = false;
+ }
+ else if(aStateFlags & nsIWPL.STATE_STOP)
+ {
+ if(aRequest)
+ {
+ let msg = "";
+ let location;
+ if(aRequest instanceof CI.nsIChannel || "URI" in aRequest)
+ {
+ location = aRequest.URI;
+ if(location.spec != "about:blank")
+ {
+ switch (aStatus)
+ {
+ case Components.results.NS_BINDING_ABORTED:
+ msg = this._getters.strings.getString("nv_stopped");
+ break;
+ case Components.results.NS_ERROR_NET_TIMEOUT:
+ msg = this._getters.strings.getString("nv_timeout");
+ break;
+ }
+ }
+ }
+
+ if(!msg && (!location || location.spec != "about:blank"))
+ {
+ msg = this._getters.strings.getString("nv_done");
+ }
+
+ this._statusService.setDefaultStatus(msg);
+ this._statusService.setNetworkStatus("", this._busyUI);
+ }
+
+ if(this._busyUI)
+ {
+ this._busyUI = false;
+ this.collapsed = true;
+ this.value = 0;
+ }
+ }
+ },
+
+ onUpdateCurrentBrowser: function(aStateFlags, aStatus, aMessage, aTotalProgress)
+ {
+ let nsIWPL = CI.nsIWebProgressListener;
+ let loadingDone = aStateFlags & nsIWPL.STATE_STOP;
+
+ this.onStateChange(
+ this._gBrowser.webProgress,
+ { URI: this._gBrowser.currentURI },
+ ((loadingDone ? nsIWPL.STATE_STOP : nsIWPL.STATE_START) | (aStateFlags & nsIWPL.STATE_IS_NETWORK)),
+ aStatus
+ );
+
+ if(!loadingDone)
+ {
+ this.onProgressChange(this._gBrowser.webProgress, null, 0, 0, aTotalProgress, 1);
+ this.onStatusChange(this._gBrowser.webProgress, null, 0, aMessage);
+ }
+ },
+
+ onProgressChange: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
+ {
+ if (aMaxTotalProgress > 0 && this._busyUI)
+ {
+ // This is highly optimized. Don't touch this code unless
+ // you are intimately familiar with the cost of setting
+ // attrs on XUL elements. -- hyatt
+ let percentage = (aCurTotalProgress * 100) / aMaxTotalProgress;
+ this.value = percentage;
+ }
+ },
+
+ onProgressChange64: function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
+ {
+ return this.onProgressChange(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress);
+ },
+
+ QueryInterface: XPCOMUtils.generateQI([ CI.nsIWebProgressListener, CI.nsIWebProgressListener2 ])
};
diff --git a/application/palemoon/components/statusbar/Status.jsm b/application/palemoon/components/statusbar/Status.jsm
index 3795545a3..d888c7d94 100644
--- a/application/palemoon/components/statusbar/Status.jsm
+++ b/application/palemoon/components/statusbar/Status.jsm
@@ -13,452 +13,452 @@ CU.import("resource://gre/modules/XPCOMUtils.jsm");
function S4EStatusService(window, service, getters)
{
- this._window = window;
- this._service = service;
- this._getters = getters;
+ this._window = window;
+ this._service = service;
+ this._getters = getters;
- this._overLinkService = new S4EOverlinkService(this._window, this._service, this);
+ this._overLinkService = new S4EOverlinkService(this._window, this._service, this);
}
S4EStatusService.prototype =
{
- _window: null,
- _service: null,
- _getters: null,
- _overLinkService: null,
-
- _overLink: { val: "", type: "" },
- _network: { val: "", type: "" },
- _networkXHR: { val: "", type: "" },
- _status: { val: "", type: "" },
- _jsStatus: { val: "", type: "" },
- _defaultStatus: { val: "", type: "" },
-
- _isFullScreen: false,
- _isFullScreenVideo: false,
-
- _statusText: { val: "", type: "" },
- _noUpdate: false,
- _statusChromeTimeoutID: 0,
- _statusContentTimeoutID: 0,
-
- getCompositeStatusText: function()
- {
- return this._statusText.val;
- },
-
- getStatusText: function()
- {
- return this._status.val;
- },
-
- setNetworkStatus: function(status, busy)
- {
- if(busy)
- {
- this._network = { val: status, type: "network" };
- this._networkXHR = { val: "", type: "network xhr" };
- }
- else
- {
- this._networkXHR = { val: status, type: "network xhr" };
- }
- this.updateStatusField();
- },
-
- setStatusText: function(status)
- {
- this._status = { val: status, type: "status chrome" };
- this.updateStatusField();
- },
-
- setJSStatus: function(status)
- {
- this._jsStatus = { val: status, type: "status content" };
- this.updateStatusField();
- },
-
- setJSDefaultStatus: function(status)
- {
- // This was removed from Firefox in Bug 862917
- },
-
- setDefaultStatus: function(status)
- {
- this._defaultStatus = { val: status, type: "status chrome default" };
- this.updateStatusField();
- },
-
- setOverLink: function(link, aAnchor)
- {
- this._overLinkService.update(link, aAnchor);
- },
-
- setOverLinkInternal: function(link, aAnchor)
- {
- let status = this._service.status;
- let statusLinkOver = this._service.statusLinkOver;
-
- if(statusLinkOver)
- {
- link = link.replace(/[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g, encodeURIComponent);
- if(status == statusLinkOver)
- {
- this._overLink = { val: link, type: "overLink", anchor: aAnchor };
- this.updateStatusField();
- }
- else
- {
- this.setStatusField(statusLinkOver, { val: link, type: "overLink", anchor: aAnchor }, true);
- }
- }
- },
-
- setNoUpdate: function(nu)
- {
- this._noUpdate = nu;
- },
-
- buildBinding: function() {
- let XULBWPropHandler = function(prop, oldval, newval) {
- CU.reportError("Attempt to modify XULBrowserWindow." + prop);
- return oldval;
- };
-
- ["updateStatusField", "onStatusChange"].forEach(function(prop)
- {
- this._window.XULBrowserWindow.unwatch(prop);
- this._window.XULBrowserWindow[prop] = function() {};
- this._window.XULBrowserWindow.watch(prop, XULBWPropHandler);
- }, this);
-
- ["getCompositeStatusText", "getStatusText", "setStatusText", "setJSStatus",
- "setJSDefaultStatus", "setDefaultStatus", "setOverLink"].forEach(function(prop)
- {
- this._window.XULBrowserWindow.unwatch(prop);
- 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()
- {
- // No need to unbind from the XULBrowserWindow, it's already null at this point
-
- this.clearTimer("_statusChromeTimeoutID");
- this.clearTimer("_statusContentTimeoutID");
-
- this._overLinkService.destroy();
-
- ["_overLink", "_network", "_networkXHR", "_status", "_jsStatus", "_defaultStatus",
- "_statusText", "_window", "_service", "_getters", "_overLinkService"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- buildTextOrder: function()
- {
- this.__defineGetter__("_textOrder", function()
- {
- let textOrder = ["_overLink"];
- if(this._service.statusNetwork)
- {
- textOrder.push("_network");
- if(this._service.statusNetworkXHR)
- {
- textOrder.push("_networkXHR");
- }
- }
- textOrder.push("_status", "_jsStatus");
- if(this._service.statusDefault)
- {
- textOrder.push("_defaultStatus");
- }
-
- delete this._textOrder;
- return this._textOrder = textOrder;
- });
- },
-
- updateStatusField: function(force)
- {
- let text = { val: "", type: "" };
- for(let i = 0; !text.val && i < this._textOrder.length; i++)
- {
- text = this[this._textOrder[i]];
- }
-
- if(this._statusText.val != text.val || force)
- {
- if(this._noUpdate)
- {
- return;
- }
-
- this._statusText = text;
-
- this.setStatusField(this._service.status, text, false);
-
- if(text.val && this._service.statusTimeout)
- {
- this.setTimer(text.type);
- }
- }
- },
-
- updateFullScreen: function()
- {
- 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.clearStatusField();
- this.updateStatusField(true);
- },
-
- setTimer: function(type)
- {
- let typeArgs = type.split(" ", 3);
-
- if(typeArgs.length < 2 || typeArgs[0] != "status")
- {
- return;
- }
-
- if(typeArgs[1] == "chrome")
- {
- this.clearTimer("_statusChromeTimeoutID");
- this._statusChromeTimeoutID = this._window.setTimeout(function(self, isDefault)
- {
- self._statusChromeTimeoutID = 0;
- if(isDefault)
- {
- self.setDefaultStatus("");
- }
- else
- {
- self.setStatusText("");
- }
- }, this._service.statusTimeout, this, (typeArgs.length == 3 && typeArgs[2] == "default"));
- }
- else
- {
- this.clearTimer("_statusContentTimeoutID");
- this._statusContentTimeoutID = this._window.setTimeout(function(self)
- {
- self._statusContentTimeoutID = 0;
- self.setJSStatus("");
- }, this._service.statusTimeout, this);
- }
- },
-
- clearTimer: function(timerName)
- {
- if(this[timerName] != 0)
- {
- this._window.clearTimeout(this[timerName]);
- this[timerName] = 0;
- }
- },
-
- clearStatusField: function()
- {
- this._getters.statusOverlay.value = "";
-
- let status_label = this._getters.statusWidgetLabel;
- if(status_label)
- {
- status_label.value = "";
- }
-
- },
-
- setStatusField: function(location, text, allowTooltip)
- {
- if(!location)
- {
- return;
- }
-
- let label = null;
-
- if(this._isFullScreen && this._service.advancedStatusDetectFullScreen)
- {
- switch(location)
- {
- case 1: // Toolbar
- location = 3
- break;
- case 2: // URL bar
- if(Services.prefs.getBoolPref("browser.fullscreen.autohide"))
- {
- location = 3
- }
- break;
- }
- }
-
- switch(location)
- {
- case 1: // Toolbar
- label = this._getters.statusWidgetLabel;
- break;
- case 2: // URL Bar
- break;
- case 3: // Popup
- default:
- if(this._isFullScreenVideo && this._service.advancedStatusDetectVideo)
- {
- return;
- }
- label = this._getters.statusOverlay;
- break;
- }
-
- if(label)
- {
- label.setAttribute("previoustype", label.getAttribute("type"));
- label.setAttribute("type", text.type);
- label.value = text.val;
- label.setAttribute("crop", text.type == "overLink" ? "center" : "end");
- }
- }
+ _window: null,
+ _service: null,
+ _getters: null,
+ _overLinkService: null,
+
+ _overLink: { val: "", type: "" },
+ _network: { val: "", type: "" },
+ _networkXHR: { val: "", type: "" },
+ _status: { val: "", type: "" },
+ _jsStatus: { val: "", type: "" },
+ _defaultStatus: { val: "", type: "" },
+
+ _isFullScreen: false,
+ _isFullScreenVideo: false,
+
+ _statusText: { val: "", type: "" },
+ _noUpdate: false,
+ _statusChromeTimeoutID: 0,
+ _statusContentTimeoutID: 0,
+
+ getCompositeStatusText: function()
+ {
+ return this._statusText.val;
+ },
+
+ getStatusText: function()
+ {
+ return this._status.val;
+ },
+
+ setNetworkStatus: function(status, busy)
+ {
+ if(busy)
+ {
+ this._network = { val: status, type: "network" };
+ this._networkXHR = { val: "", type: "network xhr" };
+ }
+ else
+ {
+ this._networkXHR = { val: status, type: "network xhr" };
+ }
+ this.updateStatusField();
+ },
+
+ setStatusText: function(status)
+ {
+ this._status = { val: status, type: "status chrome" };
+ this.updateStatusField();
+ },
+
+ setJSStatus: function(status)
+ {
+ this._jsStatus = { val: status, type: "status content" };
+ this.updateStatusField();
+ },
+
+ setJSDefaultStatus: function(status)
+ {
+ // This was removed from Firefox in Bug 862917
+ },
+
+ setDefaultStatus: function(status)
+ {
+ this._defaultStatus = { val: status, type: "status chrome default" };
+ this.updateStatusField();
+ },
+
+ setOverLink: function(link, aAnchor)
+ {
+ this._overLinkService.update(link, aAnchor);
+ },
+
+ setOverLinkInternal: function(link, aAnchor)
+ {
+ let status = this._service.status;
+ let statusLinkOver = this._service.statusLinkOver;
+
+ if(statusLinkOver)
+ {
+ link = link.replace(/[\u200e\u200f\u202a\u202b\u202c\u202d\u202e]/g, encodeURIComponent);
+ if(status == statusLinkOver)
+ {
+ this._overLink = { val: link, type: "overLink", anchor: aAnchor };
+ this.updateStatusField();
+ }
+ else
+ {
+ this.setStatusField(statusLinkOver, { val: link, type: "overLink", anchor: aAnchor }, true);
+ }
+ }
+ },
+
+ setNoUpdate: function(nu)
+ {
+ this._noUpdate = nu;
+ },
+
+ buildBinding: function() {
+ let XULBWPropHandler = function(prop, oldval, newval) {
+ CU.reportError("Attempt to modify XULBrowserWindow." + prop);
+ return oldval;
+ };
+
+ ["updateStatusField", "onStatusChange"].forEach(function(prop)
+ {
+ this._window.XULBrowserWindow.unwatch(prop);
+ this._window.XULBrowserWindow[prop] = function() {};
+ this._window.XULBrowserWindow.watch(prop, XULBWPropHandler);
+ }, this);
+
+ ["getCompositeStatusText", "getStatusText", "setStatusText", "setJSStatus",
+ "setJSDefaultStatus", "setDefaultStatus", "setOverLink"].forEach(function(prop)
+ {
+ this._window.XULBrowserWindow.unwatch(prop);
+ 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()
+ {
+ // No need to unbind from the XULBrowserWindow, it's already null at this point
+
+ this.clearTimer("_statusChromeTimeoutID");
+ this.clearTimer("_statusContentTimeoutID");
+
+ this._overLinkService.destroy();
+
+ ["_overLink", "_network", "_networkXHR", "_status", "_jsStatus", "_defaultStatus",
+ "_statusText", "_window", "_service", "_getters", "_overLinkService"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ buildTextOrder: function()
+ {
+ this.__defineGetter__("_textOrder", function()
+ {
+ let textOrder = ["_overLink"];
+ if(this._service.statusNetwork)
+ {
+ textOrder.push("_network");
+ if(this._service.statusNetworkXHR)
+ {
+ textOrder.push("_networkXHR");
+ }
+ }
+ textOrder.push("_status", "_jsStatus");
+ if(this._service.statusDefault)
+ {
+ textOrder.push("_defaultStatus");
+ }
+
+ delete this._textOrder;
+ return this._textOrder = textOrder;
+ });
+ },
+
+ updateStatusField: function(force)
+ {
+ let text = { val: "", type: "" };
+ for(let i = 0; !text.val && i < this._textOrder.length; i++)
+ {
+ text = this[this._textOrder[i]];
+ }
+
+ if(this._statusText.val != text.val || force)
+ {
+ if(this._noUpdate)
+ {
+ return;
+ }
+
+ this._statusText = text;
+
+ this.setStatusField(this._service.status, text, false);
+
+ if(text.val && this._service.statusTimeout)
+ {
+ this.setTimer(text.type);
+ }
+ }
+ },
+
+ updateFullScreen: function()
+ {
+ 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.clearStatusField();
+ this.updateStatusField(true);
+ },
+
+ setTimer: function(type)
+ {
+ let typeArgs = type.split(" ", 3);
+
+ if(typeArgs.length < 2 || typeArgs[0] != "status")
+ {
+ return;
+ }
+
+ if(typeArgs[1] == "chrome")
+ {
+ this.clearTimer("_statusChromeTimeoutID");
+ this._statusChromeTimeoutID = this._window.setTimeout(function(self, isDefault)
+ {
+ self._statusChromeTimeoutID = 0;
+ if(isDefault)
+ {
+ self.setDefaultStatus("");
+ }
+ else
+ {
+ self.setStatusText("");
+ }
+ }, this._service.statusTimeout, this, (typeArgs.length == 3 && typeArgs[2] == "default"));
+ }
+ else
+ {
+ this.clearTimer("_statusContentTimeoutID");
+ this._statusContentTimeoutID = this._window.setTimeout(function(self)
+ {
+ self._statusContentTimeoutID = 0;
+ self.setJSStatus("");
+ }, this._service.statusTimeout, this);
+ }
+ },
+
+ clearTimer: function(timerName)
+ {
+ if(this[timerName] != 0)
+ {
+ this._window.clearTimeout(this[timerName]);
+ this[timerName] = 0;
+ }
+ },
+
+ clearStatusField: function()
+ {
+ this._getters.statusOverlay.value = "";
+
+ let status_label = this._getters.statusWidgetLabel;
+ if(status_label)
+ {
+ status_label.value = "";
+ }
+
+ },
+
+ setStatusField: function(location, text, allowTooltip)
+ {
+ if(!location)
+ {
+ return;
+ }
+
+ let label = null;
+
+ if(this._isFullScreen && this._service.advancedStatusDetectFullScreen)
+ {
+ switch(location)
+ {
+ case 1: // Toolbar
+ location = 3
+ break;
+ case 2: // URL bar
+ if(Services.prefs.getBoolPref("browser.fullscreen.autohide"))
+ {
+ location = 3
+ }
+ break;
+ }
+ }
+
+ switch(location)
+ {
+ case 1: // Toolbar
+ label = this._getters.statusWidgetLabel;
+ break;
+ case 2: // URL Bar
+ break;
+ case 3: // Popup
+ default:
+ if(this._isFullScreenVideo && this._service.advancedStatusDetectVideo)
+ {
+ return;
+ }
+ label = this._getters.statusOverlay;
+ break;
+ }
+
+ if(label)
+ {
+ label.setAttribute("previoustype", label.getAttribute("type"));
+ label.setAttribute("type", text.type);
+ label.value = text.val;
+ label.setAttribute("crop", text.type == "overLink" ? "center" : "end");
+ }
+ }
};
function S4EOverlinkService(window, service, statusService) {
- this._window = window;
- this._service = service;
- this._statusService = statusService;
+ this._window = window;
+ this._service = service;
+ this._statusService = statusService;
}
S4EOverlinkService.prototype =
{
- _window: null,
- _service: null,
- _statusService: null,
-
- _timer: 0,
- _currentLink: { link: "", anchor: null },
- _pendingLink: { link: "", anchor: null },
- _listening: false,
-
- update: function(aLink, aAnchor)
- {
- this.clearTimer();
- this.stopListen();
- this._pendingLink = { link: aLink, anchor: aAnchor };
-
- if(!aLink)
- {
- if(this._window.XULBrowserWindow.hideOverLinkImmediately || !this._service.statusLinkOverDelayHide)
- {
- this._show();
- }
- else
- {
- this._showDelayed();
- }
- }
- else if(this._currentLink.link || !this._service.statusLinkOverDelayShow)
- {
- this._show();
- }
- else
- {
- this._showDelayed();
- this.startListen();
- }
- },
-
- destroy: function()
- {
- this.clearTimer();
- this.stopListen();
-
- ["_currentLink", "_pendingLink", "_statusService", "_window"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- startListen: function()
- {
- if(!this._listening)
- {
- this._window.addEventListener("mousemove", this, true);
- this._listening = true;
- }
- },
-
- stopListen: function()
- {
- if(this._listening)
- {
- this._window.removeEventListener("mousemove", this, true);
- this._listening = false;
- }
- },
-
- clearTimer: function()
- {
- if(this._timer != 0)
- {
- this._window.clearTimeout(this._timer);
- this._timer = 0;
- }
- },
-
- handleEvent: function(event)
- {
- switch(event.type)
- {
- case "mousemove":
- this.clearTimer();
- this._showDelayed();
- }
- },
-
- _showDelayed: function()
- {
- let delay = ((this._pendingLink.link)
- ? this._service.statusLinkOverDelayShow
- : this._service.statusLinkOverDelayHide);
-
- this._timer = this._window.setTimeout(function(self)
- {
- self._timer = 0;
- self._show();
- self.stopListen();
- }, delay, this);
- },
-
- _show: function()
- {
- this._currentLink = this._pendingLink;
- this._statusService.setOverLinkInternal(this._currentLink.link, this._currentLink.anchor);
- }
+ _window: null,
+ _service: null,
+ _statusService: null,
+
+ _timer: 0,
+ _currentLink: { link: "", anchor: null },
+ _pendingLink: { link: "", anchor: null },
+ _listening: false,
+
+ update: function(aLink, aAnchor)
+ {
+ this.clearTimer();
+ this.stopListen();
+ this._pendingLink = { link: aLink, anchor: aAnchor };
+
+ if(!aLink)
+ {
+ if(this._window.XULBrowserWindow.hideOverLinkImmediately || !this._service.statusLinkOverDelayHide)
+ {
+ this._show();
+ }
+ else
+ {
+ this._showDelayed();
+ }
+ }
+ else if(this._currentLink.link || !this._service.statusLinkOverDelayShow)
+ {
+ this._show();
+ }
+ else
+ {
+ this._showDelayed();
+ this.startListen();
+ }
+ },
+
+ destroy: function()
+ {
+ this.clearTimer();
+ this.stopListen();
+
+ ["_currentLink", "_pendingLink", "_statusService", "_window"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ startListen: function()
+ {
+ if(!this._listening)
+ {
+ this._window.addEventListener("mousemove", this, true);
+ this._listening = true;
+ }
+ },
+
+ stopListen: function()
+ {
+ if(this._listening)
+ {
+ this._window.removeEventListener("mousemove", this, true);
+ this._listening = false;
+ }
+ },
+
+ clearTimer: function()
+ {
+ if(this._timer != 0)
+ {
+ this._window.clearTimeout(this._timer);
+ this._timer = 0;
+ }
+ },
+
+ handleEvent: function(event)
+ {
+ switch(event.type)
+ {
+ case "mousemove":
+ this.clearTimer();
+ this._showDelayed();
+ }
+ },
+
+ _showDelayed: function()
+ {
+ let delay = ((this._pendingLink.link)
+ ? this._service.statusLinkOverDelayShow
+ : this._service.statusLinkOverDelayHide);
+
+ this._timer = this._window.setTimeout(function(self)
+ {
+ self._timer = 0;
+ self._show();
+ self.stopListen();
+ }, delay, this);
+ },
+
+ _show: function()
+ {
+ this._currentLink = this._pendingLink;
+ this._statusService.setOverLinkInternal(this._currentLink.link, this._currentLink.anchor);
+ }
};
diff --git a/application/palemoon/components/statusbar/Status4Evar.jsm b/application/palemoon/components/statusbar/Status4Evar.jsm
index 03e899afc..055306a88 100644
--- a/application/palemoon/components/statusbar/Status4Evar.jsm
+++ b/application/palemoon/components/statusbar/Status4Evar.jsm
@@ -23,257 +23,257 @@ CU.import("resource:///modules/statusbar/Toolbars.jsm");
function Status4Evar(window, gBrowser, toolbox)
{
- this._window = window;
- this._toolbox = toolbox;
+ this._window = window;
+ this._toolbox = toolbox;
- this.getters = new S4EWindowGetters(this._window);
- this.toolbars = new S4EToolbars(this._window, gBrowser, this._toolbox, s4e_service, this.getters);
- 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.getters = new S4EWindowGetters(this._window);
+ this.toolbars = new S4EToolbars(this._window, gBrowser, this._toolbox, s4e_service, this.getters);
+ 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._window.addEventListener("unload", this, false);
+ this._window.addEventListener("unload", this, false);
}
Status4Evar.prototype =
{
- _window: null,
- _toolbox: null,
-
- getters: null,
- toolbars: null,
- statusService: null,
- progressMeter: null,
- downloadStatus: null,
- sizeModeService: null,
-
- setup: function()
- {
- this._toolbox.addEventListener("beforecustomization", this, false);
- this._toolbox.addEventListener("aftercustomization", this, false);
-
- this.toolbars.setup();
- this.updateWindow();
-
- // OMFG HAX! If a page is already loading, fake a network start event
- if(this._window.XULBrowserWindow._busyUI)
- {
- let nsIWPL = CI.nsIWebProgressListener;
- this.progressMeter.onStateChange(0, null, nsIWPL.STATE_START | nsIWPL.STATE_IS_NETWORK, 0);
- }
- },
-
- destroy: function()
- {
- this._window.removeEventListener("unload", this, false);
- this._toolbox.removeEventListener("aftercustomization", this, false);
- this._toolbox.removeEventListener("beforecustomization", this, false);
-
- this.getters.destroy();
- this.statusService.destroy();
- this.downloadStatus.destroy();
- this.progressMeter.destroy();
- this.toolbars.destroy();
- this.sizeModeService.destroy();
-
- ["_window", "_toolbox", "getters", "statusService", "downloadStatus",
- "progressMeter", "toolbars", "sizeModeService"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- handleEvent: function(aEvent)
- {
- switch(aEvent.type)
- {
- case "unload":
- this.destroy();
- break;
- case "beforecustomization":
- this.beforeCustomization();
- break;
- case "aftercustomization":
- this.updateWindow();
- break;
- }
- },
-
- beforeCustomization: function()
- {
- this.toolbars.updateSplitters(false);
- this.toolbars.updateWindowGripper(false);
-
- this.statusService.setNoUpdate(true);
- let status_label = this.getters.statusWidgetLabel;
- if(status_label)
- {
- status_label.value = this.getters.strings.getString("statusText");
- }
-
- this.downloadStatus.customizing(true);
- },
-
- updateWindow: function()
- {
- this.statusService.setNoUpdate(false);
- this.getters.resetGetters();
- this.statusService.buildTextOrder();
- this.statusService.buildBinding();
- this.downloadStatus.init();
- this.downloadStatus.customizing(false);
- this.toolbars.updateSplitters(true);
-
- s4e_service.updateWindow(this._window);
- // This also handles the following:
- // * buildTextOrder()
- // * updateStatusField(true)
- // * updateWindowGripper(true)
- },
-
- launchOptions: function(currentWindow)
- {
- let optionsURL = "chrome://browser/content/statusbar/prefs.xul";
- let windows = Services.wm.getEnumerator(null);
- while (windows.hasMoreElements())
- {
- let win = windows.getNext();
- if (win.document.documentURI == optionsURL)
- {
- win.focus();
- return;
- }
- }
-
- let features = "chrome,titlebar,toolbar,centerscreen";
- try
- {
- let instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply");
- features += instantApply ? ",dialog=no" : ",modal";
- }
- catch(e)
- {
- features += ",modal";
- }
- currentWindow.openDialog(optionsURL, "", features);
- }
+ _window: null,
+ _toolbox: null,
+
+ getters: null,
+ toolbars: null,
+ statusService: null,
+ progressMeter: null,
+ downloadStatus: null,
+ sizeModeService: null,
+
+ setup: function()
+ {
+ this._toolbox.addEventListener("beforecustomization", this, false);
+ this._toolbox.addEventListener("aftercustomization", this, false);
+
+ this.toolbars.setup();
+ this.updateWindow();
+
+ // OMFG HAX! If a page is already loading, fake a network start event
+ if(this._window.XULBrowserWindow._busyUI)
+ {
+ let nsIWPL = CI.nsIWebProgressListener;
+ this.progressMeter.onStateChange(0, null, nsIWPL.STATE_START | nsIWPL.STATE_IS_NETWORK, 0);
+ }
+ },
+
+ destroy: function()
+ {
+ this._window.removeEventListener("unload", this, false);
+ this._toolbox.removeEventListener("aftercustomization", this, false);
+ this._toolbox.removeEventListener("beforecustomization", this, false);
+
+ this.getters.destroy();
+ this.statusService.destroy();
+ this.downloadStatus.destroy();
+ this.progressMeter.destroy();
+ this.toolbars.destroy();
+ this.sizeModeService.destroy();
+
+ ["_window", "_toolbox", "getters", "statusService", "downloadStatus",
+ "progressMeter", "toolbars", "sizeModeService"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ handleEvent: function(aEvent)
+ {
+ switch(aEvent.type)
+ {
+ case "unload":
+ this.destroy();
+ break;
+ case "beforecustomization":
+ this.beforeCustomization();
+ break;
+ case "aftercustomization":
+ this.updateWindow();
+ break;
+ }
+ },
+
+ beforeCustomization: function()
+ {
+ this.toolbars.updateSplitters(false);
+ this.toolbars.updateWindowGripper(false);
+
+ this.statusService.setNoUpdate(true);
+ let status_label = this.getters.statusWidgetLabel;
+ if(status_label)
+ {
+ status_label.value = this.getters.strings.getString("statusText");
+ }
+
+ this.downloadStatus.customizing(true);
+ },
+
+ updateWindow: function()
+ {
+ this.statusService.setNoUpdate(false);
+ this.getters.resetGetters();
+ this.statusService.buildTextOrder();
+ this.statusService.buildBinding();
+ this.downloadStatus.init();
+ this.downloadStatus.customizing(false);
+ this.toolbars.updateSplitters(true);
+
+ s4e_service.updateWindow(this._window);
+ // This also handles the following:
+ // * buildTextOrder()
+ // * updateStatusField(true)
+ // * updateWindowGripper(true)
+ },
+
+ launchOptions: function(currentWindow)
+ {
+ let optionsURL = "chrome://browser/content/statusbar/prefs.xul";
+ let windows = Services.wm.getEnumerator(null);
+ while (windows.hasMoreElements())
+ {
+ let win = windows.getNext();
+ if (win.document.documentURI == optionsURL)
+ {
+ win.focus();
+ return;
+ }
+ }
+
+ let features = "chrome,titlebar,toolbar,centerscreen";
+ try
+ {
+ let instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply");
+ features += instantApply ? ",dialog=no" : ",modal";
+ }
+ catch(e)
+ {
+ features += ",modal";
+ }
+ currentWindow.openDialog(optionsURL, "", features);
+ }
};
function S4EWindowGetters(window)
{
- this._window = window;
+ this._window = window;
}
S4EWindowGetters.prototype =
{
- _window: null,
- _getterMap:
- [
- ["addonbar", "addon-bar"],
- ["addonbarCloseButton", "addonbar-closebutton"],
- ["browserBottomBox", "browser-bottombox"],
- ["downloadButton", "status4evar-download-button"],
- ["downloadButtonTooltip", "status4evar-download-tooltip"],
- ["downloadButtonProgress", "status4evar-download-progress-bar"],
- ["downloadButtonLabel", "status4evar-download-label"],
- ["downloadButtonAnchor", "status4evar-download-anchor"],
- ["downloadNotifyAnchor", "status4evar-download-notification-anchor"],
- ["statusBar", "status4evar-status-bar"],
- ["statusWidget", "status4evar-status-widget"],
- ["statusWidgetLabel", "status4evar-status-text"],
- ["strings", "bundle_status4evar"],
- ["throbberProgress", "status4evar-throbber-widget"],
- ["toolbarProgress", "status4evar-progress-bar"]
- ],
-
- resetGetters: function()
- {
- let document = this._window.document;
-
- this._getterMap.forEach(function(getter)
- {
- let [prop, id] = getter;
- delete this[prop];
- this.__defineGetter__(prop, function()
- {
- delete this[prop];
- return this[prop] = document.getElementById(id);
- });
- }, this);
-
- delete this.statusOverlay;
- this.__defineGetter__("statusOverlay", function()
- {
- let so = this._window.XULBrowserWindow.statusTextField;
- if(!so)
- {
- return null;
- }
-
- delete this.statusOverlay;
- return this.statusOverlay = so;
- });
- },
-
- destroy: function()
- {
- this._getterMap.forEach(function(getter)
- {
- let [prop, id] = getter;
- delete this[prop];
- }, this);
-
- ["statusOverlay", "statusOverlay", "_window"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- }
+ _window: null,
+ _getterMap:
+ [
+ ["addonbar", "addon-bar"],
+ ["addonbarCloseButton", "addonbar-closebutton"],
+ ["browserBottomBox", "browser-bottombox"],
+ ["downloadButton", "status4evar-download-button"],
+ ["downloadButtonTooltip", "status4evar-download-tooltip"],
+ ["downloadButtonProgress", "status4evar-download-progress-bar"],
+ ["downloadButtonLabel", "status4evar-download-label"],
+ ["downloadButtonAnchor", "status4evar-download-anchor"],
+ ["downloadNotifyAnchor", "status4evar-download-notification-anchor"],
+ ["statusBar", "status4evar-status-bar"],
+ ["statusWidget", "status4evar-status-widget"],
+ ["statusWidgetLabel", "status4evar-status-text"],
+ ["strings", "bundle_status4evar"],
+ ["throbberProgress", "status4evar-throbber-widget"],
+ ["toolbarProgress", "status4evar-progress-bar"]
+ ],
+
+ resetGetters: function()
+ {
+ let document = this._window.document;
+
+ this._getterMap.forEach(function(getter)
+ {
+ let [prop, id] = getter;
+ delete this[prop];
+ this.__defineGetter__(prop, function()
+ {
+ delete this[prop];
+ return this[prop] = document.getElementById(id);
+ });
+ }, this);
+
+ delete this.statusOverlay;
+ this.__defineGetter__("statusOverlay", function()
+ {
+ let so = this._window.XULBrowserWindow.statusTextField;
+ if(!so)
+ {
+ return null;
+ }
+
+ delete this.statusOverlay;
+ return this.statusOverlay = so;
+ });
+ },
+
+ destroy: function()
+ {
+ this._getterMap.forEach(function(getter)
+ {
+ let [prop, id] = getter;
+ delete this[prop];
+ }, this);
+
+ ["statusOverlay", "statusOverlay", "_window"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ }
};
function SizeModeService(window, s4e)
{
- this._window = window;
- this._s4e = s4e;
+ this._window = window;
+ this._s4e = s4e;
- this.lastFullScreen = this._window.fullScreen;
- this.lastwindowState = this._window.windowState;
- this._window.addEventListener("sizemodechange", this, false);
+ this.lastFullScreen = this._window.fullScreen;
+ this.lastwindowState = this._window.windowState;
+ this._window.addEventListener("sizemodechange", this, false);
}
SizeModeService.prototype =
{
- _window: null,
- _s4e: null,
-
- lastFullScreen: null,
- lastwindowState: null,
-
- destroy: function()
- {
- this._window.removeEventListener("sizemodechange", this, false);
-
- ["_window", "_s4e"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- handleEvent: function(e)
- {
- if(this._window.fullScreen != this.lastFullScreen)
- {
- this.lastFullScreen = this._window.fullScreen;
- this._s4e.statusService.updateFullScreen();
- }
-
- if(this._window.windowState != this.lastwindowState)
- {
- this.lastwindowState = this._window.windowState;
- this._s4e.toolbars.updateWindowGripper(true);
- }
- },
-
- QueryInterface: XPCOMUtils.generateQI([ CI.nsIDOMEventListener ])
+ _window: null,
+ _s4e: null,
+
+ lastFullScreen: null,
+ lastwindowState: null,
+
+ destroy: function()
+ {
+ this._window.removeEventListener("sizemodechange", this, false);
+
+ ["_window", "_s4e"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ handleEvent: function(e)
+ {
+ if(this._window.fullScreen != this.lastFullScreen)
+ {
+ this.lastFullScreen = this._window.fullScreen;
+ this._s4e.statusService.updateFullScreen();
+ }
+
+ if(this._window.windowState != this.lastwindowState)
+ {
+ this.lastwindowState = this._window.windowState;
+ this._s4e.toolbars.updateWindowGripper(true);
+ }
+ },
+
+ QueryInterface: XPCOMUtils.generateQI([ CI.nsIDOMEventListener ])
};
diff --git a/application/palemoon/components/statusbar/Toolbars.jsm b/application/palemoon/components/statusbar/Toolbars.jsm
index dda8565fd..321efd092 100644
--- a/application/palemoon/components/statusbar/Toolbars.jsm
+++ b/application/palemoon/components/statusbar/Toolbars.jsm
@@ -13,209 +13,209 @@ CU.import("resource://gre/modules/Services.jsm");
function S4EToolbars(window, gBrowser, toolbox, service, getters)
{
- this._window = window;
- this._toolbox = toolbox;
- this._service = service;
- this._getters = getters;
- this._handler = new ClassicS4EToolbars(this._window, this._toolbox);
+ this._window = window;
+ this._toolbox = toolbox;
+ this._service = service;
+ this._getters = getters;
+ this._handler = new ClassicS4EToolbars(this._window, this._toolbox);
}
S4EToolbars.prototype =
{
- _window: null,
- _toolbox: null,
- _service: null,
- _getters: null,
-
- _handler: null,
-
- setup: function()
- {
- this.updateSplitters(false);
- this.updateWindowGripper(false);
- this._handler.setup(this._service.firstRun);
- },
-
- destroy: function()
- {
- this._handler.destroy();
-
- ["_window", "_toolbox", "_service", "_getters", "_handler"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- updateSplitters: function(action)
- {
- let document = this._window.document;
-
- let splitter_before = document.getElementById("status4evar-status-splitter-before");
- if(splitter_before)
- {
- splitter_before.parentNode.removeChild(splitter_before);
- }
-
- let splitter_after = document.getElementById("status4evar-status-splitter-after");
- if(splitter_after)
- {
- splitter_after.parentNode.removeChild(splitter_after);
- }
-
- let status = this._getters.statusWidget;
- if(!action || !status)
- {
- return;
- }
-
- let urlbar = document.getElementById("urlbar-container");
- let stop = document.getElementById("stop-button");
- let fullscreenflex = document.getElementById("fullscreenflex");
-
- let nextSibling = status.nextSibling;
- let previousSibling = status.previousSibling;
-
- function getSplitter(splitter, suffix)
- {
- if(!splitter)
- {
- splitter = document.createElement("splitter");
- splitter.id = "status4evar-status-splitter-" + suffix;
- splitter.setAttribute("resizebefore", "flex");
- splitter.setAttribute("resizeafter", "flex");
- splitter.className = "chromeclass-toolbar-additional status4evar-status-splitter";
- }
- return splitter;
- }
-
- if((previousSibling && previousSibling.flex > 0)
- || (urlbar && stop && urlbar.getAttribute("combined") && stop == previousSibling))
- {
- status.parentNode.insertBefore(getSplitter(splitter_before, "before"), status);
- }
-
- if(nextSibling && nextSibling.flex > 0 && nextSibling != fullscreenflex)
- {
- status.parentNode.insertBefore(getSplitter(splitter_after, "after"), nextSibling);
- }
- },
-
- updateWindowGripper: function(action)
- {
- let document = this._window.document;
-
- let gripper = document.getElementById("status4evar-window-gripper");
- let toolbar = this._getters.statusBar || this._getters.addonbar;
-
- if(!action || !toolbar || !this._service.addonbarWindowGripper
- || this._window.windowState != CI.nsIDOMChromeWindow.STATE_NORMAL || toolbar.toolbox.customizing)
- {
- if(gripper)
- {
- gripper.parentNode.removeChild(gripper);
- }
- return;
- }
-
- gripper = this._handler.buildGripper(toolbar, gripper, "status4evar-window-gripper");
-
- toolbar.appendChild(gripper);
- }
+ _window: null,
+ _toolbox: null,
+ _service: null,
+ _getters: null,
+
+ _handler: null,
+
+ setup: function()
+ {
+ this.updateSplitters(false);
+ this.updateWindowGripper(false);
+ this._handler.setup(this._service.firstRun);
+ },
+
+ destroy: function()
+ {
+ this._handler.destroy();
+
+ ["_window", "_toolbox", "_service", "_getters", "_handler"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ updateSplitters: function(action)
+ {
+ let document = this._window.document;
+
+ let splitter_before = document.getElementById("status4evar-status-splitter-before");
+ if(splitter_before)
+ {
+ splitter_before.parentNode.removeChild(splitter_before);
+ }
+
+ let splitter_after = document.getElementById("status4evar-status-splitter-after");
+ if(splitter_after)
+ {
+ splitter_after.parentNode.removeChild(splitter_after);
+ }
+
+ let status = this._getters.statusWidget;
+ if(!action || !status)
+ {
+ return;
+ }
+
+ let urlbar = document.getElementById("urlbar-container");
+ let stop = document.getElementById("stop-button");
+ let fullscreenflex = document.getElementById("fullscreenflex");
+
+ let nextSibling = status.nextSibling;
+ let previousSibling = status.previousSibling;
+
+ function getSplitter(splitter, suffix)
+ {
+ if(!splitter)
+ {
+ splitter = document.createElement("splitter");
+ splitter.id = "status4evar-status-splitter-" + suffix;
+ splitter.setAttribute("resizebefore", "flex");
+ splitter.setAttribute("resizeafter", "flex");
+ splitter.className = "chromeclass-toolbar-additional status4evar-status-splitter";
+ }
+ return splitter;
+ }
+
+ if((previousSibling && previousSibling.flex > 0)
+ || (urlbar && stop && urlbar.getAttribute("combined") && stop == previousSibling))
+ {
+ status.parentNode.insertBefore(getSplitter(splitter_before, "before"), status);
+ }
+
+ if(nextSibling && nextSibling.flex > 0 && nextSibling != fullscreenflex)
+ {
+ status.parentNode.insertBefore(getSplitter(splitter_after, "after"), nextSibling);
+ }
+ },
+
+ updateWindowGripper: function(action)
+ {
+ let document = this._window.document;
+
+ let gripper = document.getElementById("status4evar-window-gripper");
+ let toolbar = this._getters.statusBar || this._getters.addonbar;
+
+ if(!action || !toolbar || !this._service.addonbarWindowGripper
+ || this._window.windowState != CI.nsIDOMChromeWindow.STATE_NORMAL || toolbar.toolbox.customizing)
+ {
+ if(gripper)
+ {
+ gripper.parentNode.removeChild(gripper);
+ }
+ return;
+ }
+
+ gripper = this._handler.buildGripper(toolbar, gripper, "status4evar-window-gripper");
+
+ toolbar.appendChild(gripper);
+ }
};
function ClassicS4EToolbars(window, toolbox)
{
- this._window = window;
- this._toolbox = toolbox;
+ this._window = window;
+ this._toolbox = toolbox;
}
ClassicS4EToolbars.prototype =
{
- _window: null,
- _toolbox: null,
-
- setup: function(firstRun)
- {
- let document = this._window.document;
-
- let addon_bar = document.getElementById("addon-bar");
- if(addon_bar)
- {
- let baseSet = "addonbar-closebutton"
- + ",status4evar-status-widget"
- + ",status4evar-progress-widget";
-
- // Update the defaultSet
- let defaultSet = baseSet;
- let defaultSetIgnore = ["addonbar-closebutton", "spring", "status-bar"];
- addon_bar.getAttribute("defaultset").split(",").forEach(function(item)
- {
- if(defaultSetIgnore.indexOf(item) == -1)
- {
- defaultSet += "," + item;
- }
- });
- defaultSet += ",status-bar"
- addon_bar.setAttribute("defaultset", defaultSet);
-
- // Update the currentSet
- if(firstRun)
- {
- let isCustomizableToolbar = function(aElt)
- {
- return aElt.localName == "toolbar" && aElt.getAttribute("customizable") == "true";
- }
-
- let isCustomizedAlready = false;
- let toolbars = Array.filter(this._toolbox.childNodes, isCustomizableToolbar).concat(
- Array.filter(this._toolbox.externalToolbars, isCustomizableToolbar));
- toolbars.forEach(function(toolbar)
- {
- if(toolbar.currentSet.indexOf("status4evar") > -1)
- {
- isCustomizedAlready = true;
- }
- });
-
- if(!isCustomizedAlready)
- {
- let currentSet = baseSet;
- let currentSetIgnore = ["addonbar-closebutton", "spring"];
- addon_bar.currentSet.split(",").forEach(function(item)
- {
- if(currentSetIgnore.indexOf(item) == -1)
- {
- currentSet += "," + item;
- }
- });
- addon_bar.currentSet = currentSet;
- addon_bar.setAttribute("currentset", currentSet);
- document.persist(addon_bar.id, "currentset");
- this._window.setToolbarVisibility(addon_bar, true);
- }
- }
- }
- },
-
- destroy: function()
- {
- ["_window", "_toolbox"].forEach(function(prop)
- {
- delete this[prop];
- }, this);
- },
-
- buildGripper: function(toolbar, gripper, id)
- {
- if(!gripper)
- {
- let document = this._window.document;
-
- gripper = document.createElement("resizer");
- gripper.id = id;
- gripper.dir = "bottomend";
- }
-
- return gripper;
- }
+ _window: null,
+ _toolbox: null,
+
+ setup: function(firstRun)
+ {
+ let document = this._window.document;
+
+ let addon_bar = document.getElementById("addon-bar");
+ if(addon_bar)
+ {
+ let baseSet = "addonbar-closebutton"
+ + ",status4evar-status-widget"
+ + ",status4evar-progress-widget";
+
+ // Update the defaultSet
+ let defaultSet = baseSet;
+ let defaultSetIgnore = ["addonbar-closebutton", "spring", "status-bar"];
+ addon_bar.getAttribute("defaultset").split(",").forEach(function(item)
+ {
+ if(defaultSetIgnore.indexOf(item) == -1)
+ {
+ defaultSet += "," + item;
+ }
+ });
+ defaultSet += ",status-bar"
+ addon_bar.setAttribute("defaultset", defaultSet);
+
+ // Update the currentSet
+ if(firstRun)
+ {
+ let isCustomizableToolbar = function(aElt)
+ {
+ return aElt.localName == "toolbar" && aElt.getAttribute("customizable") == "true";
+ }
+
+ let isCustomizedAlready = false;
+ let toolbars = Array.filter(this._toolbox.childNodes, isCustomizableToolbar).concat(
+ Array.filter(this._toolbox.externalToolbars, isCustomizableToolbar));
+ toolbars.forEach(function(toolbar)
+ {
+ if(toolbar.currentSet.indexOf("status4evar") > -1)
+ {
+ isCustomizedAlready = true;
+ }
+ });
+
+ if(!isCustomizedAlready)
+ {
+ let currentSet = baseSet;
+ let currentSetIgnore = ["addonbar-closebutton", "spring"];
+ addon_bar.currentSet.split(",").forEach(function(item)
+ {
+ if(currentSetIgnore.indexOf(item) == -1)
+ {
+ currentSet += "," + item;
+ }
+ });
+ addon_bar.currentSet = currentSet;
+ addon_bar.setAttribute("currentset", currentSet);
+ document.persist(addon_bar.id, "currentset");
+ this._window.setToolbarVisibility(addon_bar, true);
+ }
+ }
+ }
+ },
+
+ destroy: function()
+ {
+ ["_window", "_toolbox"].forEach(function(prop)
+ {
+ delete this[prop];
+ }, this);
+ },
+
+ buildGripper: function(toolbar, gripper, id)
+ {
+ if(!gripper)
+ {
+ let document = this._window.document;
+
+ gripper = document.createElement("resizer");
+ gripper.id = id;
+ gripper.dir = "bottomend";
+ }
+
+ return gripper;
+ }
};
diff --git a/application/palemoon/components/statusbar/content/overlay.css b/application/palemoon/components/statusbar/content/overlay.css
index 6375b8ef8..fd3452119 100644
--- a/application/palemoon/components/statusbar/content/overlay.css
+++ b/application/palemoon/components/statusbar/content/overlay.css
@@ -8,8 +8,7 @@
* Status Popup
*/
-statuspanel
-{
- -moz-binding: url("chrome://browser/content/statusbar/tabbrowser.xml#statuspanel");
+statuspanel {
+ -moz-binding: url("chrome://browser/content/statusbar/tabbrowser.xml#statuspanel");
}
diff --git a/application/palemoon/components/statusbar/content/overlay.js b/application/palemoon/components/statusbar/content/overlay.js
index cf6cfe296..b868aaf0e 100644
--- a/application/palemoon/components/statusbar/content/overlay.js
+++ b/application/palemoon/components/statusbar/content/overlay.js
@@ -6,11 +6,11 @@ if(!caligon) var caligon = {};
window.addEventListener("load", function buildS4E()
{
- window.removeEventListener("load", buildS4E, false);
+ window.removeEventListener("load", buildS4E, false);
- Components.utils.import("resource:///modules/statusbar/Status4Evar.jsm");
+ Components.utils.import("resource:///modules/statusbar/Status4Evar.jsm");
- caligon.status4evar = new Status4Evar(window, gBrowser, gNavToolbox);
- caligon.status4evar.setup();
+ caligon.status4evar = new Status4Evar(window, gBrowser, gNavToolbox);
+ caligon.status4evar.setup();
}, false);
diff --git a/application/palemoon/components/statusbar/content/overlay.xul b/application/palemoon/components/statusbar/content/overlay.xul
index f9a61a92e..b9934ee65 100644
--- a/application/palemoon/components/statusbar/content/overlay.xul
+++ b/application/palemoon/components/statusbar/content/overlay.xul
@@ -13,23 +13,23 @@
<overlay id="status4evar-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <stringbundleset id="stringbundleset">
- <stringbundle id="bundle_status4evar" src="chrome://browser/locale/statusbar/overlay.properties" />
- </stringbundleset>
+ <stringbundleset id="stringbundleset">
+ <stringbundle id="bundle_status4evar" src="chrome://browser/locale/statusbar/overlay.properties" />
+ </stringbundleset>
- <script type="application/javascript" src="chrome://browser/content/statusbar/overlay.js" />
+ <script type="application/javascript" src="chrome://browser/content/statusbar/overlay.js" />
- <commandset>
- <command id="S4E:Options" oncommand="caligon.status4evar.launchOptions(window);"/>
- </commandset>
+ <commandset>
+ <command id="S4E:Options" oncommand="caligon.status4evar.launchOptions(window);"/>
+ </commandset>
- <popupset id="mainPopupSet">
- <hbox id="status4evar-download-notification-container" mousethrough="always">
- <vbox id="status4evar-download-notification-anchor">
- <vbox id="status4evar-download-notification-icon" />
- </vbox>
- </hbox>
- </popupset>
+ <popupset id="mainPopupSet">
+ <hbox id="status4evar-download-notification-container" mousethrough="always">
+ <vbox id="status4evar-download-notification-anchor">
+ <vbox id="status4evar-download-notification-icon" />
+ </vbox>
+ </hbox>
+ </popupset>
<menupopup id="menu_ToolsPopup">
<menuitem id="statusbar-options-fx" command="S4E:Options"
@@ -41,41 +41,41 @@
label="&status4evar.menu.options.label;"/>
</menupopup>
- <toolbarpalette id="BrowserToolbarPalette">
- <toolbaritem id="status4evar-status-widget"
- title="&status4evar.status.widget.title;"
- removable="true" flex="1" persist="width" width="100">
- <label id="status4evar-status-text" flex="1" crop="end" value="&status4evar.status.widget.title;" />
- </toolbaritem>
+ <toolbarpalette id="BrowserToolbarPalette">
+ <toolbaritem id="status4evar-status-widget"
+ title="&status4evar.status.widget.title;"
+ removable="true" flex="1" persist="width" width="100">
+ <label id="status4evar-status-text" flex="1" crop="end" value="&status4evar.status.widget.title;" />
+ </toolbaritem>
- <toolbarbutton id="status4evar-download-button"
- title="&status4evar.download.widget.title;"
- class="toolbarbutton-1 chromeclass-toolbar-additional"
- removable="true" collapsed="true" tooltip="_child"
- oncommand="caligon.status4evar.downloadStatus.openUI(event)">
- <stack id="status4evar-download-anchor" class="toolbarbutton-icon">
- <vbox id="status4evar-download-icon" />
- <vbox pack="end">
- <progressmeter id="status4evar-download-progress-bar" mode="normal" value="0" collapsed="true" min="0" max="100" />
- </vbox>
- </stack>
- <tooltip id="status4evar-download-tooltip" />
- <label id="status4evar-download-label" value="&status4evar.download.widget.title;" class="toolbarbutton-text" crop="right" flex="1" />
- </toolbarbutton>
+ <toolbarbutton id="status4evar-download-button"
+ title="&status4evar.download.widget.title;"
+ class="toolbarbutton-1 chromeclass-toolbar-additional"
+ removable="true" collapsed="true" tooltip="_child"
+ oncommand="caligon.status4evar.downloadStatus.openUI(event)">
+ <stack id="status4evar-download-anchor" class="toolbarbutton-icon">
+ <vbox id="status4evar-download-icon" />
+ <vbox pack="end">
+ <progressmeter id="status4evar-download-progress-bar" mode="normal" value="0" collapsed="true" min="0" max="100" />
+ </vbox>
+ </stack>
+ <tooltip id="status4evar-download-tooltip" />
+ <label id="status4evar-download-label" value="&status4evar.download.widget.title;" class="toolbarbutton-text" crop="right" flex="1" />
+ </toolbarbutton>
- <toolbaritem id="status4evar-progress-widget"
- title="&status4evar.progress.widget.title;"
- removable="true">
- <progressmeter id="status4evar-progress-bar" class="progressmeter-statusbar"
- mode="normal" value="0" collapsed="true" min="0" max="100" />
- </toolbaritem>
+ <toolbaritem id="status4evar-progress-widget"
+ title="&status4evar.progress.widget.title;"
+ removable="true">
+ <progressmeter id="status4evar-progress-bar" class="progressmeter-statusbar"
+ mode="normal" value="0" collapsed="true" min="0" max="100" />
+ </toolbaritem>
- <toolbarbutton id="status4evar-options-button"
- title="&status4evar.options.widget.title;"
- class="toolbarbutton-1 chromeclass-toolbar-additional"
- label="&status4evar.options.widget.label;"
- removable="true" command="S4E:Options" tooltiptext="&status4evar.options.widget.title;" />
- </toolbarpalette>
+ <toolbarbutton id="status4evar-options-button"
+ title="&status4evar.options.widget.title;"
+ class="toolbarbutton-1 chromeclass-toolbar-additional"
+ label="&status4evar.options.widget.label;"
+ removable="true" command="S4E:Options" tooltiptext="&status4evar.options.widget.title;" />
+ </toolbarpalette>
<statusbar id="status-bar" ordinal="1" />
</overlay>
diff --git a/application/palemoon/components/statusbar/content/prefs.css b/application/palemoon/components/statusbar/content/prefs.css
index c627f78fb..bafaa6129 100644
--- a/application/palemoon/components/statusbar/content/prefs.css
+++ b/application/palemoon/components/statusbar/content/prefs.css
@@ -4,8 +4,7 @@
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-.css-bg-editor
-{
- -moz-binding: url("chrome://browser/content/statusbar/prefs.xml#css-bg-editor");
+.css-bg-editor {
+ -moz-binding: url("chrome://browser/content/statusbar/prefs.xml#css-bg-editor");
}
diff --git a/application/palemoon/components/statusbar/content/prefs.js b/application/palemoon/components/statusbar/content/prefs.js
index ed81fb271..47fd4b63d 100644
--- a/application/palemoon/components/statusbar/content/prefs.js
+++ b/application/palemoon/components/statusbar/content/prefs.js
@@ -6,267 +6,267 @@ Components.utils.import("resource://gre/modules/Services.jsm");
var status4evarPrefs =
{
- get dynamicProgressStyle()
- {
- let styleSheets = window.document.styleSheets;
- for(let i = 0; i < styleSheets.length; i++)
- {
- let styleSheet = styleSheets[i];
- if(styleSheet.href == "chrome://browser/skin/statusbar/dynamic.css")
- {
- delete this.dynamicProgressStyle;
- return this.dynamicProgressStyle = styleSheet;
- }
- }
-
- return null;
- },
+ get dynamicProgressStyle()
+ {
+ let styleSheets = window.document.styleSheets;
+ for(let i = 0; i < styleSheets.length; i++)
+ {
+ let styleSheet = styleSheets[i];
+ if(styleSheet.href == "chrome://browser/skin/statusbar/dynamic.css")
+ {
+ delete this.dynamicProgressStyle;
+ return this.dynamicProgressStyle = styleSheet;
+ }
+ }
+
+ return null;
+ },
//
// Status timeout management
//
- get statusTimeoutPref()
- {
- delete this.statusTimeoutPref;
- return this.statusTimeoutPref = document.getElementById("status4evar-pref-status-timeout");
- },
-
- get statusTimeoutCheckbox()
- {
- delete this.statusTimeoutCheckbox;
- return this.statusTimeoutCheckbox = document.getElementById("status4evar-status-timeout-check");
- },
-
- statusTimeoutChanged: function()
- {
- if(this.statusTimeoutPref.value > 0)
- {
- this.statusTimeoutPref.disabled = false;
- this.statusTimeoutCheckbox.checked = true;
- }
- else
- {
- this.statusTimeoutPref.disabled = true;
- this.statusTimeoutCheckbox.checked = false;
- }
- },
-
- statusTimeoutSync: function()
- {
- this.statusTimeoutChanged();
- return undefined;
- },
-
- statusTimeoutToggle: function()
- {
- if(this.statusTimeoutPref.disabled == this.statusTimeoutCheckbox.checked)
- {
- if(this.statusTimeoutCheckbox.checked)
- {
- this.statusTimeoutPref.value = 10;
- }
- else
- {
- this.statusTimeoutPref.value = 0;
- }
- }
- },
+ get statusTimeoutPref()
+ {
+ delete this.statusTimeoutPref;
+ return this.statusTimeoutPref = document.getElementById("status4evar-pref-status-timeout");
+ },
+
+ get statusTimeoutCheckbox()
+ {
+ delete this.statusTimeoutCheckbox;
+ return this.statusTimeoutCheckbox = document.getElementById("status4evar-status-timeout-check");
+ },
+
+ statusTimeoutChanged: function()
+ {
+ if(this.statusTimeoutPref.value > 0)
+ {
+ this.statusTimeoutPref.disabled = false;
+ this.statusTimeoutCheckbox.checked = true;
+ }
+ else
+ {
+ this.statusTimeoutPref.disabled = true;
+ this.statusTimeoutCheckbox.checked = false;
+ }
+ },
+
+ statusTimeoutSync: function()
+ {
+ this.statusTimeoutChanged();
+ return undefined;
+ },
+
+ statusTimeoutToggle: function()
+ {
+ if(this.statusTimeoutPref.disabled == this.statusTimeoutCheckbox.checked)
+ {
+ if(this.statusTimeoutCheckbox.checked)
+ {
+ this.statusTimeoutPref.value = 10;
+ }
+ else
+ {
+ this.statusTimeoutPref.value = 0;
+ }
+ }
+ },
//
// Status network management
//
- get statusNetworkPref()
- {
- delete this.statusNetworkPref;
- return this.statusNetworkPref = document.getElementById("status4evar-pref-status-network");
- },
-
- get statusNetworkXHRPref()
- {
- delete this.statusNetworkXHRPref;
- return this.statusNetworkXHRPref = document.getElementById("status4evar-pref-status-network-xhr");
- },
-
- statusNetworkChanged: function()
- {
- this.statusNetworkXHRPref.disabled = ! this.statusNetworkPref.value;
- },
-
- statusNetworkSync: function()
- {
- this.statusNetworkChanged();
- return undefined;
- },
+ get statusNetworkPref()
+ {
+ delete this.statusNetworkPref;
+ return this.statusNetworkPref = document.getElementById("status4evar-pref-status-network");
+ },
+
+ get statusNetworkXHRPref()
+ {
+ delete this.statusNetworkXHRPref;
+ return this.statusNetworkXHRPref = document.getElementById("status4evar-pref-status-network-xhr");
+ },
+
+ statusNetworkChanged: function()
+ {
+ this.statusNetworkXHRPref.disabled = ! this.statusNetworkPref.value;
+ },
+
+ statusNetworkSync: function()
+ {
+ this.statusNetworkChanged();
+ return undefined;
+ },
//
// Status Text langth managment
//
- get textMaxLengthPref()
- {
- delete this.textMaxLengthPref;
- return this.textMaxLengthPref = document.getElementById("status4evar-pref-status-toolbar-maxLength");
- },
-
- get textMaxLengthCheckbox()
- {
- delete this.textMaxLengthCheckbox;
- return this.textMaxLengthCheckbox = document.getElementById("status4evar-status-toolbar-maxLength-check");
- },
-
- textLengthChanged: function()
- {
- if(this.textMaxLengthPref.value > 0)
- {
- this.textMaxLengthPref.disabled = false;
- this.textMaxLengthCheckbox.checked = true;
- }
- else
- {
- this.textMaxLengthPref.disabled = true;
- this.textMaxLengthCheckbox.checked = false;
- }
- },
-
- textLengthSync: function()
- {
- this.textLengthChanged();
- return undefined;
- },
-
- textLengthToggle: function()
- {
- if(this.textMaxLengthPref.disabled == this.textMaxLengthCheckbox.checked)
- {
- if(this.textMaxLengthCheckbox.checked)
- {
- this.textMaxLengthPref.value = 800;
- }
- else
- {
- this.textMaxLengthPref.value = 0;
- }
- }
- },
+ get textMaxLengthPref()
+ {
+ delete this.textMaxLengthPref;
+ return this.textMaxLengthPref = document.getElementById("status4evar-pref-status-toolbar-maxLength");
+ },
+
+ get textMaxLengthCheckbox()
+ {
+ delete this.textMaxLengthCheckbox;
+ return this.textMaxLengthCheckbox = document.getElementById("status4evar-status-toolbar-maxLength-check");
+ },
+
+ textLengthChanged: function()
+ {
+ if(this.textMaxLengthPref.value > 0)
+ {
+ this.textMaxLengthPref.disabled = false;
+ this.textMaxLengthCheckbox.checked = true;
+ }
+ else
+ {
+ this.textMaxLengthPref.disabled = true;
+ this.textMaxLengthCheckbox.checked = false;
+ }
+ },
+
+ textLengthSync: function()
+ {
+ this.textLengthChanged();
+ return undefined;
+ },
+
+ textLengthToggle: function()
+ {
+ if(this.textMaxLengthPref.disabled == this.textMaxLengthCheckbox.checked)
+ {
+ if(this.textMaxLengthCheckbox.checked)
+ {
+ this.textMaxLengthPref.value = 800;
+ }
+ else
+ {
+ this.textMaxLengthPref.value = 0;
+ }
+ }
+ },
//
// Toolbar progress style management
//
- get progressToolbarStylePref()
- {
- delete this.progressToolbarStylePref;
- return this.progressToolbarStylePref = document.getElementById("status4evar-pref-progress-toolbar-style");
- },
-
- get progressToolbarCSSPref()
- {
- delete this.progressToolbarCSSPref;
- return this.progressToolbarCSSPref = document.getElementById("status4evar-pref-progress-toolbar-css");
- },
-
- get progressToolbarProgress()
- {
- delete this.progressToolbarProgress;
- return this.progressToolbarProgress = document.getElementById("status4evar-progress-bar");
- },
-
- progressToolbarCSSChanged: function()
- {
- if(!this.progressToolbarCSSPref.value)
- {
- this.progressToolbarCSSPref.value = "#33FF33";
- }
- this.dynamicProgressStyle.cssRules[1].style.background = this.progressToolbarCSSPref.value;
- },
-
- progressToolbarStyleChanged: function()
- {
- this.progressToolbarCSSChanged();
- this.progressToolbarCSSPref.disabled = !this.progressToolbarStylePref.value;
- if(this.progressToolbarStylePref.value)
- {
- this.progressToolbarProgress.setAttribute("s4estyle", true);
- }
- else
- {
- this.progressToolbarProgress.removeAttribute("s4estyle");
- }
- },
-
- progressToolbarStyleSync: function()
- {
- this.progressToolbarStyleChanged();
- return undefined;
- },
+ get progressToolbarStylePref()
+ {
+ delete this.progressToolbarStylePref;
+ return this.progressToolbarStylePref = document.getElementById("status4evar-pref-progress-toolbar-style");
+ },
+
+ get progressToolbarCSSPref()
+ {
+ delete this.progressToolbarCSSPref;
+ return this.progressToolbarCSSPref = document.getElementById("status4evar-pref-progress-toolbar-css");
+ },
+
+ get progressToolbarProgress()
+ {
+ delete this.progressToolbarProgress;
+ return this.progressToolbarProgress = document.getElementById("status4evar-progress-bar");
+ },
+
+ progressToolbarCSSChanged: function()
+ {
+ if(!this.progressToolbarCSSPref.value)
+ {
+ this.progressToolbarCSSPref.value = "#33FF33";
+ }
+ this.dynamicProgressStyle.cssRules[1].style.background = this.progressToolbarCSSPref.value;
+ },
+
+ progressToolbarStyleChanged: function()
+ {
+ this.progressToolbarCSSChanged();
+ this.progressToolbarCSSPref.disabled = !this.progressToolbarStylePref.value;
+ if(this.progressToolbarStylePref.value)
+ {
+ this.progressToolbarProgress.setAttribute("s4estyle", true);
+ }
+ else
+ {
+ this.progressToolbarProgress.removeAttribute("s4estyle");
+ }
+ },
+
+ progressToolbarStyleSync: function()
+ {
+ this.progressToolbarStyleChanged();
+ return undefined;
+ },
//
// Download progress management
//
- get downloadProgressCheck()
- {
- delete this.downloadProgressCheck;
- return this.downloadProgressCheck = document.getElementById("status4evar-download-progress-check");
- },
-
- get downloadProgressPref()
- {
- delete this.downloadProgressPref;
- return this.downloadProgressPref = document.getElementById("status4evar-pref-download-progress");
- },
-
- get downloadProgressColorActivePref()
- {
- delete this.downloadProgressActiveColorPref;
- return this.downloadProgressActiveColorPref = document.getElementById("status4evar-pref-download-color-active");
- },
-
- get downloadProgressColorPausedPref()
- {
- delete this.downloadProgressPausedColorPref;
- return this.downloadProgressPausedColorPref = document.getElementById("status4evar-pref-download-color-paused");
- },
-
- downloadProgressSync: function()
- {
- let val = this.downloadProgressPref.value;
- this.downloadProgressColorActivePref.disabled = (val == 0);
- this.downloadProgressColorPausedPref.disabled = (val == 0);
- this.downloadProgressPref.disabled = (val == 0);
- this.downloadProgressCheck.checked = (val != 0);
- return ((val == 0) ? 1 : val);
- },
-
- downloadProgressToggle: function()
- {
- let enabled = this.downloadProgressCheck.checked;
- this.downloadProgressPref.value = ((enabled) ? 1 : 0);
- },
+ get downloadProgressCheck()
+ {
+ delete this.downloadProgressCheck;
+ return this.downloadProgressCheck = document.getElementById("status4evar-download-progress-check");
+ },
+
+ get downloadProgressPref()
+ {
+ delete this.downloadProgressPref;
+ return this.downloadProgressPref = document.getElementById("status4evar-pref-download-progress");
+ },
+
+ get downloadProgressColorActivePref()
+ {
+ delete this.downloadProgressActiveColorPref;
+ return this.downloadProgressActiveColorPref = document.getElementById("status4evar-pref-download-color-active");
+ },
+
+ get downloadProgressColorPausedPref()
+ {
+ delete this.downloadProgressPausedColorPref;
+ return this.downloadProgressPausedColorPref = document.getElementById("status4evar-pref-download-color-paused");
+ },
+
+ downloadProgressSync: function()
+ {
+ let val = this.downloadProgressPref.value;
+ this.downloadProgressColorActivePref.disabled = (val == 0);
+ this.downloadProgressColorPausedPref.disabled = (val == 0);
+ this.downloadProgressPref.disabled = (val == 0);
+ this.downloadProgressCheck.checked = (val != 0);
+ return ((val == 0) ? 1 : val);
+ },
+
+ downloadProgressToggle: function()
+ {
+ let enabled = this.downloadProgressCheck.checked;
+ this.downloadProgressPref.value = ((enabled) ? 1 : 0);
+ },
//
// Pref Window load
//
- get downloadButtonActionCommandPref()
- {
- delete this.downloadButtonActionCommandPref;
- return this.downloadButtonActionCommandPref = document.getElementById("status4evar-pref-download-button-action-command");
- },
-
- get downloadButtonActionThirdPartyItem()
- {
- delete this.downloadButtonActionThirdPartyItem;
- return this.downloadButtonActionThirdPartyItem = document.getElementById("status4evar-download-button-action-menu-thirdparty");
- },
-
- onPrefWindowLoad: function()
- {
- if(!this.downloadButtonActionCommandPref.value)
- {
- this.downloadButtonActionThirdPartyItem.disabled = true;
- }
- },
-
- onPrefWindowUnLoad: function()
- {
- }
+ get downloadButtonActionCommandPref()
+ {
+ delete this.downloadButtonActionCommandPref;
+ return this.downloadButtonActionCommandPref = document.getElementById("status4evar-pref-download-button-action-command");
+ },
+
+ get downloadButtonActionThirdPartyItem()
+ {
+ delete this.downloadButtonActionThirdPartyItem;
+ return this.downloadButtonActionThirdPartyItem = document.getElementById("status4evar-download-button-action-menu-thirdparty");
+ },
+
+ onPrefWindowLoad: function()
+ {
+ if(!this.downloadButtonActionCommandPref.value)
+ {
+ this.downloadButtonActionThirdPartyItem.disabled = true;
+ }
+ },
+
+ onPrefWindowUnLoad: function()
+ {
+ }
}
var XULBrowserWindow = {
diff --git a/application/palemoon/components/statusbar/content/prefs.xml b/application/palemoon/components/statusbar/content/prefs.xml
index cf4a00bb8..44baab18d 100644
--- a/application/palemoon/components/statusbar/content/prefs.xml
+++ b/application/palemoon/components/statusbar/content/prefs.xml
@@ -11,694 +11,694 @@
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
- <binding id="css-bg-editor">
- <content sizetopopup="pref">
- <xul:vbox flex="1">
- <xul:deck anonid="css-bg-editor-deck" flex="1">
- <xul:vbox>
- <xul:hbox align="center">
- <xul:label xbl:inherits="disabled">&status4evar.editor.css.color.label;</xul:label>
- <xul:colorpicker anonid="css-bg-editor-color" type="button" onchange="this._editor._buildCSS();" xbl:inherits="disabled" />
- </xul:hbox>
-
- <xul:hbox align="center">
- <xul:label xbl:inherits="disabled">&status4evar.editor.css.image.label;</xul:label>
- <xul:textbox anonid="css-bg-editor-image" readonly="true" flex="1" xbl:inherits="disabled" />
- <xul:button anonid="css-bg-editor-image-browse" label="&status4evar.option.browse;" oncommand="this._editor._imageBrowse();" xbl:inherits="disabled" />
- </xul:hbox>
- <xul:hbox align="center" pack="end">
- <xul:button anonid="css-bg-editor-image-clear" label="&status4evar.option.clear;" oncommand="this._editor._imageClear();" xbl:inherits="disabled=no-image" />
- </xul:hbox>
-
- <xul:hbox>
- <xul:groupbox pack="center">
- <xul:caption label="" />
- <xul:hbox flex="1" align="center">
- <xul:label>X</xul:label>
- </xul:hbox>
- <xul:separator class="groove" orient="horizontal" />
- <xul:hbox flex="1" align="center">
- <xul:label>Y</xul:label>
- </xul:hbox>
- </xul:groupbox>
-
- <xul:groupbox>
- <xul:caption label="&status4evar.editor.css.image.repeat;" xbl:inherits="disabled=no-image" />
- <xul:menulist anonid="css-bg-editor-image-repeat-x" sizetopopup="always" onselect="this._editor._buildCSS();" xbl:inherits="disabled=no-image">
- <xul:menupopup>
- <xul:menuitem label="&status4evar.option.no-repeat;" value="no-repeat" />
- <xul:menuitem label="&status4evar.option.repeat;" value="repeat" />
+ <binding id="css-bg-editor">
+ <content sizetopopup="pref">
+ <xul:vbox flex="1">
+ <xul:deck anonid="css-bg-editor-deck" flex="1">
+ <xul:vbox>
+ <xul:hbox align="center">
+ <xul:label xbl:inherits="disabled">&status4evar.editor.css.color.label;</xul:label>
+ <xul:colorpicker anonid="css-bg-editor-color" type="button" onchange="this._editor._buildCSS();" xbl:inherits="disabled" />
+ </xul:hbox>
+
+ <xul:hbox align="center">
+ <xul:label xbl:inherits="disabled">&status4evar.editor.css.image.label;</xul:label>
+ <xul:textbox anonid="css-bg-editor-image" readonly="true" flex="1" xbl:inherits="disabled" />
+ <xul:button anonid="css-bg-editor-image-browse" label="&status4evar.option.browse;" oncommand="this._editor._imageBrowse();" xbl:inherits="disabled" />
+ </xul:hbox>
+ <xul:hbox align="center" pack="end">
+ <xul:button anonid="css-bg-editor-image-clear" label="&status4evar.option.clear;" oncommand="this._editor._imageClear();" xbl:inherits="disabled=no-image" />
+ </xul:hbox>
+
+ <xul:hbox>
+ <xul:groupbox pack="center">
+ <xul:caption label="" />
+ <xul:hbox flex="1" align="center">
+ <xul:label>X</xul:label>
+ </xul:hbox>
+ <xul:separator class="groove" orient="horizontal" />
+ <xul:hbox flex="1" align="center">
+ <xul:label>Y</xul:label>
+ </xul:hbox>
+ </xul:groupbox>
+
+ <xul:groupbox>
+ <xul:caption label="&status4evar.editor.css.image.repeat;" xbl:inherits="disabled=no-image" />
+ <xul:menulist anonid="css-bg-editor-image-repeat-x" sizetopopup="always" onselect="this._editor._buildCSS();" xbl:inherits="disabled=no-image">
+ <xul:menupopup>
+ <xul:menuitem label="&status4evar.option.no-repeat;" value="no-repeat" />
+ <xul:menuitem label="&status4evar.option.repeat;" value="repeat" />
<!--
- <xul:menuitem label="&status4evar.option.space;" value="space" />
- <xul:menuitem label="&status4evar.option.round;" value="round" />
+ <xul:menuitem label="&status4evar.option.space;" value="space" />
+ <xul:menuitem label="&status4evar.option.round;" value="round" />
-->
- </xul:menupopup>
- </xul:menulist>
- <xul:separator class="groove" orient="horizontal" />
- <xul:menulist anonid="css-bg-editor-image-repeat-y" sizetopopup="always" onselect="this._editor._buildCSS();" xbl:inherits="disabled=no-image">
- <xul:menupopup>
- <xul:menuitem label="&status4evar.option.no-repeat;" value="no-repeat" />
- <xul:menuitem label="&status4evar.option.repeat;" value="repeat" />
+ </xul:menupopup>
+ </xul:menulist>
+ <xul:separator class="groove" orient="horizontal" />
+ <xul:menulist anonid="css-bg-editor-image-repeat-y" sizetopopup="always" onselect="this._editor._buildCSS();" xbl:inherits="disabled=no-image">
+ <xul:menupopup>
+ <xul:menuitem label="&status4evar.option.no-repeat;" value="no-repeat" />
+ <xul:menuitem label="&status4evar.option.repeat;" value="repeat" />
<!--
- <xul:menuitem label="&status4evar.option.space;" value="space" />
- <xul:menuitem label="&status4evar.option.round;" value="round" />
+ <xul:menuitem label="&status4evar.option.space;" value="space" />
+ <xul:menuitem label="&status4evar.option.round;" value="round" />
-->
- </xul:menupopup>
- </xul:menulist>
- </xul:groupbox>
-
- <xul:groupbox>
- <xul:caption label="&status4evar.editor.css.image.position;" xbl:inherits="disabled=no-image" />
- <xul:menulist anonid="css-bg-editor-image-position-x" sizetopopup="always" onselect="this._editor._updatePositionX();" xbl:inherits="disabled=no-image">
- <xul:menupopup>
- <xul:menuitem label="&status4evar.option.left;" value="left" />
- <xul:menuitem label="&status4evar.option.center;" value="center" />
- <xul:menuitem label="&status4evar.option.right;" value="right" />
- <xul:menuitem label="&status4evar.option.offset;" value="offset" />
- </xul:menupopup>
- </xul:menulist>
- <xul:separator class="groove" orient="horizontal" />
- <xul:menulist anonid="css-bg-editor-image-position-y" sizetopopup="always" onselect="this._editor._updatePositionY();" xbl:inherits="disabled=no-image">
- <xul:menupopup>
- <xul:menuitem label="&status4evar.option.top;" value="top" />
- <xul:menuitem label="&status4evar.option.center;" value="center" />
- <xul:menuitem label="&status4evar.option.bottom;" value="bottom" />
- <xul:menuitem label="&status4evar.option.offset;" value="offset" />
- </xul:menupopup>
- </xul:menulist>
- </xul:groupbox>
-
- <xul:groupbox>
- <xul:caption label="&status4evar.editor.css.image.offset;" xbl:inherits="disabled=no-image" />
- <xul:hbox>
- <xul:textbox anonid="css-bg-editor-image-offset-x" type="number" size="4" min="-65535" onchange="this._editor._buildCSS();" />
- <xul:menulist anonid="css-bg-editor-image-offset-unit-x" sizetopopup="always" onselect="this._editor._buildCSS();">
- <xul:menupopup>
- <xul:menuitem label="%" value="%" />
- <xul:menuitem label="px" value="px" />
- <xul:menuitem label="em" value="em" />
- <xul:menuitem label="in" value="in" />
- <xul:menuitem label="cm" value="cm" />
- <xul:menuitem label="mm" value="mm" />
- <xul:menuitem label="pt" value="pt" />
- <xul:menuitem label="pc" value="pc" />
- </xul:menupopup>
- </xul:menulist>
- </xul:hbox>
- <xul:separator class="groove" orient="horizontal" />
- <xul:hbox>
- <xul:textbox anonid="css-bg-editor-image-offset-y" type="number" size="4" min="-65535" onchange="this._editor._buildCSS();" />
- <xul:menulist anonid="css-bg-editor-image-offset-unit-y" sizetopopup="always" onselect="this._editor._buildCSS();">
- <xul:menupopup>
- <xul:menuitem label="%" value="%" />
- <xul:menuitem label="px" value="px" />
- <xul:menuitem label="em" value="em" />
- <xul:menuitem label="in" value="in" />
- <xul:menuitem label="cm" value="cm" />
- <xul:menuitem label="mm" value="mm" />
- <xul:menuitem label="pt" value="pt" />
- <xul:menuitem label="pc" value="pc" />
- </xul:menupopup>
- </xul:menulist>
- </xul:hbox>
- </xul:groupbox>
- </xul:hbox>
- </xul:vbox>
-
- <xul:textbox anonid="css-bg-editor-css-text" multiline="true" rows="6" xbl:inherits="disabled" />
- </xul:deck>
- </xul:vbox>
-
- <xul:hbox align="center" pack="end">
- <children includes="progressmeter|toolbox" />
- <xul:label xbl:inherits="disabled">&status4evar.editor.label;</xul:label>
- <xul:menulist anonid="css-bg-editor-mode-menu" sizetopopup="always" onselect="this._editor._updateMode();" xbl:inherits="disabled">
- <xul:menupopup>
- <xul:menuitem label="&status4evar.option.simple;" />
- <xul:menuitem label="&status4evar.option.advanced;" />
- </xul:menupopup>
- </xul:menulist>
- </xul:hbox>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- [
- "_editorColor",
- "_editorImageBrowse",
- "_editorImageClear",
- "_editorImageRepeatX",
- "_editorImageRepeatY",
- "_editorImagePositionX",
- "_editorImagePositionY",
- "_editorImageOffsetX",
- "_editorImageOffsetY",
- "_editorImageOffsetUnitX",
- "_editorImageOffsetUnitY",
- "_editorMode"
- ].forEach(function(prop)
- {
- this[prop]._editor = this;
- }, this);
-
- this.setAdvanced(true, false);
- ]]></constructor>
-
- <destructor><![CDATA[
- ]]></destructor>
-
- <field name="_disableBuildCSS"><![CDATA[
- true
- ]]></field>
-
- <field name="_editorColor" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-color");
- ]]></field>
-
- <field name="_editorCSS" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-css-text");
- ]]></field>
-
- <field name="_editorDeck" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-deck");
- ]]></field>
-
- <field name="_editorImage" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image");
- ]]></field>
-
- <field name="_editorImageBrowse" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-browse");
- ]]></field>
-
- <field name="_editorImageClear" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-clear");
- ]]></field>
-
- <field name="_editorImageRepeatX" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-repeat-x");
- ]]></field>
-
- <field name="_editorImageRepeatY" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-repeat-y");
- ]]></field>
-
- <field name="_editorImagePositionX" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-position-x");
- ]]></field>
-
- <field name="_editorImagePositionY" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-position-y");
- ]]></field>
-
- <field name="_editorImageOffsetX" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-offset-x");
- ]]></field>
-
- <field name="_editorImageOffsetY" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-offset-y");
- ]]></field>
-
- <field name="_editorImageOffsetUnitX" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-offset-unit-x");
- ]]></field>
-
- <field name="_editorImageOffsetUnitY" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-offset-unit-y");
- ]]></field>
-
- <field name="_editorMode" readonly="true"><![CDATA[
- document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-mode-menu");
- ]]></field>
-
- <field name="_initialized"><![CDATA[
- false
- ]]></field>
-
- <field name="_reRGB" readonly="true"><![CDATA[
- /^rgb\((\d+), (\d+), (\d+)\)$/
- ]]></field>
-
- <field name="_reURL" readonly="true"><![CDATA[
- /^url\(\s*['"]?(.+?)['"]?\s*\)$/
- ]]></field>
-
- <field name="_reBgPosition" readonly="true"><![CDATA[
- /^(left|center|right)? ?(-?\d+[^\s\d]+)? ?(top|center|bottom)? ?(-?\d+[^\s\d]+)?$/
- ]]></field>
-
- <field name="_reCSSUnit" readonly="true"><![CDATA[
- /^(-?\d+)([^\s\d]+)$/
- ]]></field>
-
- <field name="_strings" readonly="true"><![CDATA[
- document.getElementById("bundle_status4evar");
- ]]></field>
-
- <property name="value">
- <getter><![CDATA[
- return this._editorCSS.value;
- ]]></getter>
- <setter><![CDATA[
- this._editorCSS.value = val;
-
- if(!this._initialized)
- {
- this.setAdvanced(false, false);
- this._initialized = true;
- }
-
- return val;
- ]]></setter>
- </property>
-
- <property name="disabled">
- <getter><![CDATA[
- return this.getAttribute("disabled") == "true";
- ]]></getter>
- <setter><![CDATA[
- if(val)
- {
- this.setAttribute("disabled", "true");
- }
- else
- {
- this.removeAttribute("disabled");
- }
-
- this._updateImageControllDisable();
-
- return val;
- ]]></setter>
- </property>
-
- <method name="setAdvanced">
- <parameter name="aVal"/>
- <parameter name="aPrompt"/>
- <body><![CDATA[
- if(!aVal)
- {
- let success = this._parseCSS();
- if(!success)
- {
- let result = aPrompt && Services.prompt.confirm(window,
- this._strings.getString("simpleEditorTitle"),
- this._strings.getString("simpleEditorMessage"));
- if(result)
- { // Continue to simple mode
- this._buildCSS();
- }
- else
- { // Stay on advanced mode
- aVal = true;
- }
- }
- }
-
- this._disableBuildCSS = aVal;
- this._editorDeck.selectedIndex = ((aVal) ? 1 : 0);
- this._editorMode.selectedIndex = ((aVal) ? 1 : 0);
- ]]></body>
- </method>
-
- <method name="_buildCSS">
- <body><![CDATA[
- if(this._disableBuildCSS)
- {
- return;
- }
-
- let cssVal = this._editorColor.color;
- let imgVal = this._editorImage.value;
- if(imgVal)
- {
- cssVal += " url(\"" + imgVal + "\")";
-
- //
- // Print the background repeat
- //
- let bgRX = this._editorImageRepeatX.value;
- let bgRY = this._editorImageRepeatY.value;
- if(bgRX == "repeat" && bgRY == "no-repeat")
- {
- cssVal += " repeat-x";
- }
- else if(bgRX == "no-repeat" && bgRY == "repeat")
- {
- cssVal += " repeat-y";
- }
- else
- {
- cssVal += " " + bgRX;
- if(bgRX != bgRY)
- {
- cssVal += " " + bgRY;
- }
- }
-
- //
- // Print the background position
- //
- let bgPX = this._editorImagePositionX.value;
- let bgPOX = this._editorImageOffsetX.value;
- if(bgPX != "offset")
- {
- cssVal += " " + bgPX;
- }
- else
- {
- cssVal += " " + bgPOX + this._editorImageOffsetUnitX.value;
- }
-
- let bgPY = this._editorImagePositionY.value;
- let bgPOY = this._editorImageOffsetY.value;
- if(bgPY != "offset")
- {
- cssVal += " " + bgPY;
- }
- else
- {
- cssVal += " " + bgPOY + this._editorImageOffsetUnitY.value;
- }
- }
-
- this._editorCSS.value = cssVal;
-
- let event = document.createEvent("Event");
- event.initEvent("change", true, true);
- this._editorCSS.dispatchEvent(event);
- ]]></body>
- </method>
-
- <method name="_parseCSS">
- <body><![CDATA[
- let retVal = true;
-
- let cssParser = document.createElement("div");
- cssParser.style.background = this._editorCSS.value;
- if(!cssParser.style.background)
- {
- Components.utils.reportError("Error parsing background CSS rule: " + this._editorCSS.value);
- cssParser.style.background = "#33FF33";
- retVal = false;
- }
-
- //
- // Parse the background color
- //
- let bgC = cssParser.style.backgroundColor;
- if(this._reRGB.test(bgC))
- {
- let digits = this._reRGB.exec(bgC);
-
- let red = parseInt(digits[1]);
- let green = parseInt(digits[2]);
- let blue = parseInt(digits[3]);
-
- let rgb = blue | (green << 8) | (red << 16);
- bgC = "#" + rgb.toString(16);
- }
- else
- {
- Components.utils.reportError("Error parsing background-color value: " + bgC);
- bgC = "#33FF33";
- retVal = false;
- }
-
- //
- // Parse the background image
- //
- let bgI = cssParser.style.backgroundImage;
- if(bgI != "none" && !this._reURL.test(bgI))
- {
- Components.utils.reportError("Error parsing background-image value: " + bgI);
- bgI = "none";
- retVal = false;
- }
- bgI = ((bgI != "none") ? this._reURL.exec(bgI)[1].trim() : "");
-
- //
- // Parse the background repeat
- //
- let bgR = cssParser.style.backgroundRepeat.split(" ");
- let bgRX = bgR[0];
- if(bgRX == "repeat-x")
- {
- bgRX = "repeat";
- }
- else if(bgRX == "repeat-y")
- {
- bgRX = "no-repeat";
- }
-
- let bgRY = bgR[bgR.length - 1];
- if(bgRY == "repeat-x")
- {
- bgRY = "no-repeat";
- }
- else if(bgRY == "repeat-y")
- {
- bgRY = "repeat";
- }
-
- //
- // Parse the background position
- //
- let bgP = cssParser.style.backgroundPosition;
- let bgPParts = this._reBgPosition.exec(bgP);
- let bgPValues = new Array();
- for(let i = 1; i <= 4; i++)
- {
- if(bgPParts[i])
- {
- bgPValues.push({
- "value": bgPParts[i],
- "group": i
- });
- }
- }
-
- if(bgPValues.length == 1)
- {
- bgPValues.splice(((bgPValues[0].group == 2) ? 0 : 1), 0, {
- "value": "center",
- "group": ((bgPValues[0].group == 2) ? 0 : 2)
- });
- }
-
- if(bgPValues.length == 2 && bgPValues[1].group == 2)
- {
- bgPValues[1].group = 4;
- }
-
- for(let i = 0; i < 4; i++)
- {
- let group = (i + 1);
- if(bgPValues[i] != undefined && bgPValues[i].group == group)
- {
- continue;
- }
-
- let tmp = "0px";
- switch(i)
- {
- case 0:
- tmp = "offset";
- break;
- case 2:
- tmp = "offset";
- break;
- }
-
- bgPValues.splice(i, 0, {
- "value": tmp,
- "group": group
- });
- }
-
- let bgPOXParts = this._reCSSUnit.exec(bgPValues[1].value);
- let bgPOYParts = this._reCSSUnit.exec(bgPValues[3].value);
-
- //
- // Parse the background size
- //
-
- //
- // Initialize the UI
- //
- let disableBuildCSS = this._disableBuildCSS;
- this._disableBuildCSS = true;
-
- this._editorColor.color = bgC;
- this._editorImage.value = bgI;
- this._editorImageOffsetX.value = bgPOXParts[1];
- this._editorImageOffsetY.value = bgPOYParts[1];
-
- [
- [this._editorImageRepeatX, bgRX, "repeat", "repeat X"],
- [this._editorImageRepeatY, bgRY, "repeat", "repeat Y"],
- [this._editorImagePositionX, bgPValues[0].value, "left", "position X"],
- [this._editorImagePositionY, bgPValues[2].value, "top", "position Y"],
- [this._editorImageOffsetUnitX, bgPOXParts[2], "px", "offset X unit"],
- [this._editorImageOffsetUnitY, bgPOYParts[2], "px", "offset Y unit"]
- ].forEach(function(info)
- {
- if(!this._setSelectedItemSafe(info[0], info[1], info[2]))
- {
- Components.utils.reportError("Error setting " + info[3] + " to " + info[1]);
- retVal = false;
- }
- }, this);
-
- this._updateImageControllDisable();
-
- this._disableBuildCSS = disableBuildCSS;
-
- return retVal;
- ]]></body>
- </method>
-
- <method name="_imageBrowse">
- <body><![CDATA[
- let nsIFilePicker = Components.interfaces.nsIFilePicker;
- let filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
- filePicker.init(window, this._strings.getString("imageSelectTitle"), nsIFilePicker.modeOpen);
- filePicker.appendFilters(nsIFilePicker.filterImages);
-
- let res = filePicker.show();
- if(res == nsIFilePicker.returnOK)
- {
- this._editorImage.value = Services.io.newFileURI(filePicker.file).spec;
- this._updateImageControllDisable();
- this._buildCSS();
- }
- ]]></body>
- </method>
-
- <method name="_imageClear">
- <body><![CDATA[
- this._editorImage.value = "";
- this._editorImageRepeatX.value = "repeat";
- this._editorImageRepeatY.value = "repeat";
- this._editorImagePositionX.value = "left";
- this._editorImagePositionY.value = "top";
- this._editorImageOffsetX.value = 0;
- this._editorImageOffsetY.value = 0;
- this._editorImageOffsetUnitX.value = "px";
- this._editorImageOffsetUnitY.value = "px";
- this._updateImageControllDisable();
- this._buildCSS();
- ]]></body>
- </method>
-
- <method name="_processEvent">
- <parameter name="event"/>
- <body><![CDATA[
- if(!("css-bg-editor-css-text" == event.originalTarget.getAttribute("anonid")
- || "css-bg-editor-css-text" == document.getBindingParent(event.originalTarget).getAttribute("anonid")))
- {
- event.stopPropagation();
- }
-
- //Components.utils.reportError("Editor event " + event.type + " on " + event.originalTarget.tagName + "::" + event.originalTarget.getAttribute("anonid"));
- ]]></body>
- </method>
-
- <method name="_setSelectedItemSafe">
- <parameter name="aElement"/>
- <parameter name="aValue"/>
- <parameter name="aDefault"/>
- <body><![CDATA[
- aElement.value = aValue;
- if(!aElement.selectedItem || aElement.selectedItem.value != aValue)
- {
- aElement.value = aDefault;
- return false;
- }
- return true;
- ]]></body>
- </method>
-
- <method name="_updateImageControllDisable">
- <body><![CDATA[
- if(this.disabled || !this._editorImage.value)
- {
- this.setAttribute("no-image", "true");
- this._updatePositionOffsetXDisabled(true);
- this._updatePositionOffsetYDisabled(true);
- }
- else
- {
- this.removeAttribute("no-image");
- this._updatePositionOffsetXDisabled(false);
- this._updatePositionOffsetYDisabled(false);
- }
- ]]></body>
- </method>
-
- <method name="_updateMode">
- <body><![CDATA[
- if(this._editorMode.selectedIndex == this._editorDeck.selectedIndex)
- {
- return;
- }
-
- this.setAdvanced(((this._editorMode.selectedIndex == 1) ? true : false), true);
- ]]></body>
- </method>
-
- <method name="_updatePositionOffsetXDisabled">
- <parameter name="aVal"/>
- <body><![CDATA[
- let bgPX = this._editorImagePositionX.value;
- let disableOffsetX = aVal || (bgPX != "offset");// || bgPX == "center");
- this._editorImageOffsetX.disabled = disableOffsetX;
- this._editorImageOffsetUnitX.disabled = disableOffsetX;
- ]]></body>
- </method>
-
- <method name="_updatePositionOffsetYDisabled">
- <parameter name="aVal"/>
- <body><![CDATA[
- let bgPY = this._editorImagePositionY.value;
- var disableOffsetY = aVal || (bgPY != "offset");// || bgPY == "center");
- this._editorImageOffsetY.disabled = disableOffsetY;
- this._editorImageOffsetUnitY.disabled = disableOffsetY;
- ]]></body>
- </method>
-
- <method name="_updatePositionX">
- <body><![CDATA[
- this._updatePositionOffsetXDisabled(false);
- this._buildCSS();
- ]]></body>
- </method>
-
- <method name="_updatePositionY">
- <body><![CDATA[
- this._updatePositionOffsetYDisabled(false);
- this._buildCSS();
- ]]></body>
- </method>
- </implementation>
-
- <handlers>
- <handler event="command"><![CDATA[
- this._processEvent(event);
- ]]></handler>
-
- <handler event="change"><![CDATA[
- this._processEvent(event);
- ]]></handler>
-
- <handler event="input"><![CDATA[
- this._processEvent(event);
- ]]></handler>
-
- <handler event="select"><![CDATA[
- this._processEvent(event);
- ]]></handler>
- </handlers>
- </binding>
+ </xul:menupopup>
+ </xul:menulist>
+ </xul:groupbox>
+
+ <xul:groupbox>
+ <xul:caption label="&status4evar.editor.css.image.position;" xbl:inherits="disabled=no-image" />
+ <xul:menulist anonid="css-bg-editor-image-position-x" sizetopopup="always" onselect="this._editor._updatePositionX();" xbl:inherits="disabled=no-image">
+ <xul:menupopup>
+ <xul:menuitem label="&status4evar.option.left;" value="left" />
+ <xul:menuitem label="&status4evar.option.center;" value="center" />
+ <xul:menuitem label="&status4evar.option.right;" value="right" />
+ <xul:menuitem label="&status4evar.option.offset;" value="offset" />
+ </xul:menupopup>
+ </xul:menulist>
+ <xul:separator class="groove" orient="horizontal" />
+ <xul:menulist anonid="css-bg-editor-image-position-y" sizetopopup="always" onselect="this._editor._updatePositionY();" xbl:inherits="disabled=no-image">
+ <xul:menupopup>
+ <xul:menuitem label="&status4evar.option.top;" value="top" />
+ <xul:menuitem label="&status4evar.option.center;" value="center" />
+ <xul:menuitem label="&status4evar.option.bottom;" value="bottom" />
+ <xul:menuitem label="&status4evar.option.offset;" value="offset" />
+ </xul:menupopup>
+ </xul:menulist>
+ </xul:groupbox>
+
+ <xul:groupbox>
+ <xul:caption label="&status4evar.editor.css.image.offset;" xbl:inherits="disabled=no-image" />
+ <xul:hbox>
+ <xul:textbox anonid="css-bg-editor-image-offset-x" type="number" size="4" min="-65535" onchange="this._editor._buildCSS();" />
+ <xul:menulist anonid="css-bg-editor-image-offset-unit-x" sizetopopup="always" onselect="this._editor._buildCSS();">
+ <xul:menupopup>
+ <xul:menuitem label="%" value="%" />
+ <xul:menuitem label="px" value="px" />
+ <xul:menuitem label="em" value="em" />
+ <xul:menuitem label="in" value="in" />
+ <xul:menuitem label="cm" value="cm" />
+ <xul:menuitem label="mm" value="mm" />
+ <xul:menuitem label="pt" value="pt" />
+ <xul:menuitem label="pc" value="pc" />
+ </xul:menupopup>
+ </xul:menulist>
+ </xul:hbox>
+ <xul:separator class="groove" orient="horizontal" />
+ <xul:hbox>
+ <xul:textbox anonid="css-bg-editor-image-offset-y" type="number" size="4" min="-65535" onchange="this._editor._buildCSS();" />
+ <xul:menulist anonid="css-bg-editor-image-offset-unit-y" sizetopopup="always" onselect="this._editor._buildCSS();">
+ <xul:menupopup>
+ <xul:menuitem label="%" value="%" />
+ <xul:menuitem label="px" value="px" />
+ <xul:menuitem label="em" value="em" />
+ <xul:menuitem label="in" value="in" />
+ <xul:menuitem label="cm" value="cm" />
+ <xul:menuitem label="mm" value="mm" />
+ <xul:menuitem label="pt" value="pt" />
+ <xul:menuitem label="pc" value="pc" />
+ </xul:menupopup>
+ </xul:menulist>
+ </xul:hbox>
+ </xul:groupbox>
+ </xul:hbox>
+ </xul:vbox>
+
+ <xul:textbox anonid="css-bg-editor-css-text" multiline="true" rows="6" xbl:inherits="disabled" />
+ </xul:deck>
+ </xul:vbox>
+
+ <xul:hbox align="center" pack="end">
+ <children includes="progressmeter|toolbox" />
+ <xul:label xbl:inherits="disabled">&status4evar.editor.label;</xul:label>
+ <xul:menulist anonid="css-bg-editor-mode-menu" sizetopopup="always" onselect="this._editor._updateMode();" xbl:inherits="disabled">
+ <xul:menupopup>
+ <xul:menuitem label="&status4evar.option.simple;" />
+ <xul:menuitem label="&status4evar.option.advanced;" />
+ </xul:menupopup>
+ </xul:menulist>
+ </xul:hbox>
+ </content>
+
+ <implementation>
+ <constructor><![CDATA[
+ [
+ "_editorColor",
+ "_editorImageBrowse",
+ "_editorImageClear",
+ "_editorImageRepeatX",
+ "_editorImageRepeatY",
+ "_editorImagePositionX",
+ "_editorImagePositionY",
+ "_editorImageOffsetX",
+ "_editorImageOffsetY",
+ "_editorImageOffsetUnitX",
+ "_editorImageOffsetUnitY",
+ "_editorMode"
+ ].forEach(function(prop)
+ {
+ this[prop]._editor = this;
+ }, this);
+
+ this.setAdvanced(true, false);
+ ]]></constructor>
+
+ <destructor><![CDATA[
+ ]]></destructor>
+
+ <field name="_disableBuildCSS"><![CDATA[
+ true
+ ]]></field>
+
+ <field name="_editorColor" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-color");
+ ]]></field>
+
+ <field name="_editorCSS" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-css-text");
+ ]]></field>
+
+ <field name="_editorDeck" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-deck");
+ ]]></field>
+
+ <field name="_editorImage" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image");
+ ]]></field>
+
+ <field name="_editorImageBrowse" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-browse");
+ ]]></field>
+
+ <field name="_editorImageClear" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-clear");
+ ]]></field>
+
+ <field name="_editorImageRepeatX" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-repeat-x");
+ ]]></field>
+
+ <field name="_editorImageRepeatY" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-repeat-y");
+ ]]></field>
+
+ <field name="_editorImagePositionX" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-position-x");
+ ]]></field>
+
+ <field name="_editorImagePositionY" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-position-y");
+ ]]></field>
+
+ <field name="_editorImageOffsetX" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-offset-x");
+ ]]></field>
+
+ <field name="_editorImageOffsetY" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-offset-y");
+ ]]></field>
+
+ <field name="_editorImageOffsetUnitX" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-offset-unit-x");
+ ]]></field>
+
+ <field name="_editorImageOffsetUnitY" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-image-offset-unit-y");
+ ]]></field>
+
+ <field name="_editorMode" readonly="true"><![CDATA[
+ document.getAnonymousElementByAttribute(this, "anonid", "css-bg-editor-mode-menu");
+ ]]></field>
+
+ <field name="_initialized"><![CDATA[
+ false
+ ]]></field>
+
+ <field name="_reRGB" readonly="true"><![CDATA[
+ /^rgb\((\d+), (\d+), (\d+)\)$/
+ ]]></field>
+
+ <field name="_reURL" readonly="true"><![CDATA[
+ /^url\(\s*['"]?(.+?)['"]?\s*\)$/
+ ]]></field>
+
+ <field name="_reBgPosition" readonly="true"><![CDATA[
+ /^(left|center|right)? ?(-?\d+[^\s\d]+)? ?(top|center|bottom)? ?(-?\d+[^\s\d]+)?$/
+ ]]></field>
+
+ <field name="_reCSSUnit" readonly="true"><![CDATA[
+ /^(-?\d+)([^\s\d]+)$/
+ ]]></field>
+
+ <field name="_strings" readonly="true"><![CDATA[
+ document.getElementById("bundle_status4evar");
+ ]]></field>
+
+ <property name="value">
+ <getter><![CDATA[
+ return this._editorCSS.value;
+ ]]></getter>
+ <setter><![CDATA[
+ this._editorCSS.value = val;
+
+ if(!this._initialized)
+ {
+ this.setAdvanced(false, false);
+ this._initialized = true;
+ }
+
+ return val;
+ ]]></setter>
+ </property>
+
+ <property name="disabled">
+ <getter><![CDATA[
+ return this.getAttribute("disabled") == "true";
+ ]]></getter>
+ <setter><![CDATA[
+ if(val)
+ {
+ this.setAttribute("disabled", "true");
+ }
+ else
+ {
+ this.removeAttribute("disabled");
+ }
+
+ this._updateImageControllDisable();
+
+ return val;
+ ]]></setter>
+ </property>
+
+ <method name="setAdvanced">
+ <parameter name="aVal"/>
+ <parameter name="aPrompt"/>
+ <body><![CDATA[
+ if(!aVal)
+ {
+ let success = this._parseCSS();
+ if(!success)
+ {
+ let result = aPrompt && Services.prompt.confirm(window,
+ this._strings.getString("simpleEditorTitle"),
+ this._strings.getString("simpleEditorMessage"));
+ if(result)
+ { // Continue to simple mode
+ this._buildCSS();
+ }
+ else
+ { // Stay on advanced mode
+ aVal = true;
+ }
+ }
+ }
+
+ this._disableBuildCSS = aVal;
+ this._editorDeck.selectedIndex = ((aVal) ? 1 : 0);
+ this._editorMode.selectedIndex = ((aVal) ? 1 : 0);
+ ]]></body>
+ </method>
+
+ <method name="_buildCSS">
+ <body><![CDATA[
+ if(this._disableBuildCSS)
+ {
+ return;
+ }
+
+ let cssVal = this._editorColor.color;
+ let imgVal = this._editorImage.value;
+ if(imgVal)
+ {
+ cssVal += " url(\"" + imgVal + "\")";
+
+ //
+ // Print the background repeat
+ //
+ let bgRX = this._editorImageRepeatX.value;
+ let bgRY = this._editorImageRepeatY.value;
+ if(bgRX == "repeat" && bgRY == "no-repeat")
+ {
+ cssVal += " repeat-x";
+ }
+ else if(bgRX == "no-repeat" && bgRY == "repeat")
+ {
+ cssVal += " repeat-y";
+ }
+ else
+ {
+ cssVal += " " + bgRX;
+ if(bgRX != bgRY)
+ {
+ cssVal += " " + bgRY;
+ }
+ }
+
+ //
+ // Print the background position
+ //
+ let bgPX = this._editorImagePositionX.value;
+ let bgPOX = this._editorImageOffsetX.value;
+ if(bgPX != "offset")
+ {
+ cssVal += " " + bgPX;
+ }
+ else
+ {
+ cssVal += " " + bgPOX + this._editorImageOffsetUnitX.value;
+ }
+
+ let bgPY = this._editorImagePositionY.value;
+ let bgPOY = this._editorImageOffsetY.value;
+ if(bgPY != "offset")
+ {
+ cssVal += " " + bgPY;
+ }
+ else
+ {
+ cssVal += " " + bgPOY + this._editorImageOffsetUnitY.value;
+ }
+ }
+
+ this._editorCSS.value = cssVal;
+
+ let event = document.createEvent("Event");
+ event.initEvent("change", true, true);
+ this._editorCSS.dispatchEvent(event);
+ ]]></body>
+ </method>
+
+ <method name="_parseCSS">
+ <body><![CDATA[
+ let retVal = true;
+
+ let cssParser = document.createElement("div");
+ cssParser.style.background = this._editorCSS.value;
+ if(!cssParser.style.background)
+ {
+ Components.utils.reportError("Error parsing background CSS rule: " + this._editorCSS.value);
+ cssParser.style.background = "#33FF33";
+ retVal = false;
+ }
+
+ //
+ // Parse the background color
+ //
+ let bgC = cssParser.style.backgroundColor;
+ if(this._reRGB.test(bgC))
+ {
+ let digits = this._reRGB.exec(bgC);
+
+ let red = parseInt(digits[1]);
+ let green = parseInt(digits[2]);
+ let blue = parseInt(digits[3]);
+
+ let rgb = blue | (green << 8) | (red << 16);
+ bgC = "#" + rgb.toString(16);
+ }
+ else
+ {
+ Components.utils.reportError("Error parsing background-color value: " + bgC);
+ bgC = "#33FF33";
+ retVal = false;
+ }
+
+ //
+ // Parse the background image
+ //
+ let bgI = cssParser.style.backgroundImage;
+ if(bgI != "none" && !this._reURL.test(bgI))
+ {
+ Components.utils.reportError("Error parsing background-image value: " + bgI);
+ bgI = "none";
+ retVal = false;
+ }
+ bgI = ((bgI != "none") ? this._reURL.exec(bgI)[1].trim() : "");
+
+ //
+ // Parse the background repeat
+ //
+ let bgR = cssParser.style.backgroundRepeat.split(" ");
+ let bgRX = bgR[0];
+ if(bgRX == "repeat-x")
+ {
+ bgRX = "repeat";
+ }
+ else if(bgRX == "repeat-y")
+ {
+ bgRX = "no-repeat";
+ }
+
+ let bgRY = bgR[bgR.length - 1];
+ if(bgRY == "repeat-x")
+ {
+ bgRY = "no-repeat";
+ }
+ else if(bgRY == "repeat-y")
+ {
+ bgRY = "repeat";
+ }
+
+ //
+ // Parse the background position
+ //
+ let bgP = cssParser.style.backgroundPosition;
+ let bgPParts = this._reBgPosition.exec(bgP);
+ let bgPValues = new Array();
+ for(let i = 1; i <= 4; i++)
+ {
+ if(bgPParts[i])
+ {
+ bgPValues.push({
+ "value": bgPParts[i],
+ "group": i
+ });
+ }
+ }
+
+ if(bgPValues.length == 1)
+ {
+ bgPValues.splice(((bgPValues[0].group == 2) ? 0 : 1), 0, {
+ "value": "center",
+ "group": ((bgPValues[0].group == 2) ? 0 : 2)
+ });
+ }
+
+ if(bgPValues.length == 2 && bgPValues[1].group == 2)
+ {
+ bgPValues[1].group = 4;
+ }
+
+ for(let i = 0; i < 4; i++)
+ {
+ let group = (i + 1);
+ if(bgPValues[i] != undefined && bgPValues[i].group == group)
+ {
+ continue;
+ }
+
+ let tmp = "0px";
+ switch(i)
+ {
+ case 0:
+ tmp = "offset";
+ break;
+ case 2:
+ tmp = "offset";
+ break;
+ }
+
+ bgPValues.splice(i, 0, {
+ "value": tmp,
+ "group": group
+ });
+ }
+
+ let bgPOXParts = this._reCSSUnit.exec(bgPValues[1].value);
+ let bgPOYParts = this._reCSSUnit.exec(bgPValues[3].value);
+
+ //
+ // Parse the background size
+ //
+
+ //
+ // Initialize the UI
+ //
+ let disableBuildCSS = this._disableBuildCSS;
+ this._disableBuildCSS = true;
+
+ this._editorColor.color = bgC;
+ this._editorImage.value = bgI;
+ this._editorImageOffsetX.value = bgPOXParts[1];
+ this._editorImageOffsetY.value = bgPOYParts[1];
+
+ [
+ [this._editorImageRepeatX, bgRX, "repeat", "repeat X"],
+ [this._editorImageRepeatY, bgRY, "repeat", "repeat Y"],
+ [this._editorImagePositionX, bgPValues[0].value, "left", "position X"],
+ [this._editorImagePositionY, bgPValues[2].value, "top", "position Y"],
+ [this._editorImageOffsetUnitX, bgPOXParts[2], "px", "offset X unit"],
+ [this._editorImageOffsetUnitY, bgPOYParts[2], "px", "offset Y unit"]
+ ].forEach(function(info)
+ {
+ if(!this._setSelectedItemSafe(info[0], info[1], info[2]))
+ {
+ Components.utils.reportError("Error setting " + info[3] + " to " + info[1]);
+ retVal = false;
+ }
+ }, this);
+
+ this._updateImageControllDisable();
+
+ this._disableBuildCSS = disableBuildCSS;
+
+ return retVal;
+ ]]></body>
+ </method>
+
+ <method name="_imageBrowse">
+ <body><![CDATA[
+ let nsIFilePicker = Components.interfaces.nsIFilePicker;
+ let filePicker = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
+ filePicker.init(window, this._strings.getString("imageSelectTitle"), nsIFilePicker.modeOpen);
+ filePicker.appendFilters(nsIFilePicker.filterImages);
+
+ let res = filePicker.show();
+ if(res == nsIFilePicker.returnOK)
+ {
+ this._editorImage.value = Services.io.newFileURI(filePicker.file).spec;
+ this._updateImageControllDisable();
+ this._buildCSS();
+ }
+ ]]></body>
+ </method>
+
+ <method name="_imageClear">
+ <body><![CDATA[
+ this._editorImage.value = "";
+ this._editorImageRepeatX.value = "repeat";
+ this._editorImageRepeatY.value = "repeat";
+ this._editorImagePositionX.value = "left";
+ this._editorImagePositionY.value = "top";
+ this._editorImageOffsetX.value = 0;
+ this._editorImageOffsetY.value = 0;
+ this._editorImageOffsetUnitX.value = "px";
+ this._editorImageOffsetUnitY.value = "px";
+ this._updateImageControllDisable();
+ this._buildCSS();
+ ]]></body>
+ </method>
+
+ <method name="_processEvent">
+ <parameter name="event"/>
+ <body><![CDATA[
+ if(!("css-bg-editor-css-text" == event.originalTarget.getAttribute("anonid")
+ || "css-bg-editor-css-text" == document.getBindingParent(event.originalTarget).getAttribute("anonid")))
+ {
+ event.stopPropagation();
+ }
+
+ //Components.utils.reportError("Editor event " + event.type + " on " + event.originalTarget.tagName + "::" + event.originalTarget.getAttribute("anonid"));
+ ]]></body>
+ </method>
+
+ <method name="_setSelectedItemSafe">
+ <parameter name="aElement"/>
+ <parameter name="aValue"/>
+ <parameter name="aDefault"/>
+ <body><![CDATA[
+ aElement.value = aValue;
+ if(!aElement.selectedItem || aElement.selectedItem.value != aValue)
+ {
+ aElement.value = aDefault;
+ return false;
+ }
+ return true;
+ ]]></body>
+ </method>
+
+ <method name="_updateImageControllDisable">
+ <body><![CDATA[
+ if(this.disabled || !this._editorImage.value)
+ {
+ this.setAttribute("no-image", "true");
+ this._updatePositionOffsetXDisabled(true);
+ this._updatePositionOffsetYDisabled(true);
+ }
+ else
+ {
+ this.removeAttribute("no-image");
+ this._updatePositionOffsetXDisabled(false);
+ this._updatePositionOffsetYDisabled(false);
+ }
+ ]]></body>
+ </method>
+
+ <method name="_updateMode">
+ <body><![CDATA[
+ if(this._editorMode.selectedIndex == this._editorDeck.selectedIndex)
+ {
+ return;
+ }
+
+ this.setAdvanced(((this._editorMode.selectedIndex == 1) ? true : false), true);
+ ]]></body>
+ </method>
+
+ <method name="_updatePositionOffsetXDisabled">
+ <parameter name="aVal"/>
+ <body><![CDATA[
+ let bgPX = this._editorImagePositionX.value;
+ let disableOffsetX = aVal || (bgPX != "offset");// || bgPX == "center");
+ this._editorImageOffsetX.disabled = disableOffsetX;
+ this._editorImageOffsetUnitX.disabled = disableOffsetX;
+ ]]></body>
+ </method>
+
+ <method name="_updatePositionOffsetYDisabled">
+ <parameter name="aVal"/>
+ <body><![CDATA[
+ let bgPY = this._editorImagePositionY.value;
+ var disableOffsetY = aVal || (bgPY != "offset");// || bgPY == "center");
+ this._editorImageOffsetY.disabled = disableOffsetY;
+ this._editorImageOffsetUnitY.disabled = disableOffsetY;
+ ]]></body>
+ </method>
+
+ <method name="_updatePositionX">
+ <body><![CDATA[
+ this._updatePositionOffsetXDisabled(false);
+ this._buildCSS();
+ ]]></body>
+ </method>
+
+ <method name="_updatePositionY">
+ <body><![CDATA[
+ this._updatePositionOffsetYDisabled(false);
+ this._buildCSS();
+ ]]></body>
+ </method>
+ </implementation>
+
+ <handlers>
+ <handler event="command"><![CDATA[
+ this._processEvent(event);
+ ]]></handler>
+
+ <handler event="change"><![CDATA[
+ this._processEvent(event);
+ ]]></handler>
+
+ <handler event="input"><![CDATA[
+ this._processEvent(event);
+ ]]></handler>
+
+ <handler event="select"><![CDATA[
+ this._processEvent(event);
+ ]]></handler>
+ </handlers>
+ </binding>
</bindings>
diff --git a/application/palemoon/components/statusbar/content/prefs.xul b/application/palemoon/components/statusbar/content/prefs.xul
index d10dc006a..dd4158246 100644
--- a/application/palemoon/components/statusbar/content/prefs.xul
+++ b/application/palemoon/components/statusbar/content/prefs.xul
@@ -5,8 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE prefwindow [
- <!ENTITY % prefsDTD SYSTEM "chrome://browser/locale/statusbar/statusbar-prefs.dtd">
- %prefsDTD;
+ <!ENTITY % prefsDTD SYSTEM "chrome://browser/locale/statusbar/statusbar-prefs.dtd">
+ %prefsDTD;
]>
<?xml-stylesheet href="chrome://global/skin/config.css" type="text/css" ?>
@@ -23,275 +23,275 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="status4evarPrefs.onPrefWindowLoad();" onunload="status4evarPrefs.onPrefWindowUnLoad();">
- <stringbundleset id="stringbundleset">
- <stringbundle id="bundle_status4evar" src="chrome://browser/locale/statusbar/prefs.properties" />
- </stringbundleset>
- <script type="application/javascript" src="chrome://browser/content/statusbar/prefs.js" />
+ <stringbundleset id="stringbundleset">
+ <stringbundle id="bundle_status4evar" src="chrome://browser/locale/statusbar/prefs.properties" />
+ </stringbundleset>
+ <script type="application/javascript" src="chrome://browser/content/statusbar/prefs.js" />
- <prefpane id="status4evar-pane-status" label="&status4evar.pane.status;">
- <preferences>
- <preference id="status4evar-pref-status" name="status4evar.status" type="int" />
- <preference id="status4evar-pref-status-default" name="status4evar.status.default" type="bool" />
- <preference id="status4evar-pref-status-network" name="status4evar.status.network" type="bool"
- onchange="status4evarPrefs.statusNetworkChanged();" />
- <preference id="status4evar-pref-status-network-xhr" name="status4evar.status.network.xhr" type="bool" />
- <preference id="status4evar-pref-status-timeout" name="status4evar.status.timeout" type="int"
- onchange="status4evarPrefs.statusTimeoutChanged();" />
- <preference id="status4evar-pref-status-linkOver" name="status4evar.status.linkOver" type="int" />
- <preference id="status4evar-pref-status-linkOver-delay-show" name="status4evar.status.linkOver.delay.show" type="int" />
- <preference id="status4evar-pref-status-linkOver-delay-hide" name="status4evar.status.linkOver.delay.hide" type="int" />
- <preference id="status4evar-pref-status-toolbar-maxLength" name="status4evar.status.toolbar.maxLength" type="int"
- onchange="status4evarPrefs.textLengthChanged();" />
- <preference id="status4evar-pref-status-popup-invertMirror" name="status4evar.status.popup.invertMirror" type="bool" />
- <preference id="status4evar-pref-status-popup-mouseMirror" name="status4evar.status.popup.mouseMirror" type="bool" />
- <preference id="toolkit-pref-dom-status-change" name="dom.disable_window_status_change" type="bool" inverted="true" />
- </preferences>
-
- <commandset id="status4evar-commandset-status">
- <command id="status4evar-command-status-timeout" oncommand="status4evarPrefs.statusTimeoutToggle();" />
- <command id="status4evar-command-status-toolbar-maxLength" oncommand="status4evarPrefs.textLengthToggle();" />
- </commandset>
-
- <tabbox id="status4evar-tabbox-status" flex="1">
- <tabs id="status4evar-tabs-status">
- <tab id="status4evar-tab-status-general" label="&status4evar.tab.general;" />
- <tab id="status4evar-tab-status-toolbar" label="&status4evar.tab.toolbar;" />
- <tab id="status4evar-tab-status-popup" label="&status4evar.tab.popup;" />
- </tabs>
-
- <tabpanels id="status4evar-tabpanels-status" flex="1">
- <tabpanel id="status4evar-tabpanel-status-general" orient="vertical">
- <groupbox id="status4evar-status-general-status">
- <caption label="&status4evar.status.general.status.caption;" />
-
- <hbox align="center">
- <label id="status4evar-status-label" control="status4evar-status-menu">&status4evar.status.label;</label>
- <menulist id="status4evar-status-menu" preference="status4evar-pref-status" sizetopopup="always">
- <menupopup>
- <menuitem label="&status4evar.option.none;" value="0" />
- <menuitem label="&status4evar.option.toolbar;" value="1" />
- <menuitem label="&status4evar.option.popup;" value="3" />
- </menupopup>
- </menulist>
- </hbox>
-
- <hbox align="center">
- <checkbox id="status4evar-status-timeout-check" label="&status4evar.status.timeout.label;"
- command="status4evar-command-status-timeout" />
- <textbox id="status4evar-status-timeout-value" preference="status4evar-pref-status-timeout" type="number" size="4"
- onsyncfrompreference="return status4evarPrefs.statusTimeoutSync();" />
- <label id="status4evar-status-timeout-unit">&status4evar.unit.seconds;</label>
- </hbox>
-
- <checkbox id="status4evar-status-default-check" preference="status4evar-pref-status-default" label="&status4evar.status.default.label;" />
-
- <checkbox id="status4evar-status-network-check" preference="status4evar-pref-status-network" label="&status4evar.status.network.label;"
- onsyncfrompreference="return status4evarPrefs.statusNetworkSync();" />
-
- <hbox align="center" class="indent">
- <checkbox id="status4evar-status-network-xhr-check" preference="status4evar-pref-status-network-xhr" label="&status4evar.status.network.xhr.label;" />
- </hbox>
-
- <checkbox id="toolkit-dom-status-change-check" preference="toolkit-pref-dom-status-change" label="&toolkit.dom.status.change.label;" />
- </groupbox>
-
- <groupbox id="status4evar-status-general-linkOver">
- <caption label="&status4evar.status.general.linkOver.caption;" />
-
- <hbox align="center">
- <label id="status4evar-status-linkOver-label" control="status4evar-status-linkOver-menu">&status4evar.status.linkOver.label;</label>
- <menulist id="status4evar-status-linkOver-menu" preference="status4evar-pref-status-linkOver" sizetopopup="always">
- <menupopup>
- <menuitem label="&status4evar.option.none;" value="0" />
- <menuitem label="&status4evar.option.toolbar;" value="1" />
- <menuitem label="&status4evar.option.popup;" value="3" />
- </menupopup>
- </menulist>
- </hbox>
-
- <hbox align="center">
- <label id="status4evar-status-linkOver-delay-show-label" control="status4evar-status-linkOver-delay-show-value">&status4evar.status.linkOver.delay.show.label;</label>
- <textbox id="status4evar-status-linkOver-delay-show-value" preference="status4evar-pref-status-linkOver-delay-show" type="number" size="5" />
- <label id="status4evar-status-linkOver-delay-show-unit">&status4evar.unit.milliseconds;</label>
- </hbox>
-
- <hbox align="center">
- <label id="status4evar-status-linkOver-delay-hide-label" control="status4evar-status-linkOver-delay-hide-value">&status4evar.status.linkOver.delay.hide.label;</label>
- <textbox id="status4evar-status-linkOver-delay-hide-value" preference="status4evar-pref-status-linkOver-delay-hide" type="number" size="5" />
- <label id="status4evar-status-linkOver-delay-hide-unit">&status4evar.unit.milliseconds;</label>
- </hbox>
- </groupbox>
-
- </tabpanel>
-
- <tabpanel id="status4evar-tabpanel-status-toolbar" orient="vertical">
- <hbox align="center">
- <checkbox id="status4evar-status-toolbar-maxLength-check" label="&status4evar.status.toolbar.maxLength.label;"
- command="status4evar-command-status-toolbar-maxLength" />
- <textbox id="status4evar-status-toolbar-maxLength-value" preference="status4evar-pref-status-toolbar-maxLength" type="number" size="4"
- onsyncfrompreference="return status4evarPrefs.textLengthSync();" />
- <label id="status4evar-status-toolbar-maxLength-unit">&status4evar.unit.px;</label>
- </hbox>
- </tabpanel>
-
- <tabpanel id="status4evar-tabpanel-status-popup" orient="vertical">
- <checkbox id="status4evar-status-popup-invertMirror-check" preference="status4evar-pref-status-popup-invertMirror" label="&status4evar.status.popup.invertMirror.label;" />
-
- <checkbox id="status4evar-status-popup-mouseMirror-check" preference="status4evar-pref-status-popup-mouseMirror" label="&status4evar.status.popup.mouseMirror.label;" />
- </tabpanel>
-
- </tabpanels>
- </tabbox>
- </prefpane>
-
- <prefpane id="status4evar-pane-progress" label="&status4evar.pane.progress;">
- <preferences>
- <preference id="status4evar-pref-progress-toolbar-force" name="status4evar.progress.toolbar.force" type="bool" />
- <preference id="status4evar-pref-progress-toolbar-style" name="status4evar.progress.toolbar.style" type="bool"
- onchange="status4evarPrefs.progressToolbarStyleChanged();" />
- <preference id="status4evar-pref-progress-toolbar-css" name="status4evar.progress.toolbar.css" type="string"
- onchange="status4evarPrefs.progressToolbarCSSChanged();" />
- </preferences>
-
- <commandset id="status4evar-commandset-status">
- </commandset>
-
- <checkbox id="status4evar-progress-toolbar-force-check" preference="status4evar-pref-progress-toolbar-force" label="&status4evar.progress.toolbar.force.label;" />
-
- <checkbox id="status4evar-progress-toolbar-style-check" preference="status4evar-pref-progress-toolbar-style" label="&status4evar.progress.style.label;"
- onsyncfrompreference="return status4evarPrefs.progressToolbarStyleSync();" />
-
- <vbox class="css-bg-editor" preference="status4evar-pref-progress-toolbar-css" preference-editable="true" flex="1">
- <progressmeter id="status4evar-progress-bar" value="75" flex="1" />
- </vbox>
- </prefpane>
-
- <prefpane id="status4evar-pane-download" label="&status4evar.pane.download;">
- <preferences>
- <preference id="status4evar-pref-download-button-action" name="status4evar.download.button.action" type="int" />
- <preference id="status4evar-pref-download-color-active" name="status4evar.download.color.active" type="string" />
- <preference id="status4evar-pref-download-color-paused" name="status4evar.download.color.paused" type="string" />
- <preference id="status4evar-pref-download-force" name="status4evar.download.force" type="bool" />
- <preference id="status4evar-pref-download-label" name="status4evar.download.label" type="int" />
- <preference id="status4evar-pref-download-label-force" name="status4evar.download.label.force" type="bool" />
- <preference id="status4evar-pref-download-notify-animate" name="status4evar.download.notify.animate" type="bool" />
- <preference id="status4evar-pref-download-notify-timeout" name="status4evar.download.notify.timeout" type="int" />
- <preference id="status4evar-pref-download-progress" name="status4evar.download.progress" type="int" />
- <preference id="status4evar-pref-download-tooltip" name="status4evar.download.tooltip" type="int" />
-
- <preference id="status4evar-pref-download-button-action-command" name="status4evar.download.button.action.command" type="string"/>
- </preferences>
-
- <commandset id="status4evar-commandset-download">
- <command id="status4evar-command-download-progress" oncommand="status4evarPrefs.downloadProgressToggle();" />
- </commandset>
-
- <checkbox id="status4evar-download-force-check" preference="status4evar-pref-download-force" label="&status4evar.download.force.label;" />
-
- <checkbox id="status4evar-download-label-force-check" preference="status4evar-pref-download-label-force" label="&status4evar.download.label.force.label;" />
-
- <hbox align="center">
- <label id="status4evar-download-label-label" control="status4evar-download-label-menu">&status4evar.download.label.label;</label>
- <menulist id="status4evar-download-label-menu" preference="status4evar-pref-download-label" sizetopopup="always">
- <menupopup>
- <menuitem value="0" label="&status4evar.option.dlcount;" />
- <menuitem value="1" label="&status4evar.option.dltime;" />
- <menuitem value="2" label="&status4evar.option.both;" />
- </menupopup>
- </menulist>
- </hbox>
-
- <hbox align="center">
- <label id="status4evar-download-tooltip-label" control="status4evar-download-tooltip-menu">&status4evar.download.tooltip.label;</label>
- <menulist id="status4evar-download-tooltip-menu" preference="status4evar-pref-download-tooltip" sizetopopup="always">
- <menupopup>
- <menuitem value="0" label="&status4evar.option.dlcount;" />
- <menuitem value="1" label="&status4evar.option.dltime;" />
- <menuitem value="2" label="&status4evar.option.both;" />
- </menupopup>
- </menulist>
- </hbox>
-
- <hbox align="center">
- <label id="status4evar-download-button-action-label" control="status4evar-download-button-action-menu">&status4evar.download.button.action.label;</label>
- <menulist id="status4evar-download-button-action-menu" preference="status4evar-pref-download-button-action" sizetopopup="always">
- <menupopup>
- <menuitem value="0" label="&status4evar.option.nothing;" />
- <menuitem value="1" label="&status4evar.option.firefoxdefault;" />
- <menuitem value="2" label="&status4evar.option.download.library;" />
- <menuitem value="3" label="&status4evar.option.download.tab;" />
- <menuitem value="4" label="&status4evar.option.download.thirdparty;" id="status4evar-download-button-action-menu-thirdparty" />
- </menupopup>
- </menulist>
- </hbox>
-
- <hbox align="center">
- <label id="status4evar-download-notify-timeout-label" control="status4evar-download-notify-timeout-value">&status4evar.download.notify.timeout.label;</label>
- <textbox id="status4evar-download-notify-timeout-value" preference="status4evar-pref-download-notify-timeout" type="number" size="3" />
- <label id="status4evar-download-notify-timeout-unit">&status4evar.unit.seconds;</label>
- </hbox>
-
- <checkbox id="status4evar-download-notify-animate-check" preference="status4evar-pref-download-notify-animate" label="&status4evar.download.notify.animate.label;" />
-
- <checkbox id="status4evar-download-progress-check" command="status4evar-command-download-progress" label="&status4evar.download.progress.label;" />
-
- <vbox class="indent">
- <hbox align="center">
- <radiogroup id="status4evar-download-progress-radiogroup" preference="status4evar-pref-download-progress"
- onsyncfrompreference="return status4evarPrefs.downloadProgressSync();">
- <radio value="1" label="&status4evar.download.progress.average.label;" />
- <radio value="2" label="&status4evar.download.progress.max.label;" />
- <radio value="3" label="&status4evar.download.progress.min.label;" />
- </radiogroup>
- </hbox>
-
- <hbox align="center">
- <label id="status4evar-download-color-active-label" control="status4evar-download-color-active-picker">&status4evar.download.color.active.label;</label>
- <colorpicker id="status4evar-download-color-active-picker" preference="status4evar-pref-download-color-active" type="button" />
- </hbox>
-
- <hbox align="center">
- <label id="status4evar-download-color-paused-label" control="status4evar-download-color-paused-picker">&status4evar.download.color.paused.label;</label>
- <colorpicker id="status4evar-download-color-paused-picker" preference="status4evar-pref-download-color-paused" type="button" />
- </hbox>
- </vbox>
- </prefpane>
-
- <prefpane id="status4evar-pane-addonbar" label="&status4evar.pane.statusbar;">
- <preferences>
- <preference id="status4evar-pref-addonbar-borderStyle" name="status4evar.addonbar.borderStyle" type="bool" />
- <preference id="status4evar-pref-addonbar-closeButton" name="status4evar.addonbar.closeButton" type="bool" />
- <preference id="status4evar-pref-addonbar-windowGripper" name="status4evar.addonbar.windowGripper" type="bool" />
- </preferences>
-
- <checkbox id="status4evar-addonbar-borderStyle-check" preference="status4evar-pref-addonbar-borderStyle" label="&status4evar.addonbar.borderStyle;" />
-
- <checkbox id="status4evar-addonbar-closeButton-check" preference="status4evar-pref-addonbar-closeButton" label="&status4evar.addonbar.closeButton;" />
-
- <checkbox id="status4evar-addonbar-windowGripper-check" preference="status4evar-pref-addonbar-windowGripper" label="&status4evar.addonbar.windowGripper;" />
- </prefpane>
-
- <prefpane id="status4evar-pane-advanced" label="&status4evar.pane.advanced;">
- <preferences>
- <preference id="status4evar-pref-advanced-status-detectFullScreen" name="status4evar.advanced.status.detectFullScreen" type="bool" />
- <preference id="status4evar-pref-advanced-status-detectVideo" name="status4evar.advanced.status.detectVideo" type="bool" />
- <preference id="browser-pref-urlbar-trimming-enabled" name="browser.urlbar.trimURLs" type="bool" />
- </preferences>
-
- <vbox flex="1">
- <groupbox id="status4evar-status-urlbar-builtin">
- <caption label="&status4evar.status.urlbar.firefox.builtin.caption;" />
-
- <checkbox id="browser-urlbar-trimming-enabled-ckeck" preference="browser-pref-urlbar-trimming-enabled" label="&browser.urlbar.trimming.enabled.label;" />
- </groupbox>
-
- <groupbox id="status4evar-advanced-status">
- <caption label="&status4evar.pane.status;" />
-
- <checkbox id="status4evar-advanced-status-detectFullScreen-check" preference="status4evar-pref-advanced-status-detectFullScreen" label="&status4evar.advanced.status.detectFullScreen;" />
- <checkbox id="status4evar-advanced-status-detectVideo-check" preference="status4evar-pref-advanced-status-detectVideo" label="&status4evar.advanced.status.detectVideo;" />
- </groupbox>
- </vbox>
- </prefpane>
+ <prefpane id="status4evar-pane-status" label="&status4evar.pane.status;">
+ <preferences>
+ <preference id="status4evar-pref-status" name="status4evar.status" type="int" />
+ <preference id="status4evar-pref-status-default" name="status4evar.status.default" type="bool" />
+ <preference id="status4evar-pref-status-network" name="status4evar.status.network" type="bool"
+ onchange="status4evarPrefs.statusNetworkChanged();" />
+ <preference id="status4evar-pref-status-network-xhr" name="status4evar.status.network.xhr" type="bool" />
+ <preference id="status4evar-pref-status-timeout" name="status4evar.status.timeout" type="int"
+ onchange="status4evarPrefs.statusTimeoutChanged();" />
+ <preference id="status4evar-pref-status-linkOver" name="status4evar.status.linkOver" type="int" />
+ <preference id="status4evar-pref-status-linkOver-delay-show" name="status4evar.status.linkOver.delay.show" type="int" />
+ <preference id="status4evar-pref-status-linkOver-delay-hide" name="status4evar.status.linkOver.delay.hide" type="int" />
+ <preference id="status4evar-pref-status-toolbar-maxLength" name="status4evar.status.toolbar.maxLength" type="int"
+ onchange="status4evarPrefs.textLengthChanged();" />
+ <preference id="status4evar-pref-status-popup-invertMirror" name="status4evar.status.popup.invertMirror" type="bool" />
+ <preference id="status4evar-pref-status-popup-mouseMirror" name="status4evar.status.popup.mouseMirror" type="bool" />
+ <preference id="toolkit-pref-dom-status-change" name="dom.disable_window_status_change" type="bool" inverted="true" />
+ </preferences>
+
+ <commandset id="status4evar-commandset-status">
+ <command id="status4evar-command-status-timeout" oncommand="status4evarPrefs.statusTimeoutToggle();" />
+ <command id="status4evar-command-status-toolbar-maxLength" oncommand="status4evarPrefs.textLengthToggle();" />
+ </commandset>
+
+ <tabbox id="status4evar-tabbox-status" flex="1">
+ <tabs id="status4evar-tabs-status">
+ <tab id="status4evar-tab-status-general" label="&status4evar.tab.general;" />
+ <tab id="status4evar-tab-status-toolbar" label="&status4evar.tab.toolbar;" />
+ <tab id="status4evar-tab-status-popup" label="&status4evar.tab.popup;" />
+ </tabs>
+
+ <tabpanels id="status4evar-tabpanels-status" flex="1">
+ <tabpanel id="status4evar-tabpanel-status-general" orient="vertical">
+ <groupbox id="status4evar-status-general-status">
+ <caption label="&status4evar.status.general.status.caption;" />
+
+ <hbox align="center">
+ <label id="status4evar-status-label" control="status4evar-status-menu">&status4evar.status.label;</label>
+ <menulist id="status4evar-status-menu" preference="status4evar-pref-status" sizetopopup="always">
+ <menupopup>
+ <menuitem label="&status4evar.option.none;" value="0" />
+ <menuitem label="&status4evar.option.toolbar;" value="1" />
+ <menuitem label="&status4evar.option.popup;" value="3" />
+ </menupopup>
+ </menulist>
+ </hbox>
+
+ <hbox align="center">
+ <checkbox id="status4evar-status-timeout-check" label="&status4evar.status.timeout.label;"
+ command="status4evar-command-status-timeout" />
+ <textbox id="status4evar-status-timeout-value" preference="status4evar-pref-status-timeout" type="number" size="4"
+ onsyncfrompreference="return status4evarPrefs.statusTimeoutSync();" />
+ <label id="status4evar-status-timeout-unit">&status4evar.unit.seconds;</label>
+ </hbox>
+
+ <checkbox id="status4evar-status-default-check" preference="status4evar-pref-status-default" label="&status4evar.status.default.label;" />
+
+ <checkbox id="status4evar-status-network-check" preference="status4evar-pref-status-network" label="&status4evar.status.network.label;"
+ onsyncfrompreference="return status4evarPrefs.statusNetworkSync();" />
+
+ <hbox align="center" class="indent">
+ <checkbox id="status4evar-status-network-xhr-check" preference="status4evar-pref-status-network-xhr" label="&status4evar.status.network.xhr.label;" />
+ </hbox>
+
+ <checkbox id="toolkit-dom-status-change-check" preference="toolkit-pref-dom-status-change" label="&toolkit.dom.status.change.label;" />
+ </groupbox>
+
+ <groupbox id="status4evar-status-general-linkOver">
+ <caption label="&status4evar.status.general.linkOver.caption;" />
+
+ <hbox align="center">
+ <label id="status4evar-status-linkOver-label" control="status4evar-status-linkOver-menu">&status4evar.status.linkOver.label;</label>
+ <menulist id="status4evar-status-linkOver-menu" preference="status4evar-pref-status-linkOver" sizetopopup="always">
+ <menupopup>
+ <menuitem label="&status4evar.option.none;" value="0" />
+ <menuitem label="&status4evar.option.toolbar;" value="1" />
+ <menuitem label="&status4evar.option.popup;" value="3" />
+ </menupopup>
+ </menulist>
+ </hbox>
+
+ <hbox align="center">
+ <label id="status4evar-status-linkOver-delay-show-label" control="status4evar-status-linkOver-delay-show-value">&status4evar.status.linkOver.delay.show.label;</label>
+ <textbox id="status4evar-status-linkOver-delay-show-value" preference="status4evar-pref-status-linkOver-delay-show" type="number" size="5" />
+ <label id="status4evar-status-linkOver-delay-show-unit">&status4evar.unit.milliseconds;</label>
+ </hbox>
+
+ <hbox align="center">
+ <label id="status4evar-status-linkOver-delay-hide-label" control="status4evar-status-linkOver-delay-hide-value">&status4evar.status.linkOver.delay.hide.label;</label>
+ <textbox id="status4evar-status-linkOver-delay-hide-value" preference="status4evar-pref-status-linkOver-delay-hide" type="number" size="5" />
+ <label id="status4evar-status-linkOver-delay-hide-unit">&status4evar.unit.milliseconds;</label>
+ </hbox>
+ </groupbox>
+
+ </tabpanel>
+
+ <tabpanel id="status4evar-tabpanel-status-toolbar" orient="vertical">
+ <hbox align="center">
+ <checkbox id="status4evar-status-toolbar-maxLength-check" label="&status4evar.status.toolbar.maxLength.label;"
+ command="status4evar-command-status-toolbar-maxLength" />
+ <textbox id="status4evar-status-toolbar-maxLength-value" preference="status4evar-pref-status-toolbar-maxLength" type="number" size="4"
+ onsyncfrompreference="return status4evarPrefs.textLengthSync();" />
+ <label id="status4evar-status-toolbar-maxLength-unit">&status4evar.unit.px;</label>
+ </hbox>
+ </tabpanel>
+
+ <tabpanel id="status4evar-tabpanel-status-popup" orient="vertical">
+ <checkbox id="status4evar-status-popup-invertMirror-check" preference="status4evar-pref-status-popup-invertMirror" label="&status4evar.status.popup.invertMirror.label;" />
+
+ <checkbox id="status4evar-status-popup-mouseMirror-check" preference="status4evar-pref-status-popup-mouseMirror" label="&status4evar.status.popup.mouseMirror.label;" />
+ </tabpanel>
+
+ </tabpanels>
+ </tabbox>
+ </prefpane>
+
+ <prefpane id="status4evar-pane-progress" label="&status4evar.pane.progress;">
+ <preferences>
+ <preference id="status4evar-pref-progress-toolbar-force" name="status4evar.progress.toolbar.force" type="bool" />
+ <preference id="status4evar-pref-progress-toolbar-style" name="status4evar.progress.toolbar.style" type="bool"
+ onchange="status4evarPrefs.progressToolbarStyleChanged();" />
+ <preference id="status4evar-pref-progress-toolbar-css" name="status4evar.progress.toolbar.css" type="string"
+ onchange="status4evarPrefs.progressToolbarCSSChanged();" />
+ </preferences>
+
+ <commandset id="status4evar-commandset-status">
+ </commandset>
+
+ <checkbox id="status4evar-progress-toolbar-force-check" preference="status4evar-pref-progress-toolbar-force" label="&status4evar.progress.toolbar.force.label;" />
+
+ <checkbox id="status4evar-progress-toolbar-style-check" preference="status4evar-pref-progress-toolbar-style" label="&status4evar.progress.style.label;"
+ onsyncfrompreference="return status4evarPrefs.progressToolbarStyleSync();" />
+
+ <vbox class="css-bg-editor" preference="status4evar-pref-progress-toolbar-css" preference-editable="true" flex="1">
+ <progressmeter id="status4evar-progress-bar" value="75" flex="1" />
+ </vbox>
+ </prefpane>
+
+ <prefpane id="status4evar-pane-download" label="&status4evar.pane.download;">
+ <preferences>
+ <preference id="status4evar-pref-download-button-action" name="status4evar.download.button.action" type="int" />
+ <preference id="status4evar-pref-download-color-active" name="status4evar.download.color.active" type="string" />
+ <preference id="status4evar-pref-download-color-paused" name="status4evar.download.color.paused" type="string" />
+ <preference id="status4evar-pref-download-force" name="status4evar.download.force" type="bool" />
+ <preference id="status4evar-pref-download-label" name="status4evar.download.label" type="int" />
+ <preference id="status4evar-pref-download-label-force" name="status4evar.download.label.force" type="bool" />
+ <preference id="status4evar-pref-download-notify-animate" name="status4evar.download.notify.animate" type="bool" />
+ <preference id="status4evar-pref-download-notify-timeout" name="status4evar.download.notify.timeout" type="int" />
+ <preference id="status4evar-pref-download-progress" name="status4evar.download.progress" type="int" />
+ <preference id="status4evar-pref-download-tooltip" name="status4evar.download.tooltip" type="int" />
+
+ <preference id="status4evar-pref-download-button-action-command" name="status4evar.download.button.action.command" type="string"/>
+ </preferences>
+
+ <commandset id="status4evar-commandset-download">
+ <command id="status4evar-command-download-progress" oncommand="status4evarPrefs.downloadProgressToggle();" />
+ </commandset>
+
+ <checkbox id="status4evar-download-force-check" preference="status4evar-pref-download-force" label="&status4evar.download.force.label;" />
+
+ <checkbox id="status4evar-download-label-force-check" preference="status4evar-pref-download-label-force" label="&status4evar.download.label.force.label;" />
+
+ <hbox align="center">
+ <label id="status4evar-download-label-label" control="status4evar-download-label-menu">&status4evar.download.label.label;</label>
+ <menulist id="status4evar-download-label-menu" preference="status4evar-pref-download-label" sizetopopup="always">
+ <menupopup>
+ <menuitem value="0" label="&status4evar.option.dlcount;" />
+ <menuitem value="1" label="&status4evar.option.dltime;" />
+ <menuitem value="2" label="&status4evar.option.both;" />
+ </menupopup>
+ </menulist>
+ </hbox>
+
+ <hbox align="center">
+ <label id="status4evar-download-tooltip-label" control="status4evar-download-tooltip-menu">&status4evar.download.tooltip.label;</label>
+ <menulist id="status4evar-download-tooltip-menu" preference="status4evar-pref-download-tooltip" sizetopopup="always">
+ <menupopup>
+ <menuitem value="0" label="&status4evar.option.dlcount;" />
+ <menuitem value="1" label="&status4evar.option.dltime;" />
+ <menuitem value="2" label="&status4evar.option.both;" />
+ </menupopup>
+ </menulist>
+ </hbox>
+
+ <hbox align="center">
+ <label id="status4evar-download-button-action-label" control="status4evar-download-button-action-menu">&status4evar.download.button.action.label;</label>
+ <menulist id="status4evar-download-button-action-menu" preference="status4evar-pref-download-button-action" sizetopopup="always">
+ <menupopup>
+ <menuitem value="0" label="&status4evar.option.nothing;" />
+ <menuitem value="1" label="&status4evar.option.firefoxdefault;" />
+ <menuitem value="2" label="&status4evar.option.download.library;" />
+ <menuitem value="3" label="&status4evar.option.download.tab;" />
+ <menuitem value="4" label="&status4evar.option.download.thirdparty;" id="status4evar-download-button-action-menu-thirdparty" />
+ </menupopup>
+ </menulist>
+ </hbox>
+
+ <hbox align="center">
+ <label id="status4evar-download-notify-timeout-label" control="status4evar-download-notify-timeout-value">&status4evar.download.notify.timeout.label;</label>
+ <textbox id="status4evar-download-notify-timeout-value" preference="status4evar-pref-download-notify-timeout" type="number" size="3" />
+ <label id="status4evar-download-notify-timeout-unit">&status4evar.unit.seconds;</label>
+ </hbox>
+
+ <checkbox id="status4evar-download-notify-animate-check" preference="status4evar-pref-download-notify-animate" label="&status4evar.download.notify.animate.label;" />
+
+ <checkbox id="status4evar-download-progress-check" command="status4evar-command-download-progress" label="&status4evar.download.progress.label;" />
+
+ <vbox class="indent">
+ <hbox align="center">
+ <radiogroup id="status4evar-download-progress-radiogroup" preference="status4evar-pref-download-progress"
+ onsyncfrompreference="return status4evarPrefs.downloadProgressSync();">
+ <radio value="1" label="&status4evar.download.progress.average.label;" />
+ <radio value="2" label="&status4evar.download.progress.max.label;" />
+ <radio value="3" label="&status4evar.download.progress.min.label;" />
+ </radiogroup>
+ </hbox>
+
+ <hbox align="center">
+ <label id="status4evar-download-color-active-label" control="status4evar-download-color-active-picker">&status4evar.download.color.active.label;</label>
+ <colorpicker id="status4evar-download-color-active-picker" preference="status4evar-pref-download-color-active" type="button" />
+ </hbox>
+
+ <hbox align="center">
+ <label id="status4evar-download-color-paused-label" control="status4evar-download-color-paused-picker">&status4evar.download.color.paused.label;</label>
+ <colorpicker id="status4evar-download-color-paused-picker" preference="status4evar-pref-download-color-paused" type="button" />
+ </hbox>
+ </vbox>
+ </prefpane>
+
+ <prefpane id="status4evar-pane-addonbar" label="&status4evar.pane.statusbar;">
+ <preferences>
+ <preference id="status4evar-pref-addonbar-borderStyle" name="status4evar.addonbar.borderStyle" type="bool" />
+ <preference id="status4evar-pref-addonbar-closeButton" name="status4evar.addonbar.closeButton" type="bool" />
+ <preference id="status4evar-pref-addonbar-windowGripper" name="status4evar.addonbar.windowGripper" type="bool" />
+ </preferences>
+
+ <checkbox id="status4evar-addonbar-borderStyle-check" preference="status4evar-pref-addonbar-borderStyle" label="&status4evar.addonbar.borderStyle;" />
+
+ <checkbox id="status4evar-addonbar-closeButton-check" preference="status4evar-pref-addonbar-closeButton" label="&status4evar.addonbar.closeButton;" />
+
+ <checkbox id="status4evar-addonbar-windowGripper-check" preference="status4evar-pref-addonbar-windowGripper" label="&status4evar.addonbar.windowGripper;" />
+ </prefpane>
+
+ <prefpane id="status4evar-pane-advanced" label="&status4evar.pane.advanced;">
+ <preferences>
+ <preference id="status4evar-pref-advanced-status-detectFullScreen" name="status4evar.advanced.status.detectFullScreen" type="bool" />
+ <preference id="status4evar-pref-advanced-status-detectVideo" name="status4evar.advanced.status.detectVideo" type="bool" />
+ <preference id="browser-pref-urlbar-trimming-enabled" name="browser.urlbar.trimURLs" type="bool" />
+ </preferences>
+
+ <vbox flex="1">
+ <groupbox id="status4evar-status-urlbar-builtin">
+ <caption label="&status4evar.status.urlbar.firefox.builtin.caption;" />
+
+ <checkbox id="browser-urlbar-trimming-enabled-ckeck" preference="browser-pref-urlbar-trimming-enabled" label="&browser.urlbar.trimming.enabled.label;" />
+ </groupbox>
+
+ <groupbox id="status4evar-advanced-status">
+ <caption label="&status4evar.pane.status;" />
+
+ <checkbox id="status4evar-advanced-status-detectFullScreen-check" preference="status4evar-pref-advanced-status-detectFullScreen" label="&status4evar.advanced.status.detectFullScreen;" />
+ <checkbox id="status4evar-advanced-status-detectVideo-check" preference="status4evar-pref-advanced-status-detectVideo" label="&status4evar.advanced.status.detectVideo;" />
+ </groupbox>
+ </vbox>
+ </prefpane>
</prefwindow>
diff --git a/application/palemoon/components/statusbar/content/tabbrowser.xml b/application/palemoon/components/statusbar/content/tabbrowser.xml
index 5119fa58a..2f475771d 100644
--- a/application/palemoon/components/statusbar/content/tabbrowser.xml
+++ b/application/palemoon/components/statusbar/content/tabbrowser.xml
@@ -9,210 +9,210 @@
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
- <binding id="statuspanel" display="xul:hbox" extends="chrome://browser/content/tabbrowser.xml#statuspanel">
- <implementation>
- <!-- -->
- <!-- Inverted mirror handling -->
- <!-- -->
-
- <field name="_invertMirror"><![CDATA[
- false
- ]]></field>
-
- <property name="invertMirror">
- <setter><![CDATA[
- this._invertMirror = val;
- this.mirror = this._isMirrored;
- return val;
- ]]></setter>
- <getter><![CDATA[
- return this._invertMirror;
- ]]></getter>
- </property>
-
- <!-- -->
- <!-- Mouse mirror handling -->
- <!-- -->
-
- <field name="_mouseMirror"><![CDATA[
- true
- ]]></field>
-
- <field name="_mouseMirrorListen"><![CDATA[
- false
- ]]></field>
-
- <property name="mouseMirror">
- <setter><![CDATA[
- this._mouseMirror = val;
- this.setupMouseMirror(this.value);
- return val;
- ]]></setter>
- <getter><![CDATA[
- return this._mouseMirror;
- ]]></getter>
- </property>
-
- <method name="setupMouseMirror">
- <parameter name="val"/>
- <body><![CDATA[
- if(val && this._mouseMirror)
- {
- this._calcMouseTargetRect();
- if(!this._mouseMirrorListen)
- {
- MousePosTracker.addListener(this);
- this._mouseMirrorListen = true;
- }
- }
- else
- {
- this.mirror = false;
- if(this._mouseMirrorListen)
- {
- MousePosTracker.removeListener(this);
- this._mouseMirrorListen = false;
- }
- }
- ]]></body>
- </method>
-
- <method name="_calcMouseTargetRect">
- <body><![CDATA[
- let alignRight = false;
- let isRTL = (getComputedStyle(document.documentElement).direction == "rtl");
- if((this._invertMirror && !isRTL) || (!this._invertMirror && isRTL))
- {
- alignRight = true;
- }
-
- let rect = this.getBoundingClientRect();
- this._mouseTargetRect =
- {
- top: rect.top,
- bottom: rect.bottom,
- left: ((alignRight) ? window.innerWidth - rect.width : 0),
- right: ((alignRight) ? window.innerWidth : rect.width)
- };
- ]]></body>
- </method>
-
- <method name="onMouseEnter">
- <body><![CDATA[
- this.mirror = true;
- ]]></body>
- </method>
-
- <method name="onMouseLeave">
- <body><![CDATA[
- this.mirror = false;
- ]]></body>
- </method>
-
- <!-- -->
- <!-- Mirror handling -->
- <!-- -->
-
- <field name="_isMirrored"><![CDATA[
- false
- ]]></field>
-
- <property name="mirror">
- <setter><![CDATA[
- this._isMirrored = val;
- if(this._invertMirror)
- {
- val = !val;
- }
-
- this.setBooleanAttr("mirror", val);
- ]]></setter>
- <getter><![CDATA[
- return this._isMirrored;
- ]]></getter>
- </property>
-
- <method name="_mirror">
- <body><![CDATA[
- this.mirror = !this._isMirrored;
- ]]></body>
- </method>
-
- <!-- -->
- <!-- Value handling -->
- <!-- -->
-
- <property name="label">
- <setter><![CDATA[
- if(window.caligon && window.caligon.status4evar)
- {
- window.caligon.status4evar.statusService.setStatusText(val);
- }
- return undefined;
- ]]></setter>
- <getter><![CDATA[
- if(window.caligon && window.caligon.status4evar)
- {
- return window.caligon.status4evar.statusService.getStatusText();
- }
- return "";
- ]]></getter>
- </property>
-
- <property name="value">
- <setter><![CDATA[
- this.setValue(val);
- this.setupMouseMirror(val);
- return val;
- ]]></setter>
- <getter><![CDATA[
- return ((this.hasAttribute("inactive")) ? "" : this.getAttribute("label"));
- ]]></getter>
- </property>
-
- <method name="setValue">
- <parameter name="val"/>
- <body><![CDATA[
- if((this.getAttribute("type") || "").indexOf("network") > -1 && (this.getAttribute("previoustype") || "").indexOf("network") > -1)
- {
- this.style.minWidth = getComputedStyle(this).width;
- }
- else
- {
- this.style.minWidth = "";
- }
-
- if(val)
- {
- this.setAttribute("label", val);
- this.setBooleanAttr("inactive", false);
- }
- else
- {
- this.setBooleanAttr("inactive", true);
- }
- ]]></body>
- </method>
-
- <!-- -->
- <!-- Helpers -->
- <!-- -->
-
- <method name="setBooleanAttr">
- <parameter name="name"/>
- <parameter name="val"/>
- <body><![CDATA[
- if(val)
- {
- this.setAttribute(name, "true");
- }
- else
- {
- this.removeAttribute(name);
- }
- ]]></body>
- </method>
- </implementation>
- </binding>
+ <binding id="statuspanel" display="xul:hbox" extends="chrome://browser/content/tabbrowser.xml#statuspanel">
+ <implementation>
+ <!-- -->
+ <!-- Inverted mirror handling -->
+ <!-- -->
+
+ <field name="_invertMirror"><![CDATA[
+ false
+ ]]></field>
+
+ <property name="invertMirror">
+ <setter><![CDATA[
+ this._invertMirror = val;
+ this.mirror = this._isMirrored;
+ return val;
+ ]]></setter>
+ <getter><![CDATA[
+ return this._invertMirror;
+ ]]></getter>
+ </property>
+
+ <!-- -->
+ <!-- Mouse mirror handling -->
+ <!-- -->
+
+ <field name="_mouseMirror"><![CDATA[
+ true
+ ]]></field>
+
+ <field name="_mouseMirrorListen"><![CDATA[
+ false
+ ]]></field>
+
+ <property name="mouseMirror">
+ <setter><![CDATA[
+ this._mouseMirror = val;
+ this.setupMouseMirror(this.value);
+ return val;
+ ]]></setter>
+ <getter><![CDATA[
+ return this._mouseMirror;
+ ]]></getter>
+ </property>
+
+ <method name="setupMouseMirror">
+ <parameter name="val"/>
+ <body><![CDATA[
+ if(val && this._mouseMirror)
+ {
+ this._calcMouseTargetRect();
+ if(!this._mouseMirrorListen)
+ {
+ MousePosTracker.addListener(this);
+ this._mouseMirrorListen = true;
+ }
+ }
+ else
+ {
+ this.mirror = false;
+ if(this._mouseMirrorListen)
+ {
+ MousePosTracker.removeListener(this);
+ this._mouseMirrorListen = false;
+ }
+ }
+ ]]></body>
+ </method>
+
+ <method name="_calcMouseTargetRect">
+ <body><![CDATA[
+ let alignRight = false;
+ let isRTL = (getComputedStyle(document.documentElement).direction == "rtl");
+ if((this._invertMirror && !isRTL) || (!this._invertMirror && isRTL))
+ {
+ alignRight = true;
+ }
+
+ let rect = this.getBoundingClientRect();
+ this._mouseTargetRect =
+ {
+ top: rect.top,
+ bottom: rect.bottom,
+ left: ((alignRight) ? window.innerWidth - rect.width : 0),
+ right: ((alignRight) ? window.innerWidth : rect.width)
+ };
+ ]]></body>
+ </method>
+
+ <method name="onMouseEnter">
+ <body><![CDATA[
+ this.mirror = true;
+ ]]></body>
+ </method>
+
+ <method name="onMouseLeave">
+ <body><![CDATA[
+ this.mirror = false;
+ ]]></body>
+ </method>
+
+ <!-- -->
+ <!-- Mirror handling -->
+ <!-- -->
+
+ <field name="_isMirrored"><![CDATA[
+ false
+ ]]></field>
+
+ <property name="mirror">
+ <setter><![CDATA[
+ this._isMirrored = val;
+ if(this._invertMirror)
+ {
+ val = !val;
+ }
+
+ this.setBooleanAttr("mirror", val);
+ ]]></setter>
+ <getter><![CDATA[
+ return this._isMirrored;
+ ]]></getter>
+ </property>
+
+ <method name="_mirror">
+ <body><![CDATA[
+ this.mirror = !this._isMirrored;
+ ]]></body>
+ </method>
+
+ <!-- -->
+ <!-- Value handling -->
+ <!-- -->
+
+ <property name="label">
+ <setter><![CDATA[
+ if(window.caligon && window.caligon.status4evar)
+ {
+ window.caligon.status4evar.statusService.setStatusText(val);
+ }
+ return undefined;
+ ]]></setter>
+ <getter><![CDATA[
+ if(window.caligon && window.caligon.status4evar)
+ {
+ return window.caligon.status4evar.statusService.getStatusText();
+ }
+ return "";
+ ]]></getter>
+ </property>
+
+ <property name="value">
+ <setter><![CDATA[
+ this.setValue(val);
+ this.setupMouseMirror(val);
+ return val;
+ ]]></setter>
+ <getter><![CDATA[
+ return ((this.hasAttribute("inactive")) ? "" : this.getAttribute("label"));
+ ]]></getter>
+ </property>
+
+ <method name="setValue">
+ <parameter name="val"/>
+ <body><![CDATA[
+ if((this.getAttribute("type") || "").indexOf("network") > -1 && (this.getAttribute("previoustype") || "").indexOf("network") > -1)
+ {
+ this.style.minWidth = getComputedStyle(this).width;
+ }
+ else
+ {
+ this.style.minWidth = "";
+ }
+
+ if(val)
+ {
+ this.setAttribute("label", val);
+ this.setBooleanAttr("inactive", false);
+ }
+ else
+ {
+ this.setBooleanAttr("inactive", true);
+ }
+ ]]></body>
+ </method>
+
+ <!-- -->
+ <!-- Helpers -->
+ <!-- -->
+
+ <method name="setBooleanAttr">
+ <parameter name="name"/>
+ <parameter name="val"/>
+ <body><![CDATA[
+ if(val)
+ {
+ this.setAttribute(name, "true");
+ }
+ else
+ {
+ this.removeAttribute(name);
+ }
+ ]]></body>
+ </method>
+ </implementation>
+ </binding>
</bindings>
diff --git a/application/palemoon/components/statusbar/status4evar.idl b/application/palemoon/components/statusbar/status4evar.idl
index d14fcbcd1..534dea31c 100644
--- a/application/palemoon/components/statusbar/status4evar.idl
+++ b/application/palemoon/components/statusbar/status4evar.idl
@@ -9,49 +9,49 @@ interface nsIDOMWindow;
[scriptable, uuid(33d0433d-07be-4dc4-87fd-954057310efd)]
interface nsIStatus4Evar : nsISupports
{
- readonly attribute boolean addonbarBorderStyle;
- readonly attribute boolean addonbarCloseButton;
- readonly attribute boolean addonbarLegacyShim;
- readonly attribute boolean addonbarWindowGripper;
-
- readonly attribute boolean advancedStatusDetectFullScreen;
- readonly attribute boolean advancedStatusDetectVideo;
-
- readonly attribute long downloadButtonAction;
- readonly attribute ACString downloadButtonActionCommand;
- readonly attribute ACString downloadColorActive;
- readonly attribute ACString downloadColorPaused;
- readonly attribute boolean downloadForce;
- readonly attribute long downloadLabel;
- readonly attribute boolean downloadLabelForce;
- readonly attribute boolean downloadNotifyAnimate;
- readonly attribute long downloadNotifyTimeout;
- readonly attribute long downloadProgress;
- readonly attribute long downloadTooltip;
-
- readonly attribute boolean firstRun;
- readonly attribute boolean firstRunAustralis;
-
- readonly attribute ACString progressToolbarCSS;
- readonly attribute boolean progressToolbarForce;
- readonly attribute boolean progressToolbarStyle;
- readonly attribute boolean progressToolbarStyleAdvanced;
-
- readonly attribute long status;
- readonly attribute boolean statusDefault;
- readonly attribute boolean statusNetwork;
- readonly attribute boolean statusNetworkXHR;
- readonly attribute long statusTimeout;
- readonly attribute long statusLinkOver;
- readonly attribute long statusLinkOverDelayShow;
- readonly attribute long statusLinkOverDelayHide;
-
- readonly attribute long statusToolbarMaxLength;
-
- readonly attribute boolean statusToolbarInvertMirror;
- readonly attribute boolean statusToolbarMouseMirror;
-
- void resetPrefs();
- void updateWindow(in nsIDOMWindow win);
+ readonly attribute boolean addonbarBorderStyle;
+ readonly attribute boolean addonbarCloseButton;
+ readonly attribute boolean addonbarLegacyShim;
+ readonly attribute boolean addonbarWindowGripper;
+
+ readonly attribute boolean advancedStatusDetectFullScreen;
+ readonly attribute boolean advancedStatusDetectVideo;
+
+ readonly attribute long downloadButtonAction;
+ readonly attribute ACString downloadButtonActionCommand;
+ readonly attribute ACString downloadColorActive;
+ readonly attribute ACString downloadColorPaused;
+ readonly attribute boolean downloadForce;
+ readonly attribute long downloadLabel;
+ readonly attribute boolean downloadLabelForce;
+ readonly attribute boolean downloadNotifyAnimate;
+ readonly attribute long downloadNotifyTimeout;
+ readonly attribute long downloadProgress;
+ readonly attribute long downloadTooltip;
+
+ readonly attribute boolean firstRun;
+ readonly attribute boolean firstRunAustralis;
+
+ readonly attribute ACString progressToolbarCSS;
+ readonly attribute boolean progressToolbarForce;
+ readonly attribute boolean progressToolbarStyle;
+ readonly attribute boolean progressToolbarStyleAdvanced;
+
+ readonly attribute long status;
+ readonly attribute boolean statusDefault;
+ readonly attribute boolean statusNetwork;
+ readonly attribute boolean statusNetworkXHR;
+ readonly attribute long statusTimeout;
+ readonly attribute long statusLinkOver;
+ readonly attribute long statusLinkOverDelayShow;
+ readonly attribute long statusLinkOverDelayHide;
+
+ readonly attribute long statusToolbarMaxLength;
+
+ readonly attribute boolean statusToolbarInvertMirror;
+ readonly attribute boolean statusToolbarMouseMirror;
+
+ void resetPrefs();
+ void updateWindow(in nsIDOMWindow win);
};
diff --git a/application/palemoon/components/statusbar/status4evar.js b/application/palemoon/components/statusbar/status4evar.js
index abc6c9175..4aa2e3e78 100644
--- a/application/palemoon/components/statusbar/status4evar.js
+++ b/application/palemoon/components/statusbar/status4evar.js
@@ -18,677 +18,677 @@ function Status_4_Evar(){}
Status_4_Evar.prototype =
{
- classID: Components.ID("{33d0433d-07be-4dc4-87fd-954057310efd}"),
- QueryInterface: XPCOMUtils.generateQI([
- CI.nsISupportsWeakReference,
- CI.nsIObserver,
- CI.nsIStatus4Evar
- ]),
-
- prefs: null,
-
- addonbarBorderStyle: false,
- addonbarCloseButton: false,
- addonbarWindowGripper: true,
-
- advancedStatusDetectFullScreen: true,
- advancedStatusDetectVideo: true,
-
- downloadButtonAction: 1,
- downloadButtonActionCommand: "",
- downloadColorActive: null,
- downloadColorPaused: null,
- downloadForce: false,
- downloadLabel: 0,
- downloadLabelForce: true,
- downloadNotifyAnimate: true,
- downloadNotifyTimeout: 60000,
- downloadProgress: 1,
- downloadTooltip: 1,
-
- firstRun: true,
-
- progressToolbarCSS: null,
- progressToolbarForce: false,
- progressToolbarStyle: false,
-
- status: 1,
- statusDefault: true,
- statusNetwork: true,
- statusTimeout: 10000,
- statusLinkOver: 1,
- statusLinkOverDelayShow: 70,
- statusLinkOverDelayHide: 150,
-
- statusToolbarMaxLength: 0,
-
- statusToolbarInvertMirror: false,
- statusToolbarMouseMirror: true,
-
- pref_registry:
- {
- "addonbar.borderStyle":
- {
- update: function()
- {
- this.addonbarBorderStyle = this.prefs.getBoolPref("addonbar.borderStyle");
- },
- updateWindow: function(win)
- {
- let browser_bottom_box = win.caligon.status4evar.getters.browserBottomBox;
- if(browser_bottom_box)
- {
- this.setBoolElementAttribute(browser_bottom_box, "s4eboarder", this.addonbarBorderStyle);
- }
- }
- },
-
- "addonbar.closeButton":
- {
- update: function()
- {
- this.addonbarCloseButton = this.prefs.getBoolPref("addonbar.closeButton");
- },
- updateWindow: function(win)
- {
- let addonbar_close_button = win.caligon.status4evar.getters.addonbarCloseButton;
- if(addonbar_close_button)
- {
- addonbar_close_button.hidden = !this.addonbarCloseButton;
- }
- }
- },
-
- "addonbar.windowGripper":
- {
- update: function()
- {
- this.addonbarWindowGripper = this.prefs.getBoolPref("addonbar.windowGripper");
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.toolbars.updateWindowGripper(true);
- }
- },
-
- "advanced.status.detectFullScreen":
- {
- update: function()
- {
- this.advancedStatusDetectFullScreen = this.prefs.getBoolPref("advanced.status.detectFullScreen");
- }
- },
-
- "advanced.status.detectVideo":
- {
- update: function()
- {
- this.advancedStatusDetectVideo = this.prefs.getBoolPref("advanced.status.detectVideo");
- }
- },
-
- "download.button.action":
- {
- update: function()
- {
- this.downloadButtonAction = this.prefs.getIntPref("download.button.action");
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.downloadStatus.updateBinding();
- }
- },
-
- "download.button.action.command":
- {
- update: function()
- {
- this.downloadButtonActionCommand = this.prefs.getCharPref("download.button.action.command");
- }
- },
-
- "download.color.active":
- {
- update: function()
- {
- this.downloadColorActive = this.prefs.getCharPref("download.color.active");
- },
- updateDynamicStyle: function(sheet)
- {
- sheet.cssRules[2].style.backgroundColor = this.downloadColorActive;
- }
- },
-
- "download.color.paused":
- {
- update: function()
- {
- this.downloadColorPaused = this.prefs.getCharPref("download.color.paused");
- },
- updateDynamicStyle: function(sheet)
- {
- sheet.cssRules[3].style.backgroundColor = this.downloadColorPaused;
- }
- },
-
- "download.force":
- {
- update: function()
- {
- this.downloadForce = this.prefs.getBoolPref("download.force");
- },
- updateWindow: function(win)
- {
- let download_button = win.caligon.status4evar.getters.downloadButton;
- if(download_button)
- {
- this.setBoolElementAttribute(download_button, "forcevisible", this.downloadForce);
- }
-
- let download_notify_anchor = win.caligon.status4evar.getters.downloadNotifyAnchor;
- this.setBoolElementAttribute(download_notify_anchor, "forcevisible", this.downloadForce);
- }
- },
-
- "download.label":
- {
- update: function()
- {
- this.downloadLabel = this.prefs.getIntPref("download.label");
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.downloadStatus.updateButton();
- }
- },
-
- "download.label.force":
- {
- update: function()
- {
- this.downloadLabelForce = this.prefs.getBoolPref("download.label.force");
- },
- updateWindow: function(win)
- {
- let download_button = win.caligon.status4evar.getters.downloadButton;
- if(download_button)
- {
- this.setBoolElementAttribute(download_button, "forcelabel", this.downloadLabelForce);
- }
- }
- },
-
- "download.notify.animate":
- {
- update: function()
- {
- this.downloadNotifyAnimate = this.prefs.getBoolPref("download.notify.animate");
- }
- },
-
- "download.notify.timeout":
- {
- update: function()
- {
- this.downloadNotifyTimeout = (this.prefs.getIntPref("download.notify.timeout") * 1000);
- }
- },
-
- "download.progress":
- {
- update: function()
- {
- this.downloadProgress = this.prefs.getIntPref("download.progress");
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.downloadStatus.updateButton();
- }
- },
-
- "download.tooltip":
- {
- update: function()
- {
- this.downloadTooltip = this.prefs.getIntPref("download.tooltip");
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.downloadStatus.updateButton();
- }
- },
-
- "progress.toolbar.css":
- {
- update: function()
- {
- this.progressToolbarCSS = this.prefs.getCharPref("progress.toolbar.css");
- },
- updateDynamicStyle: function(sheet)
- {
- sheet.cssRules[1].style.background = this.progressToolbarCSS;
- }
- },
-
- "progress.toolbar.force":
- {
- update: function()
- {
- this.progressToolbarForce = this.prefs.getBoolPref("progress.toolbar.force");
- },
- updateWindow: function(win)
- {
- let toolbar_progress = win.caligon.status4evar.getters.toolbarProgress;
- if(toolbar_progress)
- {
- this.setBoolElementAttribute(toolbar_progress, "forcevisible", this.progressToolbarForce);
- }
- }
- },
-
- "progress.toolbar.style":
- {
- update: function()
- {
- this.progressToolbarStyle = this.prefs.getBoolPref("progress.toolbar.style");
- },
- updateWindow: function(win)
- {
- let toolbar_progress = win.caligon.status4evar.getters.toolbarProgress;
- if(toolbar_progress)
- {
- this.setBoolElementAttribute(toolbar_progress, "s4estyle", this.progressToolbarStyle);
- }
- }
- },
-
- "status":
- {
- update: function()
- {
- this.status = this.prefs.getIntPref("status");
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.statusService.clearStatusField();
- win.caligon.status4evar.statusService.updateStatusField(true);
- }
- },
-
- "status.default":
- {
- update: function()
- {
- this.statusDefault = this.prefs.getBoolPref("status.default");
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.statusService.buildTextOrder();
- win.caligon.status4evar.statusService.updateStatusField(true);
- }
- },
-
- "status.linkOver":
- {
- update: function()
- {
- this.statusLinkOver = this.prefs.getIntPref("status.linkOver");
- }
- },
-
- "status.linkOver.delay.show":
- {
- update: function()
- {
- this.statusLinkOverDelayShow = this.prefs.getIntPref("status.linkOver.delay.show");
- }
- },
-
- "status.linkOver.delay.hide":
- {
- update: function()
- {
- this.statusLinkOverDelayHide = this.prefs.getIntPref("status.linkOver.delay.hide");
- }
- },
-
- "status.network":
- {
- update: function()
- {
- this.statusNetwork = this.prefs.getBoolPref("status.network");
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.statusService.buildTextOrder();
- }
- },
-
- "status.network.xhr":
- {
- update: function()
- {
- this.statusNetworkXHR = this.prefs.getBoolPref("status.network.xhr");
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.statusService.buildTextOrder();
- }
- },
-
- "status.timeout":
- {
- update: function()
- {
- this.statusTimeout = (this.prefs.getIntPref("status.timeout") * 1000);
- },
- updateWindow: function(win)
- {
- win.caligon.status4evar.statusService.updateStatusField(true);
- }
- },
-
- "status.toolbar.maxLength":
- {
- update: function()
- {
- this.statusToolbarMaxLength = this.prefs.getIntPref("status.toolbar.maxLength");
- },
- updateWindow: function(win)
- {
- let status_widget = win.caligon.status4evar.getters.statusWidget;
- if(status_widget)
- {
- status_widget.maxWidth = (this.statusToolbarMaxLength || "");
- }
- }
- },
-
- "status.popup.invertMirror":
- {
- update: function()
- {
- this.statusToolbarInvertMirror = this.prefs.getBoolPref("status.popup.invertMirror");
- },
- updateWindow: function(win)
- {
- let statusOverlay = win.caligon.status4evar.getters.statusOverlay;
- if(statusOverlay)
- {
- statusOverlay.invertMirror = this.statusToolbarInvertMirror;
- }
- }
- },
-
- "status.popup.mouseMirror":
- {
- update: function()
- {
- this.statusToolbarMouseMirror = this.prefs.getBoolPref("status.popup.mouseMirror");
- },
- updateWindow: function(win)
- {
- let statusOverlay = win.caligon.status4evar.getters.statusOverlay;
- if(statusOverlay)
- {
- statusOverlay.mouseMirror = this.statusToolbarMouseMirror;
- }
- }
- }
-
- },
-
- // nsIObserver
- observe: function(subject, topic, data)
- {
- try
- {
- switch(topic)
- {
- case "profile-after-change":
- this.startup();
- break;
- case "quit-application":
- this.shutdown();
- break;
- case "nsPref:changed":
- this.updatePref(data, true);
- break;
- }
- }
- catch(e)
- {
- CU.reportError(e);
- }
- },
-
- startup: function()
- {
- this.prefs = Services.prefs.getBranch("status4evar.").QueryInterface(CI.nsIPrefBranch2);
-
- this.firstRun = this.prefs.getBoolPref("firstRun");
- if(this.firstRun)
- {
- this.prefs.setBoolPref("firstRun", false);
- }
-
- this.migrate();
-
- for(let pref in this.pref_registry)
- {
- let pro = this.pref_registry[pref];
-
- pro.update = pro.update.bind(this);
- if(pro.updateWindow)
- {
- pro.updateWindow = pro.updateWindow.bind(this);
- }
- if(pro.updateDynamicStyle)
- {
- pro.updateDynamicStyle = pro.updateDynamicStyle.bind(this);
- }
-
- this.prefs.addObserver(pref, this, true);
-
- this.updatePref(pref, false);
- }
-
- Services.obs.addObserver(this, "quit-application", true);
- },
-
- shutdown: function()
- {
- Services.obs.removeObserver(this, "quit-application");
-
- for(let pref in this.pref_registry)
- {
- this.prefs.removeObserver(pref, this);
- }
-
- this.prefs = null;
- },
-
- migrate: function()
- {
- if(!this.firstRun)
- {
- let migration = 0;
- try
- {
- migration = this.prefs.getIntPref("migration");
- }
- catch(e) {}
-
- switch(migration)
- {
- case 5:
- this.migrateBoolPref("status.detectFullScreen", "advanced.status.detectFullScreen");
- case 6:
- let oldDownloadAction = this.prefs.getIntPref("download.button.action");
- let newDownloadAction = 1;
- switch(oldDownloadAction)
- {
- case 2:
- newDownloadAction = 1;
- break;
- case 3:
- newDownloadAction = 2;
- break;
- case 4:
- newDownloadAction = 1;
- break;
- }
- this.prefs.setIntPref("download.button.action", newDownloadAction);
- case 7:
- let progressLocation = this.prefs.getIntPref("status");
- if (progressLocation == 2)
- this.prefs.setIntPref("status", 1);
- let linkOverLocation = this.prefs.getIntPref("status.linkOver");
- if (linkOverLocation == 2)
- this.prefs.setIntPref("status.linkOver", 1);
- break;
- case CURRENT_MIGRATION:
- break;
- }
- }
-
- this.prefs.setIntPref("migration", CURRENT_MIGRATION);
- },
-
- migrateBoolPref: function(oldPref, newPref)
- {
- if(this.prefs.prefHasUserValue(oldPref))
- {
- this.prefs.setBoolPref(newPref, this.prefs.getBoolPref(oldPref));
- this.prefs.clearUserPref(oldPref);
- }
- },
-
- migrateIntPref: function(oldPref, newPref)
- {
- if(this.prefs.prefHasUserValue(oldPref))
- {
- this.prefs.setIntPref(newPref, this.prefs.getIntPref(oldPref));
- this.prefs.clearUserPref(oldPref);
- }
- },
-
- migrateCharPref: function(oldPref, newPref)
- {
- if(this.prefs.prefHasUserValue(oldPref))
- {
- this.prefs.setCharPref(newPref, this.prefs.getCharPref(oldPref));
- this.prefs.clearUserPref(oldPref);
- }
- },
-
- updatePref: function(pref, updateWindows)
- {
- if(!(pref in this.pref_registry))
- {
- return;
- }
- let pro = this.pref_registry[pref];
-
- pro.update();
-
- if(updateWindows)
- {
- let windowsEnum = Services.wm.getEnumerator("navigator:browser");
- while(windowsEnum.hasMoreElements())
- {
- this.updateWindow(windowsEnum.getNext(), pro);
- }
- }
-
- if(pro.alsoUpdate)
- {
- pro.alsoUpdate.forEach(function (alsoPref)
- {
- this.updatePref(alsoPref);
- }, this);
- }
- },
-
- // Updtate a browser window
- updateWindow: function(win, pro)
- {
- if(!(win instanceof CI.nsIDOMWindow)
- || !(win.document.documentElement.getAttribute("windowtype") == "navigator:browser"))
- {
- return;
- }
-
- if(pro)
- {
- this.handlePro(win, pro);
- }
- else
- {
- for(let pref in this.pref_registry)
- {
- this.handlePro(win, this.pref_registry[pref]);
- }
- }
- },
-
- handlePro: function(win, pro)
- {
- if(pro.updateWindow)
- {
- pro.updateWindow(win);
- }
-
- if(pro.updateDynamicStyle)
- {
- let styleSheets = win.document.styleSheets;
- for(let i = 0; i < styleSheets.length; i++)
- {
- let styleSheet = styleSheets[i];
- if(styleSheet.href == "chrome://browser/skin/statusbar/dynamic.css")
- {
- pro.updateDynamicStyle(styleSheet);
- break;
- }
- }
- }
- },
-
- setBoolElementAttribute: function(elem, attr, val)
- {
- if(val)
- {
- elem.setAttribute(attr, "true");
- }
- else
- {
- elem.removeAttribute(attr);
- }
- },
-
- setStringElementAttribute: function(elem, attr, val)
- {
- if(val)
- {
- elem.setAttribute(attr, val);
- }
- else
- {
- elem.removeAttribute(attr);
- }
- },
-
- resetPrefs: function()
- {
- let childPrefs = this.prefs.getChildList("");
- childPrefs.forEach(function(pref)
- {
- if(this.prefs.prefHasUserValue(pref))
- {
- this.prefs.clearUserPref(pref);
- }
- }, this);
- }
+ classID: Components.ID("{33d0433d-07be-4dc4-87fd-954057310efd}"),
+ QueryInterface: XPCOMUtils.generateQI([
+ CI.nsISupportsWeakReference,
+ CI.nsIObserver,
+ CI.nsIStatus4Evar
+ ]),
+
+ prefs: null,
+
+ addonbarBorderStyle: false,
+ addonbarCloseButton: false,
+ addonbarWindowGripper: true,
+
+ advancedStatusDetectFullScreen: true,
+ advancedStatusDetectVideo: true,
+
+ downloadButtonAction: 1,
+ downloadButtonActionCommand: "",
+ downloadColorActive: null,
+ downloadColorPaused: null,
+ downloadForce: false,
+ downloadLabel: 0,
+ downloadLabelForce: true,
+ downloadNotifyAnimate: true,
+ downloadNotifyTimeout: 60000,
+ downloadProgress: 1,
+ downloadTooltip: 1,
+
+ firstRun: true,
+
+ progressToolbarCSS: null,
+ progressToolbarForce: false,
+ progressToolbarStyle: false,
+
+ status: 1,
+ statusDefault: true,
+ statusNetwork: true,
+ statusTimeout: 10000,
+ statusLinkOver: 1,
+ statusLinkOverDelayShow: 70,
+ statusLinkOverDelayHide: 150,
+
+ statusToolbarMaxLength: 0,
+
+ statusToolbarInvertMirror: false,
+ statusToolbarMouseMirror: true,
+
+ pref_registry:
+ {
+ "addonbar.borderStyle":
+ {
+ update: function()
+ {
+ this.addonbarBorderStyle = this.prefs.getBoolPref("addonbar.borderStyle");
+ },
+ updateWindow: function(win)
+ {
+ let browser_bottom_box = win.caligon.status4evar.getters.browserBottomBox;
+ if(browser_bottom_box)
+ {
+ this.setBoolElementAttribute(browser_bottom_box, "s4eboarder", this.addonbarBorderStyle);
+ }
+ }
+ },
+
+ "addonbar.closeButton":
+ {
+ update: function()
+ {
+ this.addonbarCloseButton = this.prefs.getBoolPref("addonbar.closeButton");
+ },
+ updateWindow: function(win)
+ {
+ let addonbar_close_button = win.caligon.status4evar.getters.addonbarCloseButton;
+ if(addonbar_close_button)
+ {
+ addonbar_close_button.hidden = !this.addonbarCloseButton;
+ }
+ }
+ },
+
+ "addonbar.windowGripper":
+ {
+ update: function()
+ {
+ this.addonbarWindowGripper = this.prefs.getBoolPref("addonbar.windowGripper");
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.toolbars.updateWindowGripper(true);
+ }
+ },
+
+ "advanced.status.detectFullScreen":
+ {
+ update: function()
+ {
+ this.advancedStatusDetectFullScreen = this.prefs.getBoolPref("advanced.status.detectFullScreen");
+ }
+ },
+
+ "advanced.status.detectVideo":
+ {
+ update: function()
+ {
+ this.advancedStatusDetectVideo = this.prefs.getBoolPref("advanced.status.detectVideo");
+ }
+ },
+
+ "download.button.action":
+ {
+ update: function()
+ {
+ this.downloadButtonAction = this.prefs.getIntPref("download.button.action");
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.downloadStatus.updateBinding();
+ }
+ },
+
+ "download.button.action.command":
+ {
+ update: function()
+ {
+ this.downloadButtonActionCommand = this.prefs.getCharPref("download.button.action.command");
+ }
+ },
+
+ "download.color.active":
+ {
+ update: function()
+ {
+ this.downloadColorActive = this.prefs.getCharPref("download.color.active");
+ },
+ updateDynamicStyle: function(sheet)
+ {
+ sheet.cssRules[2].style.backgroundColor = this.downloadColorActive;
+ }
+ },
+
+ "download.color.paused":
+ {
+ update: function()
+ {
+ this.downloadColorPaused = this.prefs.getCharPref("download.color.paused");
+ },
+ updateDynamicStyle: function(sheet)
+ {
+ sheet.cssRules[3].style.backgroundColor = this.downloadColorPaused;
+ }
+ },
+
+ "download.force":
+ {
+ update: function()
+ {
+ this.downloadForce = this.prefs.getBoolPref("download.force");
+ },
+ updateWindow: function(win)
+ {
+ let download_button = win.caligon.status4evar.getters.downloadButton;
+ if(download_button)
+ {
+ this.setBoolElementAttribute(download_button, "forcevisible", this.downloadForce);
+ }
+
+ let download_notify_anchor = win.caligon.status4evar.getters.downloadNotifyAnchor;
+ this.setBoolElementAttribute(download_notify_anchor, "forcevisible", this.downloadForce);
+ }
+ },
+
+ "download.label":
+ {
+ update: function()
+ {
+ this.downloadLabel = this.prefs.getIntPref("download.label");
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.downloadStatus.updateButton();
+ }
+ },
+
+ "download.label.force":
+ {
+ update: function()
+ {
+ this.downloadLabelForce = this.prefs.getBoolPref("download.label.force");
+ },
+ updateWindow: function(win)
+ {
+ let download_button = win.caligon.status4evar.getters.downloadButton;
+ if(download_button)
+ {
+ this.setBoolElementAttribute(download_button, "forcelabel", this.downloadLabelForce);
+ }
+ }
+ },
+
+ "download.notify.animate":
+ {
+ update: function()
+ {
+ this.downloadNotifyAnimate = this.prefs.getBoolPref("download.notify.animate");
+ }
+ },
+
+ "download.notify.timeout":
+ {
+ update: function()
+ {
+ this.downloadNotifyTimeout = (this.prefs.getIntPref("download.notify.timeout") * 1000);
+ }
+ },
+
+ "download.progress":
+ {
+ update: function()
+ {
+ this.downloadProgress = this.prefs.getIntPref("download.progress");
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.downloadStatus.updateButton();
+ }
+ },
+
+ "download.tooltip":
+ {
+ update: function()
+ {
+ this.downloadTooltip = this.prefs.getIntPref("download.tooltip");
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.downloadStatus.updateButton();
+ }
+ },
+
+ "progress.toolbar.css":
+ {
+ update: function()
+ {
+ this.progressToolbarCSS = this.prefs.getCharPref("progress.toolbar.css");
+ },
+ updateDynamicStyle: function(sheet)
+ {
+ sheet.cssRules[1].style.background = this.progressToolbarCSS;
+ }
+ },
+
+ "progress.toolbar.force":
+ {
+ update: function()
+ {
+ this.progressToolbarForce = this.prefs.getBoolPref("progress.toolbar.force");
+ },
+ updateWindow: function(win)
+ {
+ let toolbar_progress = win.caligon.status4evar.getters.toolbarProgress;
+ if(toolbar_progress)
+ {
+ this.setBoolElementAttribute(toolbar_progress, "forcevisible", this.progressToolbarForce);
+ }
+ }
+ },
+
+ "progress.toolbar.style":
+ {
+ update: function()
+ {
+ this.progressToolbarStyle = this.prefs.getBoolPref("progress.toolbar.style");
+ },
+ updateWindow: function(win)
+ {
+ let toolbar_progress = win.caligon.status4evar.getters.toolbarProgress;
+ if(toolbar_progress)
+ {
+ this.setBoolElementAttribute(toolbar_progress, "s4estyle", this.progressToolbarStyle);
+ }
+ }
+ },
+
+ "status":
+ {
+ update: function()
+ {
+ this.status = this.prefs.getIntPref("status");
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.statusService.clearStatusField();
+ win.caligon.status4evar.statusService.updateStatusField(true);
+ }
+ },
+
+ "status.default":
+ {
+ update: function()
+ {
+ this.statusDefault = this.prefs.getBoolPref("status.default");
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.statusService.buildTextOrder();
+ win.caligon.status4evar.statusService.updateStatusField(true);
+ }
+ },
+
+ "status.linkOver":
+ {
+ update: function()
+ {
+ this.statusLinkOver = this.prefs.getIntPref("status.linkOver");
+ }
+ },
+
+ "status.linkOver.delay.show":
+ {
+ update: function()
+ {
+ this.statusLinkOverDelayShow = this.prefs.getIntPref("status.linkOver.delay.show");
+ }
+ },
+
+ "status.linkOver.delay.hide":
+ {
+ update: function()
+ {
+ this.statusLinkOverDelayHide = this.prefs.getIntPref("status.linkOver.delay.hide");
+ }
+ },
+
+ "status.network":
+ {
+ update: function()
+ {
+ this.statusNetwork = this.prefs.getBoolPref("status.network");
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.statusService.buildTextOrder();
+ }
+ },
+
+ "status.network.xhr":
+ {
+ update: function()
+ {
+ this.statusNetworkXHR = this.prefs.getBoolPref("status.network.xhr");
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.statusService.buildTextOrder();
+ }
+ },
+
+ "status.timeout":
+ {
+ update: function()
+ {
+ this.statusTimeout = (this.prefs.getIntPref("status.timeout") * 1000);
+ },
+ updateWindow: function(win)
+ {
+ win.caligon.status4evar.statusService.updateStatusField(true);
+ }
+ },
+
+ "status.toolbar.maxLength":
+ {
+ update: function()
+ {
+ this.statusToolbarMaxLength = this.prefs.getIntPref("status.toolbar.maxLength");
+ },
+ updateWindow: function(win)
+ {
+ let status_widget = win.caligon.status4evar.getters.statusWidget;
+ if(status_widget)
+ {
+ status_widget.maxWidth = (this.statusToolbarMaxLength || "");
+ }
+ }
+ },
+
+ "status.popup.invertMirror":
+ {
+ update: function()
+ {
+ this.statusToolbarInvertMirror = this.prefs.getBoolPref("status.popup.invertMirror");
+ },
+ updateWindow: function(win)
+ {
+ let statusOverlay = win.caligon.status4evar.getters.statusOverlay;
+ if(statusOverlay)
+ {
+ statusOverlay.invertMirror = this.statusToolbarInvertMirror;
+ }
+ }
+ },
+
+ "status.popup.mouseMirror":
+ {
+ update: function()
+ {
+ this.statusToolbarMouseMirror = this.prefs.getBoolPref("status.popup.mouseMirror");
+ },
+ updateWindow: function(win)
+ {
+ let statusOverlay = win.caligon.status4evar.getters.statusOverlay;
+ if(statusOverlay)
+ {
+ statusOverlay.mouseMirror = this.statusToolbarMouseMirror;
+ }
+ }
+ }
+
+ },
+
+ // nsIObserver
+ observe: function(subject, topic, data)
+ {
+ try
+ {
+ switch(topic)
+ {
+ case "profile-after-change":
+ this.startup();
+ break;
+ case "quit-application":
+ this.shutdown();
+ break;
+ case "nsPref:changed":
+ this.updatePref(data, true);
+ break;
+ }
+ }
+ catch(e)
+ {
+ CU.reportError(e);
+ }
+ },
+
+ startup: function()
+ {
+ this.prefs = Services.prefs.getBranch("status4evar.").QueryInterface(CI.nsIPrefBranch2);
+
+ this.firstRun = this.prefs.getBoolPref("firstRun");
+ if(this.firstRun)
+ {
+ this.prefs.setBoolPref("firstRun", false);
+ }
+
+ this.migrate();
+
+ for(let pref in this.pref_registry)
+ {
+ let pro = this.pref_registry[pref];
+
+ pro.update = pro.update.bind(this);
+ if(pro.updateWindow)
+ {
+ pro.updateWindow = pro.updateWindow.bind(this);
+ }
+ if(pro.updateDynamicStyle)
+ {
+ pro.updateDynamicStyle = pro.updateDynamicStyle.bind(this);
+ }
+
+ this.prefs.addObserver(pref, this, true);
+
+ this.updatePref(pref, false);
+ }
+
+ Services.obs.addObserver(this, "quit-application", true);
+ },
+
+ shutdown: function()
+ {
+ Services.obs.removeObserver(this, "quit-application");
+
+ for(let pref in this.pref_registry)
+ {
+ this.prefs.removeObserver(pref, this);
+ }
+
+ this.prefs = null;
+ },
+
+ migrate: function()
+ {
+ if(!this.firstRun)
+ {
+ let migration = 0;
+ try
+ {
+ migration = this.prefs.getIntPref("migration");
+ }
+ catch(e) {}
+
+ switch(migration)
+ {
+ case 5:
+ this.migrateBoolPref("status.detectFullScreen", "advanced.status.detectFullScreen");
+ case 6:
+ let oldDownloadAction = this.prefs.getIntPref("download.button.action");
+ let newDownloadAction = 1;
+ switch(oldDownloadAction)
+ {
+ case 2:
+ newDownloadAction = 1;
+ break;
+ case 3:
+ newDownloadAction = 2;
+ break;
+ case 4:
+ newDownloadAction = 1;
+ break;
+ }
+ this.prefs.setIntPref("download.button.action", newDownloadAction);
+ case 7:
+ let progressLocation = this.prefs.getIntPref("status");
+ if (progressLocation == 2)
+ this.prefs.setIntPref("status", 1);
+ let linkOverLocation = this.prefs.getIntPref("status.linkOver");
+ if (linkOverLocation == 2)
+ this.prefs.setIntPref("status.linkOver", 1);
+ break;
+ case CURRENT_MIGRATION:
+ break;
+ }
+ }
+
+ this.prefs.setIntPref("migration", CURRENT_MIGRATION);
+ },
+
+ migrateBoolPref: function(oldPref, newPref)
+ {
+ if(this.prefs.prefHasUserValue(oldPref))
+ {
+ this.prefs.setBoolPref(newPref, this.prefs.getBoolPref(oldPref));
+ this.prefs.clearUserPref(oldPref);
+ }
+ },
+
+ migrateIntPref: function(oldPref, newPref)
+ {
+ if(this.prefs.prefHasUserValue(oldPref))
+ {
+ this.prefs.setIntPref(newPref, this.prefs.getIntPref(oldPref));
+ this.prefs.clearUserPref(oldPref);
+ }
+ },
+
+ migrateCharPref: function(oldPref, newPref)
+ {
+ if(this.prefs.prefHasUserValue(oldPref))
+ {
+ this.prefs.setCharPref(newPref, this.prefs.getCharPref(oldPref));
+ this.prefs.clearUserPref(oldPref);
+ }
+ },
+
+ updatePref: function(pref, updateWindows)
+ {
+ if(!(pref in this.pref_registry))
+ {
+ return;
+ }
+ let pro = this.pref_registry[pref];
+
+ pro.update();
+
+ if(updateWindows)
+ {
+ let windowsEnum = Services.wm.getEnumerator("navigator:browser");
+ while(windowsEnum.hasMoreElements())
+ {
+ this.updateWindow(windowsEnum.getNext(), pro);
+ }
+ }
+
+ if(pro.alsoUpdate)
+ {
+ pro.alsoUpdate.forEach(function (alsoPref)
+ {
+ this.updatePref(alsoPref);
+ }, this);
+ }
+ },
+
+ // Updtate a browser window
+ updateWindow: function(win, pro)
+ {
+ if(!(win instanceof CI.nsIDOMWindow)
+ || !(win.document.documentElement.getAttribute("windowtype") == "navigator:browser"))
+ {
+ return;
+ }
+
+ if(pro)
+ {
+ this.handlePro(win, pro);
+ }
+ else
+ {
+ for(let pref in this.pref_registry)
+ {
+ this.handlePro(win, this.pref_registry[pref]);
+ }
+ }
+ },
+
+ handlePro: function(win, pro)
+ {
+ if(pro.updateWindow)
+ {
+ pro.updateWindow(win);
+ }
+
+ if(pro.updateDynamicStyle)
+ {
+ let styleSheets = win.document.styleSheets;
+ for(let i = 0; i < styleSheets.length; i++)
+ {
+ let styleSheet = styleSheets[i];
+ if(styleSheet.href == "chrome://browser/skin/statusbar/dynamic.css")
+ {
+ pro.updateDynamicStyle(styleSheet);
+ break;
+ }
+ }
+ }
+ },
+
+ setBoolElementAttribute: function(elem, attr, val)
+ {
+ if(val)
+ {
+ elem.setAttribute(attr, "true");
+ }
+ else
+ {
+ elem.removeAttribute(attr);
+ }
+ },
+
+ setStringElementAttribute: function(elem, attr, val)
+ {
+ if(val)
+ {
+ elem.setAttribute(attr, val);
+ }
+ else
+ {
+ elem.removeAttribute(attr);
+ }
+ },
+
+ resetPrefs: function()
+ {
+ let childPrefs = this.prefs.getChildList("");
+ childPrefs.forEach(function(pref)
+ {
+ if(this.prefs.prefHasUserValue(pref))
+ {
+ this.prefs.clearUserPref(pref);
+ }
+ }, this);
+ }
};
const NSGetFactory = XPCOMUtils.generateNSGetFactory([Status_4_Evar]);
diff --git a/application/palemoon/config/version.txt b/application/palemoon/config/version.txt
index 1d43844fa..b117d70fa 100644
--- a/application/palemoon/config/version.txt
+++ b/application/palemoon/config/version.txt
@@ -1 +1 @@
-27.9.0a1 \ No newline at end of file
+28.0.0a1 \ No newline at end of file
diff --git a/application/palemoon/configure.in b/application/palemoon/configure.in
index 379c4e515..0dbb0d8bc 100644
--- a/application/palemoon/configure.in
+++ b/application/palemoon/configure.in
@@ -5,7 +5,12 @@ dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
dnl Things we need to carry from confvars.sh
-
+AC_DEFINE(MOZ_PHOENIX)
+AC_SUBST(MOZ_PHOENIX)
+AC_DEFINE(MC_PALEMOON)
+AC_SUBST(MC_PALEMOON)
+AC_DEFINE(MOZ_PHOENIX_EXTENSIONS)
+AC_SUBST(MOZ_PHOENIX_EXTENSIONS)
dnl Optional parts of the build.
diff --git a/application/palemoon/confvars.sh b/application/palemoon/confvars.sh
index 7466d0c3c..8a1d00c68 100644
--- a/application/palemoon/confvars.sh
+++ b/application/palemoon/confvars.sh
@@ -3,58 +3,103 @@
# 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_BASENAME=Palemoon
+# Application Basename and Vendor
+# MOZ_APP_BASENAME and MOZ_APP_VENDOR must not have spaces.
+# These values where appropriate are hardcoded in application.ini
+# to "Pale Moon" and "Moonchild Productions" respectively for
+# Pale Moon
+MOZ_APP_BASENAME=Palemoon
MOZ_APP_VENDOR=Moonchild
-MOZ_UPDATER=1
+
+# Application Version
+# MOZ_APP_VERSION is read from ./config/version.txt
+# MOZ_APP_VERSION_DISPLAY is not used in Pale Moon so set it
+# to MOZ_APP_VERSION
+MOZ_APP_VERSION=`cat ${_topsrcdir}/$MOZ_BUILD_APP/config/version.txt`
+MOZ_APP_VERSION_DISPLAY=$MOZ_APP_VERSION
+
+# Application ID
+# This is a unique identifier used for the application
+# Most frequently the AppID is used for targetApplication
+# in extensions and for chrome manifests
+MOZ_APP_ID={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}
+
+# Use static Application INI File
+MOZ_APP_STATIC_INI=1
+
+# Application Branding
+# The default is MOZ_BRANDING_DIRECTORY and should never point to
+# official branding by default.
+# Changing MOZ_*BRANDING_DIRECTORY requires a clobber because branding
+# dependencies are broken.
+# MOZ_APP_DISPLAYNAME will be set by [branding]/configure.sh
+MOZ_BRANDING_DIRECTORY=$MOZ_BUILD_APP/branding/unofficial
+MOZ_OFFICIAL_BRANDING_DIRECTORY=$MOZ_BUILD_APP/branding/official
+
+# Enables conditional code in the platform for Pale Moon only
+MC_PALEMOON=1
+
+# Enables conditional code in the platform for historically
+# Firefox-like browsers
MOZ_PHOENIX=1
-if test "$OS_TARGET" = "WINNT"; then
- MOZ_BUNDLED_FONTS=1
-fi
+# Browser Feature: Status bar Component
+MOZ_BROWSER_STATUSBAR=1
-MOZ_CHROME_FILE_FORMAT=omni
+# Browser Feature: Profile Migration Component
+MOZ_PROFILE_MIGRATOR=1
+
+# Platform Feature: Application Update Service
+# 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
+
+# Platform Feature: Developer Tools
+# XXX: Devtools are disabled until they can be made to work with Pale Moon
+MOZ_DEVTOOLS=1
+
+# Platform Feature: "Phoenix" Extensions Support aka Dual-guid system.
+# Allows installation of Firefox GUID targeted extensions despite having
+# a different Application ID
+# On UXP this is a possible feature only for the Tycho Add-ons Manager
+MOZ_PHOENIX_EXTENSIONS=1
+
+# Platform Feature: Sync Service
MOZ_SERVICES_COMMON=1
-MOZ_MEDIA_NAVIGATOR=1
-MOZ_SERVICES_CRYPTO=1
MOZ_SERVICES_SYNC=1
-MOZ_APP_VERSION=`cat ${_topsrcdir}/$MOZ_BUILD_APP/config/version.txt`
-MOZ_EXTENSIONS_DEFAULT=" gio"
-MOZ_SERVICES_FXACCOUNTS=1
-MOZ_DISABLE_EXPORT_JS=1
-MOZ_WEBGL_CONFORMANT=1
-MOZ_ACTIVITIES=1
+# Platform Feature: JS based Downloads Manager
MOZ_JSDOWNLOADS=1
-MOZ_WEBM_ENCODER=1
-MOZ_PHOENIX_EXTENSIONS=1
-MOZ_BROWSER_STATUSBAR=1
+# Platform Feature: Conformant WebGL
+# Exposes the "webgl" context name, which is reserved for
+# conformant implementations.
+MOZ_WEBGL_CONFORMANT=1
-#disabled by default on desktop.
-MOZ_DEVTOOLS=
-
-# MOZ_APP_DISPLAYNAME will be set by branding/configure.sh
-# Changing MOZ_*BRANDING_DIRECTORY requires a clobber to ensure correct results,
-# because branding dependencies are broken.
-# MOZ_BRANDING_DIRECTORY is the default branding directory used when none is
-# specified. It should never point to the "official" branding directory.
-# For mozilla-beta, mozilla-release, or mozilla-central repositories, use
-# "nightly" branding (until bug 659568 is fixed).
-# For the mozilla-aurora repository, use "aurora".
-MOZ_BRANDING_DIRECTORY=browser/branding/unofficial
-MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official
-# New Pale Moon App GUID
-# Firefox MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
-MOZ_APP_ID={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}
-# 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=palemoon-release
-# The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
-MAR_CHANNEL_ID=palemoon-release
-MOZ_PROFILE_MIGRATOR=1
-MOZ_EXTENSION_MANAGER=1
-MOZ_APP_STATIC_INI=1
+# Platform Feature: Windows Maintaince Service
+# XXX: This is never used
+if test "$OS_ARCH" = "WINNT"; then
+ MOZ_MAINTENANCE_SERVICE=
+fi
+
+# Set the chrome packing format
+# Possible values are omni, jar, and flat
+# Currently, only omni and flat are supported
+MOZ_CHROME_FILE_FORMAT=omni
+
+# Set the default top-level extensions
+MOZ_EXTENSIONS_DEFAULT=" gio"
+
+# Fold Libs
if test "$OS_TARGET" = "WINNT" -o "$OS_TARGET" = "Darwin"; then
MOZ_FOLD_LIBS=1
fi
+
+# Include bundled fonts
+if test "$OS_ARCH" = "WINNT" -o \
+ "$OS_ARCH" = "Linux"; then
+ MOZ_BUNDLED_FONTS=1
+fi
diff --git a/application/palemoon/fonts/EmojiOneMozilla.ttf b/application/palemoon/fonts/EmojiOneMozilla.ttf
deleted file mode 100644
index 50356509d..000000000
--- a/application/palemoon/fonts/EmojiOneMozilla.ttf
+++ /dev/null
Binary files differ
diff --git a/application/palemoon/fonts/README.txt b/application/palemoon/fonts/README.txt
index 188ea3fff..bf5cb7e6e 100644
--- a/application/palemoon/fonts/README.txt
+++ b/application/palemoon/fonts/README.txt
@@ -1,9 +1,9 @@
-EmojiOne Mozilla
+Twemoji Mozilla
================
-The upstream repository of EmojiOne Mozilla can be found at
+The upstream repository of Twemoji Mozilla can be found at
- https://github.com/mozilla/emojione-colr
+ https://github.com/mozilla/twemoji-colr
Please refer commit history for the current version of the font.
-This file purposely omit the version, so there is no need to update it here.
+This file purposely omits the version, so there is no need to update it here.
diff --git a/application/palemoon/fonts/TwemojiMozilla.ttf b/application/palemoon/fonts/TwemojiMozilla.ttf
new file mode 100644
index 000000000..8139089f1
--- /dev/null
+++ b/application/palemoon/fonts/TwemojiMozilla.ttf
Binary files differ
diff --git a/application/palemoon/fonts/moz.build b/application/palemoon/fonts/moz.build
index 93d07120b..02c027c46 100644
--- a/application/palemoon/fonts/moz.build
+++ b/application/palemoon/fonts/moz.build
@@ -4,8 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-if CONFIG['OS_ARCH'] in ('WINNT'):
+if CONFIG['OS_ARCH'] in ('WINNT', 'Linux'):
DIST_SUBDIR = ''
FINAL_TARGET_FILES.fonts += [
- 'EmojiOneMozilla.ttf'
+ 'TwemojiMozilla.ttf'
]
diff --git a/application/palemoon/installer/Makefile.in b/application/palemoon/installer/Makefile.in
index 7ba8ae9e8..368b16efc 100644
--- a/application/palemoon/installer/Makefile.in
+++ b/application/palemoon/installer/Makefile.in
@@ -34,9 +34,9 @@ ifdef MOZ_ENABLE_GNOME_COMPONENT
DEFINES += -DMOZ_ENABLE_GNOME_COMPONENT=1
endif
-ifdef MOZ_WIDGET_GTK
+ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
DEFINES += -DMOZ_GTK=1
-ifdef MOZ_ENABLE_GTK3
+ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
DEFINES += -DMOZ_GTK3=1
endif
endif
@@ -65,18 +65,14 @@ endif
DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
# Set MSVC dlls version to package, if any.
-ifdef WIN32_REDIST_DIR
ifdef MOZ_NO_DEBUG_RTL
+ifdef WIN32_REDIST_DIR
DEFINES += -DMOZ_PACKAGE_MSVC_DLLS=1
DEFINES += -DMSVC_C_RUNTIME_DLL=$(MSVC_C_RUNTIME_DLL)
DEFINES += -DMSVC_CXX_RUNTIME_DLL=$(MSVC_CXX_RUNTIME_DLL)
-DEFINES += -DMSVC_OPENMP_DLL=$(MSVC_OPENMP_DLL)
-ifdef MSVC_APPCRT_DLL
-DEFINES += -DMSVC_APPCRT_DLL=$(MSVC_APPCRT_DLL)
-endif
-ifdef MSVC_DESKTOPCRT_DLL
-DEFINES += -DMSVC_DESKTOPCRT_DLL=$(MSVC_DESKTOPCRT_DLL)
endif
+ifdef WIN_UCRT_REDIST_DIR
+DEFINES += -DMOZ_PACKAGE_WIN_UCRT_DLLS=1
endif
endif
@@ -135,16 +131,17 @@ AB = $(firstword $(subst -, ,$(AB_CD)))
DEFINES += -DAB=$(AB)
DEFINES += -DMOZ_ICU_VERSION=$(MOZ_ICU_VERSION)
-ifdef MOZ_NATIVE_ICU
-DEFINES += -DMOZ_NATIVE_ICU
+ifdef MOZ_SYSTEM_ICU
+DEFINES += -DMOZ_SYSTEM_ICU
endif
-ifdef MOZ_SHARED_ICU
-DEFINES += -DMOZ_SHARED_ICU
+ifdef MOZ_ICU_DATA_ARCHIVE
+DEFINES += -DMOZ_ICU_DATA_ARCHIVE
endif
ifdef MOZ_JEMALLOC3
DEFINES += -DMOZ_JEMALLOC3
endif
DEFINES += -DMOZ_ICU_DBG_SUFFIX=$(MOZ_ICU_DBG_SUFFIX)
+DEFINES += -DICU_DATA_FILE=$(ICU_DATA_FILE)
ifdef CLANG_CXX
DEFINES += -DCLANG_CXX
endif
@@ -161,7 +158,7 @@ endif
libs::
- $(MAKE) -C $(DEPTH)/browser/locales langpack
+ $(MAKE) -C $(DEPTH)/application/palemoon/locales langpack
ifeq (WINNT,$(OS_ARCH))
PKGCOMP_FIND_OPTS =
diff --git a/application/palemoon/installer/package-manifest.in b/application/palemoon/installer/package-manifest.in
index a581ff469..f7b12838b 100644
--- a/application/palemoon/installer/package-manifest.in
+++ b/application/palemoon/installer/package-manifest.in
@@ -35,10 +35,11 @@
#ifdef XP_MACOSX
; Mac bundle stuff
@APPNAME@/Contents/Info.plist
+@APPNAME@/Contents/Library/LaunchServices
@APPNAME@/Contents/PkgInfo
@RESPATH@/firefox.icns
@RESPATH@/document.icns
-@RESPATH@/@AB@.lproj/*
+@RESPATH@/@LPROJ_ROOT@.lproj/*
#endif
[@AB_CD@]
@@ -51,14 +52,14 @@
@RESPATH@/browser/defaults/profile/localstore.rdf
@RESPATH@/browser/defaults/profile/mimeTypes.rdf
@RESPATH@/dictionaries/*
-#if defined(XP_WIN)
+#if defined(XP_WIN) || defined(XP_LINUX)
@RESPATH@/fonts/*
#endif
@RESPATH@/hyphenation/*
@RESPATH@/browser/@PREF_DIR@/palemoon-l10n.js
@RESPATH@/browser/searchplugins/*
-#ifdef XP_WIN32
-@RESPATH@/uninstall/helper.exe
+#ifdef HAVE_MAKENSISU
+@BINPATH@/uninstall/helper.exe
#endif
#ifdef MOZ_UPDATER
@RESPATH@/update.locale
@@ -67,10 +68,6 @@
[xpcom]
@RESPATH@/dependentlibs.list
-#ifdef GKMEDIAS_SHARED_LIBRARY
-@BINPATH@/@DLL_PREFIX@gkmedias@DLL_SUFFIX@
-#endif
-@BINPATH@/@DLL_PREFIX@mozalloc@DLL_SUFFIX@
#ifdef MOZ_SHARED_MOZGLUE
@BINPATH@/@DLL_PREFIX@mozglue@DLL_SUFFIX@
#endif
@@ -80,7 +77,7 @@
#ifdef MOZ_DMD
@BINPATH@/@DLL_PREFIX@dmd@DLL_SUFFIX@
#endif
-#ifndef MOZ_NATIVE_NSPR
+#ifndef MOZ_SYSTEM_NSPR
#ifndef MOZ_FOLD_LIBS
@BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@plc4@DLL_SUFFIX@
@@ -100,60 +97,32 @@
#endif
#ifdef XP_WIN32
@BINPATH@/plugin-hang-ui@BIN_SUFFIX@
-#ifdef MOZ_PACKAGE_MSVC_DLLS
+#if MOZ_PACKAGE_MSVC_DLLS
@BINPATH@/@MSVC_C_RUNTIME_DLL@
@BINPATH@/@MSVC_CXX_RUNTIME_DLL@
-@BINPATH@/@MSVC_OPENMP_DLL@
-#ifdef MSVC_APPCRT_DLL
-@BINPATH@/@MSVC_APPCRT_DLL@
-#endif
-#ifdef MSVC_DESKTOPCRT_DLL
-@BINPATH@/@MSVC_DESKTOPCRT_DLL@
-#endif
-#endif
-#endif
-#ifndef MOZ_NATIVE_ICU
-#ifdef MOZ_SHARED_ICU
-#ifdef XP_WIN
-#ifdef MOZ_DEBUG
-@BINPATH@/icudt@MOZ_ICU_DBG_SUFFIX@@MOZ_ICU_VERSION@.dll
-@BINPATH@/icuin@MOZ_ICU_DBG_SUFFIX@@MOZ_ICU_VERSION@.dll
-@BINPATH@/icuuc@MOZ_ICU_DBG_SUFFIX@@MOZ_ICU_VERSION@.dll
-#else
-@BINPATH@/icudt@MOZ_ICU_VERSION@.dll
-@BINPATH@/icuin@MOZ_ICU_VERSION@.dll
-@BINPATH@/icuuc@MOZ_ICU_VERSION@.dll
#endif
-#elif defined(XP_MACOSX)
-@BINPATH@/libicudata.@MOZ_ICU_VERSION@.dylib
-@BINPATH@/libicui18n.@MOZ_ICU_VERSION@.dylib
-@BINPATH@/libicuuc.@MOZ_ICU_VERSION@.dylib
-#elif defined(XP_UNIX)
-@BINPATH@/libicudata.so.@MOZ_ICU_VERSION@
-@BINPATH@/libicui18n.so.@MOZ_ICU_VERSION@
-@BINPATH@/libicuuc.so.@MOZ_ICU_VERSION@
+#if MOZ_PACKAGE_WIN_UCRT_DLLS
+@BINPATH@/api-ms-win-*.dll
+@BINPATH@/ucrtbase.dll
#endif
#endif
-#endif
-#ifdef MOZ_REPLACE_MALLOC
-#ifndef MOZ_JEMALLOC3
-@BINPATH@/@DLL_PREFIX@replace_jemalloc@DLL_SUFFIX@
-#endif
+#ifdef MOZ_ICU_DATA_ARCHIVE
+@RESPATH@/@ICU_DATA_FILE@
#endif
#ifdef MOZ_GTK3
@BINPATH@/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
-@BINPATH@/@DLL_PREFIX@mozgtk2@DLL_SUFFIX@
+@BINPATH@/gtk2/@DLL_PREFIX@mozgtk@DLL_SUFFIX@
#endif
[browser]
; [Base Browser Files]
#ifndef XP_UNIX
@BINPATH@/@MOZ_APP_NAME@.exe
-@BINPATH@/palemoon.VisualElementsManifest.xml
+@BINPATH@/@MOZ_APP_NAME@.VisualElementsManifest.xml
@BINPATH@/browser/VisualElements/VisualElements_150.png
@BINPATH@/browser/VisualElements/VisualElements_70.png
#else
-@RESPATH@/@MOZ_APP_NAME@-bin
+@BINPATH@/@MOZ_APP_NAME@-bin
@BINPATH@/@MOZ_APP_NAME@
#endif
@RESPATH@/application.ini
@@ -161,490 +130,67 @@
@RESPATH@/update-settings.ini
#endif
@RESPATH@/platform.ini
-#ifndef MOZ_NATIVE_SQLITE
+#ifndef MOZ_SYSTEM_SQLITE
#ifndef MOZ_FOLD_LIBS
@BINPATH@/@DLL_PREFIX@mozsqlite3@DLL_SUFFIX@
#endif
#endif
+@BINPATH@/@DLL_PREFIX@lgpllibs@DLL_SUFFIX@
+#ifdef MOZ_FFVPX
+@BINPATH@/@DLL_PREFIX@mozavutil@DLL_SUFFIX@
+@BINPATH@/@DLL_PREFIX@mozavcodec@DLL_SUFFIX@
+#endif
@RESPATH@/browser/blocklist.xml
#ifdef XP_UNIX
#ifndef XP_MACOSX
@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@/browser/components/components.manifest
-@RESPATH@/components/alerts.xpt
+@RESPATH@/components/*
+@RESPATH@/browser/components/*
+#ifdef MOZ_ARTIFACT_BUILDS
+#endif
#ifdef ACCESSIBILITY
#ifdef XP_WIN32
+@BINPATH@/Accessible.tlb
@BINPATH@/AccessibleMarshal.dll
+@BINPATH@/IA2Marshal.dll
+#endif
#endif
-@RESPATH@/components/accessibility.xpt
-#endif
-@RESPATH@/components/appshell.xpt
-@RESPATH@/components/appstartup.xpt
-@RESPATH@/components/autocomplete.xpt
-@RESPATH@/components/autoconfig.xpt
-@RESPATH@/components/browser-element.xpt
-@RESPATH@/browser/components/browsercompsbase.xpt
-@RESPATH@/browser/components/browser-feeds.xpt
-@RESPATH@/components/caps.xpt
-@RESPATH@/components/chrome.xpt
-@RESPATH@/components/commandhandler.xpt
-@RESPATH@/components/commandlines.xpt
-@RESPATH@/components/compartments.xpt
-@RESPATH@/components/composer.xpt
-@RESPATH@/components/content_events.xpt
-@RESPATH@/components/content_html.xpt
-@RESPATH@/components/content_goannamediaplugins.xpt
#ifdef MOZ_WEBRTC
-@RESPATH@/components/content_webrtc.xpt
-#endif
-@RESPATH@/components/content_xslt.xpt
-@RESPATH@/components/cookie.xpt
-@RESPATH@/components/devtools_security.xpt
-@RESPATH@/components/directory.xpt
-@RESPATH@/components/docshell.xpt
-@RESPATH@/components/dom.xpt
-#ifdef MOZ_ACTIVITIES
-@RESPATH@/components/dom_activities.xpt
-@RESPATH@/components/dom_messages.xpt
-#endif
-@RESPATH@/components/dom_apps.xpt
-@RESPATH@/components/dom_base.xpt
-@RESPATH@/components/dom_system.xpt
-#ifdef MOZ_B2G_BT
-@RESPATH@/components/dom_bluetooth.xpt
-#endif
-@RESPATH@/components/dom_canvas.xpt
-@RESPATH@/components/dom_alarm.xpt
-@RESPATH@/components/dom_core.xpt
-@RESPATH@/components/dom_css.xpt
-@RESPATH@/components/dom_devicestorage.xpt
-@RESPATH@/components/dom_events.xpt
-@RESPATH@/components/dom_geolocation.xpt
-@RESPATH@/components/dom_media.xpt
-@RESPATH@/components/dom_network.xpt
-@RESPATH@/components/dom_notification.xpt
-@RESPATH@/components/dom_html.xpt
-@RESPATH@/components/dom_offline.xpt
-@RESPATH@/components/dom_json.xpt
-@RESPATH@/components/dom_power.xpt
-@RESPATH@/components/dom_quota.xpt
-@RESPATH@/components/dom_range.xpt
-@RESPATH@/components/dom_security.xpt
-@RESPATH@/components/dom_settings.xpt
-@RESPATH@/components/dom_permissionsettings.xpt
-@RESPATH@/components/dom_sidebar.xpt
-@RESPATH@/components/dom_cellbroadcast.xpt
-@RESPATH@/components/dom_mobilemessage.xpt
-@RESPATH@/components/dom_storage.xpt
-@RESPATH@/components/dom_stylesheets.xpt
-@RESPATH@/components/dom_telephony.xpt
-@RESPATH@/components/dom_traversal.xpt
-@RESPATH@/components/dom_tv.xpt
-@RESPATH@/components/dom_voicemail.xpt
+#endif
#ifdef MOZ_WEBSPEECH
-@RESPATH@/components/dom_webspeechrecognition.xpt
-#endif
-@RESPATH@/components/dom_workers.xpt
-@RESPATH@/components/dom_xbl.xpt
-@RESPATH@/components/dom_xpath.xpt
-@RESPATH@/components/dom_xul.xpt
-#ifdef MOZ_GAMEPAD
-@RESPATH@/components/dom_gamepad.xpt
-#endif
-#ifdef MOZ_PAY
-@RESPATH@/components/dom_payment.xpt
-#endif
-@RESPATH@/components/dom_presentation.xpt
-@RESPATH@/components/downloads.xpt
-@RESPATH@/components/editor.xpt
-@RESPATH@/components/embed_base.xpt
-@RESPATH@/components/extensions.xpt
-@RESPATH@/components/exthandler.xpt
-@RESPATH@/components/exthelper.xpt
-@RESPATH@/components/fastfind.xpt
-@RESPATH@/components/feeds.xpt
-#ifdef MOZ_GTK
-@RESPATH@/components/filepicker.xpt
-#endif
-@RESPATH@/components/find.xpt
-@RESPATH@/browser/components/fuel.xpt
-@RESPATH@/components/gfx.xpt
-@RESPATH@/components/html5.xpt
-@RESPATH@/components/htmlparser.xpt
-@RESPATH@/components/identity.xpt
-@RESPATH@/components/imglib2.xpt
-@RESPATH@/components/inspector.xpt
-@RESPATH@/components/intl.xpt
-@RESPATH@/components/jar.xpt
-@RESPATH@/components/jsdebugger.xpt
-@RESPATH@/components/jsdownloads.xpt
-@RESPATH@/components/jsinspector.xpt
-@RESPATH@/components/layout_base.xpt
-
-#ifdef NS_PRINTING
-@RESPATH@/components/layout_printing.xpt
-#endif
-@RESPATH@/components/layout_xul_tree.xpt
-@RESPATH@/components/layout_xul.xpt
-@RESPATH@/components/locale.xpt
-@RESPATH@/components/lwbrk.xpt
-@RESPATH@/browser/components/migration.xpt
-@RESPATH@/components/mimetype.xpt
-@RESPATH@/components/mozfind.xpt
-@RESPATH@/components/necko_about.xpt
-@RESPATH@/components/necko_cache.xpt
-@RESPATH@/components/necko_cache2.xpt
-@RESPATH@/components/necko_cookie.xpt
-@RESPATH@/components/necko_dns.xpt
-@RESPATH@/components/necko_file.xpt
-@RESPATH@/components/necko_ftp.xpt
-@RESPATH@/components/necko_http.xpt
-@RESPATH@/components/necko_res.xpt
-@RESPATH@/components/necko_socket.xpt
-@RESPATH@/components/necko_strconv.xpt
-@RESPATH@/components/necko_viewsource.xpt
-@RESPATH@/components/necko_websocket.xpt
-#ifdef NECKO_WIFI
-@RESPATH@/components/necko_wifi.xpt
#endif
-@RESPATH@/components/necko_wyciwyg.xpt
-@RESPATH@/components/necko.xpt
-@RESPATH@/components/loginmgr.xpt
-@RESPATH@/components/parentalcontrols.xpt
-#ifdef MOZ_WEBRTC
-@RESPATH@/components/peerconnection.xpt
-#endif
-@RESPATH@/components/places.xpt
-@RESPATH@/components/plugin.xpt
-@RESPATH@/components/pref.xpt
-@RESPATH@/components/prefetch.xpt
-@RESPATH@/components/profile.xpt
-@RESPATH@/components/rdf.xpt
-@RESPATH@/components/satchel.xpt
-@RESPATH@/components/saxparser.xpt
-@RESPATH@/browser/components/sessionstore.xpt
-@RESPATH@/components/services-crypto-component.xpt
-#ifdef MOZ_CAPTIVEDETECT
-@RESPATH@/components/captivedetect.xpt
-#endif
-@RESPATH@/browser/components/shellservice.xpt
-#ifdef MOZ_BROWSER_STATUSBAR
-@RESPATH@/browser/components/status4evar.xpt
-#endif
-@RESPATH@/components/shistory.xpt
-@RESPATH@/components/spellchecker.xpt
-@RESPATH@/components/storage.xpt
-@RESPATH@/components/toolkit_asyncshutdown.xpt
-@RESPATH@/components/toolkit_filewatcher.xpt
-@RESPATH@/components/toolkit_finalizationwitness.xpt
-@RESPATH@/components/toolkit_formautofill.xpt
-@RESPATH@/components/toolkit_osfile.xpt
-@RESPATH@/components/toolkit_xulstore.xpt
-@RESPATH@/components/toolkitprofile.xpt
-#ifdef MOZ_ENABLE_XREMOTE
-@RESPATH@/components/toolkitremote.xpt
-#endif
-@RESPATH@/components/txtsvc.xpt
-@RESPATH@/components/txmgr.xpt
-@RESPATH@/components/uconv.xpt
-@RESPATH@/components/unicharutil.xpt
-@RESPATH@/components/update.xpt
-@RESPATH@/components/uriloader.xpt
-@RESPATH@/components/urlformatter.xpt
-@RESPATH@/components/webBrowser_core.xpt
-@RESPATH@/components/webbrowserpersist.xpt
-@RESPATH@/components/widget.xpt
-#ifdef XP_MACOSX
-@RESPATH@/components/widget_cocoa.xpt
-#endif
-@RESPATH@/components/windowds.xpt
-@RESPATH@/components/windowwatcher.xpt
-@RESPATH@/components/xpcom_base.xpt
-@RESPATH@/components/xpcom_system.xpt
-@RESPATH@/components/xpcom_components.xpt
-@RESPATH@/components/xpcom_ds.xpt
-@RESPATH@/components/xpcom_io.xpt
-@RESPATH@/components/xpcom_threads.xpt
-@RESPATH@/components/xpcom_xpti.xpt
-@RESPATH@/components/xpconnect.xpt
-@RESPATH@/components/xulapp.xpt
-@RESPATH@/components/xul.xpt
-@RESPATH@/components/xultmpl.xpt
-@RESPATH@/components/zipwriter.xpt
-@RESPATH@/components/telemetry.xpt
-
-; JavaScript components
-@RESPATH@/components/ChromeNotifications.js
-@RESPATH@/components/ChromeNotifications.manifest
-@RESPATH@/components/ConsoleAPI.manifest
-@RESPATH@/components/ConsoleAPIStorage.js
-@RESPATH@/components/BrowserElementParent.manifest
-@RESPATH@/components/BrowserElementParent.js
-@RESPATH@/components/FeedProcessor.manifest
-@RESPATH@/components/FeedProcessor.js
-@RESPATH@/browser/components/BrowserFeeds.manifest
-@RESPATH@/browser/components/FeedConverter.js
-@RESPATH@/browser/components/FeedWriter.js
-@RESPATH@/browser/components/fuelApplication.manifest
-@RESPATH@/browser/components/fuelApplication.js
-@RESPATH@/browser/components/WebContentConverter.js
-@RESPATH@/browser/components/BrowserComponents.manifest
-@RESPATH@/browser/components/nsBrowserContentHandler.js
-@RESPATH@/browser/components/nsBrowserGlue.js
-@RESPATH@/browser/components/nsSetDefaultBrowser.manifest
-@RESPATH@/browser/components/nsSetDefaultBrowser.js
-@RESPATH@/browser/components/BrowserDownloads.manifest
-@RESPATH@/browser/components/DownloadsStartup.js
-@RESPATH@/browser/components/DownloadsUI.js
-@RESPATH@/browser/components/BrowserPlaces.manifest
-@RESPATH@/components/Downloads.manifest
-@RESPATH@/components/DownloadLegacy.js
-@RESPATH@/components/BrowserPageThumbs.manifest
-@RESPATH@/components/crashmonitor.manifest
-@RESPATH@/components/nsCrashMonitor.js
-@RESPATH@/components/SiteSpecificUserAgent.js
-@RESPATH@/components/SiteSpecificUserAgent.manifest
-@RESPATH@/components/toolkitsearch.manifest
-@RESPATH@/components/nsSearchService.js
-@RESPATH@/components/nsSearchSuggestions.js
-@RESPATH@/components/nsSidebar.js
-@RESPATH@/components/passwordmgr.manifest
-@RESPATH@/components/nsLoginInfo.js
-@RESPATH@/components/nsLoginManager.js
-@RESPATH@/components/nsLoginManagerPrompter.js
-@RESPATH@/components/storage-json.js
-@RESPATH@/components/crypto-SDR.js
-@RESPATH@/components/jsconsole-clhandler.manifest
-@RESPATH@/components/jsconsole-clhandler.js
-#ifdef MOZ_DEVTOOLS
-@RESPATH@/components/devtools-clhandler.manifest
-@RESPATH@/components/devtools-clhandler.js
-#endif
-@RESPATH@/components/webvtt.xpt
-@RESPATH@/components/WebVTT.manifest
-@RESPATH@/components/WebVTTParserWrapper.js
#ifdef MOZ_GTK
-@RESPATH@/components/nsFilePicker.manifest
-@RESPATH@/components/nsFilePicker.js
-#endif
-@RESPATH@/components/nsHelperAppDlg.manifest
-@RESPATH@/components/nsHelperAppDlg.js
-@RESPATH@/components/NetworkGeolocationProvider.manifest
-@RESPATH@/components/NetworkGeolocationProvider.js
-@RESPATH@/components/extensions.manifest
-@RESPATH@/components/addonManager.js
-@RESPATH@/components/amContentHandler.js
-@RESPATH@/components/amInstallTrigger.js
-@RESPATH@/components/amWebInstallListener.js
-@RESPATH@/components/nsBlocklistService.js
-#ifdef MOZ_UPDATER
-@RESPATH@/components/nsUpdateService.manifest
-@RESPATH@/components/nsUpdateService.js
-@RESPATH@/components/nsUpdateServiceStub.js
-#endif
-@RESPATH@/components/nsUpdateTimerManager.manifest
-@RESPATH@/components/nsUpdateTimerManager.js
-@RESPATH@/components/addoncompat.manifest
-@RESPATH@/components/multiprocessShims.js
-@RESPATH@/components/remoteTagService.js
-@RESPATH@/components/pluginGlue.manifest
-@RESPATH@/components/ProcessSingleton.manifest
-@RESPATH@/components/MainProcessSingleton.js
-@RESPATH@/components/ContentProcessSingleton.js
-@RESPATH@/browser/components/nsSessionStore.manifest
-@RESPATH@/browser/components/nsSessionStartup.js
-@RESPATH@/browser/components/nsSessionStore.js
-@RESPATH@/components/nsURLFormatter.manifest
-@RESPATH@/components/nsURLFormatter.js
-@RESPATH@/browser/components/@DLL_PREFIX@browsercomps@DLL_SUFFIX@
-@RESPATH@/components/txEXSLTRegExFunctions.manifest
-@RESPATH@/components/txEXSLTRegExFunctions.js
-@RESPATH@/components/toolkitplaces.manifest
-@RESPATH@/components/nsLivemarkService.js
-@RESPATH@/components/nsTaggingService.js
-@RESPATH@/components/nsPlacesAutoComplete.manifest
-@RESPATH@/components/nsPlacesAutoComplete.js
-@RESPATH@/components/UnifiedComplete.manifest
-@RESPATH@/components/UnifiedComplete.js
-@RESPATH@/components/nsPlacesExpiration.js
-@RESPATH@/browser/components/PlacesProtocolHandler.js
-@RESPATH@/components/PlacesCategoriesStarter.js
-@RESPATH@/components/ColorAnalyzer.js
-@RESPATH@/components/PageThumbsProtocol.js
-@RESPATH@/components/nsDefaultCLH.manifest
-@RESPATH@/components/nsDefaultCLH.js
-@RESPATH@/components/nsContentPrefService.manifest
-@RESPATH@/components/nsContentPrefService.js
-@RESPATH@/components/nsContentDispatchChooser.manifest
-@RESPATH@/components/nsContentDispatchChooser.js
-@RESPATH@/components/nsHandlerService.manifest
-@RESPATH@/components/nsHandlerService.js
-@RESPATH@/components/nsWebHandlerApp.manifest
-@RESPATH@/components/nsWebHandlerApp.js
-@RESPATH@/components/satchel.manifest
-@RESPATH@/components/nsFormAutoComplete.js
-@RESPATH@/components/nsFormHistory.js
-@RESPATH@/components/FormHistoryStartup.js
-@RESPATH@/components/nsInputListAutoComplete.js
-@RESPATH@/components/formautofill.manifest
-@RESPATH@/components/FormAutofillContentService.js
-@RESPATH@/components/FormAutofillStartup.js
-@RESPATH@/components/contentAreaDropListener.manifest
-@RESPATH@/components/contentAreaDropListener.js
-@RESPATH@/browser/components/BrowserProfileMigrators.manifest
-@RESPATH@/browser/components/ProfileMigrator.js
-@RESPATH@/browser/components/ChromeProfileMigrator.js
-@RESPATH@/browser/components/FirefoxProfileMigrator.js
-#ifdef MOZ_BROWSER_STATUSBAR
-@RESPATH@/browser/components/status4evar.js
-@RESPATH@/browser/components/status4evar.manifest
#endif
-#ifdef XP_WIN
-@RESPATH@/browser/components/IEProfileMigrator.js
-@RESPATH@/browser/components/SafariProfileMigrator.js
+#ifdef NS_PRINTING
#endif
-#ifdef XP_MACOSX
-@RESPATH@/browser/components/SafariProfileMigrator.js
-#endif
-#ifdef MOZ_ENABLE_DBUS
-@RESPATH@/components/@DLL_PREFIX@dbusservice@DLL_SUFFIX@
-#endif
-#ifdef MOZ_ENABLE_GNOME_COMPONENT
-@RESPATH@/components/@DLL_PREFIX@mozgnome@DLL_SUFFIX@
-#endif
-#ifdef MOZ_ENABLE_GNOMEVFS
-@RESPATH@/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
-#endif
-#if defined(MOZ_ENABLE_DBUS) || defined(MOZ_ENABLE_GNOME_COMPONENT) || defined(MOZ_ENABLE_GNOMEVFS)
-@RESPATH@/components/components.manifest
-#endif
-@RESPATH@/components/nsINIProcessor.manifest
-@RESPATH@/components/nsINIProcessor.js
-@RESPATH@/components/nsPrompter.manifest
-@RESPATH@/components/nsPrompter.js
-#ifdef MOZ_DATA_REPORTING
-@RESPATH@/components/DataReporting.manifest
-@RESPATH@/components/DataReportingService.js
-#endif
-#ifdef MOZ_SERVICES_HEALTHREPORT
-@RESPATH@/components/HealthReportComponents.manifest
-@RESPATH@/browser/components/SelfSupportService.manifest
-@RESPATH@/browser/components/SelfSupportService.js
-#endif
-#ifdef MOZ_SERVICES_SYNC
-@RESPATH@/components/SyncComponents.manifest
-@RESPATH@/components/Weave.js
-#endif
-#ifdef MOZ_CAPTIVEDETECT
-@RESPATH@/components/CaptivePortalDetectComponents.manifest
-@RESPATH@/components/captivedetect.js
-#endif
-@RESPATH@/components/servicesComponents.manifest
-@RESPATH@/components/cryptoComponents.manifest
-@RESPATH@/components/TelemetryStartup.js
-@RESPATH@/components/TelemetryStartup.manifest
-@RESPATH@/components/XULStore.js
-@RESPATH@/components/XULStore.manifest
-@RESPATH@/components/messageWakeupService.js
-@RESPATH@/components/messageWakeupService.manifest
-@RESPATH@/components/SettingsManager.js
-@RESPATH@/components/SettingsManager.manifest
-@RESPATH@/components/Webapps.js
-@RESPATH@/components/Webapps.manifest
-@RESPATH@/components/AppsService.js
-@RESPATH@/components/AppsService.manifest
-@RESPATH@/components/nsDOMIdentity.js
-@RESPATH@/components/nsIDService.js
-@RESPATH@/components/Identity.manifest
-@RESPATH@/components/recording-cmdline.js
-@RESPATH@/components/recording-cmdline.manifest
-@RESPATH@/components/htmlMenuBuilder.js
-@RESPATH@/components/htmlMenuBuilder.manifest
-
-@RESPATH@/components/RequestSync.manifest
-@RESPATH@/components/RequestSyncManager.js
-@RESPATH@/components/RequestSyncScheduler.js
-
-@RESPATH@/components/PermissionSettings.js
-@RESPATH@/components/PermissionSettings.manifest
-@RESPATH@/components/ContactManager.js
-@RESPATH@/components/ContactManager.manifest
-@RESPATH@/components/PhoneNumberService.js
-@RESPATH@/components/PhoneNumberService.manifest
-@RESPATH@/components/NotificationStorage.js
-@RESPATH@/components/NotificationStorage.manifest
-@RESPATH@/components/AlarmsManager.js
-@RESPATH@/components/AlarmsManager.manifest
-@RESPATH@/components/Push.js
-@RESPATH@/components/Push.manifest
-@RESPATH@/components/PushServiceLauncher.js
-
-@RESPATH@/components/SlowScriptDebug.manifest
-@RESPATH@/components/SlowScriptDebug.js
-
-#ifndef RELEASE_BUILD
-@RESPATH@/components/InterAppComm.manifest
-@RESPATH@/components/InterAppCommService.js
-@RESPATH@/components/InterAppConnection.js
-@RESPATH@/components/InterAppMessagePort.js
+#ifdef MOZ_ENABLE_PROFILER_SPS
#endif
-
-@RESPATH@/components/TCPSocket.js
-@RESPATH@/components/TCPServerSocket.js
-@RESPATH@/components/TCPSocketParentIntermediary.js
-@RESPATH@/components/TCPSocket.manifest
-
-#ifdef MOZ_ACTIVITIES
-@RESPATH@/components/SystemMessageCache.js
-@RESPATH@/components/SystemMessageInternal.js
-@RESPATH@/components/SystemMessageManager.js
-@RESPATH@/components/SystemMessageManager.manifest
-
-@RESPATH@/components/Activities.manifest
-@RESPATH@/components/ActivityProxy.js
-@RESPATH@/components/ActivityRequestHandler.js
-@RESPATH@/components/ActivityWrapper.js
-@RESPATH@/components/ActivityMessageConfigurator.js
+#ifdef ENABLE_INTL_API
#endif
-
-#ifdef MOZ_PAY
-@RESPATH@/components/Payment.js
-@RESPATH@/components/PaymentFlowInfo.js
-@RESPATH@/components/Payment.manifest
+#ifdef NECKO_WIFI
#endif
-
#ifdef MOZ_WEBRTC
-@RESPATH@/components/PeerConnection.js
-@RESPATH@/components/PeerConnection.manifest
+#endif
+#ifdef MOZ_ENABLE_PROFILER_SPS
+#endif
+#ifdef MOZ_ENABLE_XREMOTE
+#endif
+#ifdef XP_MACOSX
#endif
@RESPATH@/chrome/marionette@JAREXT@
@RESPATH@/chrome/marionette.manifest
-@RESPATH@/components/MarionetteComponents.manifest
-@RESPATH@/components/marionettecomponent.js
-
-#ifdef MOZ_WEBSPEECH
-@RESPATH@/components/dom_webspeechsynth.xpt
-#endif
-
-@RESPATH@/components/nsAsyncShutdown.manifest
-@RESPATH@/components/nsAsyncShutdown.js
-
-@RESPATH@/components/PresentationDeviceInfoManager.manifest
-@RESPATH@/components/PresentationDeviceInfoManager.js
-
-; InputMethod API
-@RESPATH@/components/MozKeyboard.js
-@RESPATH@/components/InputMethod.manifest
-
-#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
-@RESPATH@/components/TestInterfaceJS.js
-@RESPATH@/components/TestInterfaceJS.manifest
-#endif
; Modules
@RESPATH@/browser/modules/*
@@ -658,15 +204,17 @@
#ifdef MOZ_D3DCOMPILER_VISTA_DLL
@BINPATH@/@MOZ_D3DCOMPILER_VISTA_DLL@
#endif
-
#endif # MOZ_ANGLE_RENDERER
; [Browser Chrome Files]
@RESPATH@/browser/chrome.manifest
@RESPATH@/browser/chrome/browser@JAREXT@
@RESPATH@/browser/chrome/browser.manifest
-@RESPATH@/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf
+#ifdef XP_WIN
+@RESPATH@/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/chrome.manifest
+#endif
@RESPATH@/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/icon.png
+@RESPATH@/browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf
@RESPATH@/chrome/toolkit@JAREXT@
@RESPATH@/chrome/toolkit.manifest
@RESPATH@/chrome/recording.manifest
@@ -677,6 +225,16 @@
@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
+@RESPATH@/browser/@PREF_DIR@/devtools.js
+
; shell icons
#ifdef XP_UNIX
#ifndef XP_MACOSX
@@ -693,28 +251,16 @@
; All the pref files must be part of base to prevent migration bugs
@RESPATH@/browser/@PREF_DIR@/palemoon.js
@RESPATH@/browser/@PREF_DIR@/palemoon-branding.js
-@RESPATH@/goanna.js
-@RESPATH@/defaults/autoconfig/platform.js
+@RESPATH@/greprefs.js
@RESPATH@/defaults/autoconfig/prefcalls.js
-@RESPATH@/browser/defaults/profile/prefs.js
-#ifndef LIBXUL_SDK
; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)
; Technically this is an app pref file, but we are keeping it in the original
; gre location for now.
@RESPATH@/defaults/pref/channel-prefs.js
-#else
-; For Fx-on-xr, channel-prefs lives with the app preferences. (Bug 762588)
-@RESPATH@/@PREF_DIR@/channel-prefs.js
-#endif
; Services (gre) prefs
-#ifdef MOZ_SERVICES_NOTIFICATIONS
-@RESPATH@/defaults/pref/services-notifications.js
-#endif
-#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.
@@ -749,7 +295,7 @@
@RESPATH@/res/fonts/*
@RESPATH@/res/dtd/*
@RESPATH@/res/html/*
-#if defined(XP_MACOSX) || defined(XP_WIN)
+#if defined(XP_MACOSX)
; For SafariProfileMigrator.js.
@RESPATH@/res/langGroups.properties
#endif
@@ -761,15 +307,13 @@
; svg
@RESPATH@/res/svg.css
-@RESPATH@/components/dom_svg.xpt
-@RESPATH@/components/dom_smil.xpt
; [Personal Security Manager]
;
; NSS libraries are signed in the staging directory,
; meaning their .chk files are created there directly.
;
-#ifndef MOZ_NATIVE_NSS
+#ifndef MOZ_SYSTEM_NSS
#if defined(XP_LINUX) && !defined(ANDROID)
@BINPATH@/@DLL_PREFIX@freeblpriv3@DLL_SUFFIX@
#else
@@ -789,20 +333,22 @@
#endif
@RESPATH@/chrome/pippki@JAREXT@
@RESPATH@/chrome/pippki.manifest
-@RESPATH@/components/pipboot.xpt
-@RESPATH@/components/pipnss.xpt
-@RESPATH@/components/pippki.xpt
; For process sandboxing
#if defined(MOZ_SANDBOX)
#if defined(XP_WIN)
-@BINPATH@/@DLL_PREFIX@sandboxbroker@DLL_SUFFIX@
#if defined(WOW_HELPER)
@BINPATH@/wow_helper.exe
#endif
#endif
#endif
+#if defined(MOZ_SANDBOX)
+#if defined(XP_LINUX)
+@BINPATH@/@DLL_PREFIX@mozsandbox@DLL_SUFFIX@
+#endif
+#endif
+
; for Solaris SPARC
#ifdef SOLARIS
bin/libfreebl_32fpu_3.so
@@ -820,13 +366,7 @@ bin/libfreebl_32int64_3.so
#endif
#endif
-@RESPATH@/components/DataStore.manifest
-@RESPATH@/components/DataStoreImpl.js
-@RESPATH@/components/dom_datastore.xpt
-
; Shutdown Terminator
-@RESPATH@/components/nsTerminatorTelemetry.js
-@RESPATH@/components/terminator.manifest
#if defined(CLANG_CXX)
#if defined(MOZ_ASAN) || defined(MOZ_TSAN)
@@ -835,5 +375,5 @@ bin/libfreebl_32int64_3.so
#endif
#if defined(MOZ_ASAN) && defined(CLANG_CL)
-@BINPATH@/clang_rt.asan_dynamic-i386.dll
+@BINPATH@/clang_rt.asan_dynamic-*.dll
#endif
diff --git a/application/palemoon/installer/removed-files.in b/application/palemoon/installer/removed-files.in
index 8bfd72e4e..8801d1cb0 100644
--- a/application/palemoon/installer/removed-files.in
+++ b/application/palemoon/installer/removed-files.in
@@ -65,29 +65,27 @@
# platforms.
# Common File Removals
+# This is located under the "distribution/" directory and it was added before
+# Firefox 27
+@DIR_MACOS@distribution/extensions/testpilot@labs.mozilla.com.xpi
-# Some users are ending up with unpacked chrome instead of omni.ja. This
-# causes updates to break badly, see bug 1063052. Removing the toplevel
-# chrome.manifest causes us to use the updated omni.ja.
-#ifndef MOZ_GTK
- @DIR_MACOS@chrome.manifest
- #ifdef XP_MACOSX
- @DIR_RESOURCES@chrome.manifest
- #endif
+# Mac OS X v2 signing removals
+#ifdef XP_MACOSX
+ @DIR_MACOS@active-update.xml
+ @DIR_MACOS@update-settings.ini
+ @DIR_MACOS@updates.xml
+ @DIR_MACOS@defaults/*
+ @DIR_MACOS@updates/*
#endif
# Common Directory removals
+@DIR_MACOS@chrome/
#ifdef XP_UNIX
#ifndef XP_MACOSX
chrome/icons/
chrome/icons/default/
#endif
#endif
-
-# Remove previously-bundled ruby/s4e extensions
-@DIR_MACOS@distribution/bundles/statusbar@palemoon.org/*
-@DIR_MACOS@distribution/bundles/{3ff46564-d77c-491c-bfc5-fc555c87dbc4}/*
-
@DIR_MACOS@chrome/overlayinfo/
@DIR_MACOS@components/
@DIR_MACOS@defaults/autoconfig/
@@ -114,4 +112,5 @@
@DIR_MACOS@plugins/MRJPlugin.plugin/*
Contents/Plug-Ins/PrintPDE.plugin/*
#endif
+@DIR_MACOS@searchplugins/*
@DIR_MACOS@webapprt/components/
diff --git a/application/palemoon/installer/windows/Makefile.in b/application/palemoon/installer/windows/Makefile.in
index 127456765..8c434c54f 100644
--- a/application/palemoon/installer/windows/Makefile.in
+++ b/application/palemoon/installer/windows/Makefile.in
@@ -5,9 +5,7 @@
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
CONFIG_DIR = instgen
-SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/firefox/7zSD.sfx
-APP_VERSION := $(shell cat $(srcdir)/../../config/version.txt)
-DEFINES += -DAPP_VERSION=$(APP_VERSION)
+SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/palemoon/7zSD.sfx
INSTALLER_FILES = \
app.tag \
@@ -16,6 +14,12 @@ INSTALLER_FILES = \
nsis/shared.nsh \
$(NULL)
+ifdef MOZ_MAINTENANCE_SERVICE
+INSTALLER_FILES += \
+ nsis/maintenanceservice_installer.nsi \
+ $(NULL)
+endif
+
BRANDING_FILES = \
branding.nsi \
appname.bmp \
@@ -24,13 +28,6 @@ BRANDING_FILES = \
wizWatermark.bmp \
$(NULL)
-DEFINES += \
- -DAB_CD=$(AB_CD) \
- -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
- -DMOZ_APP_DISPLAYNAME="${MOZ_APP_DISPLAYNAME}" \
- -DMOZILLA_VERSION=${MOZILLA_VERSION} \
- $(NULL)
-
include $(topsrcdir)/config/config.mk
ifdef LOCALE_MERGEDIR
@@ -61,6 +58,17 @@ 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)
diff --git a/application/palemoon/installer/windows/moz.build b/application/palemoon/installer/windows/moz.build
index 895d11993..12e7831ed 100644
--- a/application/palemoon/installer/windows/moz.build
+++ b/application/palemoon/installer/windows/moz.build
@@ -1,6 +1,11 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# -*- 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/.
+DEFINES['APP_VERSION'] = CONFIG['MOZ_APP_VERSION']
+
+DEFINES['MOZ_APP_NAME'] = CONFIG['MOZ_APP_NAME']
+DEFINES['MOZ_APP_DISPLAYNAME'] = CONFIG['MOZ_APP_DISPLAYNAME']
+DEFINES['MOZILLA_VERSION'] = CONFIG['MOZILLA_VERSION']
diff --git a/application/palemoon/installer/windows/nsis/defines.nsi.in b/application/palemoon/installer/windows/nsis/defines.nsi.in
index ad171a5d6..97422c4f6 100644
--- a/application/palemoon/installer/windows/nsis/defines.nsi.in
+++ b/application/palemoon/installer/windows/nsis/defines.nsi.in
@@ -3,6 +3,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/.
+# 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@"
@@ -14,13 +31,17 @@
!define DDEApplication "Pale Moon"
!define AppRegName "Pale Moon"
+!ifndef DEV_EDITION
!define BrandShortName "@MOZ_APP_DISPLAYNAME@"
+!endif
!define BrandFullName "${BrandFullNameInternal}"
-!define NO_UNINSTALL_SURVEY
-
-# !define CERTIFICATE_NAME "Mozilla Corporation"
-# !define CERTIFICATE_ISSUER "Thawte Code Signing CA - G2"
+!define CERTIFICATE_NAME "Mozilla Corporation"
+!define CERTIFICATE_ISSUER "DigiCert SHA2 Assured ID Code Signing CA"
+; Changing the name or issuer requires us to have both the old and the new
+; in the registry at the same time, temporarily.
+!define CERTIFICATE_NAME_PREVIOUS "Mozilla Corporation"
+!define CERTIFICATE_ISSUER_PREVIOUS "DigiCert Assured ID Code Signing CA-1"
# LSP_CATEGORIES is the permitted LSP categories for the application. Each LSP
# category value is ANDed together to set multiple permitted categories.
@@ -39,20 +60,26 @@
#ifdef HAVE_64BIT_BUILD
!define HAVE_64BIT_BUILD
!define ARCH "x64"
-!define MinSupportedVer "Microsoft Windows Vista x64"
+!define MinSupportedVer "Microsoft Windows 7 x64"
#else
!define ARCH "x86"
-!define MinSupportedVer "Microsoft Windows Vista"
+!define MinSupportedVer "Microsoft Windows 7"
+#endif
+
+!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" "Pale Moon"
-VIAddVersionKey "CompanyName" "Moonchild Productions"
+VIAddVersionKey "ProductName" "${BrandShortName}"
+VIAddVersionKey "CompanyName" "${CompanyName}"
#ifdef MOZ_OFFICIAL_BRANDING
-VIAddVersionKey "LegalTrademarks" "Pale Moon is the intellectual property of Moonchild Productions."
+VIAddVersionKey "LegalTrademarks" "${BrandShortName} is a Trademark of Moonchild Productions."
#endif
-VIAddVersionKey "LegalCopyright" "Moonchild Productions"
+VIAddVersionKey "LegalCopyright" "${CompanyName}"
VIAddVersionKey "FileVersion" "${AppVersion}"
VIAddVersionKey "ProductVersion" "${AppVersion}"
# Comments is not used but left below commented out for future reference
diff --git a/application/palemoon/installer/windows/nsis/installer.nsi b/application/palemoon/installer/windows/nsis/installer.nsi
index 147a56c9b..276b94f74 100644
--- a/application/palemoon/installer/windows/nsis/installer.nsi
+++ b/application/palemoon/installer/windows/nsis/installer.nsi
@@ -5,7 +5,7 @@
# Required Plugins:
# AppAssocReg http://nsis.sourceforge.net/Application_Association_Registration_plug-in
# ApplicationID http://nsis.sourceforge.net/ApplicationID_plug-in
-# CityHash http://mxr.mozilla.org/mozilla-central/source/other-licenses/nsis/Contrib/CityHash
+# CityHash http://dxr.mozilla.org/mozilla-central/source/other-licenses/nsis/Contrib/CityHash
# ShellLink http://nsis.sourceforge.net/ShellLink_plug-in
# UAC http://nsis.sourceforge.net/UAC_plug-in
# ServicesHelper Mozilla specific plugin that is located in /other-licenses/nsis
@@ -21,15 +21,25 @@ CRCCheck on
RequestExecutionLevel user
+; 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 ./
Var TmpVal
Var InstallType
Var AddStartMenuSC
+Var AddTaskbarSC
Var AddQuickLaunchSC
Var AddDesktopSC
Var InstallMaintenanceService
Var PageName
+Var PreventRebootRequired
; By defining NO_STARTMENU_DIR an installer that doesn't provide an option for
; an application's Start Menu PROGRAMS directory and doesn't define the
@@ -82,6 +92,7 @@ VIAddVersionKey "OriginalFilename" "setup.exe"
!insertmacro InitHashAppModelId
!insertmacro IsHandlerForInstallDir
!insertmacro IsPinnedToTaskBar
+!insertmacro IsUserAdmin
!insertmacro LogDesktopShortcut
!insertmacro LogQuickLaunchShortcut
!insertmacro LogStartMenuShortcut
@@ -90,6 +101,7 @@ VIAddVersionKey "OriginalFilename" "setup.exe"
!insertmacro RegCleanAppHandler
!insertmacro RegCleanMain
!insertmacro RegCleanUninstall
+!insertmacro RemovePrecompleteEntries
!insertmacro SetAppLSPCategories
!insertmacro SetBrandNameVars
!insertmacro UpdateShortcutAppModelIDs
@@ -153,6 +165,11 @@ 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
@@ -185,7 +202,42 @@ Section "-InstallStartCleanup"
SetOutPath "$INSTDIR"
${StartInstallLog} "${BrandFullName}" "${AB_CD}" "${AppVersion}" "${GREVersion}"
- ; Delete the app exe to prevent launching the app while we are installing.
+ StrCpy $R9 "true"
+ StrCpy $PreventRebootRequired "false"
+ ${GetParameters} $R8
+ ${GetOptions} "$R8" "/INI=" $R7
+ ${Unless} ${Errors}
+ ; The configuration file must also exist
+ ${If} ${FileExists} "$R7"
+ ReadINIStr $R9 $R7 "Install" "RemoveDistributionDir"
+ ReadINIStr $R8 $R7 "Install" "PreventRebootRequired"
+ ${If} $R8 == "true"
+ StrCpy $PreventRebootRequired "true"
+ ${EndIf}
+ ${EndIf}
+ ${EndUnless}
+
+ ; Remove directories and files we always control before parsing the uninstall
+ ; log so empty directories can be removed.
+ ${If} ${FileExists} "$INSTDIR\updates"
+ RmDir /r "$INSTDIR\updates"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\updated"
+ RmDir /r "$INSTDIR\updated"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\defaults\shortcuts"
+ RmDir /r "$INSTDIR\defaults\shortcuts"
+ ${EndIf}
+ ; Only remove the distribution directory if it exists and if the installer
+ ; isn't launched with an ini file that has RemoveDistributionDir=false in the
+ ; install section.
+ ${If} ${FileExists} "$INSTDIR\distribution"
+ ${AndIf} $R9 != "false"
+ RmDir /r "$INSTDIR\distribution"
+ ${EndIf}
+
+ ; Delete the app exe if present to prevent launching the app while we are
+ ; installing.
ClearErrors
${DeleteFile} "$INSTDIR\${FileMainEXE}"
${If} ${Errors}
@@ -201,9 +253,31 @@ Section "-InstallStartCleanup"
${InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs"
; Remove the updates directory for Vista and above
- ${CleanUpdateDirectories} "Mozilla\Firefox" "Mozilla\updates"
+ ${CleanUpdateDirectories} "Mozilla\Pale Moon" "Mozilla\updates"
${RemoveDeprecatedFiles}
+ ${RemovePrecompleteEntries} "false"
+
+ ${If} ${FileExists} "$INSTDIR\defaults\pref\channel-prefs.js"
+ Delete "$INSTDIR\defaults\pref\channel-prefs.js"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\defaults\pref"
+ RmDir "$INSTDIR\defaults\pref"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\defaults"
+ RmDir "$INSTDIR\defaults"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\uninstall"
+ ; Remove the uninstall directory that we control
+ RmDir /r "$INSTDIR\uninstall"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\update-settings.ini"
+ Delete "$INSTDIR\update-settings.ini"
+ ${EndIf}
+
+ ; Explictly remove empty webapprt dir in case it exists (bug 757978).
+ RmDir "$INSTDIR\webapprt\components"
+ RmDir "$INSTDIR\webapprt"
${InstallStartCleanupCommon}
SectionEnd
@@ -215,8 +289,6 @@ Section "-Application" APP_IDX
DetailPrint $(STATUS_INSTALL_APP)
SetDetailsPrint none
- RmDir /r /REBOOTOK "$INSTDIR\${TO_BE_DELETED}"
-
${LogHeader} "Installing Main Files"
${CopyFilesFromDir} "$EXEDIR\core" "$INSTDIR" \
"$(ERROR_CREATE_DIRECTORY_PREFIX)" \
@@ -237,18 +309,6 @@ Section "-Application" APP_IDX
${LogMsg} "Registered: $INSTDIR\AccessibleMarshal.dll"
${EndIf}
- ; Write extra files created by the application to the uninstall log so they
- ; will be removed when the application is uninstalled. To remove an empty
- ; directory write a bogus filename to the deepest directory and all empty
- ; parent directories will be removed.
- ${LogUninstall} "File: \components\compreg.dat"
- ${LogUninstall} "File: \components\xpti.dat"
- ${LogUninstall} "File: \active-update.xml"
- ${LogUninstall} "File: \install.log"
- ${LogUninstall} "File: \install_status.log"
- ${LogUninstall} "File: \install_wizard.log"
- ${LogUninstall} "File: \updates.xml"
-
ClearErrors
; Default for creating Start Menu shortcut
@@ -336,10 +396,12 @@ 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
@@ -353,16 +415,53 @@ 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}"
@@ -437,6 +536,13 @@ Section "-Application" APP_IDX
${EndIf}
${EndIf}
+ ; Update lastwritetime of the Start Menu shortcut to clear the tile cache.
+ ${If} ${AtLeastWin8}
+ ${AndIf} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
+ FileOpen $0 "$SMPROGRAMS\${BrandFullName}.lnk" a
+ FileClose $0
+ ${EndIf}
+
${If} $AddDesktopSC == 1
CreateShortCut "$DESKTOP\${BrandFullName}.lnk" "$INSTDIR\${FileMainEXE}"
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
@@ -472,6 +578,13 @@ 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.
@@ -481,8 +594,35 @@ Section "-InstallEndCleanup"
SetDetailsPrint none
${Unless} ${Silent}
+ ClearErrors
${MUI_INSTALLOPTIONS_READ} $0 "summary.ini" "Field 4" "State"
${If} "$0" == "1"
+ ; NB: this code is duplicated in stub.nsi. Please keep in sync.
+ ; For data migration in the app, we want to know what the default browser
+ ; value was before we changed it. To do so, we read it here and store it
+ ; in our own registry key.
+ StrCpy $0 ""
+ ${If} ${AtLeastWinVista}
+ AppAssocReg::QueryCurrentDefault "http" "protocol" "effective"
+ Pop $1
+ ; If the method hasn't failed, $1 will contain the progid. Check:
+ ${If} "$1" != "method failed"
+ ${AndIf} "$1" != "method not available"
+ ; Read the actual command from the progid
+ ReadRegStr $0 HKCR "$1\shell\open\command" ""
+ ${EndIf}
+ ${EndIf}
+ ; If using the App Association Registry didn't happen or failed, fall back
+ ; to the effective http default:
+ ${If} "$0" == ""
+ ReadRegStr $0 HKCR "http\shell\open\command" ""
+ ${EndIf}
+ ; If we have something other than empty string now, write the value.
+ ${If} "$0" != ""
+ ClearErrors
+ WriteRegStr HKCU "Software\Mozilla\Pale Moon" "OldDefaultBrowserCommand" "$0"
+ ${EndIf}
+
${LogHeader} "Setting as the default browser"
ClearErrors
${GetParameters} $0
@@ -493,46 +633,64 @@ Section "-InstallEndCleanup"
GetFunctionAddress $0 SetAsDefaultAppUserHKCU
UAC::ExecCodeSegment $0
${EndIf}
+ ${ElseIfNot} ${Errors}
+ ${LogHeader} "Writing default-browser opt-out"
+ ClearErrors
+ WriteRegStr HKCU "Software\Mozilla\Pale Moon" "DefaultBrowserOptOut" "True"
+ ${If} ${Errors}
+ ${LogMsg} "Error writing default-browser opt-out"
+ ${EndIf}
${EndIf}
- ; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details).
- ${MigrateTaskBarShortcut}
${EndUnless}
- ${GetShortcutsLogPath} $0
- WriteIniStr "$0" "TASKBAR" "Migrated" "true"
+ ; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details).
+ ${MigrateTaskBarShortcut}
+
+ ; Add the Firewall entries during install
+ Call AddFirewallEntries
; Refresh desktop icons
System::Call "shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i ${SHCNF_DWORDFLUSH}, i 0, i 0)"
${InstallEndCleanupCommon}
+ ${If} $PreventRebootRequired == "true"
+ SetRebootFlag false
+ ${EndIf}
+
${If} ${RebootFlag}
- ; When a reboot is required give SHChangeNotify time to finish the
- ; refreshing the icons so the OS doesn't display the icons from helper.exe
- Sleep 10000
- ${LogHeader} "Reboot Required To Finish Installation"
- ; ${FileMainEXE}.moz-upgrade should never exist but just in case...
- ${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-upgrade"
- Rename "$INSTDIR\${FileMainEXE}" "$INSTDIR\${FileMainEXE}.moz-upgrade"
- ${EndUnless}
+ ; Admin is required to delete files on reboot so only add the moz-delete if
+ ; the user is an admin. After calling UAC::IsAdmin $0 will equal 1 if the
+ ; user is an admin.
+ UAC::IsAdmin
+ ${If} "$0" == "1"
+ ; When a reboot is required give SHChangeNotify time to finish the
+ ; refreshing the icons so the OS doesn't display the icons from helper.exe
+ Sleep 10000
+ ${LogHeader} "Reboot Required To Finish Installation"
+ ; ${FileMainEXE}.moz-upgrade should never exist but just in case...
+ ${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-upgrade"
+ Rename "$INSTDIR\${FileMainEXE}" "$INSTDIR\${FileMainEXE}.moz-upgrade"
+ ${EndUnless}
- ${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
- ClearErrors
- Rename "$INSTDIR\${FileMainEXE}" "$INSTDIR\${FileMainEXE}.moz-delete"
- ${Unless} ${Errors}
- Delete /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-delete"
+ ${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
+ ClearErrors
+ Rename "$INSTDIR\${FileMainEXE}" "$INSTDIR\${FileMainEXE}.moz-delete"
+ ${Unless} ${Errors}
+ Delete /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-delete"
+ ${EndUnless}
+ ${EndIf}
+
+ ${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}"
+ CopyFiles /SILENT "$INSTDIR\uninstall\helper.exe" "$INSTDIR"
+ FileOpen $0 "$INSTDIR\${FileMainEXE}" w
+ FileWrite $0 "Will be deleted on restart"
+ Rename /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-upgrade" "$INSTDIR\${FileMainEXE}"
+ FileClose $0
+ Delete "$INSTDIR\${FileMainEXE}"
+ Rename "$INSTDIR\helper.exe" "$INSTDIR\${FileMainEXE}"
${EndUnless}
${EndIf}
-
- ${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}"
- CopyFiles /SILENT "$INSTDIR\uninstall\helper.exe" "$INSTDIR"
- FileOpen $0 "$INSTDIR\${FileMainEXE}" w
- FileWrite $0 "Will be deleted on restart"
- Rename /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-upgrade" "$INSTDIR\${FileMainEXE}"
- FileClose $0
- Delete "$INSTDIR\${FileMainEXE}"
- Rename "$INSTDIR\helper.exe" "$INSTDIR\${FileMainEXE}"
- ${EndUnless}
${EndIf}
SectionEnd
@@ -669,7 +827,9 @@ Function CheckExistingInstall
FunctionEnd
Function LaunchApp
+!ifndef DEV_EDITION
${ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_LAUNCH)"
+!endif
ClearErrors
${GetParameters} $0
@@ -776,9 +936,7 @@ Function leaveShortcuts
Abort
${EndIf}
${MUI_INSTALLOPTIONS_READ} $AddDesktopSC "shortcuts.ini" "Field 2" "State"
-
- ; If we have a Metro browser and are Win8, then we don't have a Field 3
- ${MUI_INSTALLOPTIONS_READ} $AddStartMenuSC "shortcuts.ini" "Field 3" "State"
+ ${MUI_INSTALLOPTIONS_READ} $AddStartMenuSC "shortcuts.ini" "Field 3" "State"
; Don't install the quick launch shortcut on Windows 7
${Unless} ${AtLeastWin7}
@@ -790,6 +948,59 @@ 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
@@ -838,14 +1049,14 @@ Function preSummary
WriteRegStr HKLM "Software\Mozilla" "${BrandShortName}InstallerTest" "Write Test"
${Unless} ${Errors}
DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
- ; Check if Firefox is the http handler for this user.
+ ; Check if 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}
- ; If Firefox isn't the http handler for this user show the option to set
- ; Firefox as the default browser.
+ ; If Pale Moon isn't the http handler for this user show the option to set
+ ; Pale Moon as the default browser.
${If} "$R9" != "true"
${AndIf} ${AtMostWin2008R2}
WriteINIStr "$PLUGINSDIR\summary.ini" "Settings" NumFields "4"
@@ -926,7 +1137,46 @@ Function .onInit
StrCpy $LANGUAGE 0
${SetBrandNameVars} "$EXEDIR\core\distribution\setup.ini"
- ${InstallOnInitCommon} "$(WARN_MIN_SUPPORTED_OS_MSG)"
+ ; Don't install on systems that don't support SSE2. The parameter value of
+ ; 10 is for PF_XMMI64_INSTRUCTIONS_AVAILABLE which will check whether the
+ ; SSE2 instruction set is available. Result returned in $R7.
+ System::Call "kernel32::IsProcessorFeaturePresent(i 10)i .R7"
+
+ ; Windows NT 6.0 and lower are not supported on any architecture.
+ ${Unless} ${AtLeastWin7}
+ ${If} "$R7" == "0"
+ strCpy $R7 "$(WARN_MIN_SUPPORTED_OSVER_CPU_MSG)"
+ ${Else}
+ strCpy $R7 "$(WARN_MIN_SUPPORTED_OSVER_MSG)"
+ ${EndIf}
+ MessageBox MB_OKCANCEL|MB_ICONSTOP "$R7" IDCANCEL +2
+ ExecShell "open" "${URLSystemRequirements}"
+ Quit
+ ${EndUnless}
+
+ ; SSE2 support
+ ${If} "$R7" == "0"
+ MessageBox MB_OKCANCEL|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_CPU_MSG)" IDCANCEL +2
+ ExecShell "open" "${URLSystemRequirements}"
+ Quit
+ ${EndIf}
+
+!ifdef HAVE_64BIT_BUILD
+ ${Unless} ${RunningX64}
+ MessageBox MB_OKCANCEL|MB_ICONSTOP "$(WARN_MIN_SUPPORTED_OSVER_MSG)" IDCANCEL +2
+ ExecShell "open" "${URLSystemRequirements}"
+ Quit
+ ${EndUnless}
+ SetRegView 64
+!endif
+
+ ${InstallOnInitCommon} "$(WARN_MIN_SUPPORTED_OSVER_CPU_MSG)"
+
+; 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
+ System::Call 'user32::SetProcessDPIAware()'
+!endif
!insertmacro InitInstallOptionsFile "options.ini"
!insertmacro InitInstallOptionsFile "shortcuts.ini"
@@ -1016,6 +1266,25 @@ Function .onInit
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
new file mode 100644
index 000000000..1f73bac6a
--- /dev/null
+++ b/application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi
@@ -0,0 +1,332 @@
+# 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 9770d4733..294e3e6fc 100644
--- a/application/palemoon/installer/windows/nsis/shared.nsh
+++ b/application/palemoon/installer/windows/nsis/shared.nsh
@@ -2,12 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-; The registration ID of the COM server which is used for choosing wether
-; to launch the Win8 metro browser or desktop browser.
-!define DELEGATE_EXECUTE_HANDLER_ID {5100FEC1-212B-4BF5-9BF8-3E650FD794A3}
-
!macro PostUpdate
-
; PostUpdate is called from both session 0 and from the user session
; for service updates, make sure that we only register with the user session
; Otherwise ApplicationID::Set can fail intermittently with a file in use error.
@@ -15,7 +10,7 @@
System::Call "kernel32::ProcessIdToSessionId(i $0, *i ${NSIS_MAX_STRLEN} r9)"
; Determine if we're the protected UserChoice default or not. If so fix the
- ; start menu tile. In case there are 2 Pale Moon installations, we only do
+ ; start menu tile. In case there are 2 PaleMoon installations, we only do
; this if the application being updated is the default.
ReadRegStr $0 HKCU "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice" "ProgId"
${If} $0 == "PaleMoonURL"
@@ -61,6 +56,9 @@
; Win7 taskbar and start menu link maintenance
Call FixShortcutAppModelIDs
+ ; Add the Firewall entries after an update
+ Call AddFirewallEntries
+
; Only update the Clients\StartMenuInternet registry key values in HKLM if
; they don't exist or this installation is the same as the one set in those
; keys.
@@ -100,6 +98,13 @@
; root of the Start Menu Programs directory.
${MigrateStartMenuShortcut}
+ ; Update lastwritetime of the Start Menu shortcut to clear the tile cache.
+ ${If} ${AtLeastWin8}
+ ${AndIf} ${FileExists} "$SMPROGRAMS\${BrandFullName}.lnk"
+ FileOpen $0 "$SMPROGRAMS\${BrandFullName}.lnk" a
+ FileClose $0
+ ${EndIf}
+
; Adds a pinned Task Bar shortcut (see MigrateTaskBarShortcut for details).
${MigrateTaskBarShortcut}
@@ -120,6 +125,50 @@
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"
@@ -280,11 +329,11 @@
${If} ${Errors}
WriteRegStr SHCTX "SOFTWARE\Classes\${FILE_TYPE}" "" "PaleMoonHTML"
${EndIf}
+ WriteRegStr SHCTX "SOFTWARE\Classes\${FILE_TYPE}\OpenWithProgids" "PaleMoonHTML" ""
!macroend
!define AddAssociationIfNoneExist "!insertmacro AddAssociationIfNoneExist"
-
-; Adds the protocol and file handler registry entries for making Pale Moon the
+; Adds the protocol and file handler registry entries for making PaleMoon the
; default handler (uses SHCTX).
!macro SetHandlers
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
@@ -318,10 +367,11 @@
WriteRegStr SHCTX "$0\.xhtml" "" "PaleMoonHTML"
${EndIf}
- ;Register file associations, but only if they don't exist yet.
+ ${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
@@ -331,7 +381,6 @@
${AddDisabledDDEHandlerValues} "PaleMoonURL" "$2" "$8,1" "${AppRegName} URL" \
"true"
-
; An empty string is used for the 4th & 5th params because the following
; protocol handlers already have a display name and the additional keys
; required for a protocol handler.
@@ -341,7 +390,7 @@
!macroend
!define SetHandlers "!insertmacro SetHandlers"
-; Adds the HKLM\Software\Clients\StartMenuInternet\{EXE} registry
+; Adds the HKLM\Software\Clients\StartMenuInternet\PALEMOON.EXE registry
; entries (does not use SHCTX).
;
; The values for StartMenuInternet are only valid under HKLM and there can only
@@ -420,7 +469,7 @@
; The IconHandler reference for PaleMoonHTML can end up in an inconsistent state
; due to changes not being detected by the IconHandler for side by side
; installs (see bug 268512). The symptoms can be either an incorrect icon or no
-; icon being displayed for files associated with Pale Moon (does not use SHCTX).
+; icon being displayed for files associated with PaleMoon (does not use SHCTX).
!macro FixShellIconHandler RegKey
ClearErrors
ReadRegStr $1 ${RegKey} "Software\Classes\PaleMoonHTML\ShellEx\IconHandler" ""
@@ -436,37 +485,67 @@
; Add Software\Mozilla\ registry entries (uses SHCTX).
!macro SetAppKeys
+ ; Check if this is an ESR release and if so add registry values so it is
+ ; possible to determine that this is an ESR install (bug 726781).
+ ClearErrors
+ ${WordFind} "${UpdateChannel}" "esr" "E#" $3
+ ${If} ${Errors}
+ StrCpy $3 ""
+ ${Else}
+ StrCpy $3 " ESR"
+ ${EndIf}
+
${GetLongPath} "$INSTDIR" $8
- StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Main"
+ StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion}$3 (${ARCH} ${AB_CD})\Main"
${WriteRegStr2} $TmpVal "$0" "Install Directory" "$8" 0
${WriteRegStr2} $TmpVal "$0" "PathToExe" "$8\${FileMainEXE}" 0
- StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})\Uninstall"
- ${WriteRegStr2} $TmpVal "$0" "Description" "${BrandFullNameInternal} (${ARCH} ${AB_CD})" 0
+ StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion}$3 (${ARCH} ${AB_CD})\Uninstall"
+ ${WriteRegStr2} $TmpVal "$0" "Description" "${BrandFullNameInternal} ${AppVersion}$3 (${ARCH} ${AB_CD})" 0
- StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion} (${AB_CD})"
- ${WriteRegStr2} $TmpVal "$0" "" "${AppVersion} (${AB_CD})" 0
+ StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}\${AppVersion}$3 (${ARCH} ${AB_CD})"
+ ${WriteRegStr2} $TmpVal "$0" "" "${AppVersion}$3 (${ARCH} ${AB_CD})" 0
+ ${If} "$3" == ""
+ DeleteRegValue SHCTX "$0" "ESR"
+ ${Else}
+ ${WriteRegDWORD2} $TmpVal "$0" "ESR" 1 0
+ ${EndIf}
- StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}\bin"
+ StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}$3\bin"
${WriteRegStr2} $TmpVal "$0" "PathToExe" "$8\${FileMainEXE}" 0
- StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}\extensions"
+ StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}$3\extensions"
${WriteRegStr2} $TmpVal "$0" "Components" "$8\components" 0
${WriteRegStr2} $TmpVal "$0" "Plugins" "$8\plugins" 0
- StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}"
- ${WriteRegStr2} $TmpVal "$0" "GoannaVer" "${GREVersion}" 0
+ StrCpy $0 "Software\Mozilla\${BrandFullNameInternal} ${AppVersion}$3"
+ ${WriteRegStr2} $TmpVal "$0" "GeckoVer" "${GREVersion}" 0
+ ${If} "$3" == ""
+ DeleteRegValue SHCTX "$0" "ESR"
+ ${Else}
+ ${WriteRegDWORD2} $TmpVal "$0" "ESR" 1 0
+ ${EndIf}
- StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}"
+ StrCpy $0 "Software\Mozilla\${BrandFullNameInternal}$3"
${WriteRegStr2} $TmpVal "$0" "" "${GREVersion}" 0
- ${WriteRegStr2} $TmpVal "$0" "CurrentVersion" "${AppVersion} (${AB_CD})" 0
+ ${WriteRegStr2} $TmpVal "$0" "CurrentVersion" "${AppVersion}$3 (${ARCH} ${AB_CD})" 0
!macroend
!define SetAppKeys "!insertmacro SetAppKeys"
; Add uninstall registry entries. This macro tests for write access to determine
; if the uninstall keys should be added to HKLM or HKCU.
!macro SetUninstallKeys
- StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} (${ARCH} ${AB_CD})"
+ ; Check if this is an ESR release and if so add registry values so it is
+ ; possible to determine that this is an ESR install (bug 726781).
+ ClearErrors
+ ${WordFind} "${UpdateChannel}" "esr" "E#" $3
+ ${If} ${Errors}
+ StrCpy $3 ""
+ ${Else}
+ StrCpy $3 " ESR"
+ ${EndIf}
+
+ StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\Uninstall\${BrandFullNameInternal} ${AppVersion}$3 (${ARCH} ${AB_CD})"
StrCpy $2 ""
ClearErrors
@@ -493,15 +572,24 @@
${GetLongPath} "$INSTDIR" $8
; Write the uninstall registry keys
- ${WriteRegStr2} $1 "$0" "Comments" "${BrandFullNameInternal} (${ARCH} ${AB_CD})" 0
+ ${WriteRegStr2} $1 "$0" "Comments" "${BrandFullNameInternal} ${AppVersion}$3 (${ARCH} ${AB_CD})" 0
${WriteRegStr2} $1 "$0" "DisplayIcon" "$8\${FileMainEXE},0" 0
- ${WriteRegStr2} $1 "$0" "DisplayName" "${BrandFullNameInternal} (${ARCH} ${AB_CD})" 0
+ ${WriteRegStr2} $1 "$0" "DisplayName" "${BrandFullNameInternal} ${AppVersion}$3 (${ARCH} ${AB_CD})" 0
${WriteRegStr2} $1 "$0" "DisplayVersion" "${AppVersion}" 0
+ ${WriteRegStr2} $1 "$0" "HelpLink" "${HelpLink}" 0
${WriteRegStr2} $1 "$0" "InstallLocation" "$8" 0
${WriteRegStr2} $1 "$0" "Publisher" "Moonchild Productions" 0
${WriteRegStr2} $1 "$0" "UninstallString" "$\"$8\uninstall\helper.exe$\"" 0
- ${WriteRegStr2} $1 "$0" "URLInfoAbout" "${URLInfoAbout}" 0
+ DeleteRegValue SHCTX "$0" "URLInfoAbout"
+; Don't add URLUpdateInfo which is the release notes url except for the release
+; and esr channels since nightly, aurora, and beta do not have release notes.
+; Note: URLUpdateInfo is only defined in the official branding.nsi.
+!ifdef URLUpdateInfo
+!ifndef BETA_UPDATE_CHANNEL
${WriteRegStr2} $1 "$0" "URLUpdateInfo" "${URLUpdateInfo}" 0
+!endif
+!endif
+ ${WriteRegStr2} $1 "$0" "URLInfoAbout" "${URLInfoAbout}" 0
${WriteRegDWORD2} $1 "$0" "NoModify" 1 0
${WriteRegDWORD2} $1 "$0" "NoRepair" 1 0
@@ -518,7 +606,7 @@
!define SetUninstallKeys "!insertmacro SetUninstallKeys"
; Due to a bug when associating some file handlers, only SHCTX was checked for
-; some file types such as ".webm". SHCTX is set to HKCU or HKLM depending on
+; some file types such as ".pdf". SHCTX is set to HKCU or HKLM depending on
; whether the installer has write access to HKLM. The bug would happen when
; HCKU was checked and didn't exist since programs aren't required to set the
; HKCU Software\Classes keys when associating handlers. The fix uses the merged
@@ -534,7 +622,7 @@
ReadRegStr $2 HKCR "${FILE_TYPE}\PersistentHandler" ""
${If} "$2" != ""
; Since there is a persistent handler remove PaleMoonHTML as the default
- ; value from both HKCU and HKLM if it is set to PaleMoonHTML.
+ ; value from both HKCU and HKLM if it set to PaleMoonHTML.
${If} "$0" == "PaleMoonHTML"
DeleteRegValue HKCU "Software\Classes\${FILE_TYPE}" ""
${EndIf}
@@ -542,7 +630,7 @@
DeleteRegValue HKLM "Software\Classes\${FILE_TYPE}" ""
${EndIf}
${ElseIf} "$0" == "PaleMoonHTML"
- ; Since KHCU is set to PaleMoonHTML, remove it as the default value
+ ; Since KHCU is set to PaleMoonHTML remove PaleMoonHTML as the default value
; from HKCU if HKLM is set to a value other than an empty string.
${If} "$1" != ""
DeleteRegValue HKCU "Software\Classes\${FILE_TYPE}" ""
@@ -630,6 +718,54 @@
!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"
@@ -641,10 +777,9 @@
; update if the DefaultIcon is from palemoon.exe (Bug 301073).
${RegCleanAppHandler} "chrome"
- ; Remove the app compatibility registry key
- StrCpy $0 "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"
- DeleteRegValue HKLM "$0" "$INSTDIR\${FileMainEXE}"
- DeleteRegValue HKCU "$0" "$INSTDIR\${FileMainEXE}"
+ ; Remove protocol handler registry keys added by the MS shim
+ DeleteRegKey HKLM "Software\Classes\PaleMoon.URL"
+ DeleteRegKey HKCU "Software\Classes\PaleMoon.URL"
; Delete gopher from Capabilities\URLAssociations if it is present.
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
@@ -671,147 +806,21 @@
RmDir /r /REBOOTOK "$INSTDIR\extensions\talkback@mozilla.org"
${EndIf}
- ; Remove the Java Console extension (bug 597235)
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0012-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0012-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0013-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0013-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0014-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0014-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0015-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0015-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0016-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0016-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0017-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0017-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0018-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0018-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0019-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0019-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0020-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0020-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0021-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0021-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0022-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0015-0000-0022-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0000-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0000-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0001-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0001-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0002-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0002-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0003-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0003-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0004-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0004-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0005-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0005-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0006-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0006-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0007-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0007-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0010-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0010-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0011-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0011-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0012-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0012-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0013-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0013-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0014-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0014-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0015-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0015-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0016-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0016-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0017-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0017-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0018-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0018-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0019-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0019-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0020-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0020-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0021-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0021-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0022-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0022-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0023-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0023-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0024-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0024-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0025-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0025-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0027-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0027-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0028-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0028-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0029-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0029-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0030-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0030-ABCDEFFEDCBA}"
- ${EndIf}
+ ; Remove the Java Console extension (bug 1165156)
${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0031-ABCDEFFEDCBA}"
RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0031-ABCDEFFEDCBA}"
${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0032-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0032-ABCDEFFEDCBA}"
+ ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0034-ABCDEFFEDCBA}"
+ RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0034-ABCDEFFEDCBA}"
${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0000-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0000-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0001-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0001-ABCDEFFEDCBA}"
- ${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0002-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0002-ABCDEFFEDCBA}"
+ ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0039-ABCDEFFEDCBA}"
+ RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0039-ABCDEFFEDCBA}"
${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0003-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0003-ABCDEFFEDCBA}"
+ ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0045-ABCDEFFEDCBA}"
+ RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0016-0000-0045-ABCDEFFEDCBA}"
${EndIf}
- ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0004-ABCDEFFEDCBA}"
- RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0004-ABCDEFFEDCBA}"
+ ${If} ${FileExists} "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0000-ABCDEFFEDCBA}"
+ RmDir /r /REBOOTOK "$INSTDIR\extensions\{CAFEEFAC-0017-0000-0000-ABCDEFFEDCBA}"
${EndIf}
!macroend
!define RemoveDeprecatedFiles "!insertmacro RemoveDeprecatedFiles"
@@ -876,15 +885,15 @@
${If} $5 == ""
${Break}
${EndIf}
- ${If} $5 == 233 ; ansi ??
+ ${If} $5 == 233 ; ansi é
StrCpy $0 "1"
FileWriteByte $4 195
FileWriteByte $4 169
- ${ElseIf} $5 == 241 ; ansi ??
+ ${ElseIf} $5 == 241 ; ansi ñ
StrCpy $0 "1"
FileWriteByte $4 195
FileWriteByte $4 177
- ${ElseIf} $5 == 252 ; ansi ??
+ ${ElseIf} $5 == 252 ; ansi ü
StrCpy $0 "1"
FileWriteByte $4 195
FileWriteByte $4 188
@@ -926,17 +935,24 @@
ClearErrors
WriteIniStr "$0" "TASKBAR" "Migrated" "true"
${If} ${AtLeastWin7}
- ; No need to check the default on Win8 and later
- ${If} ${AtMostWin2008R2}
- ; Check if 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
+ ; 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}
- ${EndIf}
- ${If} "$R9" == "true"
- ${OrIf} ${AtLeastWin8}
+ ${If} "$R9" == "true"
+ ${OrIf} ${AtLeastWin8}
+ ${PinToTaskBar}
+ ${EndIf}
+ ${ElseIf} $AddTaskbarSC == "1"
${PinToTaskBar}
${EndIf}
${EndIf}
@@ -1152,17 +1168,86 @@
; returns after the first check.
Push "end"
Push "AccessibleMarshal.dll"
+ Push "IA2Marshal.dll"
Push "freebl3.dll"
Push "nssckbi.dll"
Push "nspr4.dll"
Push "nssdbm3.dll"
Push "mozsqlite3.dll"
Push "xpcom.dll"
+ Push "crashreporter.exe"
+ Push "minidump-analyzer.exe"
Push "updater.exe"
Push "${FileMainEXE}"
!macroend
!define PushFilesToCheck "!insertmacro PushFilesToCheck"
+
+; Pushes the string "true" to the top of the stack if the Firewall service is
+; running and pushes the string "false" to the top of the stack if it isn't.
+!define SC_MANAGER_ALL_ACCESS 0x3F
+!define SERVICE_QUERY_CONFIG 0x0001
+!define SERVICE_QUERY_STATUS 0x0004
+!define SERVICE_RUNNING 0x4
+
+!macro IsFirewallSvcRunning
+ Push $R9
+ Push $R8
+ Push $R7
+ Push $R6
+ Push "false"
+
+ System::Call 'advapi32::OpenSCManagerW(n, n, i ${SC_MANAGER_ALL_ACCESS}) i.R6'
+ ${If} $R6 != 0
+ ; MpsSvc is the Firewall service on Windows Vista and above.
+ ; When opening the service with SERVICE_QUERY_CONFIG the return value will
+ ; be 0 if the service is not installed.
+ System::Call 'advapi32::OpenServiceW(i R6, t "MpsSvc", i ${SERVICE_QUERY_CONFIG}) i.R7'
+ ${If} $R7 != 0
+ System::Call 'advapi32::CloseServiceHandle(i R7) n'
+ ; Open the service with SERVICE_QUERY_CONFIG so its status can be queried.
+ System::Call 'advapi32::OpenServiceW(i R6, t "MpsSvc", i ${SERVICE_QUERY_STATUS}) i.R7'
+ ${Else}
+ ; SharedAccess is the Firewall service on Windows XP.
+ ; When opening the service with SERVICE_QUERY_CONFIG the return value will
+ ; be 0 if the service is not installed.
+ System::Call 'advapi32::OpenServiceW(i R6, t "SharedAccess", i ${SERVICE_QUERY_CONFIG}) i.R7'
+ ${If} $R7 != 0
+ System::Call 'advapi32::CloseServiceHandle(i R7) n'
+ ; Open the service with SERVICE_QUERY_CONFIG so its status can be
+ ; queried.
+ System::Call 'advapi32::OpenServiceW(i R6, t "SharedAccess", i ${SERVICE_QUERY_STATUS}) i.R7'
+ ${EndIf}
+ ${EndIf}
+ ; Did the calls to OpenServiceW succeed?
+ ${If} $R7 != 0
+ System::Call '*(i,i,i,i,i,i,i) i.R9'
+ ; Query the current status of the service.
+ System::Call 'advapi32::QueryServiceStatus(i R7, i $R9) i'
+ System::Call '*$R9(i, i.R8)'
+ System::Free $R9
+ System::Call 'advapi32::CloseServiceHandle(i R7) n'
+ IntFmt $R8 "0x%X" $R8
+ ${If} $R8 == ${SERVICE_RUNNING}
+ Pop $R9
+ Push "true"
+ ${EndIf}
+ ${EndIf}
+ System::Call 'advapi32::CloseServiceHandle(i R6) n'
+ ${EndIf}
+
+ Exch 1
+ Pop $R6
+ Exch 1
+ Pop $R7
+ Exch 1
+ Pop $R8
+ Exch 1
+ Pop $R9
+!macroend
+!define IsFirewallSvcRunning "!insertmacro IsFirewallSvcRunning"
+!define un.IsFirewallSvcRunning "!insertmacro IsFirewallSvcRunning"
+
; Sets this installation as the default browser by setting the registry keys
; under HKEY_CURRENT_USER via registry calls and using the AppAssocReg NSIS
; plugin for Vista and above. This is a function instead of a macro so it is
@@ -1214,7 +1299,7 @@ Function SetAsDefaultAppUserHKCU
${EndUnless}
${EndIf}
${RemoveDeprecatedKeys}
- ${PinToTaskBar}
+ ${MigrateTaskBarShortcut}
FunctionEnd
; Helper for updating the shortcut application model IDs.
@@ -1225,6 +1310,15 @@ Function FixShortcutAppModelIDs
${EndIf}
FunctionEnd
+; Helper for adding Firewall exceptions during install and after app update.
+Function AddFirewallEntries
+ ${IsFirewallSvcRunning}
+ Pop $0
+ ${If} "$0" == "true"
+ liteFirewallW::AddRule "$INSTDIR\${FileMainEXE}" "${BrandShortName} ($INSTDIR)"
+ ${EndIf}
+FunctionEnd
+
; The !ifdef NO_LOG prevents warnings when compiling the installer.nsi due to
; this function only being used by the uninstaller.nsi.
!ifdef NO_LOG
@@ -1311,4 +1405,4 @@ Function SetAsDefaultAppUser
FunctionEnd
!define SetAsDefaultAppUser "Call SetAsDefaultAppUser"
-!endif
+!endif ; NO_LOG
diff --git a/application/palemoon/installer/windows/nsis/uninstaller.nsi b/application/palemoon/installer/windows/nsis/uninstaller.nsi
index 2ed5d9dfc..333fd33d6 100644
--- a/application/palemoon/installer/windows/nsis/uninstaller.nsi
+++ b/application/palemoon/installer/windows/nsis/uninstaller.nsi
@@ -4,7 +4,7 @@
# Required Plugins:
# AppAssocReg http://nsis.sourceforge.net/Application_Association_Registration_plug-in
-# CityHash http://mxr.mozilla.org/mozilla-central/source/other-licenses/nsis/Contrib/CityHash
+# CityHash http://dxr.mozilla.org/mozilla-central/source/other-licenses/nsis/Contrib/CityHash
# ShellLink http://nsis.sourceforge.net/ShellLink_plug-in
# UAC http://nsis.sourceforge.net/UAC_plug-in
@@ -19,6 +19,14 @@ CRCCheck on
RequestExecutionLevel user
+; 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 ./
; On Vista and above attempt to elevate Standard Users in addition to users that
@@ -32,6 +40,7 @@ RequestExecutionLevel user
"Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"
Var TmpVal
+Var MaintCertKey
; Other included files may depend upon these includes!
; The following includes are provided by NSIS.
@@ -67,6 +76,7 @@ VIAddVersionKey "OriginalFilename" "helper.exe"
!insertmacro InitHashAppModelId
!insertmacro IsHandlerForInstallDir
!insertmacro IsPinnedToTaskBar
+!insertmacro IsUserAdmin
!insertmacro LogDesktopShortcut
!insertmacro LogQuickLaunchShortcut
!insertmacro LogStartMenuShortcut
@@ -85,19 +95,18 @@ VIAddVersionKey "OriginalFilename" "helper.exe"
!insertmacro un.CheckForFilesInUse
!insertmacro un.CleanUpdateDirectories
!insertmacro un.CleanVirtualStore
-!insertmacro un.DeleteRelativeProfiles
!insertmacro un.DeleteShortcuts
!insertmacro un.GetLongPath
!insertmacro un.GetSecondInstallPath
!insertmacro un.InitHashAppModelId
!insertmacro un.ManualCloseAppPrompt
-!insertmacro un.ParseUninstallLog
!insertmacro un.RegCleanAppHandler
!insertmacro un.RegCleanFileHandler
!insertmacro un.RegCleanMain
!insertmacro un.RegCleanUninstall
!insertmacro un.RegCleanProtocolHandler
!insertmacro un.RemoveQuotesFromPath
+!insertmacro un.RemovePrecompleteEntries
!insertmacro un.SetAppLSPCategories
!insertmacro un.SetBrandNameVars
@@ -146,29 +155,69 @@ ShowUnInstDetails nevershow
!insertmacro MUI_UNPAGE_WELCOME
; Custom Uninstall Confirm Page
-UninstPage custom un.preConfirm un.leaveConfirm
+UninstPage custom un.preConfirm
; Remove Files Page
!insertmacro MUI_UNPAGE_INSTFILES
; Finish Page
-; Don't setup the survey controls, functions, etc. when the application has
-; defined NO_UNINSTALL_SURVEY
-!ifndef NO_UNINSTALL_SURVEY
-!define MUI_PAGE_CUSTOMFUNCTION_PRE un.preFinish
-!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
-!define MUI_FINISHPAGE_SHOWREADME ""
-!define MUI_FINISHPAGE_SHOWREADME_TEXT $(SURVEY_TEXT)
-!define MUI_FINISHPAGE_SHOWREADME_FUNCTION un.Survey
-!endif
-
!insertmacro MUI_UNPAGE_FINISH
; Use the default dialog for IDD_VERIFY for a simple Banner
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 ""
@@ -194,15 +243,6 @@ Section "Uninstall"
ClearErrors
${EndIf}
- ${MUI_INSTALLOPTIONS_READ} $0 "unconfirm.ini" "Field 3" "State"
- ${If} "$0" == "1"
- ${un.DeleteRelativeProfiles} "Moonchild Productions\Pale Moon"
- ${un.DeleteRelativeProfiles} "Moonchild Productions\MetroPM"
- RmDir "$APPDATA\Mozilla\Extensions\{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}"
- RmDir "$APPDATA\Mozilla\Extensions"
- RmDir "$APPDATA\Mozilla"
- ${EndIf}
-
; setup the application model id registration value
${un.InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs"
@@ -218,7 +258,7 @@ Section "Uninstall"
${EndIf}
; Remove the updates directory for Vista and above
- ${un.CleanUpdateDirectories} "Moonchild Productions\Pale Moon" "Moonchild Productions\updates"
+ ${un.CleanUpdateDirectories} "Mozilla\PaleMoon" "Mozilla\updates"
; Remove any app model id's stored in the registry for this install path
DeleteRegValue HKCU "Software\Mozilla\${AppName}\TaskBarIDs" "$INSTDIR"
@@ -254,6 +294,10 @@ Section "Uninstall"
${un.RegCleanFileHandler} ".shtml" "PaleMoonHTML"
${un.RegCleanFileHandler} ".xht" "PaleMoonHTML"
${un.RegCleanFileHandler} ".xhtml" "PaleMoonHTML"
+ ${un.RegCleanFileHandler} ".oga" "PaleMoonHTML"
+ ${un.RegCleanFileHandler} ".ogg" "PaleMoonHTML"
+ ${un.RegCleanFileHandler} ".ogv" "PaleMoonHTML"
+ ${un.RegCleanFileHandler} ".pdf" "PaleMoonHTML"
${un.RegCleanFileHandler} ".webm" "PaleMoonHTML"
${EndIf}
@@ -273,7 +317,7 @@ Section "Uninstall"
; The StartMenuInternet registry key is independent of the default browser
; settings. The XPInstall base un-installer always removes this key if it is
; uninstalling the default browser and it will always replace the keys when
- ; installing even if there is another install of Firefox that is set as the
+ ; installing even if there is another install of PaleMoon that is set as the
; default browser. Now the key is always updated on install but it is only
; removed if it refers to this install location.
${If} "$INSTDIR" == "$R1"
@@ -289,7 +333,7 @@ Section "Uninstall"
; The StartMenuInternet registry key is independent of the default browser
; settings. The XPInstall base un-installer always removes this key if it is
; uninstalling the default browser and it will always replace the keys when
- ; installing even if there is another install of Firefox that is set as the
+ ; installing even if there is another install of PaleMoon that is set as the
; default browser. Now the key is always updated on install but it is only
; removed if it refers to this install location.
${If} "$INSTDIR" == "$R1"
@@ -307,7 +351,7 @@ Section "Uninstall"
StrCpy $0 "Software\Microsoft\MediaPlayer\ShimInclusionList\plugin-container.exe"
DeleteRegKey HKLM "$0"
DeleteRegKey HKCU "$0"
- StrCpy $0 "Software\Classes\MIME\Database\Content Type\application/x-xpinstall;app=firefox"
+ StrCpy $0 "Software\Classes\MIME\Database\Content Type\application/x-xpinstall;app=PaleMoon"
DeleteRegKey HKLM "$0"
DeleteRegKey HKCU "$0"
${Else}
@@ -335,42 +379,63 @@ Section "Uninstall"
${If} ${FileExists} "$INSTDIR\distribution"
RmDir /r /REBOOTOK "$INSTDIR\distribution"
${EndIf}
- ${If} ${FileExists} "$INSTDIR\removed-files"
- Delete /REBOOTOK "$INSTDIR\removed-files"
- ${EndIf}
; Remove files that may be left behind by the application in the
; VirtualStore directory.
${un.CleanVirtualStore}
- ; Parse the uninstall log to unregister dll's and remove all installed
- ; files / directories this install is responsible for.
- ${un.ParseUninstallLog}
+ ; Only unregister the dll if the registration points to this installation
+ ReadRegStr $R1 HKCR "CLSID\{0D68D6D0-D93D-4D08-A30D-F00DD1F45B24}\InProcServer32" ""
+ ${If} "$INSTDIR\AccessibleMarshal.dll" == "$R1"
+ ${UnregisterDLL} "$INSTDIR\AccessibleMarshal.dll"
+ ${EndIf}
+
+ ${un.RemovePrecompleteEntries} "false"
- ; Remove the uninstall directory that we control
- RmDir /r /REBOOTOK "$INSTDIR\uninstall"
+ ${If} ${FileExists} "$INSTDIR\defaults\pref\channel-prefs.js"
+ Delete /REBOOTOK "$INSTDIR\defaults\pref\channel-prefs.js"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\defaults\pref"
+ RmDir /REBOOTOK "$INSTDIR\defaults\pref"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\defaults"
+ RmDir /REBOOTOK "$INSTDIR\defaults"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\uninstall"
+ ; Remove the uninstall directory that we control
+ RmDir /r /REBOOTOK "$INSTDIR\uninstall"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\install.log"
+ Delete /REBOOTOK "$INSTDIR\install.log"
+ ${EndIf}
+ ${If} ${FileExists} "$INSTDIR\update-settings.ini"
+ Delete /REBOOTOK "$INSTDIR\update-settings.ini"
+ ${EndIf}
- ; Explictly remove empty webapprt dir in case it exists
- ; See bug 757978
+ ; Explicitly remove empty webapprt dir in case it exists (bug 757978).
RmDir "$INSTDIR\webapprt\components"
RmDir "$INSTDIR\webapprt"
- RmDir /r /REBOOTOK "$INSTDIR\${TO_BE_DELETED}"
-
; Remove the installation directory if it is empty
- ${RemoveDir} "$INSTDIR"
+ RmDir "$INSTDIR"
- ; If firefox.exe was successfully deleted yet we still need to restart to
- ; remove other files create a dummy firefox.exe.moz-delete to prevent the
+ ; If PaleMoon.exe was successfully deleted yet we still need to restart to
+ ; remove other files create a dummy PaleMoon.exe.moz-delete to prevent the
; installer from allowing an install without restart when it is required
; to complete an uninstall.
${If} ${RebootFlag}
- ${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-delete"
- FileOpen $0 "$INSTDIR\${FileMainEXE}.moz-delete" w
- FileWrite $0 "Will be deleted on restart"
- Delete /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-delete"
- FileClose $0
- ${EndUnless}
+ ; Admin is required to delete files on reboot so only add the moz-delete if
+ ; the user is an admin. After calling UAC::IsAdmin $0 will equal 1 if the
+ ; user is an admin.
+ UAC::IsAdmin
+ ${If} "$0" == "1"
+ ${Unless} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-delete"
+ FileOpen $0 "$INSTDIR\${FileMainEXE}.moz-delete" w
+ FileWrite $0 "Will be deleted on restart"
+ Delete /REBOOTOK "$INSTDIR\${FileMainEXE}.moz-delete"
+ FileClose $0
+ ${EndUnless}
+ ${EndIf}
${EndIf}
; Refresh desktop icons otherwise the start menu internet item won't be
@@ -378,19 +443,38 @@ Section "Uninstall"
; clients registry key by the OS under some conditions.
System::Call "shell32::SHChangeNotify(i ${SHCNE_ASSOCCHANGED}, i 0, i 0, i 0)"
-SectionEnd
-
-################################################################################
-# Helper Functions
-
-; Don't setup the survey controls, functions, etc. when the application has
-; defined NO_UNINSTALL_SURVEY
-!ifndef NO_UNINSTALL_SURVEY
-Function un.Survey
- Exec "$\"$TmpVal$\" $\"${SurveyURL}$\""
-FunctionEnd
+ ; Users who uninstall then reinstall expecting PaleMoon to use a clean profile
+ ; may be surprised during first-run. This key is checked during startup of PaleMoon and
+ ; subsequently deleted after checking. If the value is found during startup
+ ; the browser will offer to Reset PaleMoon. We use the UpdateChannel to match
+ ; 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"
+ liteFirewallW::RemoveRule "$INSTDIR\${FileMainEXE}" "${BrandShortName} ($INSTDIR)"
+ ${EndIf}
+SectionEnd
+
################################################################################
# Language
@@ -453,7 +537,7 @@ Function un.preConfirm
${EndIf}
; Setup the unconfirm.ini file for the Custom Uninstall Confirm Page
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "5"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "3"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Type "label"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 1" Text "$(UN_CONFIRM_UNINSTALLED_FROM)"
@@ -473,44 +557,22 @@ Function un.preConfirm
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" Bottom "30"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 2" flags "READONLY"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Type "checkbox"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Text "$(UN_REMOVE_PROFILES)"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Type "label"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Text "$(UN_CONFIRM_CLICK)"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Left "0"
WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Right "-1"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Top "40"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Bottom "50"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" State "0"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" flags "NOTIFY"
-
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Type "text"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" State "$(UN_REMOVE_PROFILES_DESC)"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Left "0"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Right "-1"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Top "52"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Bottom "120"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" flags "MULTILINE|READONLY"
-
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Type "label"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Text "$(UN_CONFIRM_CLICK)"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Left "0"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Right "-1"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Top "130"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 5" Bottom "150"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Top "130"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Bottom "150"
${If} "$TmpVal" == "true"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Type "label"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Text "$(SUMMARY_REBOOT_REQUIRED_UNINSTALL)"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Left "0"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Right "-1"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Top "35"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 6" Bottom "45"
-
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "6"
-
- ; To insert this control reset Top / Bottom for controls below this one
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Top "55"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 3" Bottom "65"
- WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Top "67"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Type "label"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Text "$(SUMMARY_REBOOT_REQUIRED_UNINSTALL)"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Left "0"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Right "-1"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Top "35"
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Field 4" Bottom "45"
+
+ WriteINIStr "$PLUGINSDIR\unconfirm.ini" "Settings" NumFields "4"
${EndIf}
!insertmacro MUI_HEADER_TEXT "$(UN_CONFIRM_PAGE_TITLE)" "$(UN_CONFIRM_PAGE_SUBTITLE)"
@@ -518,72 +580,12 @@ Function un.preConfirm
; focus. This sets the focus to the Install button instead.
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "unconfirm.ini"
GetDlgItem $0 $HWNDPARENT 1
- ${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 4" "HWND"
- SetCtlColors $1 0x000000 0xFFFFEE
- ShowWindow $1 ${SW_HIDE}
System::Call "user32::SetFocus(i r0, i 0x0007, i,i)i"
${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 2" "HWND"
SendMessage $1 ${WM_SETTEXT} 0 "STR:$INSTDIR"
!insertmacro MUI_INSTALLOPTIONS_SHOW
FunctionEnd
-Function un.leaveConfirm
- ${MUI_INSTALLOPTIONS_READ} $0 "unconfirm.ini" "Settings" "State"
- StrCmp $0 "3" +1 continue
- ${MUI_INSTALLOPTIONS_READ} $0 "unconfirm.ini" "Field 3" "State"
- ${MUI_INSTALLOPTIONS_READ} $1 "unconfirm.ini" "Field 4" "HWND"
- StrCmp $0 1 +1 +3
- ShowWindow $1 ${SW_SHOW}
- Abort
-
- ShowWindow $1 ${SW_HIDE}
- Abort
-
- continue:
-
- ; Try to delete the app executable and if we can't delete it try to find the
- ; app's message window and prompt the user to close the app. This allows
- ; running an instance that is located in another directory. If for whatever
- ; reason there is no message window we will just rename the app's files and
- ; then remove them on restart if they are in use.
- ClearErrors
- ${DeleteFile} "$INSTDIR\${FileMainEXE}"
- ${If} ${Errors}
- ${un.ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_UNINSTALL)"
- ${EndIf}
-FunctionEnd
-
-!ifndef NO_UNINSTALL_SURVEY
-Function un.preFinish
- ; Do not modify the finish page if there is a reboot pending
- ${Unless} ${RebootFlag}
- ; Setup the survey controls, functions, etc.
- StrCpy $TmpVal "SOFTWARE\Microsoft\IE Setup\Setup"
- ClearErrors
- ReadRegStr $0 HKLM $TmpVal "Path"
- ${If} ${Errors}
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "NumFields" "3"
- ${Else}
- ExpandEnvStrings $0 "$0" ; this value will usually contain %programfiles%
- ${If} $0 != "\"
- StrCpy $0 "$0\"
- ${EndIf}
- StrCpy $0 "$0\iexplore.exe"
- ClearErrors
- GetFullPathName $TmpVal $0
- ${If} ${Errors}
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "NumFields" "3"
- ${Else}
- ; When we add an optional action to the finish page the cancel button
- ; is enabled. This disables it and leaves the finish button as the
- ; only choice.
- !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "settings" "cancelenabled" "0"
- ${EndIf}
- ${EndIf}
- ${EndUnless}
-FunctionEnd
-!endif
-
################################################################################
# Initialization Functions
@@ -605,6 +607,14 @@ Function un.onInit
${un.UninstallUnOnInitCommon}
+; 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
+
!insertmacro InitInstallOptionsFile "unconfirm.ini"
FunctionEnd
diff --git a/application/palemoon/installer/windows/stub.tag b/application/palemoon/installer/windows/stub.tag
deleted file mode 100644
index 4eae031d6..000000000
--- a/application/palemoon/installer/windows/stub.tag
+++ /dev/null
@@ -1,4 +0,0 @@
-;!@Install@!UTF-8!
-Title="Pale Moon"
-RunProgram="setup-stub.exe"
-;!@InstallEnd@! \ No newline at end of file
diff --git a/application/palemoon/locales/Makefile.in b/application/palemoon/locales/Makefile.in
index f00d7a040..5720a76df 100644
--- a/application/palemoon/locales/Makefile.in
+++ b/application/palemoon/locales/Makefile.in
@@ -96,11 +96,7 @@ NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
%/defaults/profile/bookmarks.html: bookmarks.inc generic/profile/bookmarks.html.in
$(SYSINSTALL) -D $(dir $@)
- $(call py_action,preprocessor, \
- -I $< \
- -DAB_CD=$(NO_JA_JP_MAC_AB_CD) \
- $(srcdir)/generic/profile/bookmarks.html.in \
- -o $@)
+ $(call py_action,preprocessor,$< -DAB_CD=$(NO_JA_JP_MAC_AB_CD) $(srcdir)/generic/profile/bookmarks.html.in -o $@)
libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
@@ -124,10 +120,10 @@ searchplugins: $(addprefix $(FINAL_TARGET)/searchplugins/,$(SEARCHPLUGINS))
libs-%:
$(NSINSTALL) -D $(DIST)/install
- @$(MAKE) -C ../../toolkit/locales libs-$*
- @$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
- @$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
- @$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$*
+ @$(MAKE) -C ../../../toolkit/locales libs-$*
+ @$(MAKE) -C ../../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
+ @$(MAKE) -C ../../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+ @$(MAKE) -C ../../../intl/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.dtd b/application/palemoon/locales/en-US/chrome/browser/browser.dtd
index fe5f64854..65cc34fa0 100644
--- a/application/palemoon/locales/en-US/chrome/browser/browser.dtd
+++ b/application/palemoon/locales/en-US/chrome/browser/browser.dtd
@@ -337,7 +337,6 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY appMenuSafeMode.label "Restart in Safe Mode…">
<!ENTITY openCmd.commandkey "l">
-<!ENTITY urlbar.placeholder2 "Search or enter address">
<!ENTITY urlbar.accesskey "d">
<!ENTITY urlbar.switchToTab.label "Switch to tab:">
@@ -643,8 +642,10 @@ just addresses the organization to follow, e.g. "This site is run by " -->
<!ENTITY getUserMedia.selectMicrophone.label "Microphone to share:">
<!ENTITY getUserMedia.selectMicrophone.accesskey "M">
+#ifdef MOZ_WEBRTC
<!ENTITY webrtcIndicatorButton.label "Camera / Microphone Access">
<!ENTITY webrtcIndicatorButton.tooltip "Display sites you are currently sharing your camera or microphone with">
+#endif
<!ENTITY mixedContentBlocked.moreinfo "Most websites will still work properly even when this content is blocked.">
diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.properties b/application/palemoon/locales/en-US/chrome/browser/browser.properties
index 5f75502ed..bf363d103 100644
--- a/application/palemoon/locales/en-US/chrome/browser/browser.properties
+++ b/application/palemoon/locales/en-US/chrome/browser/browser.properties
@@ -220,6 +220,8 @@ tabHistory.goBack=Go back to this page
tabHistory.goForward=Go forward to this page
# URL Bar
+urlbar.placeholder=Search or enter address
+urlbar.placeholderURLOnly=Enter address
pasteAndGo.label=Paste & Go
# Block autorefresh
@@ -361,26 +363,6 @@ restartButton=Restart
# menu, set this to "true". Otherwise, you can leave it as "false".
browser.menu.showCharacterEncoding=false
-# LOCALIZATION NOTE (syncPromoNotification.bookmarks.label): This appears in
-# the add bookmark star panel. %S will be replaced by syncBrandShortName.
-# The final space separates this text from the Learn More link.
-syncPromoNotification.bookmarks.description=You can access your bookmarks on all your devices with %S.\u0020
-# LOCALIZATION NOTE (syncPromoNotification.passwords.label): This appears in
-# the remember password panel. %S will be replaced by syncBrandShortName.
-# The final space separates this text from the Learn More link.
-syncPromoNotification.passwords.description=You can access your passwords on all your devices with %S.\u0020
-syncPromoNotification.learnMoreLinkText=Learn More
-# LOCALIZATION NOTE (syncPromoNotification.addons.label): This appears in
-# the add-on install complete panel when Sync isn't set.
-# %S will be replaced by syncBrandShortName.
-# The final space separates this text from the Learn More link.
-syncPromoNotification.addons.description=You can access your add-ons on all your devices with %S.\u0020
-# LOCALIZATION NOTE (syncPromoNotification.addons-sync-disabled.label):
-# This appears in the add-on install complete panel when Sync is set
-# but addons sync is not. %S will be replaced by syncBrandShortName.
-# The final space separates this text from the Learn More link.
-syncPromoNotification.addons-sync-disabled.description=You can use your %S account to synchronize add-ons across multiple devices.\u0020
-
# Mozilla data reporting notification (Telemetry, Firefox Health Report, etc)
dataReportingNotification.message = %1$S automatically sends some data to %2$S so that we can improve your experience.
dataReportingNotification.button.label = Choose What I Share
diff --git a/application/palemoon/locales/en-US/chrome/browser/migration/migration.dtd b/application/palemoon/locales/en-US/chrome/browser/migration/migration.dtd
deleted file mode 100644
index 2848c4e67..000000000
--- a/application/palemoon/locales/en-US/chrome/browser/migration/migration.dtd
+++ /dev/null
@@ -1,36 +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 migrationWizard.title "Import Wizard">
-
-<!ENTITY importFrom.label "Import Preferences, Bookmarks, History, Passwords and other data from:">
-<!ENTITY importFromBookmarks.label "Import Bookmarks from:">
-
-<!ENTITY importFromIE.label "Microsoft Internet Explorer">
-<!ENTITY importFromIE.accesskey "M">
-<!ENTITY importFromNothing.label "Don't import anything">
-<!ENTITY importFromNothing.accesskey "D">
-<!ENTITY importFromSafari.label "Safari">
-<!ENTITY importFromSafari.accesskey "S">
-<!ENTITY importFromChrome.label "Chrome">
-<!ENTITY importFromChrome.accesskey "C">
-<!ENTITY importFromFirefox.label "Firefox">
-<!ENTITY importFromFirefox.accesskey "X">
-
-<!ENTITY noMigrationSources.label "No programs that contain bookmarks, history or password data could be found.">
-
-<!ENTITY importSource.title "Import Settings and Data">
-<!ENTITY importItems.title "Items to Import">
-<!ENTITY importItems.label "Select which items to import:">
-
-<!ENTITY migrating.title "Importing…">
-<!ENTITY migrating.label "The following items are currently being imported…">
-
-<!ENTITY selectProfile.title "Select Profile">
-<!ENTITY selectProfile.label "The following profiles are available to import from:">
-
-<!ENTITY done.title "Import Complete">
-<!ENTITY done.label "The following items were successfully imported:">
-
diff --git a/application/palemoon/locales/en-US/chrome/browser/migration/migration.properties b/application/palemoon/locales/en-US/chrome/browser/migration/migration.properties
deleted file mode 100644
index b1cb03d0a..000000000
--- a/application/palemoon/locales/en-US/chrome/browser/migration/migration.properties
+++ /dev/null
@@ -1,51 +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/.
-
-profileName_format=%S %S
-
-# Browser Specific
-sourceNameIE=Internet Explorer
-sourceNameSafari=Safari
-sourceNameChrome=Google Chrome
-sourceNameFirefox=Mozilla Firefox
-
-importedBookmarksFolder=From %S
-
-importedSafariReadingList=Reading List (From Safari)
-
-# Import Sources
-# Note: When adding an import source for profile reset, add the string name to
-# resetProfile.js if it should be listed in the reset dialog.
-1_ie=Internet Options
-1_safari=Preferences
-1_chrome=Preferences
-
-2_ie=Cookies
-2_safari=Cookies
-2_chrome=Cookies
-2_firefox=Cookies
-
-4_ie=Browsing History
-4_safari=Browsing History
-4_chrome=Browsing History
-4_firefox_history_and_bookmarks=Browsing History and Bookmarks
-
-8_ie=Saved Form History
-8_safari=Saved Form History
-8_chrome=Saved Form History
-8_firefox=Saved Form History
-
-16_ie=Saved Passwords
-16_safari=Saved Passwords
-16_chrome=Saved Passwords
-16_firefox=Saved Passwords
-
-32_ie=Favorites
-32_safari=Bookmarks
-32_chrome=Bookmarks
-
-64_ie=Other Data
-64_safari=Other Data
-64_chrome=Other Data
-64_firefox_other=Other Data
diff --git a/application/palemoon/locales/en-US/chrome/browser/places/places.dtd b/application/palemoon/locales/en-US/chrome/browser/places/places.dtd
index 949593e7d..9578754d2 100644
--- a/application/palemoon/locales/en-US/chrome/browser/places/places.dtd
+++ b/application/palemoon/locales/en-US/chrome/browser/places/places.dtd
@@ -31,8 +31,6 @@
<!ENTITY importBookmarksFromHTML.accesskey "I">
<!ENTITY exportBookmarksToHTML.label "Export Bookmarks to HTML…">
<!ENTITY exportBookmarksToHTML.accesskey "E">
-<!ENTITY importOtherBrowser.label "Import Data from Another Browser…">
-<!ENTITY importOtherBrowser.accesskey "A">
<!ENTITY cmd.backup.label "Backup…">
<!ENTITY cmd.backup.accesskey "B">
diff --git a/application/palemoon/locales/en-US/chrome/overrides/netError.dtd b/application/palemoon/locales/en-US/chrome/overrides/netError.dtd
index 3ed288d90..c97bd1b59 100644
--- a/application/palemoon/locales/en-US/chrome/overrides/netError.dtd
+++ b/application/palemoon/locales/en-US/chrome/overrides/netError.dtd
@@ -7,6 +7,8 @@
<!ENTITY loadError.label "Problem loading page">
<!ENTITY retry.label "Try Again">
+<!ENTITY returnToPreviousPage.label "Go Back">
+<!ENTITY advanced.label "Advanced">
<!-- Specific error messages -->
@@ -14,7 +16,7 @@
<!ENTITY connectionFailure.longDesc "&sharedLongDesc;">
<!ENTITY deniedPortAccess.title "This address is restricted">
-<!ENTITY deniedPortAccess.longDesc "<p>The requested address specified a port (e.g. <q>palemoon.org:25</q> for port 25 on palemoon.org) normally used for purposes <em>other</em> than Web browsing. The browser has canceled the request for your protection and security.</p>">
+<!ENTITY deniedPortAccess.longDesc "">
<!ENTITY dnsNotFound.title "Server not found">
<!ENTITY dnsNotFound.longDesc "
@@ -22,7 +24,7 @@
<li>Check the address for typing errors such as
<strong>ww</strong>.example.com instead of
<strong>www</strong>.example.com</li>
- <li>If you are unable to load any pages, check your computer's network
+ <li>If you are unable to load any pages, check your computer’s network
connection.</li>
<li>If your computer or network is protected by a firewall or proxy, make sure
that &brandShortName; is permitted to access the Web.</li>
@@ -37,18 +39,31 @@
</ul>
">
+<!ENTITY fileAccessDenied.title "Access to the file was denied">
+<!ENTITY fileAccessDenied.longDesc "
+<ul>
+ <li>It may have been removed, moved, or file permissions may be preventing access.</li>
+</ul>
+">
<!ENTITY generic.title "Oops.">
<!ENTITY generic.longDesc "
-<p>&brandShortName; can't load this page for some reason.</p>
+<p>&brandShortName; can’t load this page for some reason.</p>
">
+<!ENTITY captivePortal.title "Login to network">
+<!ENTITY captivePortal.longDesc "
+<p>This network may require you to login to access the internet.</p>
+">
+
+<!ENTITY openPortalLoginPage.label "Open Login Page">
+
<!ENTITY malformedURI.title "The address isn't valid">
<!ENTITY malformedURI.longDesc "
<ul>
<li>Web addresses are usually written like
<strong>http://www.example.com/</strong></li>
- <li>Make sure that you're using forward slashes (i.e.
+ <li>Make sure that you’re using forward slashes (i.e.
<strong>/</strong>).</li>
</ul>
">
@@ -57,7 +72,7 @@
<!ENTITY netInterrupt.longDesc "&sharedLongDesc;">
<!ENTITY notCached.title "Document Expired">
-<!ENTITY notCached.longDesc "<p>The requested document is not available in &brandShortName;'s cache.</p><ul><li>As a security precaution, &brandShortName; does not automatically re-request sensitive documents.</li><li>Click Try Again to re-request the document from the website.</li></ul>">
+<!ENTITY notCached.longDesc "<p>The requested document is not available in &brandShortName;’s cache.</p><ul><li>As a security precaution, &brandShortName; does not automatically re-request sensitive documents.</li><li>Click Try Again to re-request the document from the website.</li></ul>">
<!ENTITY netOffline.title "Offline mode">
<!ENTITY netOffline.longDesc2 "
@@ -86,7 +101,7 @@
<!ENTITY netTimeout.title "The connection has timed out">
<!ENTITY netTimeout.longDesc "&sharedLongDesc;">
-<!ENTITY unknownProtocolFound.title "The address wasn't understood">
+<!ENTITY unknownProtocolFound.title "The address wasn’t understood">
<!ENTITY unknownProtocolFound.longDesc "
<ul>
<li>You might need to install other software to open this address.</li>
@@ -112,7 +127,7 @@
</ul>
">
-<!ENTITY redirectLoop.title "The page isn't redirecting properly">
+<!ENTITY redirectLoop.title "The page isn’t redirecting properly">
<!ENTITY redirectLoop.longDesc "
<ul>
<li>This problem can sometimes be caused by disabling or refusing to accept
@@ -146,12 +161,17 @@ someone trying to impersonate the server.</li>
be temporary, and you can try again later.</li>
</ul>
">
+<!ENTITY certerror.longpagetitle1 "Your connection is not secure">
+<!-- Localization note (certerror.introPara) - The text content of the span tag
+will be replaced at runtime with the name of the server to which the user
+was trying to connect. -->
+<!ENTITY certerror.introPara "The owner of <span class='hostname'/> has configured their website improperly. To protect your information from being stolen, &brandShortName; has not connected to this website.">
<!ENTITY sharedLongDesc "
<ul>
<li>The site could be temporarily unavailable or too busy. Try again in a few
moments.</li>
- <li>If you are unable to load any pages, check your computer's network
+ <li>If you are unable to load any pages, check your computer’s network
connection.</li>
<li>If your computer or network is protected by a firewall or proxy, make sure
that &brandShortName; is permitted to access the Web.</li>
@@ -186,6 +206,8 @@ be temporary, and you can try again later.</li>
<!ENTITY corruptedContentError.title "Corrupted Content Error">
<!ENTITY corruptedContentError.longDesc "<p>The page you are trying to view cannot be shown because an error in the data transmission was detected.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
+<!ENTITY corruptedContentErrorv2.title "Corrupted Content Error">
+<!ENTITY corruptedContentErrorv2.longDesc "<p>The page you are trying to view cannot be shown because an error in the data transmission was detected.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
<!ENTITY securityOverride.linkText "Or you can add an exception…">
@@ -207,6 +229,7 @@ functionality specific to firefox. -->
<!ENTITY errorReporting.title "Report this error">
<!ENTITY errorReporting.longDesc "Reporting the address and certificate information for <span id='hostname'></span> will help us identify and block malicious sites. Thanks for helping create a safer web!">
<!ENTITY errorReporting.automatic "Automatically report errors in the future">
+<!ENTITY errorReporting.automatic2 "Report errors like this to help Mozilla identify and block malicious sites">
<!ENTITY errorReporting.learnMore "Learn more…">
<!ENTITY errorReporting.sending "Sending report">
<!ENTITY errorReporting.sent "Report sent">
@@ -221,3 +244,33 @@ functionality specific to firefox. -->
"ssl_error_unsupported_version". -->
<!ENTITY sslv3Used.longDesc "Advanced info: ssl_error_unsupported_version">
<!ENTITY sslv3Used.learnMore "Learn More…">
+<!-- LOCALIZATION NOTE (sslv3Used.longDesc2) - Do not translate
+ "SSL_ERROR_UNSUPPORTED_VERSION". -->
+<!ENTITY sslv3Used.longDesc2 "Advanced info: SSL_ERROR_UNSUPPORTED_VERSION">
+
+<!ENTITY weakCryptoUsed.title "Your connection is not secure">
+<!-- LOCALIZATION NOTE (weakCryptoUsed.longDesc2) - Do not translate
+ "SSL_ERROR_NO_CYPHER_OVERLAP". -->
+<!ENTITY weakCryptoUsed.longDesc2 "Advanced info: SSL_ERROR_NO_CYPHER_OVERLAP">
+<!ENTITY weakCryptoAdvanced.title "Advanced">
+<!ENTITY weakCryptoAdvanced.longDesc "<span class='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe.">
+<!ENTITY weakCryptoAdvanced.override "(Not secure) Try loading <span class='hostname'></span> using outdated security">
+
+<!-- LOCALIZATION NOTE (certerror.wrongSystemTime) - The <span id='..' /> tags will be injected with actual values,
+ please leave them unchanged. -->
+<!ENTITY certerror.wrongSystemTime "<p>A secure connection to <span id='wrongSystemTime_URL'/> isn’t possible because your clock appears to show the wrong time.</p> <p>Your computer thinks it is <span id='wrongSystemTime_systemDate'/>. To fix this problem, change your date and time settings to match the correct time.</p>">
+
+<!ENTITY certerror.pagetitle1 "Insecure Connection">
+<!ENTITY certerror.whatShouldIDo.badStsCertExplanation "This site uses HTTP
+Strict Transport Security (HSTS) to specify that &brandShortName; may only connect
+to it securely. As a result, it is not possible to add an exception for this
+certificate.">
+<!ENTITY certerror.copyToClipboard.label "Copy text to clipboard">
+
+<!ENTITY inadequateSecurityError.title "Your connection is not secure">
+<!-- LOCALIZATION NOTE (inadequateSecurityError.longDesc) - Do not translate
+ "NS_ERROR_NET_INADEQUATE_SECURITY". -->
+<!ENTITY inadequateSecurityError.longDesc "<p><span class='hostname'></span> uses security technology that is outdated and vulnerable to attack. An attacker could easily reveal information which you thought to be safe. The website administrator will need to fix the server first before you can visit the site.</p><p>Error code: NS_ERROR_NET_INADEQUATE_SECURITY</p>">
+
+<!ENTITY prefReset.longDesc "It looks like your network security settings might be causing this. Do you want the default settings to be restored?">
+<!ENTITY prefReset.label "Restore default settings">
diff --git a/application/palemoon/locales/generic/install.rdf b/application/palemoon/locales/generic/install.rdf
deleted file mode 100644
index d04c67a61..000000000
--- a/application/palemoon/locales/generic/install.rdf
+++ /dev/null
@@ -1,30 +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/.
-
-#filter substitution
--->
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest"
- em:id="@MOZ_LANGPACK_EID@"
- em:name="@MOZ_LANG_TITLE@ Language Pack"
- em:version="@MOZ_APP_VERSION@"
- em:type="8"
- em:creator="@MOZ_LANGPACK_CREATOR@">
-#ifdef MOZ_LANGPACK_CONTRIBUTORS
- @MOZ_LANGPACK_CONTRIBUTORS@
-#endif
-
- <em:targetApplication>
- <Description>
- <em:id>{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}</em:id>
- <em:minVersion>@MOZ_APP_VERSION@</em:minVersion>
- <em:maxVersion>@MOZ_APP_MAXVERSION@</em:maxVersion>
- </Description>
- </em:targetApplication>
- </Description>
-</RDF>
diff --git a/application/palemoon/locales/jar.mn b/application/palemoon/locales/jar.mn
index 451a86ab7..f2b9ddeb2 100644
--- a/application/palemoon/locales/jar.mn
+++ b/application/palemoon/locales/jar.mn
@@ -16,7 +16,7 @@
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/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)
@@ -55,8 +55,6 @@
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/migration/migration.dtd (%chrome/browser/migration/migration.dtd)
- locale/browser/migration/migration.properties (%chrome/browser/migration/migration.properties)
locale/browser/preferences/aboutPermissions.dtd (%chrome/browser/preferences/aboutPermissions.dtd)
locale/browser/preferences/aboutPermissions.properties (%chrome/browser/preferences/aboutPermissions.properties)
locale/browser/preferences/advanced.dtd (%chrome/browser/preferences/advanced.dtd)
diff --git a/application/palemoon/locales/l10n.ini b/application/palemoon/locales/l10n.ini
index df5eb7ac0..9a466b65e 100644
--- a/application/palemoon/locales/l10n.ini
+++ b/application/palemoon/locales/l10n.ini
@@ -3,14 +3,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
[general]
-depth = ../..
-all = browser/locales/all-locales
+depth = ../../..
+all = application/palemoon/locales/all-locales
[compare]
-dirs = browser
+dirs = application/palemoon
extensions/reporter
other-licenses/branding/firefox
- browser/branding/official
+ application/palemoon/branding/official
[includes]
# non-central apps might want to use %(topsrcdir)s here, or other vars
diff --git a/application/palemoon/modules/AboutHomeUtils.jsm b/application/palemoon/modules/AboutHomeUtils.jsm
index 1d4070eaf..72712e1f3 100644
--- a/application/palemoon/modules/AboutHomeUtils.jsm
+++ b/application/palemoon/modules/AboutHomeUtils.jsm
@@ -44,7 +44,7 @@ this.AboutHomeUtils = {
return !Services.prefs.getBoolPref("browser.EULA.override");
} catch (e) { }
-#ifndef MOZILLA_OFFICIAL
+#ifndef MC_OFFICIAL
// Non-official builds shouldn't show the notification.
return false;
#endif
diff --git a/application/palemoon/modules/AutoCompletePopup.jsm b/application/palemoon/modules/AutoCompletePopup.jsm
new file mode 100644
index 000000000..c3698f905
--- /dev/null
+++ b/application/palemoon/modules/AutoCompletePopup.jsm
@@ -0,0 +1,293 @@
+/* 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 Cc = Components.classes;
+const Ci = Components.interfaces;
+const Cu = Components.utils;
+
+this.EXPORTED_SYMBOLS = [ "AutoCompletePopup" ];
+
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
+
+// nsITreeView implementation that feeds the autocomplete popup
+// with the search data.
+var AutoCompleteTreeView = {
+ // nsISupports
+ QueryInterface: XPCOMUtils.generateQI([Ci.nsITreeView,
+ Ci.nsIAutoCompleteController]),
+
+ // Private variables
+ treeBox: null,
+ results: [],
+
+ // nsITreeView
+ selection: null,
+
+ get rowCount() { return this.results.length; },
+ setTree: function(treeBox) { this.treeBox = treeBox; },
+ getCellText: function(idx, column) { return this.results[idx].value },
+ isContainer: function(idx) { return false; },
+ getCellValue: function(idx, column) { return false },
+ isContainerOpen: function(idx) { return false; },
+ isContainerEmpty: function(idx) { return false; },
+ isSeparator: function(idx) { return false; },
+ isSorted: function() { return false; },
+ isEditable: function(idx, column) { return false; },
+ canDrop: function(idx, orientation, dt) { return false; },
+ getLevel: function(idx) { return 0; },
+ getParentIndex: function(idx) { return -1; },
+ hasNextSibling: function(idx, after) { return idx < this.results.length - 1 },
+ toggleOpenState: function(idx) { },
+ getCellProperties: function(idx, column) { return this.results[idx].style || ""; },
+ getRowProperties: function(idx) { return ""; },
+ getImageSrc: function(idx, column) { return null; },
+ getProgressMode : function(idx, column) { },
+ cycleHeader: function(column) { },
+ cycleCell: function(idx, column) { },
+ selectionChanged: function() { },
+ performAction: function(action) { },
+ performActionOnCell: function(action, index, column) { },
+ getColumnProperties: function(column) { return ""; },
+
+ // nsIAutoCompleteController
+ get matchCount() {
+ return this.rowCount;
+ },
+
+ handleEnter: function(aIsPopupSelection) {
+ AutoCompletePopup.handleEnter(aIsPopupSelection);
+ },
+
+ stopSearch: function() {},
+
+ // Internal JS-only API
+ clearResults: function() {
+ this.results = [];
+ },
+
+ setResults: function(results) {
+ this.results = results;
+ },
+};
+
+this.AutoCompletePopup = {
+ MESSAGES: [
+ "FormAutoComplete:SelectBy",
+ "FormAutoComplete:GetSelectedIndex",
+ "FormAutoComplete:SetSelectedIndex",
+ "FormAutoComplete:MaybeOpenPopup",
+ "FormAutoComplete:ClosePopup",
+ "FormAutoComplete:Disconnect",
+ "FormAutoComplete:RemoveEntry",
+ "FormAutoComplete:Invalidate",
+ ],
+
+ init: function() {
+ for (let msg of this.MESSAGES) {
+ Services.mm.addMessageListener(msg, this);
+ }
+ },
+
+ uninit: function() {
+ for (let msg of this.MESSAGES) {
+ Services.mm.removeMessageListener(msg, this);
+ }
+ },
+
+ handleEvent: function(evt) {
+ switch (evt.type) {
+ case "popupshowing": {
+ this.sendMessageToBrowser("FormAutoComplete:PopupOpened");
+ break;
+ }
+
+ case "popuphidden": {
+ this.sendMessageToBrowser("FormAutoComplete:PopupClosed");
+ this.openedPopup = null;
+ this.weakBrowser = null;
+ evt.target.removeEventListener("popuphidden", this);
+ evt.target.removeEventListener("popupshowing", this);
+ break;
+ }
+ }
+ },
+
+ // Along with being called internally by the receiveMessage handler,
+ // this function is also called directly by the login manager, which
+ // uses a single message to fill in the autocomplete results. See
+ // "RemoteLogins:autoCompleteLogins".
+ showPopupWithResults: function({ browser, rect, dir, results }) {
+ if (!results.length || this.openedPopup) {
+ // We shouldn't ever be showing an empty popup, and if we
+ // already have a popup open, the old one needs to close before
+ // we consider opening a new one.
+ return;
+ }
+
+ let window = browser.ownerDocument.defaultView;
+ let tabbrowser = window.gBrowser;
+ if (Services.focus.activeWindow != window ||
+ tabbrowser.selectedBrowser != browser) {
+ // We were sent a message from a window or tab that went into the
+ // background, so we'll ignore it for now.
+ return;
+ }
+
+ this.weakBrowser = Cu.getWeakReference(browser);
+ this.openedPopup = browser.autoCompletePopup;
+ this.openedPopup.hidden = false;
+ // don't allow the popup to become overly narrow
+ this.openedPopup.setAttribute("width", Math.max(100, rect.width));
+ this.openedPopup.style.direction = dir;
+
+ AutoCompleteTreeView.setResults(results);
+ this.openedPopup.view = AutoCompleteTreeView;
+ this.openedPopup.selectedIndex = -1;
+ this.openedPopup.invalidate();
+
+ if (results.length) {
+ // Reset fields that were set from the last time the search popup was open
+ this.openedPopup.mInput = null;
+ this.openedPopup.showCommentColumn = false;
+ this.openedPopup.showImageColumn = false;
+ this.openedPopup.addEventListener("popuphidden", this);
+ this.openedPopup.addEventListener("popupshowing", this);
+ this.openedPopup.openPopupAtScreenRect("after_start", rect.left, rect.top,
+ rect.width, rect.height, false,
+ false);
+ } else {
+ this.closePopup();
+ }
+ },
+
+ invalidate(results) {
+ if (!this.openedPopup) {
+ return;
+ }
+
+ if (!results.length) {
+ this.closePopup();
+ } else {
+ AutoCompleteTreeView.setResults(results);
+ // We need to re-set the view in order for the
+ // tree to know the view has changed.
+ this.openedPopup.view = AutoCompleteTreeView;
+ this.openedPopup.invalidate();
+ }
+ },
+
+ closePopup() {
+ if (this.openedPopup) {
+ // Note that hidePopup() closes the popup immediately,
+ // so popuphiding or popuphidden events will be fired
+ // and handled during this call.
+ this.openedPopup.hidePopup();
+ }
+ AutoCompleteTreeView.clearResults();
+ },
+
+ removeLogin(login) {
+ Services.logins.removeLogin(login);
+ },
+
+ receiveMessage: function(message) {
+ if (!message.target.autoCompletePopup) {
+ // Returning false to pacify ESLint, but this return value is
+ // ignored by the messaging infrastructure.
+ return false;
+ }
+
+ switch (message.name) {
+ case "FormAutoComplete:SelectBy": {
+ this.openedPopup.selectBy(message.data.reverse, message.data.page);
+ break;
+ }
+
+ case "FormAutoComplete:GetSelectedIndex": {
+ if (this.openedPopup) {
+ return this.openedPopup.selectedIndex;
+ }
+ // If the popup was closed, then the selection
+ // has not changed.
+ return -1;
+ }
+
+ case "FormAutoComplete:SetSelectedIndex": {
+ let { index } = message.data;
+ if (this.openedPopup) {
+ this.openedPopup.selectedIndex = index;
+ }
+ break;
+ }
+
+ case "FormAutoComplete:MaybeOpenPopup": {
+ let { results, rect, dir } = message.data;
+ this.showPopupWithResults({ browser: message.target, rect, dir,
+ results });
+ break;
+ }
+
+ case "FormAutoComplete:Invalidate": {
+ let { results } = message.data;
+ this.invalidate(results);
+ break;
+ }
+
+ case "FormAutoComplete:ClosePopup": {
+ this.closePopup();
+ break;
+ }
+
+ case "FormAutoComplete:Disconnect": {
+ // The controller stopped controlling the current input, so clear
+ // any cached data. This is necessary cause otherwise we'd clear data
+ // only when starting a new search, but the next input could not support
+ // autocomplete and it would end up inheriting the existing data.
+ AutoCompleteTreeView.clearResults();
+ break;
+ }
+ }
+ // Returning false to pacify ESLint, but this return value is
+ // ignored by the messaging infrastructure.
+ return false;
+ },
+
+ /**
+ * Despite its name, this handleEnter is only called when the user clicks on
+ * one of the items in the popup since the popup is rendered in the parent process.
+ * The real controller's handleEnter is called directly in the content process
+ * for other methods of completing a selection (e.g. using the tab or enter
+ * keys) since the field with focus is in that process.
+ */
+ handleEnter(aIsPopupSelection) {
+ if (this.openedPopup) {
+ this.sendMessageToBrowser("FormAutoComplete:HandleEnter", {
+ selectedIndex: this.openedPopup.selectedIndex,
+ isPopupSelection: aIsPopupSelection,
+ });
+ }
+ },
+
+ /**
+ * If a browser exists that AutoCompletePopup knows about,
+ * sends it a message. Otherwise, this is a no-op.
+ *
+ * @param {string} msgName
+ * The name of the message to send.
+ * @param {object} data
+ * The optional data to send with the message.
+ */
+ sendMessageToBrowser(msgName, data) {
+ let browser = this.weakBrowser ? this.weakBrowser.get()
+ : null;
+ if (browser) {
+ browser.messageManager.sendAsyncMessage(msgName, data);
+ }
+ },
+
+ stopSearch: function() {}
+}
diff --git a/application/palemoon/modules/BrowserNewTabPreloader.jsm b/application/palemoon/modules/BrowserNewTabPreloader.jsm
index 719a9e05e..778698fba 100644
--- a/application/palemoon/modules/BrowserNewTabPreloader.jsm
+++ b/application/palemoon/modules/BrowserNewTabPreloader.jsm
@@ -79,7 +79,7 @@ this.BrowserNewTabPreloader = {
Object.freeze(BrowserNewTabPreloader);
-let Initializer = {
+var Initializer = {
_timer: null,
_observing: false,
@@ -120,7 +120,7 @@ let Initializer = {
}
};
-let Preferences = {
+var Preferences = {
_enabled: null,
_branch: null,
@@ -157,7 +157,7 @@ let Preferences = {
},
};
-let HiddenBrowsers = {
+var HiddenBrowsers = {
_browsers: null,
_updateTimer: null,
@@ -379,7 +379,7 @@ HiddenBrowser.prototype = {
}
};
-let HostFrame = {
+var HostFrame = {
_frame: null,
_deferred: null,
diff --git a/application/palemoon/modules/FormSubmitObserver.jsm b/application/palemoon/modules/FormSubmitObserver.jsm
index 72c5ca601..e4d3e765e 100644
--- a/application/palemoon/modules/FormSubmitObserver.jsm
+++ b/application/palemoon/modules/FormSubmitObserver.jsm
@@ -9,14 +9,14 @@
"use strict";
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-let Cu = Components.utils;
-
-let HTMLInputElement = Ci.nsIDOMHTMLInputElement;
-let HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement;
-let HTMLSelectElement = Ci.nsIDOMHTMLSelectElement;
-let HTMLButtonElement = Ci.nsIDOMHTMLButtonElement;
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
+
+var HTMLInputElement = Ci.nsIDOMHTMLInputElement;
+var HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement;
+var HTMLSelectElement = Ci.nsIDOMHTMLSelectElement;
+var HTMLButtonElement = Ci.nsIDOMHTMLButtonElement;
this.EXPORTED_SYMBOLS = [ "FormSubmitObserver" ];
diff --git a/application/palemoon/modules/FormValidationHandler.jsm b/application/palemoon/modules/FormValidationHandler.jsm
index 05be510e1..387c221d7 100644
--- a/application/palemoon/modules/FormValidationHandler.jsm
+++ b/application/palemoon/modules/FormValidationHandler.jsm
@@ -8,15 +8,15 @@
"use strict";
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-let Cu = Components.utils;
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
this.EXPORTED_SYMBOLS = [ "FormValidationHandler" ];
Cu.import("resource://gre/modules/Services.jsm");
-let FormValidationHandler =
+var FormValidationHandler =
{
_panel: null,
_anchor: null,
@@ -122,7 +122,7 @@ let FormValidationHandler =
this._panel.hidden = false;
let tabBrowser = aWindow.gBrowser;
- this._anchor = tabBrowser.formValidationAnchor;
+ this._anchor = tabBrowser.popupAnchor;
this._anchor.left = aPanelData.contentRect.left;
this._anchor.top = aPanelData.contentRect.top;
this._anchor.width = aPanelData.contentRect.width;
diff --git a/application/palemoon/modules/NetworkPrioritizer.jsm b/application/palemoon/modules/NetworkPrioritizer.jsm
index ea4a87790..23d688a30 100644
--- a/application/palemoon/modules/NetworkPrioritizer.jsm
+++ b/application/palemoon/modules/NetworkPrioritizer.jsm
@@ -34,8 +34,8 @@ const PRIORITY_DELTA = -10;
// Variables
-let _lastFocusedWindow = null;
-let _windows = [];
+var _lastFocusedWindow = null;
+var _windows = [];
// Exported symbol
@@ -64,7 +64,7 @@ function _handleEvent(aEvent) {
// Methods that impact a browser. Put into single object for organization.
-let BrowserHelper = {
+var BrowserHelper = {
onOpen: function NP_BH_onOpen(aBrowser) {
// If the tab is in the focused window, leave priority as it is
if (aBrowser.ownerDocument.defaultView != _lastFocusedWindow)
@@ -91,7 +91,7 @@ let BrowserHelper = {
// Methods that impact a window. Put into single object for organization.
-let WindowHelper = {
+var WindowHelper = {
addWindow: function NP_WH_addWindow(aWindow) {
// Build internal data object
_windows.push({ window: aWindow, lastSelectedBrowser: null });
diff --git a/application/palemoon/modules/PopupNotifications.jsm b/application/palemoon/modules/PopupNotifications.jsm
index 9b2e8e5d1..15c8915ed 100644
--- a/application/palemoon/modules/PopupNotifications.jsm
+++ b/application/palemoon/modules/PopupNotifications.jsm
@@ -4,9 +4,9 @@
this.EXPORTED_SYMBOLS = ["PopupNotifications"];
-var Cc = Components.classes, Ci = Components.interfaces;
+var Cc = Components.classes, Ci = Components.interfaces, Cu = Components.utils;
-Components.utils.import("resource://gre/modules/Services.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
const NOTIFICATION_EVENT_DISMISSED = "dismissed";
const NOTIFICATION_EVENT_REMOVED = "removed";
@@ -18,8 +18,8 @@ const ICON_ATTRIBUTE_SHOWING = "showing";
const PREF_SECURITY_DELAY = "security.notification_enable_delay";
-let popupNotificationsMap = new WeakMap();
-let gNotificationParents = new WeakMap;
+var popupNotificationsMap = new WeakMap();
+var gNotificationParents = new WeakMap;
function getAnchorFromBrowser(aBrowser) {
let anchor = aBrowser.getAttribute("popupnotificationanchor") ||
@@ -33,6 +33,18 @@ function getAnchorFromBrowser(aBrowser) {
return null;
}
+function getNotificationFromElement(aElement) {
+ // Need to find the associated notification object, which is a bit tricky
+ // since it isn't associated with the element directly - this is kind of
+ // gross and very dependent on the structure of the popupnotification
+ // binding's content.
+ let notificationEl;
+ let parent = aElement;
+ while (parent && (parent = aElement.ownerDocument.getBindingParent(parent)))
+ notificationEl = parent;
+ return notificationEl;
+}
+
/**
* Notification object describes a single popup notification.
*
@@ -194,7 +206,8 @@ PopupNotifications.prototype = {
* - label (string): the button's label.
* - accessKey (string): the button's accessKey.
* - callback (function): a callback to be invoked when the button is
- * pressed.
+ * pressed, is passed an object that contains the following fields:
+ * - checkboxChecked: (boolean) If the optional checkbox is checked.
* If null, the notification will not have a button, and
* secondaryActions will be ignored.
* @param secondaryActions
@@ -234,6 +247,26 @@ PopupNotifications.prototype = {
* removed when they would have otherwise been dismissed
* (i.e. any time the popup is closed due to user
* interaction).
+ * checkbox: An object that allows you to add a checkbox and
+ * control its behavior with these fields:
+ * label:
+ * (required) Label to be shown next to the checkbox.
+ * checked:
+ * (optional) Whether the checkbox should be checked
+ * by default. Defaults to false.
+ * checkedState:
+ * (optional) An object that allows you to customize
+ * the notification state when the checkbox is checked.
+ * disableMainAction:
+ * (optional) Whether the mainAction is disabled.
+ * Defaults to false.
+ * warningLabel:
+ * (optional) A (warning) text that is shown below the
+ * checkbox. Pass null to hide.
+ * uncheckedState:
+ * (optional) An object that allows you to customize
+ * the notification state when the checkbox is not checked.
+ * Has the same attributes as checkedState.
* popupIconURL:
* A string. URL of the image to be displayed in the popup.
* Normally specified in CSS using list-style-image and the
@@ -552,6 +585,25 @@ PopupNotifications.prototype = {
}
}
+ let checkbox = n.options.checkbox;
+ if (checkbox && checkbox.label) {
+ let checked = n._checkboxChecked != null ? n._checkboxChecked : !!checkbox.checked;
+
+ popupnotification.setAttribute("checkboxhidden", "false");
+ popupnotification.setAttribute("checkboxchecked", checked);
+ popupnotification.setAttribute("checkboxlabel", checkbox.label);
+
+ popupnotification.setAttribute("checkboxcommand", "PopupNotifications._onCheckboxCommand(event);");
+
+ if (checked) {
+ this._setNotificationUIState(popupnotification, checkbox.checkedState);
+ } else {
+ this._setNotificationUIState(popupnotification, checkbox.uncheckedState);
+ }
+ } else {
+ popupnotification.setAttribute("checkboxhidden", "true");
+ }
+
this.panel.appendChild(popupnotification);
// The popupnotification may be hidden if we got it from the chrome
@@ -560,6 +612,32 @@ PopupNotifications.prototype = {
}, this);
},
+ _setNotificationUIState(notification, state={}) {
+ notification.setAttribute("mainactiondisabled", state.disableMainAction || "false");
+
+ if (state.warningLabel) {
+ notification.setAttribute("warninglabel", state.warningLabel);
+ notification.setAttribute("warninghidden", "false");
+ } else {
+ notification.setAttribute("warninghidden", "true");
+ }
+ },
+
+ _onCheckboxCommand(event) {
+ let notificationEl = getNotificationFromElement(event.originalTarget);
+ let checked = notificationEl.checkbox.checked;
+ let notification = notificationEl.notification;
+
+ // Save checkbox state to be able to persist it when re-opening the doorhanger.
+ notification._checkboxChecked = checked;
+
+ if (checked) {
+ this._setNotificationUIState(notificationEl, notification.options.checkbox.checkedState);
+ } else {
+ this._setNotificationUIState(notificationEl, notification.options.checkbox.uncheckedState);
+ }
+ },
+
_showPanel: function PopupNotifications_showPanel(notificationsToShow, anchorElement) {
this.panel.hidden = false;
@@ -752,8 +830,12 @@ PopupNotifications.prototype = {
},
_fireCallback: function PopupNotifications_fireCallback(n, event) {
- if (n.options.eventCallback)
- n.options.eventCallback.call(n, event);
+ try {
+ if (n.options.eventCallback)
+ n.options.eventCallback.call(n, event);
+ } catch (error) {
+ Cu.reportError(error);
+ }
},
_onPopupHidden: function PopupNotifications_onPopupHidden(event) {
@@ -789,15 +871,7 @@ PopupNotifications.prototype = {
},
_onButtonCommand: function PopupNotifications_onButtonCommand(event) {
- // Need to find the associated notification object, which is a bit tricky
- // since it isn't associated with the button directly - this is kind of
- // gross and very dependent on the structure of the popupnotification
- // binding's content.
- let target = event.originalTarget;
- let notificationEl;
- let parent = target;
- while (parent && (parent = target.ownerDocument.getBindingParent(parent)))
- notificationEl = parent;
+ let notificationEl = getNotificationFromElement(event.originalTarget);
if (!notificationEl)
throw "PopupNotifications_onButtonCommand: couldn't find notification element";
@@ -819,7 +893,14 @@ PopupNotifications.prototype = {
timeSinceShown + "ms");
return;
}
- notification.mainAction.callback.call();
+
+ try {
+ notification.mainAction.callback.call(undefined, {
+ checkboxChecked: notificationEl.checkbox.checked
+ });
+ } catch (error) {
+ Cu.reportError(error);
+ }
this._remove(notification);
this._update();
@@ -830,8 +911,16 @@ PopupNotifications.prototype = {
if (!target.action || !target.notification)
throw "menucommand target has no associated action/notification";
+ let notificationEl = target.parentElement;
event.stopPropagation();
- target.action.callback.call();
+
+ try {
+ target.action.callback.call(undefined, {
+ checkboxChecked: notificationEl.checkbox.checked
+ });
+ } catch (error) {
+ Cu.reportError(error);
+ }
this._remove(target.notification);
this._update();
diff --git a/application/palemoon/modules/QuotaManager.jsm b/application/palemoon/modules/QuotaManager.jsm
index e03161a69..48cfe88b3 100644
--- a/application/palemoon/modules/QuotaManager.jsm
+++ b/application/palemoon/modules/QuotaManager.jsm
@@ -6,8 +6,9 @@ this.EXPORTED_SYMBOLS = ["QuotaManagerHelper"];
Components.utils.import('resource://gre/modules/Services.jsm');
-const Cc = Components.classes;
const Ci = Components.interfaces;
+const Cc = Components.classes;
+const Cu = Components.utils;
this.QuotaManagerHelper = {
clear: function(isShutDown) {
@@ -34,12 +35,17 @@ this.QuotaManagerHelper = {
}
}
}
- var qm = Cc["@mozilla.org/dom/quota/manager;1"].getService(Ci.nsIQuotaManager);
+ var qm = Cc["@mozilla.org/dom/quota-manager-service;1"]
+ .getService(Ci.nsIQuotaManagerService);
for (var dom in doms) {
var uri = Services.io.newURI(dom, null, null);
- qm.clearStoragesForURI(uri);
+ let principal = Services.scriptSecurityManager
+ .createCodebasePrincipal(uri, {});
+ qm.clearStoragesForPrincipal(principal);
}
}
- } catch(er) {}
+ } catch(er) {
+ Cu.reportError(er);
+ }
}
};
diff --git a/application/palemoon/modules/SharedFrame.jsm b/application/palemoon/modules/SharedFrame.jsm
index 4d248ae5b..b9d59bfa9 100644
--- a/application/palemoon/modules/SharedFrame.jsm
+++ b/application/palemoon/modules/SharedFrame.jsm
@@ -18,7 +18,7 @@ const Cu = Components.utils;
* when another one of the placeholder is meant to be displayed.
* */
-let Frames = new Map();
+var Frames = new Map();
/**
* The Frames map is the main data structure that holds information
diff --git a/application/palemoon/modules/WindowsPreviewPerTab.jsm b/application/palemoon/modules/WindowsPreviewPerTab.jsm
index 41b38f0cf..c1ed05c39 100644
--- a/application/palemoon/modules/WindowsPreviewPerTab.jsm
+++ b/application/palemoon/modules/WindowsPreviewPerTab.jsm
@@ -62,9 +62,6 @@ const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1";
////////////////////////////////////////////////////////////////////////////////
//// Various utility properties
-XPCOMUtils.defineLazyServiceGetter(this, "ioSvc",
- "@mozilla.org/network/io-service;1",
- "nsIIOService");
XPCOMUtils.defineLazyServiceGetter(this, "imgTools",
"@mozilla.org/image/tools;1",
"imgITools");
@@ -73,8 +70,13 @@ XPCOMUtils.defineLazyServiceGetter(this, "faviconSvc",
"nsIFaviconService");
// nsIURI -> imgIContainer
-function _imageFromURI(uri, privateMode, callback) {
- let channel = ioSvc.newChannelFromURI(uri);
+function _imageFromURI(doc, uri, privateMode, callback) {
+ let channel = NetUtil.newChannel({
+ uri: uri,
+ loadUsingSystemPrincipal: true,
+ contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
+ });
+
try {
channel.QueryInterface(Ci.nsIPrivateBrowsingChannel);
channel.setPrivate(privateMode);
@@ -93,17 +95,17 @@ function _imageFromURI(uri, privateMode, callback) {
// favicon).
let defaultURI = faviconSvc.defaultFavicon;
if (!defaultURI.equals(uri))
- _imageFromURI(defaultURI, callback);
+ _imageFromURI(doc, defaultURI, privateMode, callback);
}
});
}
// string? -> imgIContainer
-function getFaviconAsImage(iconurl, privateMode, callback) {
+function getFaviconAsImage(doc, iconurl, privateMode, callback) {
if (iconurl)
- _imageFromURI(NetUtil.newURI(iconurl), privateMode, callback);
+ _imageFromURI(doc, NetUtil.newURI(iconurl), privateMode, callback);
else
- _imageFromURI(faviconSvc.defaultFavicon, privateMode, callback);
+ _imageFromURI(doc, faviconSvc.defaultFavicon, privateMode, callback);
}
// Snaps the given rectangle to be pixel-aligned at the given scale
@@ -460,12 +462,16 @@ TabWindow.prototype = {
preview.visible = AeroPeek.enabled;
preview.active = this.tabbrowser.selectedTab == controller.tab;
// Grab the default favicon
- getFaviconAsImage(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;
- });
+ 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;
+ });
return preview;
},
@@ -510,7 +516,14 @@ TabWindow.prototype = {
// 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.
- let inorder = [previews.get(t) for (t of tabs) if (previews.has(t))];
+ // Tycho: let inorder = [previews.get(t) for (t of tabs) if (previews.has(t))];
+ 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
@@ -545,14 +558,17 @@ TabWindow.prototype = {
//// Browser progress listener
onLinkIconAvailable: function (aBrowser, aIconURL) {
let self = this;
- getFaviconAsImage(aIconURL, PrivateBrowsingUtils.isWindowPrivate(this.win), function (img) {
- let index = self.tabbrowser.browsers.indexOf(aBrowser);
- // Only add it if we've found the index. The tab could have closed!
- if (index != -1) {
- let tab = self.tabbrowser.tabs[index];
- self.previews.get(tab).icon = img;
- }
- });
+ getFaviconAsImage(
+ aBrowser.contentWindow.document,
+ aIconURL,PrivateBrowsingUtils.isWindowPrivate(this.win),
+ function (img) {
+ let index = self.tabbrowser.browsers.indexOf(aBrowser);
+ // Only add it if we've found the index. The tab could have closed!
+ if (index != -1) {
+ let tab = self.tabbrowser.tabs[index];
+ self.previews.get(tab).icon = img;
+ }
+ });
}
}
diff --git a/application/palemoon/modules/moz.build b/application/palemoon/modules/moz.build
index b3459bcd5..67fd22338 100644
--- a/application/palemoon/modules/moz.build
+++ b/application/palemoon/modules/moz.build
@@ -9,6 +9,7 @@
EXTRA_JS_MODULES += [ 'promise.js' ]
EXTRA_JS_MODULES += [
+ 'AutoCompletePopup.jsm',
'BrowserNewTabPreloader.jsm',
'CharsetMenu.jsm',
'FormSubmitObserver.jsm',
@@ -19,10 +20,12 @@ EXTRA_JS_MODULES += [
'PageMenu.jsm',
'PopupNotifications.jsm',
'QuotaManager.jsm',
- 'SharedFrame.jsm',
- 'webrtcUI.jsm'
+ 'SharedFrame.jsm'
]
+if CONFIG['MOZ_WEBRTC']:
+ EXTRA_JS_MODULES += ['webrtcUI.jsm']
+
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
EXTRA_JS_MODULES += [
'Windows8WindowFrameColor.jsm',
@@ -35,5 +38,8 @@ EXTRA_PP_JS_MODULES += [
'RecentWindow.jsm',
]
+# Pass down 'official build' flags
+if CONFIG['MC_OFFICIAL']:
+ DEFINES['MC_OFFICIAL'] = 1
if CONFIG['MOZILLA_OFFICIAL']:
- DEFINES['MOZILLA_OFFICIAL'] = 1 \ No newline at end of file
+ DEFINES['MOZILLA_OFFICIAL'] = 1
diff --git a/application/palemoon/modules/openLocationLastURL.jsm b/application/palemoon/modules/openLocationLastURL.jsm
index 0d653df28..3f58db8ce 100644
--- a/application/palemoon/modules/openLocationLastURL.jsm
+++ b/application/palemoon/modules/openLocationLastURL.jsm
@@ -10,11 +10,11 @@ Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
this.EXPORTED_SYMBOLS = [ "OpenLocationLastURL" ];
-let prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
+var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
-let gOpenLocationLastURLData = "";
+var gOpenLocationLastURLData = "";
-let observer = {
+var observer = {
QueryInterface: function (aIID) {
if (aIID.equals(Components.interfaces.nsIObserver) ||
aIID.equals(Components.interfaces.nsISupports) ||
@@ -35,7 +35,7 @@ let observer = {
}
};
-let os = Components.classes["@mozilla.org/observer-service;1"]
+var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService);
os.addObserver(observer, "last-pb-context-exited", true);
os.addObserver(observer, "browser:purge-session-history", true);
diff --git a/application/palemoon/modules/promise.js b/application/palemoon/modules/promise.js
index 7c96f02cf..74065c8db 100644
--- a/application/palemoon/modules/promise.js
+++ b/application/palemoon/modules/promise.js
@@ -24,7 +24,7 @@ module.metadata = {
'stability': 'unstable'
};
-let promised = (function() {
+var promised = (function() {
// Note: Define shortcuts and utility functions here in order to avoid
// slower property accesses and unnecessary closure creations on each
// call of this popular function.
diff --git a/application/palemoon/moz.configure b/application/palemoon/moz.configure
new file mode 100644
index 000000000..72236254f
--- /dev/null
+++ b/application/palemoon/moz.configure
@@ -0,0 +1,7 @@
+# -*- 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/.
+
+include('../../toolkit/moz.configure')
diff --git a/application/palemoon/themes/linux/autocomplete.css b/application/palemoon/themes/linux/autocomplete.css
new file mode 100644
index 000000000..ab926851d
--- /dev/null
+++ b/application/palemoon/themes/linux/autocomplete.css
@@ -0,0 +1,210 @@
+/* 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/. */
+
+/* ===== autocomplete.css =================================================
+ == Styles used by the autocomplete widget.
+ ======================================================================= */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace html url("http://www.w3.org/1999/xhtml");
+
+/* ::::: autocomplete ::::: */
+
+/* .padded is used by autocomplete widgets that don't have an icon. Gross. -dwh */
+textbox:not(.padded) {
+ cursor: default;
+ padding: 0;
+}
+
+textbox[enablehistory="true"] {
+ -moz-appearance: none;
+ border: 0;
+ background-color: transparent;
+}
+
+textbox[nomatch="true"][highlightnonmatches="true"] {
+ color: red;
+}
+
+.private-autocomplete-textbox-container {
+ -moz-box-align: center;
+}
+
+textbox[enablehistory="true"] > .autocomplete-textbox-container {
+ -moz-appearance: menulist-textfield;
+}
+
+textbox:not(.padded) .textbox-input-box {
+ margin: 0 3px;
+}
+
+.textbox-input-box {
+ -moz-box-align: center;
+}
+
+/* ::::: autocomplete popups ::::: */
+
+panel[type="private-autocomplete"],
+panel[type="private-autocomplete-richlistbox"],
+.private-autocomplete-history-popup {
+ border-width: 1px;
+ -moz-border-top-colors: ThreeDDarkShadow;
+ -moz-border-right-colors: ThreeDDarkShadow;
+ -moz-border-bottom-colors: ThreeDDarkShadow;
+ -moz-border-left-colors: ThreeDDarkShadow;
+ padding: 0;
+ background-color: -moz-Field;
+}
+
+.private-autocomplete-history-popup {
+ max-height: 180px;
+}
+
+/* ::::: tree ::::: */
+
+.private-autocomplete-tree {
+ -moz-appearance: none !important;
+ border: none !important;
+ background-color: transparent !important;
+ color: MenuText;
+}
+
+.private-autocomplete-treecol {
+ -moz-appearance: none !important;
+ margin: 0 !important;
+ border: none !important;
+ padding: 0 !important;
+}
+
+/* GTK calculates space for a sort arrow */
+.private-autocomplete-treecol > .treecol-sortdirection {
+ -moz-appearance: none !important;
+}
+
+.private-autocomplete-treebody::-moz-tree-cell-text {
+ -moz-padding-start: 8px;
+}
+
+treechildren.private-autocomplete-treebody::-moz-tree-row(selected) {
+ background-color: Highlight;
+}
+
+treechildren.private-autocomplete-treebody::-moz-tree-cell-text(selected) {
+ color: HighlightText !important;
+}
+
+.private-autocomplete-treebody::-moz-tree-image(treecolAutoCompleteValue) {
+ max-width: 16px;
+ height: 16px;
+}
+
+/* ::::: richlistbox autocomplete ::::: */
+
+.private-autocomplete-richlistbox {
+ -moz-appearance: none;
+ margin: 1px;
+ background-color: transparent;
+}
+
+.private-autocomplete-richlistitem[selected="true"] {
+ background-color: Highlight;
+ color: HighlightText;
+}
+
+.private-autocomplete-richlistitem {
+ padding: 6px 2px;
+ color: MenuText;
+}
+
+.ac-url-box {
+ /* When setting a vertical margin here, half of that needs to be added
+ .ac-title-box's translateY for when .ac-url-box is hidden (see below). */
+ margin-top: 1px;
+}
+
+.private-autocomplete-richlistitem[actiontype="keyword"] .ac-url-box,
+.private-autocomplete-richlistitem[actiontype="searchengine"] .ac-url-box,
+.private-autocomplete-richlistitem[actiontype="visiturl"] .ac-url-box,
+.private-autocomplete-richlistitem[type~="autofill"] .ac-url-box {
+ visibility: hidden;
+}
+
+.private-autocomplete-richlistitem[actiontype="keyword"] .ac-title-box,
+.private-autocomplete-richlistitem[actiontype="searchengine"] .ac-title-box,
+.private-autocomplete-richlistitem[actiontype="visiturl"] .ac-title-box,
+.private-autocomplete-richlistitem[type~="autofill"] .ac-title-box {
+ /* Center the title by moving it down by half of .ac-url-box's height,
+ including vertical margins (if any). */
+ transform: translateY(.5em);
+}
+
+.ac-site-icon {
+ width: 16px;
+ height: 16px;
+ margin-bottom: -2px;
+ -moz-margin-start: 3px;
+ -moz-margin-end: 6px;
+}
+
+.ac-type-icon {
+ width: 16px;
+ height: 16px;
+ -moz-margin-start: 6px;
+ -moz-margin-end: 4px;
+}
+
+.ac-extra > .ac-result-type-tag {
+ margin: 0 4px;
+}
+
+.ac-extra > .ac-comment {
+ padding-right: 4px;
+}
+
+.ac-ellipsis-after {
+ margin: 0 !important;
+ padding: 0;
+ min-width: 1em;
+}
+
+.ac-normal-text {
+ margin: 0 !important;
+ padding: 0;
+}
+
+.ac-normal-text > html|span {
+ margin: 0 !important;
+ padding: 0;
+}
+
+html|span.ac-emphasize-text {
+ box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.1);
+ background-color: rgba(0,0,0,0.05);
+ border-radius: 2px;
+ text-shadow: 0 0 currentColor; /*faux bold effect*/
+}
+
+.ac-url-text > html|span.ac-emphasize-text,
+.ac-action-text > html|span.ac-emphasize-text {
+ box-shadow: none;
+}
+
+.ac-normal-text[selected="true"] > html|span.ac-emphasize-text {
+ box-shadow: inset 0 0 1px 1px rgba(255,255,255,0.3);
+ background-color: rgba(255,255,255,0.2);
+}
+
+.ac-title, .ac-url {
+ overflow: hidden;
+}
+
+/* ::::: textboxes inside toolbarpaletteitems ::::: */
+
+toolbarpaletteitem > toolbaritem > textbox > hbox > hbox > html|*.textbox-input {
+ visibility: hidden;
+}
+
+toolbarpaletteitem > toolbaritem > * > textbox > hbox > hbox > html|*.textbox-input {
+ visibility: hidden;
+}
diff --git a/application/palemoon/themes/linux/browser.css b/application/palemoon/themes/linux/browser.css
index 07e9dae9c..4f4964db8 100644
--- a/application/palemoon/themes/linux/browser.css
+++ b/application/palemoon/themes/linux/browser.css
@@ -728,9 +728,11 @@ toolbar[mode="full"] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
opacity: .4;
}
+%ifdef MOZ_WEBRTC
#webrtc-status-button {
-moz-image-region: rect(0px 192px 24px 168px);
}
+%endif
/* 16px primary toolbar buttons */
toolbar[iconsize="small"] .toolbarbutton-1:not([type="menu-button"]) {
@@ -812,7 +814,9 @@ toolbar[iconsize="small"] #downloads-button {
-moz-image-region: rect(0px 16px 16px 0px);
}
+%ifdef MOZ_WEBRTC
toolbar[iconsize="small"] #webrtc-status-button /* temporary placeholder (bug 824825) */,
+%endif
toolbar[iconsize="small"] #history-button,
toolbar[iconsize="small"] #history-menu-button {
-moz-image-region: rect(0px 32px 16px 16px);
@@ -884,9 +888,11 @@ toolbar[iconsize="small"] #feed-button {
-moz-image-region: rect(0px 112px 16px 96px);
}
+%ifdef MOZ_WEBRTC
toolbar[iconsize="small"] #webrtc-status-button {
-moz-image-region: rect(0px 128px 16px 112px);
}
+%endif
/* Fullscreen window controls */
#window-controls {
@@ -1226,10 +1232,12 @@ toolbar[iconsize="small"] #webrtc-status-button {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-64.png);
}
+%ifdef MOZ_WEBRTC
.popup-notification-icon[popupid="webRTC-sharingDevices"],
.popup-notification-icon[popupid="webRTC-shareDevices"] {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64.png);
}
+%endif
.popup-notification-icon[popupid="pointerLock"] {
list-style-image: url(chrome://browser/skin/pointerLock-64.png);
@@ -1352,6 +1360,7 @@ toolbar[iconsize="small"] #webrtc-status-button {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-16.png);
}
+%ifdef MOZ_WEBRTC
.webRTC-shareDevices-notification-icon,
#webRTC-shareDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
@@ -1361,6 +1370,7 @@ toolbar[iconsize="small"] #webrtc-status-button {
#webRTC-sharingDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-sharingDevice-16.png);
}
+%endif
.web-notifications-notification-icon,
#web-notifications-notification-icon {
@@ -1549,29 +1559,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
min-width: 27em;
}
-.panel-promo-box {
- margin: 8px -10px -10px -10px;
- padding: 8px 10px;
- border-top: 1px solid ThreeDShadow;
- background-image: linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
-}
-
-.panel-promo-icon {
- list-style-image: url("chrome://browser/skin/sync-notification-24.png");
- -moz-margin-end: 10px;
- vertical-align: middle;
-}
-
-.panel-promo-closebutton {
- margin-top: 0;
- margin-bottom: 0;
-}
-
-.panel-promo-closebutton > .toolbarbutton-text {
- padding: 0;
- margin: 0;
-}
-
/* Content area */
#sidebar {
background-color: Window;
@@ -2083,8 +2070,8 @@ toolbar[mode="text"] toolbarbutton.chevron > .toolbarbutton-icon {
}
%ifdef MOZ_DEVTOOLS
-%include ../../../toolkit/themes/shared/devtools/responsivedesign.inc.css
-%include ../../../toolkit/themes/shared/devtools/commandline.inc.css
+%include ../../../../devtools/client/themes/responsivedesign.inc.css
+%include ../../../../devtools/client/themes/commandline.inc.css
%endif
%include ../shared/plugin-doorhanger.inc.css
@@ -2109,12 +2096,12 @@ toolbar[mode="text"] toolbarbutton.chevron > .toolbarbutton-icon {
}
%endif
-.toolbarbutton-badge-container {
+.toolbarbutton-badge-stack {
margin: 5px 3px;
position: relative;
}
-toolbar[iconsize="small"] .toolbarbutton-badge-container {
+toolbar[iconsize="small"] .toolbarbutton-badge-stack {
margin: 0;
}
diff --git a/application/palemoon/themes/linux/jar.mn b/application/palemoon/themes/linux/jar.mn
index a756edbc3..7e67d0129 100644
--- a/application/palemoon/themes/linux/jar.mn
+++ b/application/palemoon/themes/linux/jar.mn
@@ -16,6 +16,7 @@ browser.jar:
#ifdef MOZ_SERVICES_SYNC
skin/classic/browser/aboutSyncTabs.css
#endif
+* skin/classic/browser/autocomplete.css
skin/classic/browser/actionicon-tab.png
* skin/classic/browser/browser.css
skin/classic/browser/click-to-play-warning-stripes.png
@@ -53,9 +54,11 @@ browser.jar:
skin/classic/browser/Toolbar.png
skin/classic/browser/Toolbar-small.png
skin/classic/browser/urlbar-arrow.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
+#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)
@@ -128,7 +131,6 @@ browser.jar:
skin/classic/browser/sync-128.png
skin/classic/browser/sync-desktopIcon.png
skin/classic/browser/sync-mobileIcon.png
- skin/classic/browser/sync-notification-24.png
skin/classic/browser/syncSetup.css
skin/classic/browser/syncCommon.css
skin/classic/browser/syncQuota.css
diff --git a/application/palemoon/themes/linux/sync-notification-24.png b/application/palemoon/themes/linux/sync-notification-24.png
deleted file mode 100644
index d67eb47ac..000000000
--- a/application/palemoon/themes/linux/sync-notification-24.png
+++ /dev/null
Binary files differ
diff --git a/application/palemoon/themes/osx/autocomplete.css b/application/palemoon/themes/osx/autocomplete.css
new file mode 100644
index 000000000..a50dbd823
--- /dev/null
+++ b/application/palemoon/themes/osx/autocomplete.css
@@ -0,0 +1,198 @@
+/* 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/. */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace html url("http://www.w3.org/1999/xhtml");
+
+/* .padded is used by autocomplete widgets that don't have an icon. Gross. -dwh */
+textbox:not(.padded) {
+ cursor: default;
+ padding: 0;
+}
+
+textbox[nomatch="true"][highlightnonmatches="true"] {
+ color: red;
+}
+
+textbox:not(.padded) .textbox-input-box {
+ margin: 0 3px;
+}
+
+.textbox-input-box {
+ -moz-box-align: center;
+}
+
+/* ::::: history button ::::: */
+
+.private-autocomplete-history-dropmarker {
+ -moz-appearance: none !important;
+ border: none !important;
+ background-color: transparent !important;
+ padding: 0px;
+ list-style-image: url("chrome://global/skin/icons/autocomplete-dropmarker.png");
+ margin: 0px;
+}
+
+/* ::::: autocomplete popups ::::: */
+
+panel[type="private-autocomplete"],
+panel[type="private-autocomplete-richlistbox"],
+.private-autocomplete-history-popup {
+ padding: 0px !important;
+ color: -moz-FieldText;
+ background-color: -moz-Field;
+ font: icon;
+ -moz-appearance: none;
+}
+
+.private-autocomplete-history-popup {
+ max-height: 180px;
+}
+
+/* ::::: tree ::::: */
+
+.private-autocomplete-tree {
+ -moz-appearance: none !important;
+ border: none !important;
+ background-color: transparent !important;
+}
+
+.private-autocomplete-treecol {
+ -moz-appearance: none !important;
+ margin: 0 !important;
+ border: none !important;
+ padding: 0 !important;
+}
+
+.private-autocomplete-treebody::-moz-tree-cell-text {
+ padding-left: 2px;
+}
+
+.private-autocomplete-treebody::-moz-tree-row {
+ border-top: none;
+}
+
+treechildren.private-autocomplete-treebody::-moz-tree-row(selected) {
+ background-color: Highlight;
+}
+
+treechildren.private-autocomplete-treebody::-moz-tree-cell-text(selected) {
+ color: HighlightText !important;
+}
+
+.private-autocomplete-treebody::-moz-tree-image(treecolAutoCompleteValue) {
+ max-width: 16px;
+ height: 16px;
+}
+
+/* ::::: richlistbox autocomplete ::::: */
+
+.private-autocomplete-richlistbox {
+ -moz-appearance: none;
+ margin: 0;
+}
+
+.private-autocomplete-richlistitem[selected="true"] {
+ background-color: Highlight;
+ color: HighlightText;
+ background-image: linear-gradient(rgba(255,255,255,0.3), transparent);
+}
+
+.private-autocomplete-richlistitem {
+ padding: 5px 2px;
+}
+
+.ac-url-box {
+ /* When setting a vertical margin here, half of that needs to be added
+ .ac-title-box's translateY for when .ac-url-box is hidden (see below). */
+ margin-top: 1px;
+}
+
+.private-autocomplete-richlistitem[actiontype="keyword"] .ac-url-box,
+.private-autocomplete-richlistitem[actiontype="searchengine"] .ac-url-box,
+.private-autocomplete-richlistitem[actiontype="visiturl"] .ac-url-box,
+.private-autocomplete-richlistitem[type~="autofill"] .ac-url-box {
+ visibility: hidden;
+}
+
+.private-autocomplete-richlistitem[actiontype="keyword"] .ac-title-box,
+.private-autocomplete-richlistitem[actiontype="searchengine"] .ac-title-box,
+.private-autocomplete-richlistitem[actiontype="visiturl"] .ac-title-box,
+.private-autocomplete-richlistitem[type~="autofill"] .ac-title-box {
+ /* Center the title by moving it down by half of .ac-url-box's height,
+ including vertical margins (if any). */
+ transform: translateY(.5em);
+}
+
+.ac-site-icon {
+ width: 16px;
+ height: 16px;
+ margin-bottom: -1px;
+ -moz-margin-start: 7px;
+ -moz-margin-end: 5px;
+}
+
+.ac-type-icon {
+ width: 16px;
+ height: 16px;
+ -moz-margin-start: 6px;
+ -moz-margin-end: 4px;
+}
+
+.ac-url-box > .ac-site-icon,
+.ac-url-box > .ac-type-icon {
+ /* Otherwise the spacer is big enough to stretch its container */
+ height: auto;
+}
+
+.ac-extra > .ac-result-type-tag {
+ margin: 0 4px;
+}
+
+.ac-extra > .ac-comment {
+ padding-right: 4px;
+}
+
+.ac-ellipsis-after {
+ margin: 0 !important;
+ padding: 0;
+ min-width: 1.1em;
+}
+
+.ac-normal-text {
+ margin: 0 !important;
+ padding: 0;
+}
+
+.ac-normal-text > html|span {
+ margin: 0 !important;
+ padding: 0;
+}
+
+html|span.ac-emphasize-text {
+ box-shadow: inset 0 0 1px 1px rgba(208,208,208,0.4);
+ background-color: rgba(208,208,208,0.2);
+ border-radius: 2px;
+ text-shadow: 0 0 currentColor;
+}
+
+.ac-url-text > html|span.ac-emphasize-text,
+.ac-action-text > html|span.ac-emphasize-text {
+ box-shadow: inset 0 0 1px 1px rgba(183,210,226,0.4);
+ background-color: rgba(183,210,226,0.3);
+}
+
+.ac-title, .ac-url {
+ overflow: hidden;
+}
+
+/* ::::: textboxes inside toolbarpaletteitems ::::: */
+
+toolbarpaletteitem > toolbaritem > textbox > hbox > hbox > html|*.textbox-input {
+ visibility: hidden;
+}
+
+toolbarpaletteitem > toolbaritem > * > textbox > hbox > hbox > html|*.textbox-input {
+ visibility: hidden;
+}
diff --git a/application/palemoon/themes/osx/browser.css b/application/palemoon/themes/osx/browser.css
index 58348a408..8d709d8e1 100644
--- a/application/palemoon/themes/osx/browser.css
+++ b/application/palemoon/themes/osx/browser.css
@@ -452,7 +452,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
}
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-icon,
-@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-badge-container,
+@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-badge-stack,
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
padding: 2px 6px;
@@ -470,7 +470,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
}
@navbarLargeIcons@ .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-icon,
-@navbarLargeIcons@ .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-badge-container,
+@navbarLargeIcons@ .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-badge-stack,
@navbarLargeIcons@ .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
padding: 3px 7px;
}
@@ -521,7 +521,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):-moz-any(:hover,[open]) > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon,
@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-icon,
-@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-badge-container,
+@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-badge-stack,
@conditionalForwardWithUrlbar@ > .toolbarbutton-1:-moz-any([disabled],:not([open]):not([disabled]):not(:active)) > .toolbarbutton-icon {
background-image: linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.5));
border-color: hsla(210,54%,20%,.25) hsla(210,54%,20%,.3) hsla(210,54%,20%,.35);
@@ -544,7 +544,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled]):hover:active > .toolbarbutton-icon,
@navbarLargeIcons@ .toolbarbutton-1[open] > .toolbarbutton-menubutton-dropmarker:not([disabled]) > .dropmarker-icon,
@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-icon,
-@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-badge-container {
+@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-badge-stack {
background-image: linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1));
background-color: hsla(210,54%,20%,.15);
border-color: hsla(210,54%,20%,.3) hsla(210,54%,20%,.35) hsla(210,54%,20%,.4);
@@ -801,10 +801,11 @@ toolbar[brighttext] #bookmarks-menu-button.bookmark-item {
-moz-image-region: rect(0, 342px, 18px, 324px);
}
+%ifdef MOZ_WEBRTC
#webrtc-status-button {
-moz-image-region: rect(0, 360px, 18px, 342px);
}
-
+%endif
/* ::::: fullscreen window controls ::::: */
@@ -1337,41 +1338,6 @@ richlistitem[type~="action"][actiontype="switchtab"][selected="true"] > .ac-url-
min-width: 27em;
}
-.panel-promo-box {
- margin: 10px -10px -10px;
- padding: 8px 10px;
- border-top: 1px solid ThreeDShadow;
- background-image: linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-@media (-moz-mac-lion-theme) {
- .panel-promo-box {
- border-top-style: none;
- background: #f1f5fb;
- color: GrayText;
- box-shadow: 0px 1px 2px rgb(204,214,234) inset;
- }
-}
-
-.panel-promo-icon {
- list-style-image: url("chrome://browser/skin/sync-notification-24.png");
- -moz-margin-end: 10px;
- vertical-align: middle;
-}
-
-.panel-promo-closebutton {
- border: none;
- -moz-margin-end: -14px;
- margin-top: -8px;
-}
-
-.panel-promo-closebutton > .toolbarbutton-text {
- padding: 0;
- margin: 0;
-}
-
/* ::::: content area ::::: */
#sidebar {
@@ -1955,11 +1921,13 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-64.png);
}
+%ifdef MOZ_WEBRTC
.popup-notification-icon[popupid="webRTC-sharingDevices"],
.popup-notification-icon[popupid="webRTC-shareDevices"] {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64.png);
}
+%endif
.popup-notification-icon[popupid="pointerLock"] {
list-style-image: url(chrome://browser/skin/pointerLock-64.png);
}
@@ -2079,6 +2047,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-16.png);
}
+%ifdef MOZ_WEBRTC
.webRTC-shareDevices-notification-icon,
#webRTC-shareDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
@@ -2088,6 +2057,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
#webRTC-sharingDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-sharingDevice-16.png);
}
+%endif
.web-notifications-notification-icon,
#web-notifications-notification-icon {
@@ -2383,8 +2353,8 @@ toolbar[brighttext] #addonbar-closebutton {
}
%ifdef MOZ_DEVTOOLS
-%include ../../../toolkit/themes/shared/devtools/responsivedesign.inc.css
-%include ../../../toolkit/themes/shared/devtools/commandline.inc.css
+%include ../../../../devtools/client/themes/responsivedesign.inc.css
+%include ../../../../devtools/client/themes/commandline.inc.css
%endif
%include ../shared/plugin-doorhanger.inc.css
@@ -2401,23 +2371,23 @@ toolbar[brighttext] #addonbar-closebutton {
}
%endif
-.toolbarbutton-badge-container {
+.toolbarbutton-badge-stack {
margin: 0;
padding: 0;
position: relative;
}
-@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-badge-container {
+@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-badge-stack {
padding: 2px 5px;
}
-.toolbarbutton-1 > .toolbarbutton-badge-container > .toolbar-icon {
+.toolbarbutton-1 > .toolbarbutton-badge-stack > .toolbar-icon {
position: absolute;
top: 2px;
right: 2px;
}
-.toolbarbutton-badge-container > .toolbarbutton-icon[label]:not([label=""]) {
+.toolbarbutton-badge-stack > .toolbarbutton-icon[label]:not([label=""]) {
-moz-margin-end: 0;
}
diff --git a/application/palemoon/themes/osx/jar.mn b/application/palemoon/themes/osx/jar.mn
index 00575bac8..186cd8a75 100644
--- a/application/palemoon/themes/osx/jar.mn
+++ b/application/palemoon/themes/osx/jar.mn
@@ -15,6 +15,7 @@ browser.jar:
#ifdef MOZ_SERVICES_SYNC
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
@@ -72,9 +73,11 @@ browser.jar:
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
+#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)
@@ -161,7 +164,6 @@ browser.jar:
skin/classic/browser/sync-bg.png
skin/classic/browser/sync-desktopIcon.png
skin/classic/browser/sync-mobileIcon.png
- skin/classic/browser/sync-notification-24.png
skin/classic/browser/syncSetup.css
skin/classic/browser/syncCommon.css
skin/classic/browser/syncQuota.css
diff --git a/application/palemoon/themes/osx/shared.inc b/application/palemoon/themes/osx/shared.inc
index 2e8a8f269..ef27746a3 100644
--- a/application/palemoon/themes/osx/shared.inc
+++ b/application/palemoon/themes/osx/shared.inc
@@ -1,4 +1,4 @@
-%include ../../../toolkit/themes/osx/global/shared.inc
+%include ../../../../toolkit/themes/osx/global/shared.inc
%include ../shared/browser.inc
%define hudButton -moz-appearance: none; color: #434343; border-radius: 4px; border: 1px solid #b5b5b5; background: linear-gradient(#fff, #f2f2f2); box-shadow: inset 0 1px rgba(255,255,255,.8), inset 0 0 1px rgba(255,255, 255,.25), 0 1px rgba(255,255,255,.3); background-clip: padding-box; background-origin: padding-box; padding: 2px 6px;
diff --git a/application/palemoon/themes/osx/sync-notification-24.png b/application/palemoon/themes/osx/sync-notification-24.png
deleted file mode 100644
index fc9a4e63d..000000000
--- a/application/palemoon/themes/osx/sync-notification-24.png
+++ /dev/null
Binary files differ
diff --git a/application/palemoon/themes/shared/browser.inc b/application/palemoon/themes/shared/browser.inc
index cd17903ce..18e69ad43 100644
--- a/application/palemoon/themes/shared/browser.inc
+++ b/application/palemoon/themes/shared/browser.inc
@@ -1,3 +1,8 @@
%filter substitution
+%ifndef MOZ_WEBRTC
+%define primaryToolbarButtons #back-button, #forward-button, #reload-button, #stop-button, #home-button, #print-button, #downloads-button, #downloads-indicator, #history-button, #history-menu-button, #bookmarks-button, #bookmarks-menu-button, #new-tab-button, #new-window-button, #cut-button, #copy-button, #paste-button, #fullscreen-button, #zoom-out-button, #zoom-in-button, #sync-button, #feed-button, #alltabs-button
+%else
%define primaryToolbarButtons #back-button, #forward-button, #reload-button, #stop-button, #home-button, #print-button, #downloads-button, #downloads-indicator, #history-button, #history-menu-button, #bookmarks-button, #bookmarks-menu-button, #new-tab-button, #new-window-button, #cut-button, #copy-button, #paste-button, #fullscreen-button, #zoom-out-button, #zoom-in-button, #sync-button, #feed-button, #alltabs-button, #webrtc-status-button
+%endif
+
diff --git a/application/palemoon/themes/windows/autocomplete.css b/application/palemoon/themes/windows/autocomplete.css
new file mode 100644
index 000000000..b3cab44c8
--- /dev/null
+++ b/application/palemoon/themes/windows/autocomplete.css
@@ -0,0 +1,238 @@
+/* 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/. */
+
+/* ===== autocomplete.css =================================================
+ == Styles used by the autocomplete widget.
+ ======================================================================= */
+
+@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
+@namespace html url("http://www.w3.org/1999/xhtml");
+
+/* ::::: autocomplete ::::: */
+
+/* .padded is used by autocomplete widgets that don't have an icon. Gross. -dwh */
+textbox:not(.padded) {
+ cursor: default;
+ padding: 0;
+}
+
+textbox[nomatch="true"][highlightnonmatches="true"] {
+ color: red;
+}
+
+.private-autocomplete-textbox-container {
+ -moz-box-align: center;
+}
+
+textbox:not(.padded) .textbox-input-box {
+ margin: 0 3px;
+}
+
+.textbox-input-box {
+ -moz-box-align: center;
+}
+
+/* ::::: autocomplete popups ::::: */
+
+panel[type="private-autocomplete"],
+panel[type="private-autocomplete-richlistbox"],
+.private-autocomplete-history-popup {
+ -moz-appearance: none;
+ border-width: 1px;
+ -moz-border-top-colors: ThreeDShadow;
+ -moz-border-right-colors: ThreeDShadow;
+ -moz-border-bottom-colors: ThreeDShadow;
+ -moz-border-left-colors: ThreeDShadow;
+ padding: 0;
+ color: -moz-FieldText;
+ background-color: -moz-Field;
+}
+
+.private-autocomplete-history-popup {
+ max-height: 180px;
+}
+
+/* ::::: tree ::::: */
+
+.private-autocomplete-tree {
+ -moz-appearance: none !important;
+ border: none !important;
+ background-color: transparent !important;
+}
+
+.private-autocomplete-treecol {
+ -moz-appearance: none !important;
+ margin: 0 !important;
+ border: none !important;
+ padding: 0 !important;
+}
+
+/* GTK calculates space for a sort arrow */
+.private-autocomplete-treecol > .treecol-sortdirection {
+ -moz-appearance: none !important;
+}
+
+.private-autocomplete-treebody::-moz-tree-cell-text {
+ -moz-padding-start: 8px;
+}
+
+treechildren.private-autocomplete-treebody::-moz-tree-row(selected) {
+ background-color: Highlight;
+}
+
+treechildren.private-autocomplete-treebody::-moz-tree-cell-text(selected) {
+ color: HighlightText !important;
+}
+
+.private-autocomplete-treebody::-moz-tree-image(treecolAutoCompleteValue) {
+ max-width: 16px;
+ height: 16px;
+}
+
+/* ::::: richlistbox autocomplete ::::: */
+
+.private-autocomplete-richlistbox {
+ -moz-appearance: none;
+ margin: 0;
+}
+
+.private-autocomplete-richlistitem {
+ padding: 1px;
+}
+
+.private-autocomplete-richlistitem[selected="true"] {
+ background-color: Highlight;
+ color: HighlightText;
+}
+
+%ifdef XP_WIN
+@media (-moz-os-version: windows-vista) and (-moz-windows-default-theme),
+ (-moz-os-version: windows-win7) and (-moz-windows-default-theme) {
+ .private-autocomplete-richlistitem[selected="true"] {
+ color: inherit;
+ background-color: transparent;
+ /* four gradients for the bevel highlights on each edge, one for blue background */
+ background-image:
+ linear-gradient(to bottom, rgba(255,255,255,0.9) 3px, transparent 3px),
+ linear-gradient(to right, rgba(255,255,255,0.5) 3px, transparent 3px),
+ linear-gradient(to left, rgba(255,255,255,0.5) 3px, transparent 3px),
+ linear-gradient(to top, rgba(255,255,255,0.4) 3px, transparent 3px),
+ linear-gradient(to bottom, rgba(163,196,247,0.3), rgba(122,180,246,0.3));
+ background-clip: content-box;
+ border-radius: 6px;
+ outline: 1px solid rgb(124,163,206);
+ -moz-outline-radius: 3px;
+ outline-offset: -2px;
+ }
+}
+%endif
+
+.ac-title-box {
+ margin-top: 4px;
+}
+
+.ac-url-box {
+ /* When setting a vertical margin here, half of that needs to be added
+ .ac-title-box's translateY for when .ac-url-box is hidden (see below). */
+ margin: 1px 0 4px;
+}
+
+.private-autocomplete-richlistitem[actiontype="keyword"] .ac-url-box,
+.private-autocomplete-richlistitem[actiontype="searchengine"] .ac-url-box,
+.private-autocomplete-richlistitem[actiontype="visiturl"] .ac-url-box,
+.private-autocomplete-richlistitem[type~="autofill"] .ac-url-box {
+ visibility: hidden;
+}
+
+.private-autocomplete-richlistitem[actiontype="keyword"] .ac-title-box,
+.private-autocomplete-richlistitem[actiontype="searchengine"] .ac-title-box,
+.private-autocomplete-richlistitem[actiontype="visiturl"] .ac-title-box,
+.private-autocomplete-richlistitem[type~="autofill"] .ac-title-box {
+ /* Center the title by moving it down by half of .ac-url-box's height,
+ including vertical margins (if any). */
+ transform: translateY(calc(.5em + 2px));
+}
+
+.ac-site-icon {
+ width: 16px;
+ height: 16px;
+ margin: 0 5px -2px;
+}
+
+.ac-type-icon {
+ width: 16px;
+ height: 16px;
+ -moz-margin-start: 6px;
+ -moz-margin-end: 4px;
+ margin-bottom: -1px;
+}
+
+.ac-url-box > .ac-site-icon,
+.ac-url-box > .ac-type-icon {
+ /* Otherwise the spacer is big enough to stretch its container */
+ height: auto;
+}
+
+.ac-extra > .ac-result-type-tag {
+ margin: 0 4px;
+}
+
+.ac-extra > .ac-comment {
+ padding-right: 4px;
+}
+
+.ac-ellipsis-after {
+ margin: 0 !important;
+ padding: 0;
+ min-width: 1em;
+}
+
+.ac-normal-text {
+ margin: 0 !important;
+ padding: 0;
+}
+
+.ac-normal-text > html|span {
+ margin: 0 !important;
+ padding: 0;
+}
+
+html|span.ac-emphasize-text {
+ box-shadow: inset 0 0 1px 1px rgba(208,208,208,0.5);
+ background-color: rgba(208,208,208,0.3);
+ border-radius: 2px;
+ text-shadow: 0 0 currentColor;
+}
+
+@media (-moz-windows-default-theme) {
+ @media not all and (-moz-os-version: windows-xp) {
+ html|span.ac-emphasize-text {
+ box-shadow: inset 0 0 1px 1px rgba(0,0,0,0.1);
+ background-color: rgba(0,0,0,0.05);
+ }
+ }
+
+ @media (-moz-os-version: windows-xp) {
+ .ac-url-text > html|span.ac-emphasize-text,
+ .ac-action-text > html|span.ac-emphasize-text {
+ box-shadow: inset 0 0 1px 1px rgba(202,214,201,0.3);
+ background-color: rgba(202,214,201,0.2);
+ }
+ }
+}
+
+.ac-title, .ac-url {
+ overflow: hidden;
+}
+
+/* ::::: textboxes inside toolbarpaletteitems ::::: */
+
+toolbarpaletteitem > toolbaritem > textbox > hbox > hbox > html|*.textbox-input {
+ visibility: hidden;
+}
+
+toolbarpaletteitem > toolbaritem > * > textbox > hbox > hbox > html|*.textbox-input {
+ visibility: hidden;
+}
+
diff --git a/application/palemoon/themes/windows/browser.css b/application/palemoon/themes/windows/browser.css
index 7c837764d..1c51accae 100644
--- a/application/palemoon/themes/windows/browser.css
+++ b/application/palemoon/themes/windows/browser.css
@@ -825,7 +825,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
}
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-icon,
-@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-badge-container,
+@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-badge-stack,
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
padding: 2px 6px;
@@ -848,7 +848,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
}
@navbarLargeIcons@ .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-icon,
-@navbarLargeIcons@ .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-badge-container,
+@navbarLargeIcons@ .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-badge-stack,
@navbarLargeIcons@ .toolbarbutton-1:not(:-moz-any(@primaryToolbarButtons@)) > .toolbarbutton-menubutton-button > .toolbarbutton-icon {
padding: 3px 7px;
}
@@ -897,7 +897,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
}
@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-icon,
-@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-badge-container,
+@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):not([checked]):not([open]):not(:active):hover > .toolbarbutton-badge-stack,
@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):-moz-any(:hover,[open]) > .toolbarbutton-menubutton-button > .toolbarbutton-icon,
@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):hover > .toolbarbutton-menubutton-dropmarker > .dropmarker-icon {
background-image: linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.5));
@@ -916,7 +916,7 @@ toolbar[mode=full] .toolbarbutton-1 > .toolbarbutton-menubutton-button {
}
@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-icon,
-@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-badge-container,
+@navbarLargeIcons@ .toolbarbutton-1:not([disabled]):-moz-any([open],[checked],:hover:active) > .toolbarbutton-badge-stack,
@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-menubutton-button:not([disabled]):hover:active > .toolbarbutton-icon,
@navbarLargeIcons@ .toolbarbutton-1[open] > .toolbarbutton-menubutton-dropmarker:not([disabled]) > .dropmarker-icon {
background-image: linear-gradient(hsla(0,0%,100%,.6), hsla(0,0%,100%,.1));
@@ -1192,10 +1192,11 @@ toolbar[brighttext] #bookmarks-menu-button.bookmark-item {
-moz-image-region: rect(0, 342px, 18px, 324px);
}
+%ifdef MOZ_WEBRTC
#webrtc-status-button {
-moz-image-region: rect(0, 360px, 18px, 342px);
}
-
+%endif
/* ::::: fullscreen window controls ::::: */
@@ -1777,42 +1778,6 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
min-width: 27em;
}
-.panel-promo-box {
- margin: 10px -10px -10px;
- padding: 8px 10px;
- border-top: 1px solid ThreeDShadow;
- background-image: linear-gradient(hsla(0,0%,0%,.15), hsla(0,0%,0%,.08) 6px);
- border-bottom-left-radius: 3px;
- border-bottom-right-radius: 3px;
-}
-
-@media (-moz-windows-default-theme) {
- .panel-promo-box {
- border-top-style: none;
- background: #f1f5fb;
- color: GrayText;
- box-shadow: 0px 1px 2px rgb(204,214,234) inset;
- }
-}
-
-.panel-promo-icon {
- list-style-image: url("chrome://browser/skin/sync-notification-24.png");
- -moz-margin-end: 10px;
- vertical-align: middle;
-}
-
-.panel-promo-closebutton {
- -moz-appearance: none;
- border: none;
- -moz-margin-end: -10px;
- margin-top: -5px;
-}
-
-.panel-promo-closebutton > .toolbarbutton-text {
- padding: 0;
- margin: 0;
-}
-
/* ::::: content area ::::: */
#sidebar {
@@ -2443,10 +2408,12 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-64.png);
}
+%ifdef MOZ_WEBRTC
.popup-notification-icon[popupid="webRTC-sharingDevices"],
.popup-notification-icon[popupid="webRTC-shareDevices"] {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-64.png);
}
+%endif
.popup-notification-icon[popupid="pointerLock"] {
list-style-image: url(chrome://browser/skin/pointerLock-64.png);
@@ -2567,6 +2534,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
list-style-image: url(chrome://browser/skin/mixed-content-blocked-16.png);
}
+%ifdef MOZ_WEBRTC
.webRTC-shareDevices-notification-icon,
#webRTC-shareDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-shareDevice-16.png);
@@ -2576,6 +2544,7 @@ toolbarbutton.bookmark-item[dragover="true"][open="true"] {
#webRTC-sharingDevices-notification-icon {
list-style-image: url(chrome://browser/skin/webRTC-sharingDevice-16.png);
}
+%endif
.web-notifications-notification-icon,
#web-notifications-notification-icon {
@@ -2858,8 +2827,8 @@ toolbar[brighttext] #addonbar-closebutton {
}
%ifdef MOZ_DEVTOOLS
-%include ../../../toolkit/themes/shared/devtools/responsivedesign.inc.css
-%include ../../../toolkit/themes/shared/devtools/commandline.inc.css
+%include ../../../../devtools/client/themes/responsivedesign.inc.css
+%include ../../../../devtools/client/themes/commandline.inc.css
%endif
%include ../shared/plugin-doorhanger.inc.css
@@ -2876,23 +2845,23 @@ toolbar[brighttext] #addonbar-closebutton {
}
%endif
-.toolbarbutton-badge-container {
+.toolbarbutton-badge-stack {
margin: 0;
padding: 0;
position: relative;
}
-@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-badge-container {
+@navbarLargeIcons@ .toolbarbutton-1 > .toolbarbutton-badge-stack {
padding: 2px 5px;
}
-.toolbarbutton-1 > .toolbarbutton-badge-container > .toolbar-icon {
+.toolbarbutton-1 > .toolbarbutton-badge-stack > .toolbar-icon {
position: absolute;
top: 2px;
right: 2px;
}
-.toolbarbutton-badge-container > .toolbarbutton-icon[label]:not([label=""]) {
+.toolbarbutton-badge-stack > .toolbarbutton-icon[label]:not([label=""]) {
-moz-margin-end: 0;
}
diff --git a/application/palemoon/themes/windows/jar.mn b/application/palemoon/themes/windows/jar.mn
index 1c1f139de..a66714b13 100644
--- a/application/palemoon/themes/windows/jar.mn
+++ b/application/palemoon/themes/windows/jar.mn
@@ -15,6 +15,7 @@ browser.jar:
#ifdef MOZ_SERVICES_SYNC
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
@@ -74,9 +75,11 @@ browser.jar:
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
+#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)
@@ -98,7 +101,7 @@ browser.jar:
skin/classic/browser/newtab/controls.png (newtab/controls.png)
skin/classic/browser/newtab/noise.png (newtab/noise.png)
skin/classic/browser/places/places.css (places/places.css)
- skin/classic/browser/places/organizer.css (places/organizer.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)
@@ -157,7 +160,6 @@ browser.jar:
skin/classic/browser/sync-bg.png
skin/classic/browser/sync-desktopIcon.png
skin/classic/browser/sync-mobileIcon.png
- skin/classic/browser/sync-notification-24.png
skin/classic/browser/syncSetup.css
skin/classic/browser/syncCommon.css
skin/classic/browser/syncQuota.css
diff --git a/application/palemoon/themes/windows/sync-notification-24.png b/application/palemoon/themes/windows/sync-notification-24.png
deleted file mode 100644
index fc9a4e63d..000000000
--- a/application/palemoon/themes/windows/sync-notification-24.png
+++ /dev/null
Binary files differ
diff --git a/application/xulrunner/README.xulrunner b/application/xulrunner/README.xulrunner
new file mode 100644
index 000000000..424b7a615
--- /dev/null
+++ b/application/xulrunner/README.xulrunner
@@ -0,0 +1,13 @@
+XULRunner is a package which can be used to run applications written in HTML
+or XUL. It can also be used to embed the gecko rendering engine into
+binary applications.
+
+XULRunner is not a product; it is a tool which can be used to create products.
+It is a byproduct of Firefox development and the Mozilla community does not
+have a strong commitment to support XULRunner development apart from Firefox
+development.
+
+For more information about using XULRunner or how to use this binary package,
+see the Mozilla Developer Center article:
+
+https://developer.mozilla.org/en/XULRunner
diff --git a/application/xulrunner/app.mozbuild b/application/xulrunner/app.mozbuild
new file mode 100644
index 000000000..7b8316016
--- /dev/null
+++ b/application/xulrunner/app.mozbuild
@@ -0,0 +1,13 @@
+# 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/.
+
+include('/toolkit/toolkit.mozbuild')
+
+if CONFIG['MOZ_EXTENSIONS']:
+ DIRS += ['/extensions']
+
+DIRS += [
+ '/application/xulrunner',
+]
diff --git a/application/xulrunner/app/Makefile.in b/application/xulrunner/app/Makefile.in
new file mode 100644
index 000000000..98e377d69
--- /dev/null
+++ b/application/xulrunner/app/Makefile.in
@@ -0,0 +1,75 @@
+# vim:set ts=8 sw=8 sts=8 et:
+# 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/.
+
+GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/,xulrunner.js)
+
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+TK_LIBS := -framework Cocoa $(TK_LIBS)
+endif
+
+ifndef MOZ_WINCONSOLE
+ifdef MOZ_DEBUG
+MOZ_WINCONSOLE = 1
+else
+MOZ_WINCONSOLE = 0
+endif
+endif
+
+# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
+# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
+NSDISTMODE = copy
+
+include $(topsrcdir)/config/config.mk
+
+include $(topsrcdir)/config/rules.mk
+
+DEFINES += -DXULRUNNER_ICO='"$(DIST)/branding/xulrunner.ico"' -DDOCUMENT_ICO='"$(DIST)/branding/document.ico"'
+
+ifdef MOZ_WIDGET_GTK
+libs::
+ $(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png $(DIST)/bin/chrome/icons/default
+ $(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png $(DIST)/bin/chrome/icons/default
+ $(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(DIST)/bin/chrome/icons/default
+endif
+
+# XXX applications would need to supply this file
+#export:: brand.dtd.in
+# $(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $^ -o brand.dtd)
+
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+
+FRAMEWORK_NAME = XUL
+FRAMEWORK_VERSION = $(MOZILLA_VERSION)
+
+FRAMEWORK_DIR = \
+ $(DIST)/$(FRAMEWORK_NAME).framework/Versions/$(FRAMEWORK_VERSION)
+
+$(FRAMEWORK_DIR)/Resources:
+ $(NSINSTALL) -D $@
+
+tools:: $(PROGRAM) $(FRAMEWORK_DIR)/Resources
+ $(NSINSTALL) $(srcdir)/macbuild/InfoPlist.strings $(FRAMEWORK_DIR)/Resources
+ sed -e 's/APP_VERSION/$(APP_VERSION)/' $(srcdir)/macbuild/Info.plist.in > $(FRAMEWORK_DIR)/Info.plist
+ rsync -av $(DIST)/bin/ $(FRAMEWORK_DIR) --exclude mangle --exclude shlibsign
+ rm -f $(DIST)/$(FRAMEWORK_NAME).framework/Versions/Current \
+ $(DIST)/$(FRAMEWORK_NAME).framework/libxpcom.dylib \
+ $(DIST)/$(FRAMEWORK_NAME).framework/XUL \
+ $(DIST)/$(FRAMEWORK_NAME).framework/xulrunner
+ ln -s $(FRAMEWORK_VERSION) $(DIST)/$(FRAMEWORK_NAME).framework/Versions/Current
+ ln -s Versions/Current/libxpcom.dylib $(DIST)/$(FRAMEWORK_NAME).framework/libxpcom.dylib
+ ln -s Versions/Current/XUL $(DIST)/$(FRAMEWORK_NAME).framework/XUL
+ ln -s Versions/Current/xulrunner $(DIST)/$(FRAMEWORK_NAME).framework/xulrunner
+
+clean clobber::
+ rm -rf $(DIST)/$(FRAMEWORK_NAME).framework
+endif
+
+README_FILE = $(srcdir)/../README.xulrunner
+
+libs::
+ $(INSTALL) $(IFLAGS1) $(README_FILE) $(DIST)/bin
+ $(INSTALL) $(IFLAGS1) $(topsrcdir)/LICENSE $(DIST)/bin
+ $(INSTALL) $(IFLAGS1) $(srcdir)/install_app.py $(DIST)/bin
+
diff --git a/application/xulrunner/app/default16.png b/application/xulrunner/app/default16.png
new file mode 100644
index 000000000..e74f5cf2e
--- /dev/null
+++ b/application/xulrunner/app/default16.png
Binary files differ
diff --git a/application/xulrunner/app/default32.png b/application/xulrunner/app/default32.png
new file mode 100644
index 000000000..914509054
--- /dev/null
+++ b/application/xulrunner/app/default32.png
Binary files differ
diff --git a/application/xulrunner/app/default48.png b/application/xulrunner/app/default48.png
new file mode 100644
index 000000000..5fd71e110
--- /dev/null
+++ b/application/xulrunner/app/default48.png
Binary files differ
diff --git a/application/xulrunner/app/document.ico b/application/xulrunner/app/document.ico
new file mode 100644
index 000000000..311116324
--- /dev/null
+++ b/application/xulrunner/app/document.ico
Binary files differ
diff --git a/application/xulrunner/app/install_app.py b/application/xulrunner/app/install_app.py
new file mode 100644
index 000000000..6be8c5ecb
--- /dev/null
+++ b/application/xulrunner/app/install_app.py
@@ -0,0 +1,221 @@
+#!/usr/bin/env 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/.
+
+# Min version of python is 2.7
+import sys
+if ((sys.version_info.major != 2) or (sys.version_info.minor < 7)):
+ raise Exception("You need to use Python version 2.7 or higher")
+
+import os, shutil, re, zipfile
+from ConfigParser import SafeConfigParser
+
+# Platform-specific support
+# see https://developer.mozilla.org/en/XULRunner/Deploying_XULRunner_1.8
+if sys.platform.startswith('linux') or sys.platform == "win32":
+ def installApp(appLocation, installDir, appName, greDir):
+ zipApp, iniParser, appName = validateArguments(appLocation, installDir, appName, greDir)
+ if (zipApp):
+ zipApp.extractAll(installDir)
+ else:
+ shutil.copytree(appLocation, installDir)
+ shutil.copy2(os.path.join(greDir, xulrunnerStubName),
+ os.path.join(installDir, appName))
+ copyGRE(greDir, os.path.join(installDir, "xulrunner"))
+
+if sys.platform.startswith('linux'):
+ xulrunnerStubName = "xulrunner-stub"
+
+ def makeAppName(leafName):
+ return leafName.lower()
+
+elif sys.platform == "win32":
+ xulrunnerStubName = "xulrunner-stub.exe"
+
+ def makeAppName(leafName):
+ return leafName + ".exe"
+
+elif sys.platform == "darwin":
+ xulrunnerStubName = "xulrunner-stub"
+
+ def installApp(appLocation, installDir, appName, greDir):
+ zipApp, iniparser, appName = validateArguments(appLocation, installDir, appName, greDir)
+ installDir += "/" + appName + ".app"
+ resourcesDir = os.path.join(installDir, "Contents/Resources")
+ if (zipApp):
+ zipApp.extractAll(resourcesDir)
+ else:
+ shutil.copytree(appLocation, resourcesDir)
+ MacOSDir = os.path.join(installDir, "Contents/MacOS")
+ os.makedirs(MacOSDir)
+ shutil.copy2(os.path.join(greDir, xulrunnerStubName), MacOSDir)
+ copyGRE(greDir,
+ os.path.join(installDir, "Contents/Frameworks/XUL.framework"))
+
+ # Contents/Info.plist
+ contents = """<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+<key>CFBundleInfoDictionaryVersion</key>
+<string>6.0</string>
+<key>CFBundlePackageType</key>
+<string>APPL</string>
+<key>CFBundleSignature</key>
+<string>????</string>
+<key>CFBundleExecutable</key>
+<string>xulrunner</string>
+<key>NSAppleScriptEnabled</key>
+<true/>
+<key>CFBundleGetInfoString</key>
+<string>$infoString</string>
+<key>CFBundleName</key>
+<string>$appName</string>
+<key>CFBundleShortVersionString</key>
+<string>$version</string>
+<key>CFBundleVersion</key>
+<string>$version.$buildID</string>
+<key>CFBundleIdentifier</key>
+<string>$reverseVendor</string>
+</dict>
+</plist>
+"""
+ version = iniparser.get("App", "Version")
+ buildID = iniparser.get("App", "BuildID")
+ infoString = appName + " " + version
+ reverseVendor = "com.vendor.unknown"
+ appID = iniparser.get("App", "ID")
+ colonIndex = appID.find("@") + 1
+ if (colonIndex != 0):
+ vendor = appID[colonIndex:]
+ reverseVendor = ".".join(vendor.split(".")[::-1])
+ contents = contents.replace("$infoString", infoString)
+ contents = contents.replace("$appName", appName)
+ contents = contents.replace("$version", version)
+ contents = contents.replace("$buildID", buildID)
+ contents = contents.replace("$reverseVendor", reverseVendor)
+ infoPList = open(os.path.join(installDir, "Contents/Info.plist"), "w+b")
+ infoPList.write(contents)
+ infoPList.close()
+
+ def makeAppName(leafName):
+ return leafName
+
+else:
+ # Implement xulrunnerStubName, installApp and makeAppName as above.
+ raise Exception("This operating system isn't supported for install_app.py yet!")
+# End platform-specific support
+
+def resolvePath(path):
+ return os.path.realpath(path)
+
+def requireINIOption(iniparser, section, option):
+ if not (iniparser.has_option(section, option)):
+ raise Exception("application.ini must have a " + option + " option under the " + section + " section")
+
+def checkAppINI(appLocation):
+ if (os.path.isdir(appLocation)):
+ zipApp = None
+ appINIPath = os.path.join(appLocation, "application.ini")
+ if not (os.path.isfile(appINIPath)):
+ raise Exception(appINIPath + " does not exist")
+ appINI = open(appINIPath)
+ elif (zipfile.is_zipfile(appLocation)):
+ zipApp = zipfile.ZipFile(appLocation)
+ if not ("application.ini" in zipApp.namelist()):
+ raise Exception("jar:" + appLocation + "!/application.ini does not exist")
+ appINI = zipApp.open("application.ini")
+ else:
+ raise Exception("appLocation must be a directory containing application.ini or a zip file with application.ini at its root")
+
+ # application.ini verification
+ iniparser = SafeConfigParser()
+ iniparser.readfp(appINI)
+ if not (iniparser.has_section("App")):
+ raise Exception("application.ini must have an App section")
+ if not (iniparser.has_section("Gecko")):
+ raise Exception("application.ini must have a Gecko section")
+ requireINIOption(iniparser, "App", "Name")
+ requireINIOption(iniparser, "App", "Version")
+ requireINIOption(iniparser, "App", "BuildID")
+ requireINIOption(iniparser, "App", "ID")
+ requireINIOption(iniparser, "Gecko", "MinVersion")
+
+ return zipApp, iniparser
+ pass
+
+def copyGRE(greDir, targetDir):
+ shutil.copytree(greDir, targetDir, symlinks=True)
+
+def validateArguments(appLocation, installDir, appName, greDir):
+ # application directory / zip verification
+ appLocation = resolvePath(appLocation)
+
+ # target directory
+ installDir = resolvePath(installDir)
+
+ if (os.path.exists(installDir)):
+ raise Exception("installDir must not exist: " + cmds.installDir)
+
+ greDir = resolvePath(greDir)
+ xulrunnerStubPath = os.path.isfile(os.path.join(greDir, xulrunnerStubName))
+ if not xulrunnerStubPath:
+ raise Exception("XULRunner stub executable not found: " + os.path.join(greDir, xulrunnerStubName))
+
+ # appName
+ zipApp, iniparser = checkAppINI(appLocation)
+ if not appName:
+ appName = iniparser.get("App", "Name")
+ appName = makeAppName(appName)
+ pattern = re.compile("[\\\/\:*?\"<>|\x00]")
+ if pattern.search(appName):
+ raise Exception("App name has illegal characters for at least one operating system")
+ return zipApp, iniparser, appName
+
+def handleCommandLine():
+ import argparse
+
+ # Argument parsing.
+ parser = argparse.ArgumentParser(
+ description="XULRunner application installer",
+ usage="""install_app.py appLocation installDir greDir [--appName APPNAME]
+ install_app.py -h
+ install_app.py --version
+ """
+ )
+ parser.add_argument(
+ "appLocation",
+ action="store",
+ help="The directory or ZIP file containing application.ini as a top-level child file"
+ )
+ parser.add_argument(
+ "installDir",
+ action="store",
+ help="The directory to install the application to"
+ )
+ parser.add_argument(
+ "--greDir",
+ action="store",
+ help="The directory containing the Gecko SDK (usually where this Python script lives)",
+ default=os.path.dirname(sys.argv[0])
+ )
+ parser.add_argument(
+ "--appName",
+ action="store",
+ help="The name of the application to install"
+ )
+ parser.add_argument("--version", action="version", version="%(prog)s 1.0")
+
+ # The command code.
+ cmds = parser.parse_args()
+ try:
+ installApp(cmds.appLocation, cmds.installDir, cmds.appName, cmds.greDir)
+ except exn:
+ shutil.rmtree(cmds.installDir)
+ raise exn
+ print cmds.appName + " application installed to " + cmds.installDir
+
+if __name__ == '__main__':
+ handleCommandLine()
diff --git a/application/xulrunner/app/macbuild/Info.plist.in b/application/xulrunner/app/macbuild/Info.plist.in
new file mode 100644
index 000000000..69676b80c
--- /dev/null
+++ b/application/xulrunner/app/macbuild/Info.plist.in
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>xulrunner-bin</string>
+ <key>CFBundleIdentifier</key>
+ <string>org.mozilla.xulrunner</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>XULRunner</string>
+ <key>CFBundlePackageType</key>
+ <string>FMWK</string>
+ <key>CFBundleSignature</key>
+ <string>MOZB</string>
+ <key>CFBundleVersion</key>
+ <string>APP_VERSION</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.5</string>
+ <key>LSMinimumSystemVersionByArchitecture</key>
+ <dict>
+ <key>i386</key>
+ <string>10.5.0</string>
+ <key>x86_64</key>
+ <string>10.6.0</string>
+ </dict>
+</dict>
+</plist>
diff --git a/application/xulrunner/app/macbuild/InfoPlist.strings b/application/xulrunner/app/macbuild/InfoPlist.strings
new file mode 100644
index 000000000..5d9eefd51
--- /dev/null
+++ b/application/xulrunner/app/macbuild/InfoPlist.strings
Binary files differ
diff --git a/application/xulrunner/app/moz.build b/application/xulrunner/app/moz.build
new file mode 100644
index 000000000..1c9cb117c
--- /dev/null
+++ b/application/xulrunner/app/moz.build
@@ -0,0 +1,70 @@
+# -*- 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/.
+
+GeckoProgram('xulrunner')
+
+SOURCES += [
+ 'nsXULRunnerApp.cpp',
+]
+
+DEFINES['XULRUNNER_PROGNAME'] = '"xulrunner"'
+if CONFIG['MOZ_DEBUG']:
+ DEFINES['DEBUG'] = True
+
+LOCAL_INCLUDES += [
+ '/toolkit/profile',
+ '/toolkit/xre',
+ '/xpcom/base',
+ '/xpcom/build',
+]
+
+if CONFIG['_MSC_VER']:
+ # Always enter a Windows program through wmain, whether or not we're
+ # a console application.
+ WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
+
+# Control the default heap size.
+# This is the heap returned by GetProcessHeap().
+# As we use the CRT heap, the default size is too large and wastes VM.
+#
+# The default heap size is 1MB on Win32.
+# The heap will grow if need be.
+#
+# Set it to 256k. See bug 127069.
+if CONFIG['OS_ARCH'] == 'WINNT' and not CONFIG['GNU_CC']:
+ LDFLAGS += ['/HEAP:0x40000']
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+ RCINCLUDE = 'splash.rc'
+ OS_LIBS += [
+ 'comctl32',
+ 'comdlg32',
+ 'uuid',
+ 'shell32',
+ 'ole32',
+ 'oleaut32',
+ 'version',
+ 'winspool',
+ ]
+
+DISABLE_STL_WRAPPING = True
+
+JS_PREFERENCE_PP_FILES += [
+ 'xulrunner.js',
+]
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+ BRANDING_FILES += [
+ 'document.ico',
+ 'xulrunner.ico',
+ ]
+
+if CONFIG['MOZ_WIDGET_GTK']:
+ BRANDING_FILES += [
+ 'default16.png',
+ 'default32.png',
+ 'default48.png',
+ ]
diff --git a/application/xulrunner/app/nsXULRunnerApp.cpp b/application/xulrunner/app/nsXULRunnerApp.cpp
new file mode 100644
index 000000000..d86317a85
--- /dev/null
+++ b/application/xulrunner/app/nsXULRunnerApp.cpp
@@ -0,0 +1,294 @@
+/* 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 "nsXULAppAPI.h"
+#include "nsXPCOMGlue.h"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef XP_WIN
+#include <windows.h>
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define snprintf _snprintf
+#endif
+#define strcasecmp _stricmp
+#endif
+
+#include "nsAppRunner.h"
+#include "nsIFile.h"
+#include "nsCOMPtr.h"
+#include "nsMemory.h"
+#include "nsCRTGlue.h"
+#include "nsStringAPI.h"
+#include "nsServiceManagerUtils.h"
+#include "plstr.h"
+#include "prprf.h"
+#include "prenv.h"
+#include "nsINIParser.h"
+
+#ifdef XP_WIN
+#define XRE_DONT_SUPPORT_XPSP2 // See https://bugzil.la/1023941#c32
+#include "nsWindowsWMain.cpp"
+#endif
+
+#include "BinaryPath.h"
+
+#include "nsXPCOMPrivate.h" // for MAXPATHLEN and XPCOM_DLL
+
+using namespace mozilla;
+
+/**
+ * Output a string to the user. This method is really only meant to be used to
+ * output last-ditch error messages designed for developers NOT END USERS.
+ *
+ * @param isError
+ * Pass true to indicate severe errors.
+ * @param fmt
+ * printf-style format string followed by arguments.
+ */
+static void Output(bool isError, const char *fmt, ... )
+{
+ va_list ap;
+ va_start(ap, fmt);
+
+#if (defined(XP_WIN) && !MOZ_WINCONSOLE)
+ wchar_t msg[2048];
+ _vsnwprintf(msg, sizeof(msg)/sizeof(msg[0]), NS_ConvertUTF8toUTF16(fmt).get(), ap);
+
+ UINT flags = MB_OK;
+ if (isError)
+ flags |= MB_ICONERROR;
+ else
+ flags |= MB_ICONINFORMATION;
+
+ MessageBoxW(nullptr, msg, L"XULRunner", flags);
+#else
+ vfprintf(stderr, fmt, ap);
+#endif
+
+ va_end(ap);
+}
+
+/**
+ * Return true if |arg| matches the given argument name.
+ */
+static bool IsArg(const char* arg, const char* s)
+{
+ if (*arg == '-')
+ {
+ if (*++arg == '-')
+ ++arg;
+ return !strcasecmp(arg, s);
+ }
+
+#if defined(XP_WIN)
+ if (*arg == '/')
+ return !strcasecmp(++arg, s);
+#endif
+
+ return false;
+}
+
+static nsresult
+GetGREVersion(const char *argv0,
+ nsACString *aMilestone,
+ nsACString *aVersion)
+{
+ if (aMilestone)
+ aMilestone->AssignLiteral("<Error>");
+ if (aVersion)
+ aVersion->AssignLiteral("<Error>");
+
+ nsCOMPtr<nsIFile> iniFile;
+ nsresult rv = BinaryPath::GetFile(argv0, getter_AddRefs(iniFile));
+ if (NS_FAILED(rv))
+ return rv;
+
+ iniFile->SetNativeLeafName(NS_LITERAL_CSTRING("platform.ini"));
+
+ nsINIParser parser;
+ rv = parser.Init(iniFile);
+ if (NS_FAILED(rv))
+ return rv;
+
+ if (aMilestone) {
+ rv = parser.GetString("Build", "Milestone", *aMilestone);
+ if (NS_FAILED(rv))
+ return rv;
+ }
+ if (aVersion) {
+ rv = parser.GetString("Build", "BuildID", *aVersion);
+ if (NS_FAILED(rv))
+ return rv;
+ }
+ return NS_OK;
+}
+
+static void Usage(const char *argv0)
+{
+ nsAutoCString milestone;
+ GetGREVersion(argv0, &milestone, nullptr);
+
+ // display additional information (XXX make localizable?)
+ Output(false,
+ "Mozilla XULRunner %s\n\n"
+ "Usage: " XULRUNNER_PROGNAME " [OPTIONS]\n"
+ " " XULRUNNER_PROGNAME " APP-FILE [APP-OPTIONS...]\n"
+ "\n"
+ "OPTIONS\n"
+ " --app specify APP-FILE (optional)\n"
+ " -h, --help show this message\n"
+ " -v, --version show version\n"
+ " --gre-version print the GRE version string on stdout\n"
+ "\n"
+ "APP-FILE\n"
+ " Application initialization file.\n"
+ "\n"
+ "APP-OPTIONS\n"
+ " Application specific options.\n",
+ milestone.get());
+}
+
+XRE_GetFileFromPathType XRE_GetFileFromPath;
+XRE_CreateAppDataType XRE_CreateAppData;
+XRE_FreeAppDataType XRE_FreeAppData;
+XRE_mainType XRE_main;
+
+static const nsDynamicFunctionLoad kXULFuncs[] = {
+ { "XRE_GetFileFromPath", (NSFuncPtr*) &XRE_GetFileFromPath },
+ { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData },
+ { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData },
+ { "XRE_main", (NSFuncPtr*) &XRE_main },
+ { nullptr, nullptr }
+};
+
+class AutoAppData
+{
+public:
+ AutoAppData(nsIFile* aINIFile) : mAppData(nullptr) {
+ nsresult rv = XRE_CreateAppData(aINIFile, &mAppData);
+ if (NS_FAILED(rv))
+ mAppData = nullptr;
+ }
+ ~AutoAppData() {
+ if (mAppData)
+ XRE_FreeAppData(mAppData);
+ }
+
+ operator nsXREAppData*() const { return mAppData; }
+ nsXREAppData* operator -> () const { return mAppData; }
+
+private:
+ nsXREAppData* mAppData;
+};
+
+int main(int argc, char* argv[])
+{
+ char exePath[MAXPATHLEN];
+ nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath);
+ if (NS_FAILED(rv)) {
+ Output(true, "Couldn't calculate the application directory.\n");
+ return 255;
+ }
+
+ char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
+ if (!lastSlash || (size_t(lastSlash - exePath) > MAXPATHLEN - sizeof(XPCOM_DLL) - 1))
+ return 255;
+
+ strcpy(++lastSlash, XPCOM_DLL);
+
+ rv = XPCOMGlueStartup(exePath);
+ if (NS_FAILED(rv)) {
+ Output(true, "Couldn't load XPCOM.\n");
+ return 255;
+ }
+
+ if (argc > 1 && (IsArg(argv[1], "h") ||
+ IsArg(argv[1], "help") ||
+ IsArg(argv[1], "?")))
+ {
+ Usage(argv[0]);
+ return 0;
+ }
+
+ if (argc == 2 && (IsArg(argv[1], "v") || IsArg(argv[1], "version")))
+ {
+ nsAutoCString milestone;
+ nsAutoCString version;
+ GetGREVersion(argv[0], &milestone, &version);
+ Output(false, "Mozilla XULRunner %s - %s\n",
+ milestone.get(), version.get());
+ return 0;
+ }
+
+ rv = XPCOMGlueLoadXULFunctions(kXULFuncs);
+ if (NS_FAILED(rv)) {
+ Output(true, "Couldn't load XRE functions.\n");
+ return 255;
+ }
+
+ if (argc > 1) {
+ nsAutoCString milestone;
+ rv = GetGREVersion(argv[0], &milestone, nullptr);
+ if (NS_FAILED(rv))
+ return 2;
+
+ if (IsArg(argv[1], "gre-version")) {
+ if (argc != 2) {
+ Usage(argv[0]);
+ return 1;
+ }
+
+ printf("%s\n", milestone.get());
+ return 0;
+ }
+
+ if (IsArg(argv[1], "install-app")) {
+ Output(true, "--install-app support has been removed. Use 'python install-app.py' instead.\n");
+ return 1;
+ }
+ }
+
+ const char *appDataFile = getenv("XUL_APP_FILE");
+
+ if (!(appDataFile && *appDataFile)) {
+ if (argc < 2) {
+ Usage(argv[0]);
+ return 1;
+ }
+
+ if (IsArg(argv[1], "app")) {
+ if (argc == 2) {
+ Usage(argv[0]);
+ return 1;
+ }
+ argv[1] = argv[0];
+ ++argv;
+ --argc;
+ }
+
+ appDataFile = argv[1];
+ argv[1] = argv[0];
+ ++argv;
+ --argc;
+
+ static char kAppEnv[MAXPATHLEN];
+ snprintf(kAppEnv, MAXPATHLEN, "XUL_APP_FILE=%s", appDataFile);
+ putenv(kAppEnv);
+ }
+
+ nsCOMPtr<nsIFile> appDataLF;
+ rv = XRE_GetFileFromPath(appDataFile, getter_AddRefs(appDataLF));
+ if (NS_FAILED(rv)) {
+ Output(true, "Error: unrecognized application.ini path.\n");
+ return 2;
+ }
+
+ AutoAppData appData(appDataLF);
+ if (!appData) {
+ Output(true, "Error: couldn't parse application.ini.\n");
+ return 2;
+ }
+
+ return XRE_main(argc, argv, appData, 0);
+}
diff --git a/application/xulrunner/app/splash.rc b/application/xulrunner/app/splash.rc
new file mode 100644
index 000000000..4374383ba
--- /dev/null
+++ b/application/xulrunner/app/splash.rc
@@ -0,0 +1,22 @@
+/* -*- 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/. */
+
+#include <windows.h>
+#include "nsNativeAppSupportWin.h"
+
+1 24 "xulrunner.exe.manifest"
+
+IDI_APPICON ICON XULRUNNER_ICO
+IDI_DOCUMENT ICON DOCUMENT_ICO
+IDI_APPLICATION ICON XULRUNNER_ICO
+
+STRINGTABLE DISCARDABLE
+BEGIN
+#ifdef DEBUG
+ IDS_STARTMENU_APPNAME, "Firefox Debug"
+#else
+ IDS_STARTMENU_APPNAME, "Firefox"
+#endif
+END
diff --git a/application/xulrunner/app/xulrunner.exe.manifest b/application/xulrunner/app/xulrunner.exe.manifest
new file mode 100644
index 000000000..b08eea074
--- /dev/null
+++ b/application/xulrunner/app/xulrunner.exe.manifest
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+ version="1.0.0.0"
+ processorArchitecture="*"
+ name="Mozilla.XULRunner"
+ type="win32"
+/>
+<description>Mozilla XULRunner</description>
+<dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="*"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+</dependency>
+<ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
+ <ms_asmv3:security>
+ <ms_asmv3:requestedPrivileges>
+ <ms_asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ </ms_asmv3:requestedPrivileges>
+ </ms_asmv3:security>
+</ms_asmv3:trustInfo>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+ </application>
+ </compatibility>
+</assembly>
diff --git a/application/xulrunner/app/xulrunner.ico b/application/xulrunner/app/xulrunner.ico
new file mode 100644
index 000000000..0518438a0
--- /dev/null
+++ b/application/xulrunner/app/xulrunner.ico
Binary files differ
diff --git a/application/xulrunner/app/xulrunner.js b/application/xulrunner/app/xulrunner.js
new file mode 100644
index 000000000..509bb48a5
--- /dev/null
+++ b/application/xulrunner/app/xulrunner.js
@@ -0,0 +1,26 @@
+/* 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/. */
+
+#filter substitution
+
+// We need to override the default values of these preferences since all.js
+// assumes these are in the navigator package, which for us is nonexistent.
+// XXX(darin): perhaps all.js should not be seamonkey specific
+pref("general.useragent.locale", "@AB_CD@");
+pref("xpinstall.dialog.confirm", "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul");
+pref("xpinstall.dialog.progress.chrome", "chrome://mozapps/content/extensions/extensions.xul");
+pref("xpinstall.dialog.progress.skin", "chrome://mozapps/content/extensions/extensions.xul");
+pref("xpinstall.dialog.progress.type.chrome", "Extension:Manager");
+pref("xpinstall.dialog.progress.type.skin", "Extension:Manager");
+pref("xpinstall.enabled", true);
+#ifdef XP_WIN
+pref("browser.preferences.instantApply", false);
+#else
+pref("browser.preferences.instantApply", true);
+#endif
+#ifdef XP_MACOSX
+pref("browser.preferences.animateFadeIn", true);
+#else
+pref("browser.preferences.animateFadeIn", false);
+#endif
diff --git a/application/xulrunner/config/mozconfig b/application/xulrunner/config/mozconfig
new file mode 100644
index 000000000..9fa972cac
--- /dev/null
+++ b/application/xulrunner/config/mozconfig
@@ -0,0 +1,9 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# This file specifies the build flags for XULRunner. You can use it by adding:
+# . $topsrcdir/xulrunner/config/mozconfig
+# to the top of your mozconfig file.
+
+ac_add_options --enable-application=xulrunner
diff --git a/application/palemoon/components/shell/Makefile.in b/application/xulrunner/config/mozconfigs/common
index df084b709..a6811c575 100644
--- a/application/palemoon/components/shell/Makefile.in
+++ b/application/xulrunner/config/mozconfigs/common
@@ -1,11 +1,7 @@
-#
# 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 $(topsrcdir)/config/rules.mk
+# This file is included at the top of all xulrunner mozconfigs
-CXXFLAGS += $(TK_CFLAGS)
-
-clobber::
- rm -f $(DIST)/lib/$(LIBRARY_NAME).lib
+. "$topsrcdir/build/mozconfig.common"
diff --git a/application/xulrunner/config/mozconfigs/common.override b/application/xulrunner/config/mozconfigs/common.override
new file mode 100644
index 000000000..8d719a5b5
--- /dev/null
+++ b/application/xulrunner/config/mozconfigs/common.override
@@ -0,0 +1,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/.
+
+# This file is included at the bottom of all xulrunner mozconfigs
+
+. "$topsrcdir/build/mozconfig.common.override"
+. "$topsrcdir/build/mozconfig.cache"
diff --git a/application/xulrunner/config/mozconfigs/linux32/xulrunner b/application/xulrunner/config/mozconfigs/linux32/xulrunner
new file mode 100644
index 000000000..171674f8c
--- /dev/null
+++ b/application/xulrunner/config/mozconfigs/linux32/xulrunner
@@ -0,0 +1,9 @@
+export MOZILLA_OFFICIAL=1
+export JAVA_HOME=/tools/jdk
+
+ac_add_options --enable-application=xulrunner
+ac_add_options --disable-tests
+
+. $topsrcdir/build/unix/mozconfig.linux32
+
+. "$topsrcdir/xulrunner/config/mozconfigs/common.override"
diff --git a/application/xulrunner/config/mozconfigs/linux32/xulrunner-qt b/application/xulrunner/config/mozconfigs/linux32/xulrunner-qt
new file mode 100644
index 000000000..54e4ecb8f
--- /dev/null
+++ b/application/xulrunner/config/mozconfigs/linux32/xulrunner-qt
@@ -0,0 +1,15 @@
+export MOZILLA_OFFICIAL=1
+export JAVA_HOME=/tools/jdk
+
+ac_add_options --enable-application=xulrunner
+ac_add_options --disable-tests
+
+. $topsrcdir/build/unix/mozconfig.linux32
+
+# QT Options
+export PKG_CONFIG_PATH=/tools/qt-4.6.3/qt/lib/pkgconfig
+ac_add_options --with-qtdir=/tools/qt-4.6.3/qt
+ac_add_options --enable-default-toolkit=cairo-qt
+ac_add_options --disable-crashreporter
+
+. "$topsrcdir/xulrunner/config/mozconfigs/common.override"
diff --git a/application/xulrunner/config/mozconfigs/linux64/xulrunner b/application/xulrunner/config/mozconfigs/linux64/xulrunner
new file mode 100644
index 000000000..c18a12f67
--- /dev/null
+++ b/application/xulrunner/config/mozconfigs/linux64/xulrunner
@@ -0,0 +1,9 @@
+export MOZILLA_OFFICIAL=1
+export JAVA_HOME=/tools/jdk
+
+ac_add_options --enable-application=xulrunner
+ac_add_options --disable-tests
+
+. $topsrcdir/build/unix/mozconfig.linux
+
+. "$topsrcdir/xulrunner/config/mozconfigs/common.override"
diff --git a/application/xulrunner/config/mozconfigs/macosx-universal/xulrunner b/application/xulrunner/config/mozconfigs/macosx-universal/xulrunner
new file mode 100644
index 000000000..ac7e24fe2
--- /dev/null
+++ b/application/xulrunner/config/mozconfigs/macosx-universal/xulrunner
@@ -0,0 +1,9 @@
+. $topsrcdir/build/macosx/universal/mozconfig
+
+export MOZILLA_OFFICIAL=1
+
+ac_add_options --enable-application=xulrunner
+ac_add_options --disable-tests
+ac_add_options --with-xulrunner-stub-name=xulrunner-stub
+
+. "$topsrcdir/xulrunner/config/mozconfigs/common.override"
diff --git a/application/xulrunner/config/mozconfigs/win32/xulrunner b/application/xulrunner/config/mozconfigs/win32/xulrunner
new file mode 100644
index 000000000..4c8b596a5
--- /dev/null
+++ b/application/xulrunner/config/mozconfigs/win32/xulrunner
@@ -0,0 +1,16 @@
+. "$topsrcdir/xulrunner/config/mozconfigs/common"
+
+export MOZILLA_OFFICIAL=1
+export JAVA_HOME=/d/jdk1.6.0_14
+
+ac_add_options --enable-application=xulrunner
+ac_add_options --enable-jemalloc
+ac_add_options --disable-tests
+
+if test "$PROCESSOR_ARCHITECTURE" = "AMD64" -o "$PROCESSOR_ARCHITEW6432" = "AMD64"; then
+ . $topsrcdir/build/win32/mozconfig.vs2013-win64
+else
+ . $topsrcdir/build/win32/mozconfig.vs2010
+fi
+
+. "$topsrcdir/xulrunner/config/mozconfigs/common.override"
diff --git a/application/xulrunner/config/mozconfigs/win64/xulrunner b/application/xulrunner/config/mozconfigs/win64/xulrunner
new file mode 100644
index 000000000..7dbade2bb
--- /dev/null
+++ b/application/xulrunner/config/mozconfigs/win64/xulrunner
@@ -0,0 +1,15 @@
+. "$topsrcdir/xulrunner/config/mozconfigs/common"
+
+ac_add_options --target=x86_64-pc-mingw32
+ac_add_options --host=x86_64-pc-mingw32
+
+export MOZILLA_OFFICIAL=1
+export JAVA_HOME=/d/jdk1.6.0_14
+
+ac_add_options --enable-application=xulrunner
+ac_add_options --enable-jemalloc
+ac_add_options --disable-tests
+
+. $topsrcdir/build/win64/mozconfig.vs2013
+
+. "$topsrcdir/xulrunner/config/mozconfigs/common.override"
diff --git a/application/xulrunner/configure.in b/application/xulrunner/configure.in
new file mode 100644
index 000000000..825faaddd
--- /dev/null
+++ b/application/xulrunner/configure.in
@@ -0,0 +1,11 @@
+dnl -*- Mode: Autoconf; tab-width: 2; indent-tabs-mode: nil; -*-
+dnl vi: set tabstop=2 shiftwidth=2 expandtab:
+dnl This Source Code Form is subject to the terms of the Mozilla Public
+dnl License, v. 2.0. If a copy of the MPL was not distributed with this
+dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+dnl Things we need to carry from confvars.sh
+AC_SUBST(MOZ_XULRUNNER)
+AC_DEFINE(MOZ_XULRUNNER)
+
+dnl Optional parts of the build.
diff --git a/application/xulrunner/confvars.sh b/application/xulrunner/confvars.sh
new file mode 100644
index 000000000..a317df2a6
--- /dev/null
+++ b/application/xulrunner/confvars.sh
@@ -0,0 +1,28 @@
+#! /bin/sh
+# 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/.
+
+MOZ_XULRUNNER=1
+MC_OFFICIAL=1
+
+MOZ_APP_NAME=xulrunner
+MOZ_APP_DISPLAYNAME=XULRunner
+MOZ_APP_VERSION=$MOZILLA_VERSION
+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
+
+MOZ_EXTENSIONS_DEFAULT=" gio"
+
+MOZ_SERVICES_COMMON=1
+MOZ_SERVICES_SYNC=1
+MOZ_SERVICES_HEALTHREPORT=
diff --git a/application/xulrunner/examples/moz.build b/application/xulrunner/examples/moz.build
new file mode 100644
index 000000000..a1782b42f
--- /dev/null
+++ b/application/xulrunner/examples/moz.build
@@ -0,0 +1,7 @@
+# -*- 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/.
+
+DIRS += ['simple']
diff --git a/application/xulrunner/examples/simple/application.ini b/application/xulrunner/examples/simple/application.ini
new file mode 100644
index 000000000..39c051422
--- /dev/null
+++ b/application/xulrunner/examples/simple/application.ini
@@ -0,0 +1,43 @@
+#filter substitution
+[App]
+;
+; This field specifies your organization's name. This field is recommended,
+; but optional.
+Vendor=MozillaTest
+;
+; This field specifies your application's name. This field is required.
+Name=Simple
+;
+; This field specifies your application's version. This field is required.
+Version=0.1
+;
+; This field specifies your application's build ID (timestamp). This field is
+; required.
+BuildID=20070625
+;
+; This field specifies a compact copyright notice for your application. This
+; field is optional.
+Copyright=Copyright (c) 2004 Mozilla.org
+;
+; This ID is just an example. Every XUL app ought to have it's own unique ID.
+; You can use the microsoft "guidgen" or "uuidgen" tools, or go on
+; irc.mozilla.org and /msg botbot uuid. This field is optional.
+ID={3aea3f07-ffe3-4060-bb03-bff3a5365e90}
+
+[Gecko]
+;
+; This field is required. It specifies the minimum Gecko version that this
+; application requires.
+MinVersion=@MOZILLA_VERSION_U@
+;
+; This field is optional. It specifies the maximum Gecko version that this
+; application requires. It should be specified if your application uses
+; unfrozen interfaces.
+MaxVersion=@MOZILLA_VERSION_U@
+
+[Shell]
+;
+; This field specifies the location of your application's main icon with file
+; extension excluded. NOTE: Unix style file separators are required. This
+; field is optional.
+Icon=chrome/icons/default/simple
diff --git a/application/xulrunner/examples/simple/components/moz.build b/application/xulrunner/examples/simple/components/moz.build
new file mode 100644
index 000000000..8ff468534
--- /dev/null
+++ b/application/xulrunner/examples/simple/components/moz.build
@@ -0,0 +1,7 @@
+# -*- 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/.
+
+DIRS += ['public', 'src']
diff --git a/application/xulrunner/examples/simple/components/public/moz.build b/application/xulrunner/examples/simple/components/public/moz.build
new file mode 100644
index 000000000..3a611f85a
--- /dev/null
+++ b/application/xulrunner/examples/simple/components/public/moz.build
@@ -0,0 +1,13 @@
+# -*- 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/.
+
+XPIDL_SOURCES += [
+ 'nsISimpleTest.idl',
+]
+
+XPIDL_MODULE = 'simple'
+
+XPI_NAME = 'simple'
diff --git a/application/xulrunner/examples/simple/components/public/nsISimpleTest.idl b/application/xulrunner/examples/simple/components/public/nsISimpleTest.idl
new file mode 100644
index 000000000..99b9b86af
--- /dev/null
+++ b/application/xulrunner/examples/simple/components/public/nsISimpleTest.idl
@@ -0,0 +1,15 @@
+/* vim:set ts=2 sw=2 sts=2 et cin: */
+/* 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 "nsISupports.idl"
+
+[scriptable, uuid(f2f71d91-0451-47ec-aaa0-166663a7711a)]
+interface nsISimpleTest : nsISupports
+{
+ /**
+ * This interface adds two numbers together and returns the result.
+ */
+ long add(in long a, in long b);
+};
diff --git a/application/xulrunner/examples/simple/components/src/SimpleTest.cpp b/application/xulrunner/examples/simple/components/src/SimpleTest.cpp
new file mode 100644
index 000000000..06249abdd
--- /dev/null
+++ b/application/xulrunner/examples/simple/components/src/SimpleTest.cpp
@@ -0,0 +1,54 @@
+/* vim:set ts=2 sw=2 sts=2 et cin: */
+/* 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 <stdio.h>
+#include "nsISimpleTest.h"
+#include "mozilla/ModuleUtils.h"
+
+class SimpleTest : public nsISimpleTest
+{
+ ~SimpleTest() {}
+public:
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSISIMPLETEST
+};
+
+NS_IMPL_ISUPPORTS(SimpleTest, nsISimpleTest)
+
+NS_IMETHODIMP
+SimpleTest::Add(int32_t a, int32_t b, int32_t *r)
+{
+ printf("add(%d,%d) from C++\n", a, b);
+
+ *r = a + b;
+ return NS_OK;
+}
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(SimpleTest)
+
+// 5e14b432-37b6-4377-923b-c987418d8429
+#define SIMPLETEST_CID \
+ { 0x5e14b432, 0x37b6, 0x4377, \
+ { 0x92, 0x3b, 0xc9, 0x87, 0x41, 0x8d, 0x84, 0x29 } }
+
+NS_DEFINE_NAMED_CID(SIMPLETEST_CID);
+
+static const mozilla::Module::CIDEntry kSimpleCIDs[] = {
+ { &kSIMPLETEST_CID, false, nullptr, SimpleTestConstructor },
+ { nullptr }
+};
+
+static const mozilla::Module::ContractIDEntry kSimpleContracts[] = {
+ { "@test.mozilla.org/simple-test;1?impl=c++", &kSIMPLETEST_CID },
+ { nullptr }
+};
+
+static const mozilla::Module kSimpleModule = {
+ mozilla::Module::kVersion,
+ kSimpleCIDs,
+ kSimpleContracts
+};
+
+NSMODULE_DEFN(SimpleTestModule) = &kSimpleModule;
diff --git a/application/xulrunner/examples/simple/components/src/SimpleTest.js b/application/xulrunner/examples/simple/components/src/SimpleTest.js
new file mode 100644
index 000000000..e6cf90660
--- /dev/null
+++ b/application/xulrunner/examples/simple/components/src/SimpleTest.js
@@ -0,0 +1,27 @@
+/* vim:set ts=2 sw=2 sts=2 et cin: */
+/* 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/XPCOMUtils.jsm");
+
+function SimpleTest() {
+}
+
+SimpleTest.prototype = {
+ classID: Components.ID("{4177e257-a0dc-49b9-a774-522a000a49fa}"),
+
+ QueryInterface: function(iid) {
+ if (iid.equals(Components.interfaces.nsISimpleTest) ||
+ iid.equals(Components.interfaces.nsISupports))
+ return this;
+ throw Components.results.NS_ERROR_NO_INTERFACE;
+ },
+
+ add: function(a, b) {
+ dump("add(" + a + "," + b + ") from JS\n");
+ return a + b;
+ }
+};
+
+this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SimpleTest]);
diff --git a/application/xulrunner/examples/simple/components/src/SimpleTest.manifest b/application/xulrunner/examples/simple/components/src/SimpleTest.manifest
new file mode 100644
index 000000000..c7388b9d7
--- /dev/null
+++ b/application/xulrunner/examples/simple/components/src/SimpleTest.manifest
@@ -0,0 +1,2 @@
+component {4177e257-a0dc-49b9-a774-522a000a49fa} SimpleTest.js
+contract @test.mozilla.org/simple-test;1?impl=js {4177e257-a0dc-49b9-a774-522a000a49fa}
diff --git a/application/xulrunner/examples/simple/components/src/moz.build b/application/xulrunner/examples/simple/components/src/moz.build
new file mode 100644
index 000000000..153bfdd0c
--- /dev/null
+++ b/application/xulrunner/examples/simple/components/src/moz.build
@@ -0,0 +1,21 @@
+# -*- 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/.
+
+SOURCES += [
+ 'SimpleTest.cpp',
+]
+
+XPCOMBinaryComponent('simpletest')
+
+EXTRA_COMPONENTS += [
+ 'SimpleTest.js',
+ 'SimpleTest.manifest',
+]
+
+XPI_NAME = 'simple'
+
+if CONFIG['GNU_CXX']:
+ CXXFLAGS += ['-Wshadow']
diff --git a/application/xulrunner/examples/simple/content/contents.rdf b/application/xulrunner/examples/simple/content/contents.rdf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/application/xulrunner/examples/simple/content/contents.rdf
diff --git a/application/xulrunner/examples/simple/content/simple.js b/application/xulrunner/examples/simple/content/simple.js
new file mode 100644
index 000000000..acf6f1029
--- /dev/null
+++ b/application/xulrunner/examples/simple/content/simple.js
@@ -0,0 +1,17 @@
+/* vim:set ts=2 sw=2 sts=2 et cin: */
+/* 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 onButtonClick() {
+ var textbox = document.getElementById("textbox");
+
+ var contractid = (textbox.value % 2 == 0) ?
+ "@test.mozilla.org/simple-test;1?impl=js" :
+ "@test.mozilla.org/simple-test;1?impl=c++";
+
+ var test = Components.classes[contractid].
+ createInstance(Components.interfaces.nsISimpleTest);
+
+ textbox.value = test.add(textbox.value, 1);
+}
diff --git a/application/xulrunner/examples/simple/content/simple.xul b/application/xulrunner/examples/simple/content/simple.xul
new file mode 100644
index 000000000..6ff915d0c
--- /dev/null
+++ b/application/xulrunner/examples/simple/content/simple.xul
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+# vim:set ts=8 sw=8 sts=8 noet:
+# 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"?>
+
+<!DOCTYPE window SYSTEM "chrome://simple/locale/simple.dtd">
+
+<window
+ id = "simple"
+ title = "&simple.title;"
+ xmlns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <script src="chrome://simple/content/simple.js"/>
+ <vbox>
+ <textbox id="textbox" value="&simple.textValue;" flex="1"/>
+ <button id="button" label="&simple.buttonLabel;" oncommand="onButtonClick();"/>
+ </vbox>
+</window>
diff --git a/application/xulrunner/examples/simple/icons/simple.ico b/application/xulrunner/examples/simple/icons/simple.ico
new file mode 100644
index 000000000..16bd7e9d1
--- /dev/null
+++ b/application/xulrunner/examples/simple/icons/simple.ico
Binary files differ
diff --git a/application/xulrunner/examples/simple/jar.mn b/application/xulrunner/examples/simple/jar.mn
new file mode 100644
index 000000000..7d141ad1d
--- /dev/null
+++ b/application/xulrunner/examples/simple/jar.mn
@@ -0,0 +1,12 @@
+# 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/.
+
+simple.jar:
+% content simple %content/
+ content/simple.xul (content/simple.xul)
+ content/simple.js (content/simple.js)
+
+en-US.jar:
+% locale simple en-US %locale/en-US/
+ locale/en-US/simple.dtd (locale/simple.dtd)
diff --git a/application/xulrunner/examples/simple/locale/simple.dtd b/application/xulrunner/examples/simple/locale/simple.dtd
new file mode 100644
index 000000000..2fd1c9285
--- /dev/null
+++ b/application/xulrunner/examples/simple/locale/simple.dtd
@@ -0,0 +1,7 @@
+<!-- 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 simple.title "Simple App">
+<!ENTITY simple.textValue "0">
+<!ENTITY simple.buttonLabel "Increment">
diff --git a/application/xulrunner/examples/simple/moz.build b/application/xulrunner/examples/simple/moz.build
new file mode 100644
index 000000000..c88c57a4b
--- /dev/null
+++ b/application/xulrunner/examples/simple/moz.build
@@ -0,0 +1,22 @@
+# -*- 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/.
+
+DIRS += ['components']
+
+XPI_NAME = 'simple'
+
+JAR_MANIFESTS += ['jar.mn']
+
+JS_PREFERENCE_FILES += [
+ 'simple-prefs.js',
+]
+
+FINAL_TARGET_PP_FILES += [
+ 'application.ini',
+]
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+ FINAL_TARGET_FILES.chrome.icons.default += ['icons/simple.ico']
diff --git a/application/xulrunner/examples/simple/simple-prefs.js b/application/xulrunner/examples/simple/simple-prefs.js
new file mode 100644
index 000000000..fc92e0df5
--- /dev/null
+++ b/application/xulrunner/examples/simple/simple-prefs.js
@@ -0,0 +1,6 @@
+/* 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/. */
+
+pref("toolkit.defaultChromeURI", "chrome://simple/content/simple.xul");
+pref("general.useragent.extra.simple", "SimpleApp/0.1");
diff --git a/application/xulrunner/installer/Makefile.in b/application/xulrunner/installer/Makefile.in
new file mode 100644
index 000000000..04803dddb
--- /dev/null
+++ b/application/xulrunner/installer/Makefile.in
@@ -0,0 +1,148 @@
+# 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/.
+
+STANDALONE_MAKEFILE := 1
+
+NO_PKG_FILES = \
+ xulrunner-config \
+ regchrome* \
+ regxpcom* \
+ $(NULL)
+
+# We want xpcshell, run-mozilla and install_app.py in the SDK but not in the binary package.
+ifndef STAGE_SDK
+NO_PKG_FILES += \
+ xpcshell* \
+ run-mozilla* \
+ install_app.py \
+ $(NULL)
+endif
+
+# If we're on mac, we don't want an end-user-facing DMG, we want a .tar.bz2
+# which developers then use to package their application.
+
+ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+MOZ_PKG_FORMAT = BZ2
+_APPNAME = XUL.framework
+_BINPATH = /$(_APPNAME)/Versions/Current
+_RESPATH := $(_BINPATH)
+endif
+
+include $(topsrcdir)/config/rules.mk
+
+INSTALL_SDK = 1
+
+include $(topsrcdir)/toolkit/mozapps/installer/signing.mk
+include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
+
+# Add pkg-config files to the install:: target
+
+pkg_config_files = \
+ libxul.pc \
+ libxul-embedding.pc \
+ mozilla-js.pc \
+ mozilla-plugin.pc \
+ $(NULL)
+
+ifdef MOZ_NATIVE_NSPR
+NSPR_NAME=nspr
+NSPR_VERSION=$(shell $(NSPR_CONFIG) --version)
+else
+pkg_config_files += mozilla-nspr.pc
+NSPR_NAME=mozilla-nspr
+FULL_NSPR_CFLAGS=-I\$${includedir}
+FULL_NSPR_LIBS=$(subst $(prefix),\$${sdkdir},$(shell $(DEPTH)/nsprpub/config/nspr-config --libs))
+NSPR_VERSION=$(shell $(DEPTH)/nsprpub/config/nspr-config --version)
+endif
+
+MOZ_XUL_LINK = -lxpcomglue_s -lxul
+ifdef JS_SHARED_LIBRARY
+MOZ_JS_LINK = -lmozjs
+else
+MOZ_JS_LINK = $(MOZ_XUL_LINK)
+endif
+
+$(warning FULL_NSPR_CFLAGS=$(FULL_NSPR_CFLAGS))
+
+ifndef MOZ_NATIVE_NSS
+pkg_config_files += mozilla-nss.pc
+endif
+
+%.pc: $(srcdir)/%.pc.in $(GLOBAL_DEPS)
+ cat $< | sed \
+ -e "s|%prefix%|$(prefix)|" \
+ -e "s|%includedir%|$(includedir)|" \
+ -e "s|%idldir%|$(idldir)|" \
+ -e "s|%sdkdir%|$(sdkdir)|" \
+ -e "s|%MOZ_APP_NAME%|$(MOZ_APP_NAME)|" \
+ -e "s|%MOZILLA_VERSION%|$(MOZ_APP_VERSION)|" \
+ -e "s|%WCHAR_CFLAGS%|$(WCHAR_CFLAGS)|" \
+ -e "s|%FULL_NSPR_LIBS%|$(FULL_NSPR_LIBS)|" \
+ -e "s|%FULL_NSPR_CFLAGS%|$(FULL_NSPR_CFLAGS)|" \
+ -e "s|%NSPR_NAME%|$(NSPR_NAME)|" \
+ -e "s|%NSPR_VERSION%|$(NSPR_VERSION)|" \
+ -e "s|%MOZ_XUL_LINK%|$(MOZ_XUL_LINK)|" \
+ -e "s|%MOZ_JS_LINK%|$(MOZ_JS_LINK)|" > $@
+ chmod 644 $@
+
+install:: $(pkg_config_files)
+ @echo pkg_config_file: $(pkg_config_files)
+ $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(libdir)/pkgconfig
+
+GARBAGE += $(pkg_config_files)
+
+GARBAGE += debian/changelog
+
+DEBDESTDIR=debian/$(MOZ_BUILD_APP)
+
+GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)
+MOZ_DEB_TIMESTAMP = "$(shell date +"%a, %d %b %Y %T %z" )"
+
+DEFINES += \
+ -DGRE_MILESTONE=$(GRE_MILESTONE) \
+ -DGRE_BUILDID=$(GRE_BUILDID) \
+ -DMOZ_DEB_TIMESTAMP=$(MOZ_DEB_TIMESTAMP) \
+ -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
+ -Dinstalldir=$(installdir) \
+ $(NULL)
+
+ifeq ($(OS_TARGET),Linux)
+debian/changelog: $(srcdir)/debian/changelog.in $(DIST)/bin/platform.ini
+ $(call py_action,preprocessor, \
+ $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@)
+
+debian/xulrunner.links: $(srcdir)/debian/xulrunner.links.in
+ $(call py_action,preprocessor, \
+ $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@)
+
+debian/xulrunner.service: $(srcdir)/debian/xulrunner.service.in
+ $(call py_action,preprocessor, \
+ $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@)
+
+debian/prerm: $(srcdir)/debian/prerm.in
+ $(call py_action,preprocessor, \
+ $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@)
+
+debian/postinst: $(srcdir)/debian/postinst.in
+ $(call py_action,preprocessor, \
+ $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@)
+
+package:
+ $(MAKE) package -C $(DEPTH)
+
+deb: package debian/changelog debian/xulrunner.service debian/xulrunner.links
+ $(NSINSTALL) $(topsrcdir)/$(MOZ_BUILD_APP)/installer/debian .
+ rm -fr $(DEBDESTDIR)
+ $(NSINSTALL) -D $(DEBDESTDIR)/$(installdir)
+ cp -pRL $(DEPTH)/dist/$(MOZ_BUILD_APP)/* $(DEBDESTDIR)/$(installdir)
+ $(NSINSTALL) -D $(DEBDESTDIR)/usr/share/dbus-1/services/
+ cp debian/$(MOZ_BUILD_APP).service $(DEBDESTDIR)/usr/share/dbus-1/services/org.mozilla.$(MOZ_BUILD_APP).service
+ dh_link; fakeroot dh_fixperms; fakeroot dh_installdeb; fakeroot dh_shlibdeps; fakeroot dh_gencontrol; fakeroot dh_md5sums; fakeroot dh_builddeb;
+endif
+
+DEB_BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
+# package name comes from xulrunner/installer/debian/changelog.in
+DEB_PKG_NAME = $(MOZ_PKG_APPNAME)_$(GRE_MILESTONE)-$(GRE_BUILDID)_$(DEB_BUILD_ARCH).deb
+# relative to $(DIST)
+UPLOAD_EXTRA_FILES += ../xulrunner/$(DEB_PKG_NAME)
diff --git a/application/xulrunner/installer/debian/changelog.in b/application/xulrunner/installer/debian/changelog.in
new file mode 100644
index 000000000..1efd55a1d
--- /dev/null
+++ b/application/xulrunner/installer/debian/changelog.in
@@ -0,0 +1,7 @@
+# if the naming changes please modify DEB_PKG_NAME in xulrunner/installer/Makefile.in as well
+#filter substitution
+xulrunner (@GRE_MILESTONE@-@GRE_BUILDID@) unstable; urgency=low
+
+ * Mozilla Nightly (Closes: #nnnn) <nnnn is the bug number of your ITP>
+
+ -- Mozilla Runtime <mobile-feedback@mozilla.com> @MOZ_DEB_TIMESTAMP@
diff --git a/application/xulrunner/installer/debian/compat b/application/xulrunner/installer/debian/compat
new file mode 100644
index 000000000..b8626c4cf
--- /dev/null
+++ b/application/xulrunner/installer/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/application/xulrunner/installer/debian/control b/application/xulrunner/installer/debian/control
new file mode 100644
index 000000000..da99aa8d4
--- /dev/null
+++ b/application/xulrunner/installer/debian/control
@@ -0,0 +1,48 @@
+Source: xulrunner
+Section: user/network
+Priority: extra
+Maintainer: Mobile Feedback <mobile-feedback@mozilla.com>
+Build-Depends: debhelper (>= 5)
+Standards-Version: 3.7.2
+
+Package: xulrunner
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: Web and JavaScript engine used by the Firefox Web browser
+ The Mozilla runtime is the modern browser engine, also known as "Gecko," that powers Firefox and can be embedded by other applications
+XB-Maemo-Display-Name: Mozilla Runtime
+XB-Maemo-Icon-26:
+ MB5!.1PT*&@H````-24A$4@```!H````:"`8```"I2DS.````"7!(67,```L3
+ M```+$P$`FIP8```%;$E$051(B:667XQ4U1W'/_>>>V?NG=F9V3^S_W%9<'#!
+ M/Q1;NQ:EQH@:T2"EH>&A34R;]$U?Q%9-VH:41BUJFV"-B<8'^Z!-VP=E?37&
+ M5=18L"SACVMVH<M.9W>8V9G9N7-G[O_3AP6$LD"$;W*3<T_R^W[.]Y=S3@Z<
+ ME90H_)\DE\Y=J]3SHW_\1)6O#FV2NVD'D*\,W<T;JWK.0W>3OA[012N68]LW
+ MD1W^!8?W_XGANQ^C5?V$(V/_8L.VGU.:.JG\\M@[UPK2SD/V#=U,K=QDW;TF
+ M#S_[&HZC4,^O9_T6'84VWO[PI]>32/MFV.URZ^;G273UT7^7`3&)#%*!TM"U
+ MS]ZHTC?\B/SUD7\J>\E?,TC^'4%LA4?DS\O^V]<H<L!I.6`:,5S[:#B^T)?1
+ M\MJZ>]YF8:GLB3@/WIQ!,U1F9AH<V]VX&DB1N]'HS6WFN]L>8>"V`6(=O;)S
+ M8]O<?"!E%/+ZFZ_R_'-[U;4CZTX6NA_8;VZX_X>IWO3W4\,]W;II4CE3MZJS
+ M9R9JIPICSOBQ,4Z_4+U<HH@H?H"W7CY`@,&NEUY1>M;?GFBC^=2NWR-434HU
+ M;OY@\]:'8OTW;3]N&@RM74ER1195Z!0S1E^QS5B3CZL[BHJ<L$_L^1T'?[O_
+ MDD07_LCQQW]$;M-3M&JEL8EJ[M$?/QN"2*OI[-"JW(AX[&<[J:174NK(D<T-
+ M(F*"N>EYBJ<7*)VI4%EHL'!ZWG7R\[_AT)Z7+O06YR%_&>PBU;V#RLE]%/]S
+ M5/A6YK7WIP+1WCLJA"Z:C44*E1H=]SZ*TMF-D=31@?J9&E:Q@EVW<2IUM$Q"
+ M\U8/W1>MW9)GXMW#Y_R_.;!6(^+SO[VH;/[K%XN'QJ>/C7VR+]CVAY1^XRVJ
+ M%A?(9`IO=`MS'8-XAH[M!5B-%JUZ`]_U20UT0;-%Z_@I8J&OJ<.]S['QF=RR
+ MK;M(]^S=R<8-[PA148S\89*WW$GVUN^1T049324I)-;D?VG,E:F7+%+?N9'%
+ M:I7J=!&W+TLSE<;Y^."?>>^))R].=+%4#+&3,%1"LX?6Z`[\U`W87\]0*Y2H
+ MN1YU)\0UX]A^2*0+HJ2!.;*2MM4K$%T91,M%B2>VPM;LN5VWC+9T0>P.K!;,
+ M%8AL"RN10$G$"7K:(1G#C1N8G2F2=XP02/!5B=-R\<(63!>1PH!(K"*W)L<4
+ MY>5!;4X/]<5V)AM0KX(J"!(F]722T/.(!KHQLYTT58FN0A!&1&Z(W_+P\B6\
+ M`U_BZW%D6U805FX`/E\>%/D&MB/(SX,:@6&"ZQ`T&MC51?SV#*X21Q,0DZ`&
+ M+J$?X9>K^">F""HE@DH-?!>D;5R^=:%E4;-<'#N!],#WH!D#31`,KB!038)\
+ M$5W5<%4)00"A@CST;[P3D_BVA73J$'J`6[\\R)THXVS,T[ZJ`]\#Q8;:/&@Z
+ M%(`C<;QL%X$O(!T#1<!"!8X>)5I<`,^&R`.$!<Q<83-0I5[X"*7S-M(IJ!6@
+ M50-A@&-#N0"#JXFZ^J&B@YF&\@($$AP+\``)A!,P>Q(NN!DN;9_2Q._8CB\,
+ M(@]:<Q#Y$#H0^-!8A,(T%&?`5T#)0*B"-7T6I$CP_PBS!ZX,HEP@3/3C)D:)
+ MXA"5(*Q!%"Y]01-D"%*'P`17!3L`KP'2!J(/8'8/>,VK@(A@]CBH:PGM'+)\
+ M=EH#G*55JQF(C8"O@]T`IP&1!()).+4+ZE^=,[L2"&`1YKZ$L!=J-X&B0AIH
+ M`C;(&O@.!&6(3H.<!N8_A9E?06W\*M[+:A!23T/J('2UH$TNG2!#0DI".H#,
+ M)&1>!-8M9_!MWFTQB*V&Q"AX(V`,@-3`*X*<`O\@^">6HEX?Z$*90/QLO<]2
+ :+Z,K%?P/&D=O=_6]@+\`````245.1*Y"8((`
+ `
diff --git a/application/xulrunner/installer/debian/icon_base64 b/application/xulrunner/installer/debian/icon_base64
new file mode 100644
index 000000000..124fb4ccc
--- /dev/null
+++ b/application/xulrunner/installer/debian/icon_base64
@@ -0,0 +1,36 @@
+begin 644 -m
+MB5!.1PT*&@H````-24A$4@```!H````:"`8```"I2DS.````"7!(67,```L3
+M```+$P$`FIP8```%;$E$051(B:667XQ4U1W'/_>>>V?NG=F9V3^S_W%9<'#!
+M/Q1;NQ:EQH@:T2"EH>&A34R;]$U?Q%9-VH:41BUJFV"-B<8'^Z!-VP=E?37&
+M5=18L"SACVMVH<M.9W>8V9G9N7-G[O_3AP6$LD"$;W*3<T_R^W[.]Y=S3@Z<
+ME90H_)\DE\Y=J]3SHW_\1)6O#FV2NVD'D*\,W<T;JWK.0W>3OA[012N68]LW
+MD1W^!8?W_XGANQ^C5?V$(V/_8L.VGU.:.JG\\M@[UPK2SD/V#=U,K=QDW;TF
+M#S_[&HZC4,^O9_T6'84VWO[PI]>32/MFV.URZ^;G273UT7^7`3&)#%*!TM"U
+MS]ZHTC?\B/SUD7\J>\E?,TC^'4%LA4?DS\O^V]<H<L!I.6`:,5S[:#B^T)?1
+M\MJZ>]YF8:GLB3@/WIQ!,U1F9AH<V]VX&DB1N]'HS6WFN]L>8>"V`6(=O;)S
+M8]O<?"!E%/+ZFZ_R_'-[U;4CZTX6NA_8;VZX_X>IWO3W4\,]W;II4CE3MZJS
+M9R9JIPICSOBQ,4Z_4+U<HH@H?H"W7CY`@,&NEUY1>M;?GFBC^=2NWR-434HU
+M;OY@\]:'8OTW;3]N&@RM74ER1195Z!0S1E^QS5B3CZL[BHJ<L$_L^1T'?[O_
+MDD07_LCQQW]$;M-3M&JEL8EJ[M$?/QN"2*OI[-"JW(AX[&<[J:174NK(D<T-
+M(F*"N>EYBJ<7*)VI4%EHL'!ZWG7R\[_AT)Z7+O06YR%_&>PBU;V#RLE]%/]S
+M5/A6YK7WIP+1WCLJA"Z:C44*E1H=]SZ*TMF-D=31@?J9&E:Q@EVW<2IUM$Q"
+M\U8/W1>MW9)GXMW#Y_R_.;!6(^+SO[VH;/[K%XN'QJ>/C7VR+]CVAY1^XRVJ
+M%A?(9`IO=`MS'8-XAH[M!5B-%JUZ`]_U20UT0;-%Z_@I8J&OJ<.]S['QF=RR
+MK;M(]^S=R<8-[PA148S\89*WW$GVUN^1T049324I)-;D?VG,E:F7+%+?N9'%
+M:I7J=!&W+TLSE<;Y^."?>>^))R].=+%4#+&3,%1"LX?6Z`[\U`W87\]0*Y2H
+MN1YU)\0UX]A^2*0+HJ2!.;*2MM4K$%T91,M%B2>VPM;LN5VWC+9T0>P.K!;,
+M%8AL"RN10$G$"7K:(1G#C1N8G2F2=XP02/!5B=-R\<(63!>1PH!(K"*W)L<4
+MY>5!;4X/]<5V)AM0KX(J"!(F]722T/.(!KHQLYTT58FN0A!&1&Z(W_+P\B6\
+M`U_BZW%D6U805FX`/E\>%/D&MB/(SX,:@6&"ZQ`T&MC51?SV#*X21Q,0DZ`&
+M+J$?X9>K^">F""HE@DH-?!>D;5R^=:%E4;-<'#N!],#WH!D#31`,KB!038)\
+M$5W5<%4)00"A@CST;[P3D_BVA73J$'J`6[\\R)THXVS,T[ZJ`]\#Q8;:/&@Z
+M%(`C<;QL%X$O(!T#1<!"!8X>)5I<`,^&R`.$!<Q<83-0I5[X"*7S-M(IJ!6@
+M50-A@&-#N0"#JXFZ^J&B@YF&\@($$AP+\``)A!,P>Q(NN!DN;9_2Q._8CB\,
+M(@]:<Q#Y$#H0^-!8A,(T%&?`5T#)0*B"-7T6I$CP_PBS!ZX,HEP@3/3C)D:)
+MXA"5(*Q!%"Y]01-D"%*'P`17!3L`KP'2!J(/8'8/>,VK@(A@]CBH:PGM'+)\
+M=EH#G*55JQF(C8"O@]T`IP&1!()).+4+ZE^=,[L2"&`1YKZ$L!=J-X&B0AIH
+M`C;(&O@.!&6(3H.<!N8_A9E?06W\*M[+:A!23T/J('2UH$TNG2!#0DI".H#,
+M)&1>!-8M9_!MWFTQB*V&Q"AX(V`,@-3`*X*<`O\@^">6HEX?Z$*90/QLO<]2
+:+Z,K%?P/&D=O=_6]@+\`````245.1*Y"8((`
+`
+end
diff --git a/application/xulrunner/installer/debian/menu b/application/xulrunner/installer/debian/menu
new file mode 100644
index 000000000..e1ce52201
--- /dev/null
+++ b/application/xulrunner/installer/debian/menu
@@ -0,0 +1,2 @@
+?package(xulrunner):needs="X11|text|vc|wm" section="Apps/Internet"\
+ title="xulrunner" command="/usr/bin/xulrunner"
diff --git a/application/xulrunner/installer/debian/postinst.in b/application/xulrunner/installer/debian/postinst.in
new file mode 100644
index 000000000..0f06640e2
--- /dev/null
+++ b/application/xulrunner/installer/debian/postinst.in
@@ -0,0 +1,42 @@
+#literal #! /bin/sh
+#filter substitution
+# postinst script for moz
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ configure)
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#ifdef MOZ_WIDGET_GTK
+gtk-update-icon-cache /usr/share/icons/hicolor
+#endif
+
+
+exit 0
+
+
diff --git a/application/xulrunner/installer/debian/prerm.in b/application/xulrunner/installer/debian/prerm.in
new file mode 100644
index 000000000..1d46d382c
--- /dev/null
+++ b/application/xulrunner/installer/debian/prerm.in
@@ -0,0 +1,29 @@
+#literal #! /bin/sh
+#filter substitution
+# prerm script for moz
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+ remove|upgrade|deconfigure)
+ ;;
+
+ failed-upgrade)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#ifdef MOZ_WIDGET_GTK
+gtk-update-icon-cache /usr/share/icons/hicolor
+#endif
+
+
+exit 0
+
+
diff --git a/application/xulrunner/installer/debian/xulrunner.links.in b/application/xulrunner/installer/debian/xulrunner.links.in
new file mode 100644
index 000000000..eabac6f51
--- /dev/null
+++ b/application/xulrunner/installer/debian/xulrunner.links.in
@@ -0,0 +1,2 @@
+#filter substitution
+@installdir@/xulrunner /usr/bin/xulrunner
diff --git a/application/xulrunner/installer/debian/xulrunner.service.in b/application/xulrunner/installer/debian/xulrunner.service.in
new file mode 100644
index 000000000..48d87a1b9
--- /dev/null
+++ b/application/xulrunner/installer/debian/xulrunner.service.in
@@ -0,0 +1,4 @@
+#filter substitution
+[D-BUS Service]
+Name=org.mozilla.@MOZ_APP_NAME@
+Exec=@installdir@/xulrunner
diff --git a/application/xulrunner/installer/libxul-embedding.pc.in b/application/xulrunner/installer/libxul-embedding.pc.in
new file mode 100644
index 000000000..100e0a763
--- /dev/null
+++ b/application/xulrunner/installer/libxul-embedding.pc.in
@@ -0,0 +1,10 @@
+prefix=%prefix%
+sdkdir=%sdkdir%
+includedir=%includedir%
+idldir=%idldir%
+
+Name: libxul-embedding
+Description: Static library for version-independent embedding of the Mozilla runtime
+Version: %MOZILLA_VERSION%
+Libs: -L${sdkdir}/lib -lxpcomglue -ldl
+Cflags: -DXPCOM_GLUE -I${includedir} %WCHAR_CFLAGS%
diff --git a/application/xulrunner/installer/libxul.pc.in b/application/xulrunner/installer/libxul.pc.in
new file mode 100644
index 000000000..ccce9aa59
--- /dev/null
+++ b/application/xulrunner/installer/libxul.pc.in
@@ -0,0 +1,11 @@
+prefix=%prefix%
+sdkdir=%sdkdir%
+includedir=%includedir%
+idldir=%idldir%
+
+Name: libxul
+Description: The Mozilla Runtime and Embedding Engine
+Version: %MOZILLA_VERSION%
+Requires: %NSPR_NAME% >= %NSPR_VERSION%
+Libs: -L${sdkdir}/lib %MOZ_XUL_LINK%
+Cflags: -I${includedir} %WCHAR_CFLAGS%
diff --git a/application/xulrunner/installer/moz.build b/application/xulrunner/installer/moz.build
new file mode 100644
index 000000000..895d11993
--- /dev/null
+++ b/application/xulrunner/installer/moz.build
@@ -0,0 +1,6 @@
+# -*- 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/.
+
diff --git a/application/xulrunner/installer/mozilla-js.pc.in b/application/xulrunner/installer/mozilla-js.pc.in
new file mode 100644
index 000000000..55e84ca00
--- /dev/null
+++ b/application/xulrunner/installer/mozilla-js.pc.in
@@ -0,0 +1,10 @@
+prefix=%prefix%
+sdkdir=%sdkdir%
+includedir=%includedir%
+
+Name: JavaScript
+Description: The Mozilla JavaScript Library
+Version: %MOZILLA_VERSION%
+Requires: %NSPR_NAME% >= %NSPR_VERSION%
+Libs: -L${sdkdir}/lib %MOZ_JS_LINK%
+Cflags: -I${includedir} -DXP_UNIX
diff --git a/application/xulrunner/installer/mozilla-nspr.pc.in b/application/xulrunner/installer/mozilla-nspr.pc.in
new file mode 100644
index 000000000..7ebd3421c
--- /dev/null
+++ b/application/xulrunner/installer/mozilla-nspr.pc.in
@@ -0,0 +1,11 @@
+prefix=%prefix%
+sdkdir=%sdkdir%
+includedir=%includedir%/nspr
+
+Name: NSPR
+Description: The Netscape Portable Runtime
+Version: %NSPR_VERSION%
+Libs: %FULL_NSPR_LIBS%
+Cflags: %FULL_NSPR_CFLAGS%
+
+
diff --git a/application/xulrunner/installer/mozilla-nss.pc.in b/application/xulrunner/installer/mozilla-nss.pc.in
new file mode 100644
index 000000000..90f14c3ae
--- /dev/null
+++ b/application/xulrunner/installer/mozilla-nss.pc.in
@@ -0,0 +1,10 @@
+prefix=%prefix%
+sdkdir=%sdkdir%
+includedir=%includedir%/nss
+
+Name: NSS
+Description: Mozilla Network Security Services
+Version: %MOZILLA_VERSION%
+Requires: %NSPR_NAME% >= %NSPR_VERSION%
+Libs: -L${sdkdir}/lib -lsmime3 -lssl3 -lnss3 -lnssutil3
+Cflags: -I${includedir}
diff --git a/application/xulrunner/installer/mozilla-plugin.pc.in b/application/xulrunner/installer/mozilla-plugin.pc.in
new file mode 100644
index 000000000..7080161b3
--- /dev/null
+++ b/application/xulrunner/installer/mozilla-plugin.pc.in
@@ -0,0 +1,8 @@
+prefix=%prefix%
+sdkdir=%sdkdir%
+includedir=%includedir%
+
+Name: Mozilla Plug-In API
+Description: Mozilla Plug-In API
+Version: %MOZILLA_VERSION%
+Cflags: -I${includedir} -DXP_UNIX
diff --git a/application/xulrunner/locales/all-locales b/application/xulrunner/locales/all-locales
new file mode 100644
index 000000000..85ef789a6
--- /dev/null
+++ b/application/xulrunner/locales/all-locales
@@ -0,0 +1,39 @@
+ar
+bg
+ca
+cs
+da
+de
+el
+en-GB
+es-AR
+es-ES
+eu
+fi
+fr
+ga-IE
+gu-IN
+he
+hu
+hy-AM
+it
+ja
+ja-JP-mac
+ko
+nb-NO
+nl
+nn-NO
+mk
+mn
+pa-IN
+pl
+pt-BR
+ro
+ru
+sk
+sl
+sq
+sv-SE
+tr
+zh-CN
+zh-TW
diff --git a/application/xulrunner/moz.build b/application/xulrunner/moz.build
new file mode 100644
index 000000000..371f69f5e
--- /dev/null
+++ b/application/xulrunner/moz.build
@@ -0,0 +1,11 @@
+# -*- 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/.
+
+CONFIGURE_SUBST_FILES += ['installer/Makefile']
+
+DIRS += [
+ 'app',
+]
diff --git a/application/xulrunner/moz.configure b/application/xulrunner/moz.configure
new file mode 100644
index 000000000..72236254f
--- /dev/null
+++ b/application/xulrunner/moz.configure
@@ -0,0 +1,7 @@
+# -*- 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/.
+
+include('../../toolkit/moz.configure')
diff --git a/application/xulrunner/stub/Makefile.in b/application/xulrunner/stub/Makefile.in
new file mode 100644
index 000000000..0fa0cccf6
--- /dev/null
+++ b/application/xulrunner/stub/Makefile.in
@@ -0,0 +1,11 @@
+# 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 MOZ_WINCONSOLE
+ifdef MOZ_DEBUG
+MOZ_WINCONSOLE = 1
+else
+MOZ_WINCONSOLE = 0
+endif
+endif
diff --git a/application/xulrunner/stub/moz.build b/application/xulrunner/stub/moz.build
new file mode 100644
index 000000000..4fd172f72
--- /dev/null
+++ b/application/xulrunner/stub/moz.build
@@ -0,0 +1,51 @@
+# -*- 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/.
+
+# The value of XULRUNNER_STUB_NAME is generated by configure to allow XULRunner
+# apps to override it using the --with-xulrunner-stub-name=<appname> argument.
+# If this configure argument is not present then the default name is
+# 'xulrunner-stub'.
+
+# We don't want to create a dependency on mozglue.
+# Statically link against the RTL on windows
+GeckoProgram(CONFIG['XULRUNNER_STUB_NAME'], mozglue=None, msvcrt='static')
+
+SOURCES += [
+ 'nsXULStub.cpp',
+]
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+ FINAL_TARGET = 'dist/XUL.framework/Versions/%(MOZILLA_VERSION)s' % CONFIG
+
+DEFINES['XPCOM_GLUE'] = True
+
+LOCAL_INCLUDES += [
+ '/xpcom/base',
+ '/xpcom/build',
+]
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+ LOCAL_INCLUDES += ['/toolkit/xre']
+ # this is an awful workaround - glandium
+ USE_LIBS += ['mfbt_staticruntime']
+
+if CONFIG['_MSC_VER']:
+ WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+ DEFINES['MOZ_XULRUNNER'] = True
+ RCINCLUDE = 'xulrunner-stub.rc'
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+ OS_LIBS += [
+ 'shell32',
+ ]
+
+DISABLE_STL_WRAPPING = True
+
+# Need to link with CoreFoundation on Mac
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+ OS_LIBS += CONFIG['TK_LIBS']
diff --git a/application/xulrunner/stub/nsXULStub.cpp b/application/xulrunner/stub/nsXULStub.cpp
new file mode 100644
index 000000000..8638ae43e
--- /dev/null
+++ b/application/xulrunner/stub/nsXULStub.cpp
@@ -0,0 +1,445 @@
+/* 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 "nsXPCOMGlue.h"
+#include "nsINIParser.h"
+#include "nsXPCOMPrivate.h" // for XP MAXPATHLEN
+#include "nsXULAppAPI.h"
+#include "nsIFile.h"
+
+#include <stdarg.h>
+
+#ifdef XP_WIN
+#include <windows.h>
+#include <io.h>
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define snprintf _snprintf
+#define vsnprintf _vsnprintf
+#endif
+#define strcasecmp _stricmp
+#define PATH_SEPARATOR_CHAR '\\'
+#define R_OK 04
+#elif defined(XP_MACOSX)
+#include <unistd.h>
+#include <sys/stat.h>
+#include <CoreFoundation/CoreFoundation.h>
+#define PATH_SEPARATOR_CHAR '/'
+#else
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#define PATH_SEPARATOR_CHAR '/'
+#endif
+
+#ifdef XP_WIN
+#define XRE_DONT_PROTECT_DLL_LOAD
+#include "nsWindowsWMain.cpp"
+#endif
+
+#define VERSION_MAXLEN 128
+
+static void Output(bool isError, const char *fmt, ... )
+{
+ va_list ap;
+ va_start(ap, fmt);
+
+#if (defined(XP_WIN) && !MOZ_WINCONSOLE)
+ char msg[2048];
+
+ vsnprintf(msg, sizeof(msg), fmt, ap);
+
+ UINT flags = MB_OK;
+ if (isError)
+ flags |= MB_ICONERROR;
+ else
+ flags |= MB_ICONINFORMATION;
+
+ wchar_t wide_msg[1024];
+ MultiByteToWideChar(CP_ACP,
+ 0,
+ msg,
+ -1,
+ wide_msg,
+ sizeof(wide_msg) / sizeof(wchar_t));
+
+ MessageBoxW(nullptr, wide_msg, L"XULRunner", flags);
+#else
+ vfprintf(stderr, fmt, ap);
+#endif
+
+ va_end(ap);
+}
+
+/**
+ * Return true if |arg| matches the given argument name.
+ */
+static bool IsArg(const char* arg, const char* s)
+{
+ if (*arg == '-')
+ {
+ if (*++arg == '-')
+ ++arg;
+ return !strcasecmp(arg, s);
+ }
+
+#if defined(XP_WIN)
+ if (*arg == '/')
+ return !strcasecmp(++arg, s);
+#endif
+
+ return false;
+}
+
+/**
+ * Return true if |aDir| is a valid file/directory.
+ */
+static bool FolderExists(const char* aDir)
+{
+#ifdef XP_WIN
+ wchar_t wideDir[MAX_PATH];
+ MultiByteToWideChar(CP_UTF8, 0, aDir, -1, wideDir, MAX_PATH);
+ DWORD fileAttrs = GetFileAttributesW(wideDir);
+ return fileAttrs != INVALID_FILE_ATTRIBUTES;
+#else
+ return access(aDir, R_OK) == 0;
+#endif
+}
+
+static nsresult GetRealPath(const char* appDataFile, char* *aResult)
+{
+#ifdef XP_WIN
+ wchar_t wAppDataFile[MAX_PATH];
+ wchar_t wIniPath[MAX_PATH];
+ MultiByteToWideChar(CP_UTF8, 0, appDataFile, -1, wAppDataFile, MAX_PATH);
+ _wfullpath(wIniPath, wAppDataFile, MAX_PATH);
+ WideCharToMultiByte(CP_UTF8, 0, wIniPath, -1, *aResult, MAX_PATH, 0, 0);
+#else
+ struct stat fileStat;
+ if (!realpath(appDataFile, *aResult) || stat(*aResult, &fileStat))
+ return NS_ERROR_FAILURE;
+#endif
+ if (!*aResult || !**aResult)
+ return NS_ERROR_FAILURE;
+
+ return NS_OK;
+}
+
+class AutoAppData
+{
+public:
+ AutoAppData(nsIFile* aINIFile) : mAppData(nullptr) {
+ nsresult rv = XRE_CreateAppData(aINIFile, &mAppData);
+ if (NS_FAILED(rv))
+ mAppData = nullptr;
+ }
+ ~AutoAppData() {
+ if (mAppData)
+ XRE_FreeAppData(mAppData);
+ }
+
+ operator nsXREAppData*() const { return mAppData; }
+ nsXREAppData* operator -> () const { return mAppData; }
+
+private:
+ nsXREAppData* mAppData;
+};
+
+XRE_CreateAppDataType XRE_CreateAppData;
+XRE_FreeAppDataType XRE_FreeAppData;
+XRE_mainType XRE_main;
+
+int
+main(int argc, char **argv)
+{
+ nsresult rv;
+ char *lastSlash;
+
+ char iniPath[MAXPATHLEN];
+ char tmpPath[MAXPATHLEN];
+ char greDir[MAXPATHLEN];
+ bool greFound = false;
+
+#if defined(XP_MACOSX)
+ CFBundleRef appBundle = CFBundleGetMainBundle();
+ if (!appBundle)
+ return 1;
+
+ CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(appBundle);
+ if (!resourcesURL)
+ return 1;
+
+ CFURLRef absResourcesURL = CFURLCopyAbsoluteURL(resourcesURL);
+ CFRelease(resourcesURL);
+ if (!absResourcesURL)
+ return 1;
+
+ CFURLRef iniFileURL =
+ CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault,
+ absResourcesURL,
+ CFSTR("application.ini"),
+ false);
+ CFRelease(absResourcesURL);
+ if (!iniFileURL)
+ return 1;
+
+ CFStringRef iniPathStr =
+ CFURLCopyFileSystemPath(iniFileURL, kCFURLPOSIXPathStyle);
+ CFRelease(iniFileURL);
+ if (!iniPathStr)
+ return 1;
+
+ CFStringGetCString(iniPathStr, iniPath, sizeof(iniPath),
+ kCFStringEncodingUTF8);
+ CFRelease(iniPathStr);
+
+#else
+
+#ifdef XP_WIN
+ wchar_t wide_path[MAX_PATH];
+ if (!::GetModuleFileNameW(nullptr, wide_path, MAX_PATH))
+ return 1;
+
+ WideCharToMultiByte(CP_UTF8, 0, wide_path,-1,
+ iniPath, MAX_PATH, nullptr, nullptr);
+
+#else
+ // on unix, there is no official way to get the path of the current binary.
+ // instead of using the MOZILLA_FIVE_HOME hack, which doesn't scale to
+ // multiple applications, we will try a series of techniques:
+ //
+ // 1) use realpath() on argv[0], which works unless we're loaded from the
+ // PATH
+ // 2) manually walk through the PATH and look for ourself
+ // 3) give up
+
+ struct stat fileStat;
+ strncpy(tmpPath, argv[0], sizeof(tmpPath));
+ lastSlash = strrchr(tmpPath, '/');
+ if (lastSlash) {
+ *lastSlash = 0;
+ realpath(tmpPath, iniPath);
+ } else {
+ const char *path = getenv("PATH");
+ if (!path)
+ return 1;
+
+ char *pathdup = strdup(path);
+ if (!pathdup)
+ return 1;
+
+ bool found = false;
+ char *token = strtok(pathdup, ":");
+ while (token) {
+ sprintf(tmpPath, "%s/%s", token, argv[0]);
+ if (stat(tmpPath, &fileStat) == 0) {
+ found = true;
+ lastSlash = strrchr(tmpPath, '/');
+ *lastSlash = 0;
+ realpath(tmpPath, iniPath);
+ break;
+ }
+ token = strtok(nullptr, ":");
+ }
+ free (pathdup);
+ if (!found)
+ return 1;
+ }
+ lastSlash = iniPath + strlen(iniPath);
+ *lastSlash = '/';
+#endif
+
+#ifndef XP_UNIX
+ lastSlash = strrchr(iniPath, PATH_SEPARATOR_CHAR);
+ if (!lastSlash)
+ return 1;
+#endif
+
+ *(++lastSlash) = '\0';
+
+ // On Linux/Win, look for XULRunner in appdir/xulrunner
+
+ snprintf(greDir, sizeof(greDir),
+ "%sxulrunner" XPCOM_FILE_PATH_SEPARATOR XPCOM_DLL,
+ iniPath);
+
+ greFound = FolderExists(greDir);
+
+#ifdef XP_UNIX
+ if (greFound) {
+ char resolved_greDir[MAXPATHLEN] = "";
+ if (realpath(greDir, resolved_greDir) && *resolved_greDir) {
+ strncpy(greDir, resolved_greDir, MAXPATHLEN);
+ }
+ }
+#endif
+
+ strncpy(lastSlash, "application.ini", sizeof(iniPath) - (lastSlash - iniPath));
+
+#endif
+
+ // If -app parameter was passed in, it is now time to take it under
+ // consideration.
+ const char *appDataFile;
+ appDataFile = getenv("XUL_APP_FILE");
+ if (!appDataFile || !*appDataFile)
+ if (argc > 1 && IsArg(argv[1], "app")) {
+ if (argc == 2) {
+ Output(false, "specify APP-FILE (optional)\n");
+ return 1;
+ }
+ argv[1] = argv[0];
+ ++argv;
+ --argc;
+
+ appDataFile = argv[1];
+ argv[1] = argv[0];
+ ++argv;
+ --argc;
+
+ char kAppEnv[MAXPATHLEN];
+ snprintf(kAppEnv, MAXPATHLEN, "XUL_APP_FILE=%s", appDataFile);
+ if (putenv(kAppEnv))
+ Output(false, "Couldn't set %s.\n", kAppEnv);
+
+ char *result = (char*) calloc(sizeof(char), MAXPATHLEN);
+ if (NS_FAILED(GetRealPath(appDataFile, &result))) {
+ Output(true, "Invalid application.ini path.\n");
+ return 1;
+ }
+
+ // We have a valid application.ini path passed in to the -app parameter
+ // but not yet a valid greDir, so lets look for it also on the same folder
+ // as the stub.
+ if (!greFound) {
+ lastSlash = strrchr(iniPath, PATH_SEPARATOR_CHAR);
+ if (!lastSlash)
+ return 1;
+
+ *(++lastSlash) = '\0';
+
+ snprintf(greDir, sizeof(greDir), "%s" XPCOM_DLL, iniPath);
+ greFound = FolderExists(greDir);
+ }
+
+ // copy it back.
+ strcpy(iniPath, result);
+ }
+
+ nsINIParser parser;
+ rv = parser.Init(iniPath);
+ if (NS_FAILED(rv)) {
+ fprintf(stderr, "Could not read application.ini\n");
+ return 1;
+ }
+
+ if (!greFound) {
+#ifdef XP_MACOSX
+ // The bundle can be found next to the executable, in the MacOS dir.
+ CFURLRef exurl = CFBundleCopyExecutableURL(appBundle);
+ CFURLRef absexurl = nullptr;
+ if (exurl) {
+ absexurl = CFURLCopyAbsoluteURL(exurl);
+ CFRelease(exurl);
+ }
+
+ if (absexurl) {
+ char tbuffer[MAXPATHLEN];
+
+ if (CFURLGetFileSystemRepresentation(absexurl, true,
+ (UInt8*) tbuffer,
+ sizeof(tbuffer)) &&
+ access(tbuffer, R_OK | X_OK) == 0) {
+ if (realpath(tbuffer, greDir)) {
+ greFound = true;
+ }
+ else {
+ greDir[0] = '\0';
+ }
+ }
+
+ CFRelease(absexurl);
+ }
+#endif
+ if (!greFound) {
+ Output(false, "Could not find the Mozilla runtime.\n");
+ return 1;
+ }
+ }
+
+ rv = XPCOMGlueStartup(greDir);
+ if (NS_FAILED(rv)) {
+ if (rv == NS_ERROR_OUT_OF_MEMORY) {
+ char applicationName[2000] = "this application";
+ parser.GetString("App", "Name", applicationName, sizeof(applicationName));
+ Output(true, "Not enough memory available to start %s.\n",
+ applicationName);
+ } else {
+ Output(true, "Couldn't load XPCOM.\n");
+ }
+ return 1;
+ }
+
+ static const nsDynamicFunctionLoad kXULFuncs[] = {
+ { "XRE_CreateAppData", (NSFuncPtr*) &XRE_CreateAppData },
+ { "XRE_FreeAppData", (NSFuncPtr*) &XRE_FreeAppData },
+ { "XRE_main", (NSFuncPtr*) &XRE_main },
+ { nullptr, nullptr }
+ };
+
+ rv = XPCOMGlueLoadXULFunctions(kXULFuncs);
+ if (NS_FAILED(rv)) {
+ Output(true, "Couldn't load XRE functions.\n");
+ return 1;
+ }
+
+ NS_LogInit();
+
+ int retval;
+
+ { // Scope COMPtr and AutoAppData
+ nsCOMPtr<nsIFile> iniFile;
+#ifdef XP_WIN
+ // On Windows iniPath is UTF-8 encoded so we need to convert it.
+ rv = NS_NewLocalFile(NS_ConvertUTF8toUTF16(iniPath), false,
+ getter_AddRefs(iniFile));
+#else
+ rv = NS_NewNativeLocalFile(nsDependentCString(iniPath), false,
+ getter_AddRefs(iniFile));
+#endif
+ if (NS_FAILED(rv)) {
+ Output(true, "Couldn't find application.ini file.\n");
+ return 1;
+ }
+
+ AutoAppData appData(iniFile);
+ if (!appData) {
+ Output(true, "Error: couldn't parse application.ini.\n");
+ return 1;
+ }
+
+ NS_ASSERTION(appData->directory, "Failed to get app directory.");
+
+ if (!appData->xreDirectory) {
+ // chop "libxul.so" off the GRE path
+ lastSlash = strrchr(greDir, PATH_SEPARATOR_CHAR);
+ if (lastSlash) {
+ *lastSlash = '\0';
+ }
+#ifdef XP_WIN
+ // same as iniPath.
+ NS_NewLocalFile(NS_ConvertUTF8toUTF16(greDir), false,
+ &appData->xreDirectory);
+#else
+ NS_NewNativeLocalFile(nsDependentCString(greDir), false,
+ &appData->xreDirectory);
+#endif
+ }
+
+ retval = XRE_main(argc, argv, appData, 0);
+ }
+
+ NS_LogTerm();
+
+ return retval;
+}
diff --git a/application/xulrunner/stub/xulrunner-stub.exe.manifest b/application/xulrunner/stub/xulrunner-stub.exe.manifest
new file mode 100644
index 000000000..57c2a7070
--- /dev/null
+++ b/application/xulrunner/stub/xulrunner-stub.exe.manifest
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+ version="1.0.0.0"
+ processorArchitecture="*"
+ name="Mozilla.XULRunner.Stub"
+ type="win32"
+/>
+<description>Mozilla XULRunner Stub</description>
+<dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="*"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+</dependency>
+<ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
+ <ms_asmv3:security>
+ <ms_asmv3:requestedPrivileges>
+ <ms_asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ </ms_asmv3:requestedPrivileges>
+ </ms_asmv3:security>
+</ms_asmv3:trustInfo>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+ </application>
+ </compatibility>
+</assembly>
diff --git a/application/xulrunner/stub/xulrunner-stub.rc b/application/xulrunner/stub/xulrunner-stub.rc
new file mode 100644
index 000000000..84c3e47ed
--- /dev/null
+++ b/application/xulrunner/stub/xulrunner-stub.rc
@@ -0,0 +1,6 @@
+/* -*- 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/. */
+
+1 24 "xulrunner-stub.exe.manifest"
diff --git a/application/xulrunner/tools/redit/Makefile.in b/application/xulrunner/tools/redit/Makefile.in
new file mode 100644
index 000000000..31c253be8
--- /dev/null
+++ b/application/xulrunner/tools/redit/Makefile.in
@@ -0,0 +1,11 @@
+# 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/. */
+
+ifeq ($(OS_ARCH),WINNT)
+
+SDK_BINARY = \
+ $(PROGRAM) \
+ $(NULL)
+
+endif
diff --git a/application/xulrunner/tools/redit/moz.build b/application/xulrunner/tools/redit/moz.build
new file mode 100644
index 000000000..812a56578
--- /dev/null
+++ b/application/xulrunner/tools/redit/moz.build
@@ -0,0 +1,15 @@
+# -*- 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/.
+
+if CONFIG['OS_ARCH'] == 'WINNT':
+ GeckoProgram('redit')
+ SOURCES += [
+ 'redit.cpp',
+ ]
+ for var in ('WIN32_LEAN_AND_MEAN', 'UNICODE', '_UNICODE'):
+ DEFINES[var] = True
+ if CONFIG['GNU_CC']:
+ WIN32_EXE_LDFLAGS += ['-municode']
diff --git a/application/xulrunner/tools/redit/redit.cpp b/application/xulrunner/tools/redit/redit.cpp
new file mode 100644
index 000000000..8a96358b2
--- /dev/null
+++ b/application/xulrunner/tools/redit/redit.cpp
@@ -0,0 +1,187 @@
+/* -*- 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/. */
+
+// System headers (alphabetical)
+#include <fcntl.h>
+#include <io.h>
+#include <share.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <windows.h>
+
+// Mozilla headers (alphabetical)
+#include "mozilla/FileUtils.h" // ScopedClose
+#include "mozilla/UniquePtrExtensions.h"
+
+/*
+Icon files are made up of:
+
+IconHeader
+IconDirEntry1
+IconDirEntry2
+...
+IconDirEntryN
+IconData1
+IconData2
+...
+IconDataN
+
+Each IconData must be added as a new RT_ICON resource to the exe. Then
+an RT_GROUP_ICON resource must be added that contains an equivalent
+header:
+
+IconHeader
+IconResEntry1
+IconResEntry2
+...
+IconResEntryN
+*/
+
+#pragma pack(push, 2)
+typedef struct
+{
+ WORD Reserved;
+ WORD ResourceType;
+ WORD ImageCount;
+} IconHeader;
+
+typedef struct
+{
+ BYTE Width;
+ BYTE Height;
+ BYTE Colors;
+ BYTE Reserved;
+ WORD Planes;
+ WORD BitsPerPixel;
+ DWORD ImageSize;
+ DWORD ImageOffset;
+} IconDirEntry;
+
+typedef struct
+{
+ BYTE Width;
+ BYTE Height;
+ BYTE Colors;
+ BYTE Reserved;
+ WORD Planes;
+ WORD BitsPerPixel;
+ DWORD ImageSize;
+ WORD ResourceID; // This field is the one difference to above
+} IconResEntry;
+#pragma pack(pop)
+
+namespace {
+ /**
+ * ScopedResourceUpdate is a RAII wrapper for Windows resource updating
+ *
+ * Instances |EndUpdateResourceW()| their handles when they go out of scope.
+ * They pass |TRUE| as the second argument to |EndUpdateResourceW()|, which
+ * causes the resource update to be aborted (changes are discarded).
+ */
+ struct ScopedResourceUpdateTraits
+ {
+ typedef HANDLE type;
+ static type empty() { return nullptr; }
+ static void release(type handle) {
+ if(nullptr != handle) {
+ EndUpdateResourceW(handle, TRUE); // Discard changes
+ }
+ }
+ };
+
+ typedef mozilla::Scoped<ScopedResourceUpdateTraits> ScopedResourceUpdate;
+};
+
+#ifdef __MINGW32__
+extern "C"
+#endif
+int
+wmain(int argc, wchar_t** argv)
+{
+ if (argc != 3) {
+ printf("Usage: redit <exe file> <icon file>\n");
+ return 1;
+ }
+
+ mozilla::ScopedClose file;
+ if (0 != _wsopen_s(&file.rwget(),
+ argv[2],
+ _O_BINARY | _O_RDONLY,
+ _SH_DENYWR,
+ _S_IREAD)
+ || (-1 == file)) {
+ fprintf(stderr, "Unable to open icon file.\n");
+ return 1;
+ }
+
+ // Load all the data from the icon file
+ long filesize = _filelength(file);
+ auto data = MakeUniqueFallible<BYTE[]>(filesize);
+ if(!data) {
+ fprintf(stderr, "Failed to allocate memory for icon file.\n");
+ return 1;
+ }
+ _read(file, data.get(), filesize);
+
+ IconHeader* header = reinterpret_cast<IconHeader*>(data.get());
+
+ // Open the target library for updating
+ ScopedResourceUpdate updateRes(BeginUpdateResourceW(argv[1], FALSE));
+ if (nullptr == updateRes) {
+ fprintf(stderr, "Unable to open library for modification.\n");
+ return 1;
+ }
+
+ // Allocate the group resource entry
+ long groupSize = sizeof(IconHeader)
+ + header->ImageCount * sizeof(IconResEntry);
+ auto group = MakeUniqueFallible<BYTE[]>(groupSize);
+ if(!group) {
+ fprintf(stderr, "Failed to allocate memory for new images.\n");
+ return 1;
+ }
+ memcpy(group.get(), data.get(), sizeof(IconHeader));
+
+ IconDirEntry* sourceIcon =
+ reinterpret_cast<IconDirEntry*>(data.get()
+ + sizeof(IconHeader));
+ IconResEntry* targetIcon =
+ reinterpret_cast<IconResEntry*>(group.get()
+ + sizeof(IconHeader));
+
+ for (int id = 1; id <= header->ImageCount; id++) {
+ // Add the individual icon
+ if (!UpdateResourceW(updateRes, RT_ICON, MAKEINTRESOURCE(id),
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
+ data + sourceIcon->ImageOffset,
+ sourceIcon->ImageSize)) {
+ fprintf(stderr, "Unable to update resource (RT_ICON).\n");
+ return 1;
+ }
+ // Copy the data for this icon
+ // (note that the structs have different sizes)
+ memcpy(targetIcon, sourceIcon, sizeof(IconResEntry));
+ targetIcon->ResourceID = id;
+ sourceIcon++;
+ targetIcon++;
+ }
+
+ if (!UpdateResourceW(updateRes, RT_GROUP_ICON, L"MAINICON",
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL),
+ group, groupSize)) {
+ fprintf(stderr, "Unable to update resource (RT_GROUP_ICON).\n");
+ return 1;
+ }
+
+ // Save the modifications
+ if(!EndUpdateResourceW(updateRes.forget(), FALSE)) {
+ fprintf(stderr, "Unable to write changes to library.\n");
+ return 1;
+ }
+
+ return 0;
+}