From 26f7e0ce36350d309c6b0fbd6261adbe98e93aab Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 30 Nov 2018 10:33:08 -0500 Subject: Issue #890 - Port cpp aboutRedirector to javascript --- .../palemoon/components/BrowserComponents.manifest | 19 +++ .../palemoon/components/about/AboutRedirector.cpp | 184 --------------------- .../palemoon/components/about/AboutRedirector.h | 32 ---- application/palemoon/components/about/moz.build | 19 --- application/palemoon/components/build/moz.build | 1 - .../palemoon/components/build/nsBrowserCompsCID.h | 4 - application/palemoon/components/build/nsModule.cpp | 20 --- application/palemoon/components/moz.build | 5 +- .../palemoon/components/nsAboutRedirector.js | 118 +++++++++++++ 9 files changed, 139 insertions(+), 263 deletions(-) delete mode 100644 application/palemoon/components/about/AboutRedirector.cpp delete mode 100644 application/palemoon/components/about/AboutRedirector.h delete mode 100644 application/palemoon/components/about/moz.build create mode 100644 application/palemoon/components/nsAboutRedirector.js (limited to 'application') diff --git a/application/palemoon/components/BrowserComponents.manifest b/application/palemoon/components/BrowserComponents.manifest index 1e4bff59a..b7f054eab 100644 --- a/application/palemoon/components/BrowserComponents.manifest +++ b/application/palemoon/components/BrowserComponents.manifest @@ -1,3 +1,22 @@ +# nsAboutRedirector.js +component {8cc51368-6aa0-43e8-b762-bde9b9fd828c} nsAboutRedirector.js +# Each entry here should be coupled with an entry in nsAboutRedirector.js +contract @mozilla.org/network/protocol/about;1?what=certerror {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=downloads {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=feeds {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=home {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=newtab {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=palemoon {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=permissions {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=privatebrowsing {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=rights {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=robots {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=sessionrestore {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +#ifdef MOZ_SERVICES_SYNC +contract @mozilla.org/network/protocol/about;1?what=sync-progress {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +contract @mozilla.org/network/protocol/about;1?what=sync-tabs {8cc51368-6aa0-43e8-b762-bde9b9fd828c} +#endif + # nsBrowserContentHandler.js component {5d0ce354-df01-421a-83fb-7ead0990c24e} nsBrowserContentHandler.js application={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} contract @mozilla.org/browser/clh;1 {5d0ce354-df01-421a-83fb-7ead0990c24e} application={8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4} diff --git a/application/palemoon/components/about/AboutRedirector.cpp b/application/palemoon/components/about/AboutRedirector.cpp deleted file mode 100644 index fbcad6094..000000000 --- a/application/palemoon/components/about/AboutRedirector.cpp +++ /dev/null @@ -1,184 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -// See also: docshell/base/nsAboutRedirector.cpp - -#include "AboutRedirector.h" -#include "nsNetUtil.h" -#include "nsIScriptSecurityManager.h" -#include "mozilla/ArrayUtils.h" - -namespace mozilla { -namespace browser { - -NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule) - -struct RedirEntry { - const char* id; - const char* url; - uint32_t flags; -}; - -/* - Entries which do not have URI_SAFE_FOR_UNTRUSTED_CONTENT will run with chrome - privileges. This is potentially dangerous. Please use - URI_SAFE_FOR_UNTRUSTED_CONTENT in the third argument to each map item below - unless your about: page really needs chrome privileges. Security review is - required before adding new map entries without - URI_SAFE_FOR_UNTRUSTED_CONTENT. -*/ -static RedirEntry kRedirMap[] = { - { - "certerror", "chrome://browser/content/certerror/aboutCertError.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT - }, - { - "downloads", "chrome://browser/content/downloads/contentAreaDownloadsView.xul", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "feeds", "chrome://browser/content/feeds/subscribe.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT - }, - { - "home", "chrome://browser/content/abouthome/aboutHome.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::MAKE_LINKABLE | - nsIAboutModule::ALLOW_SCRIPT - }, - { - "newtab", "chrome://browser/content/newtab/newTab.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "palemoon", "chrome://browser/content/palemoon.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::HIDE_FROM_ABOUTABOUT - }, - { - "permissions", "chrome://browser/content/permissions/aboutPermissions.xul", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "privatebrowsing", "chrome://browser/content/aboutPrivateBrowsing.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "rights", "chrome://global/content/aboutRights.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::MAKE_LINKABLE | - nsIAboutModule::ALLOW_SCRIPT - }, - { - "robots", "chrome://browser/content/aboutRobots.xhtml", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | - nsIAboutModule::ALLOW_SCRIPT - }, - { - "sessionrestore", "chrome://browser/content/aboutSessionRestore.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, -#ifdef MOZ_SERVICES_SYNC - { - "sync-progress", "chrome://browser/content/sync/progress.xhtml", - nsIAboutModule::ALLOW_SCRIPT - }, - { - "sync-tabs", "chrome://browser/content/sync/aboutSyncTabs.xul", - nsIAboutModule::ALLOW_SCRIPT - }, -#endif -}; -static const int kRedirTotal = ArrayLength(kRedirMap); - -static nsAutoCString -GetAboutModuleName(nsIURI *aURI) -{ - nsAutoCString path; - aURI->GetPath(path); - - int32_t f = path.FindChar('#'); - if (f >= 0) - path.SetLength(f); - - f = path.FindChar('?'); - if (f >= 0) - path.SetLength(f); - - ToLowerCase(path); - return path; -} - -NS_IMETHODIMP -AboutRedirector::NewChannel(nsIURI* aURI, - nsILoadInfo* aLoadInfo, - nsIChannel** result) -{ - NS_ENSURE_ARG_POINTER(aURI); - NS_ASSERTION(result, "must not be null"); - - nsAutoCString path = GetAboutModuleName(aURI); - - nsresult rv; - nsCOMPtr ioService = do_GetIOService(&rv); - NS_ENSURE_SUCCESS(rv, rv); - - for (int i = 0; i < kRedirTotal; i++) { - if (!strcmp(path.get(), kRedirMap[i].id)) { - nsCOMPtr tempChannel; - nsCOMPtr tempURI; - rv = NS_NewURI(getter_AddRefs(tempURI), - nsDependentCString(kRedirMap[i].url)); - NS_ENSURE_SUCCESS(rv, rv); - rv = NS_NewChannelInternal(getter_AddRefs(tempChannel), - tempURI, - aLoadInfo); - NS_ENSURE_SUCCESS(rv, rv); - - tempChannel->SetOriginalURI(aURI); - - NS_ADDREF(*result = tempChannel); - return rv; - } - } - - return NS_ERROR_ILLEGAL_VALUE; -} - -NS_IMETHODIMP -AboutRedirector::GetURIFlags(nsIURI *aURI, uint32_t *result) -{ - NS_ENSURE_ARG_POINTER(aURI); - - nsAutoCString name = GetAboutModuleName(aURI); - - for (int i = 0; i < kRedirTotal; i++) { - if (name.Equals(kRedirMap[i].id)) { - *result = kRedirMap[i].flags; - return NS_OK; - } - } - - return NS_ERROR_ILLEGAL_VALUE; -} - -nsresult -AboutRedirector::Create(nsISupports *aOuter, REFNSIID aIID, void **result) -{ - AboutRedirector* about = new AboutRedirector(); - if (about == nullptr) - return NS_ERROR_OUT_OF_MEMORY; - NS_ADDREF(about); - nsresult rv = about->QueryInterface(aIID, result); - NS_RELEASE(about); - return rv; -} - -} // namespace browser -} // namespace mozilla diff --git a/application/palemoon/components/about/AboutRedirector.h b/application/palemoon/components/about/AboutRedirector.h deleted file mode 100644 index 8feeb7491..000000000 --- a/application/palemoon/components/about/AboutRedirector.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef AboutRedirector_h__ -#define AboutRedirector_h__ - -#include "nsIAboutModule.h" - -namespace mozilla { -namespace browser { - -class AboutRedirector : public nsIAboutModule -{ -public: - NS_DECL_ISUPPORTS - NS_DECL_NSIABOUTMODULE - - AboutRedirector() {} - - static nsresult - Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); - -protected: - virtual ~AboutRedirector() {} -}; - -} // namespace browser -} // namespace mozilla - -#endif // AboutRedirector_h__ diff --git a/application/palemoon/components/about/moz.build b/application/palemoon/components/about/moz.build deleted file mode 100644 index 95a8451ba..000000000 --- a/application/palemoon/components/about/moz.build +++ /dev/null @@ -1,19 +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/. - -EXPORTS.mozilla.browser += [ - 'AboutRedirector.h', -] - -SOURCES += [ - 'AboutRedirector.cpp', -] - -FINAL_LIBRARY = 'browsercomps' - -LOCAL_INCLUDES += [ - '../build', -] diff --git a/application/palemoon/components/build/moz.build b/application/palemoon/components/build/moz.build index c85723e16..d2b200968 100644 --- a/application/palemoon/components/build/moz.build +++ b/application/palemoon/components/build/moz.build @@ -15,7 +15,6 @@ SOURCES += [ XPCOMBinaryComponent('browsercomps') LOCAL_INCLUDES += [ - '../about', '../dirprovider', '../feeds', '../shell', diff --git a/application/palemoon/components/build/nsBrowserCompsCID.h b/application/palemoon/components/build/nsBrowserCompsCID.h index 23670ae80..bbaa9ab8a 100644 --- a/application/palemoon/components/build/nsBrowserCompsCID.h +++ b/application/palemoon/components/build/nsBrowserCompsCID.h @@ -26,10 +26,6 @@ #define NS_PRIVATE_BROWSING_SERVICE_WRAPPER_CID \ { 0x136e2c4d, 0xc5a4, 0x477c, { 0xb1, 0x31, 0xd9, 0x3d, 0x7d, 0x70, 0x4f, 0x64 } } -// 7e4bb6ad-2fc4-4dc6-89ef-23e8e5ccf980 -#define NS_BROWSER_ABOUT_REDIRECTOR_CID \ -{ 0x7e4bb6ad, 0x2fc4, 0x4dc6, { 0x89, 0xef, 0x23, 0xe8, 0xe5, 0xcc, 0xf9, 0x80 } } - // {6DEB193C-F87D-4078-BC78-5E64655B4D62} #define NS_BROWSERDIRECTORYPROVIDER_CID \ { 0x6deb193c, 0xf87d, 0x4078, { 0xbc, 0x78, 0x5e, 0x64, 0x65, 0x5b, 0x4d, 0x62 } } diff --git a/application/palemoon/components/build/nsModule.cpp b/application/palemoon/components/build/nsModule.cpp index 304280ca9..f98fc08d7 100644 --- a/application/palemoon/components/build/nsModule.cpp +++ b/application/palemoon/components/build/nsModule.cpp @@ -18,8 +18,6 @@ #include "rdf.h" #include "nsFeedSniffer.h" -#include "AboutRedirector.h" -#include "nsIAboutModule.h" #include "nsNetCID.h" @@ -45,7 +43,6 @@ NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID); NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID); #endif NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID); -NS_DEFINE_NAMED_CID(NS_BROWSER_ABOUT_REDIRECTOR_CID); #ifdef XP_MACOSX NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID); #endif @@ -58,7 +55,6 @@ static const mozilla::Module::CIDEntry kBrowserCIDs[] = { { &kNS_SHELLSERVICE_CID, false, nullptr, nsGNOMEShellServiceConstructor }, #endif { &kNS_FEEDSNIFFER_CID, false, nullptr, nsFeedSnifferConstructor }, - { &kNS_BROWSER_ABOUT_REDIRECTOR_CID, false, nullptr, AboutRedirector::Create }, #ifdef XP_MACOSX { &kNS_SHELLSERVICE_CID, false, nullptr, nsMacShellServiceConstructor }, #endif @@ -73,22 +69,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = { { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID }, #endif { NS_FEEDSNIFFER_CONTRACTID, &kNS_FEEDSNIFFER_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "certerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "socialerror", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "feeds", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "privatebrowsing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "rights", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "palemoon", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "robots", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, -#ifdef MOZ_SERVICES_SYNC - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-tabs", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "sync-progress", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, -#endif - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "home", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "newtab", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "permissions", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, - { NS_ABOUT_MODULE_CONTRACTID_PREFIX "downloads", &kNS_BROWSER_ABOUT_REDIRECTOR_CID }, #ifdef XP_MACOSX { NS_SHELLSERVICE_CONTRACTID, &kNS_SHELLSERVICE_CID }, #endif diff --git a/application/palemoon/components/moz.build b/application/palemoon/components/moz.build index 397bf5142..b9df76330 100644 --- a/application/palemoon/components/moz.build +++ b/application/palemoon/components/moz.build @@ -5,7 +5,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. DIRS += [ - 'about', 'certerror', 'dirprovider', 'downloads', @@ -32,9 +31,9 @@ XPIDL_SOURCES += [ XPIDL_MODULE = 'browsercompsbase' -EXTRA_COMPONENTS += [ 'BrowserComponents.manifest' ] - EXTRA_PP_COMPONENTS += [ + 'BrowserComponents.manifest', + 'nsAboutRedirector.js', 'nsBrowserContentHandler.js', 'nsBrowserGlue.js', ] diff --git a/application/palemoon/components/nsAboutRedirector.js b/application/palemoon/components/nsAboutRedirector.js new file mode 100644 index 000000000..9c7d7953f --- /dev/null +++ b/application/palemoon/components/nsAboutRedirector.js @@ -0,0 +1,118 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +var Ci = Components.interfaces; +var Cr = Components.results; +var Cu = Components.utils; + +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); + +// See: netwerk/protocol/about/nsIAboutModule.idl +const URI_SAFE_FOR_UNTRUSTED_CONTENT = Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT; +const ALLOW_SCRIPT = Ci.nsIAboutModule.ALLOW_SCRIPT; +const HIDE_FROM_ABOUTABOUT = Ci.nsIAboutModule.HIDE_FROM_ABOUTABOUT; +const MAKE_LINKABLE = Ci.nsIAboutModule.MAKE_LINKABLE; + +function AboutRedirector() {} +AboutRedirector.prototype = { + classDescription: "Browser about: Redirector", + classID: Components.ID("{8cc51368-6aa0-43e8-b762-bde9b9fd828c}"), + QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]), + + // Each entry in the map has the key as the part after the "about:" and the + // value as a record with url and flags entries. Note that each addition here + // should be coupled with a corresponding addition in BrowserComponents.manifest. + _redirMap: { + "certerror": { + url: "chrome://browser/content/certerror/aboutCertError.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT | HIDE_FROM_ABOUTABOUT) + }, + "downloads": { + url: "chrome://browser/content/downloads/contentAreaDownloadsView.xul", + flags: ALLOW_SCRIPT + }, + "feeds": { + url: "chrome://browser/content/feeds/subscribe.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT | HIDE_FROM_ABOUTABOUT) + }, + "home": { + url: "chrome://browser/content/abouthome/aboutHome.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | MAKE_LINKABLE | ALLOW_SCRIPT) + }, + "newtab": { + url: "chrome://browser/content/newtab/newTab.xhtml", + flags: ALLOW_SCRIPT + }, + "palemoon": { + url: "chrome://browser/content/palemoon.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | HIDE_FROM_ABOUTABOUT) + }, + "permissions": { + url: "chrome://browser/content/permissions/aboutPermissions.xul", + flags: ALLOW_SCRIPT + }, + "privatebrowsing": { + url: "chrome://browser/content/aboutPrivateBrowsing.xhtml", + flags: ALLOW_SCRIPT + }, + "rights": { + url: "chrome://global/content/aboutRights.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | MAKE_LINKABLE | ALLOW_SCRIPT) + }, + "robots": { + url: "chrome://browser/content/aboutRobots.xhtml", + flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT | HIDE_FROM_ABOUTABOUT) + }, + "sessionrestore": { + url: "chrome://browser/content/aboutSessionRestore.xhtml", + flags: ALLOW_SCRIPT + }, +#ifdef MOZ_SERVICES_SYNC + "sync-progress": { + url: "chrome://browser/content/sync/progress.xhtml", + flags: ALLOW_SCRIPT + }, + "sync-tabs": { + url: "chrome://browser/content/sync/aboutSyncTabs.xul", + flags: ALLOW_SCRIPT + }, +#endif + }, + + /** + * Gets the module name from the given URI. + */ + _getModuleName: function AboutRedirector__getModuleName(aURI) { + // Strip out the first ? or #, and anything following it + let name = (/[^?#]+/.exec(aURI.path))[0]; + return name.toLowerCase(); + }, + + getURIFlags: function(aURI) { + let name = this._getModuleName(aURI); + if (!(name in this._redirMap)) + throw Cr.NS_ERROR_ILLEGAL_VALUE; + return this._redirMap[name].flags; + }, + + newChannel: function(aURI, aLoadInfo) { + let name = this._getModuleName(aURI); + if (!(name in this._redirMap)) + throw Cr.NS_ERROR_ILLEGAL_VALUE; + + let newURI = Services.io.newURI(this._redirMap[name].url, null, null); + let channel = Services.io.newChannelFromURIWithLoadInfo(newURI, aLoadInfo); + channel.originalURI = aURI; + + if (this._redirMap[name].flags & Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT) { + let principal = Services.scriptSecurityManager.getNoAppCodebasePrincipal(aURI); + channel.owner = principal; + } + + return channel; + } +}; + +var NSGetFactory = XPCOMUtils.generateNSGetFactory([AboutRedirector]); -- cgit v1.2.3 From 71737d61f75651efc5b9eaf5313a11dc3469bb1d Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 30 Nov 2018 11:02:36 -0500 Subject: Issue #889 - Clean up the Pale Moon tree - Part 1a: Move abouthome to components --- .../palemoon/base/content/abouthome/aboutHome.css | 339 --------------------- .../palemoon/base/content/abouthome/aboutHome.js | 227 -------------- .../base/content/abouthome/aboutHome.xhtml | 60 ---- .../palemoon/base/content/abouthome/addons.png | Bin 1444 -> 0 bytes .../palemoon/base/content/abouthome/addons@2x.png | Bin 3783 -> 0 bytes .../palemoon/base/content/abouthome/bookmarks.png | Bin 1276 -> 0 bytes .../base/content/abouthome/bookmarks@2x.png | Bin 2946 -> 0 bytes .../palemoon/base/content/abouthome/downloads.png | Bin 898 -> 0 bytes .../base/content/abouthome/downloads@2x.png | Bin 2018 -> 0 bytes .../palemoon/base/content/abouthome/history.png | Bin 1654 -> 0 bytes .../palemoon/base/content/abouthome/history@2x.png | Bin 4629 -> 0 bytes .../palemoon/base/content/abouthome/noise.png | Bin 4025 -> 0 bytes .../base/content/abouthome/restore-large.png | Bin 2841 -> 0 bytes .../base/content/abouthome/restore-large@2x.png | Bin 7267 -> 0 bytes .../palemoon/base/content/abouthome/restore.png | Bin 1796 -> 0 bytes .../palemoon/base/content/abouthome/restore@2x.png | Bin 4810 -> 0 bytes .../palemoon/base/content/abouthome/settings.png | Bin 1557 -> 0 bytes .../base/content/abouthome/settings@2x.png | Bin 3836 -> 0 bytes .../palemoon/base/content/abouthome/snippet1.png | Bin 1470 -> 0 bytes .../base/content/abouthome/snippet1@2x.png | Bin 3243 -> 0 bytes .../palemoon/base/content/abouthome/snippet2.png | Bin 3287 -> 0 bytes .../base/content/abouthome/snippet2@2x.png | Bin 11027 -> 0 bytes .../palemoon/base/content/abouthome/sync.png | Bin 1879 -> 0 bytes .../palemoon/base/content/abouthome/sync@2x.png | Bin 4615 -> 0 bytes application/palemoon/base/jar.mn | 24 -- .../palemoon/components/abouthome/aboutHome.css | 339 +++++++++++++++++++++ .../palemoon/components/abouthome/aboutHome.js | 227 ++++++++++++++ .../palemoon/components/abouthome/aboutHome.xhtml | 60 ++++ .../palemoon/components/abouthome/addons.png | Bin 0 -> 1444 bytes .../palemoon/components/abouthome/addons@2x.png | Bin 0 -> 3783 bytes .../palemoon/components/abouthome/bookmarks.png | Bin 0 -> 1276 bytes .../palemoon/components/abouthome/bookmarks@2x.png | Bin 0 -> 2946 bytes .../palemoon/components/abouthome/downloads.png | Bin 0 -> 898 bytes .../palemoon/components/abouthome/downloads@2x.png | Bin 0 -> 2018 bytes .../palemoon/components/abouthome/history.png | Bin 0 -> 1654 bytes .../palemoon/components/abouthome/history@2x.png | Bin 0 -> 4629 bytes application/palemoon/components/abouthome/jar.mn | 29 ++ .../palemoon/components/abouthome/moz.build | 8 + .../palemoon/components/abouthome/noise.png | Bin 0 -> 4025 bytes .../components/abouthome/restore-large.png | Bin 0 -> 2841 bytes .../components/abouthome/restore-large@2x.png | Bin 0 -> 7267 bytes .../palemoon/components/abouthome/restore.png | Bin 0 -> 1796 bytes .../palemoon/components/abouthome/restore@2x.png | Bin 0 -> 4810 bytes .../palemoon/components/abouthome/settings.png | Bin 0 -> 1557 bytes .../palemoon/components/abouthome/settings@2x.png | Bin 0 -> 3836 bytes .../palemoon/components/abouthome/snippet1.png | Bin 0 -> 1470 bytes .../palemoon/components/abouthome/snippet1@2x.png | Bin 0 -> 3243 bytes .../palemoon/components/abouthome/snippet2.png | Bin 0 -> 3287 bytes .../palemoon/components/abouthome/snippet2@2x.png | Bin 0 -> 11027 bytes application/palemoon/components/abouthome/sync.png | Bin 0 -> 1879 bytes .../palemoon/components/abouthome/sync@2x.png | Bin 0 -> 4615 bytes application/palemoon/components/moz.build | 1 + 52 files changed, 664 insertions(+), 650 deletions(-) delete mode 100644 application/palemoon/base/content/abouthome/aboutHome.css delete mode 100644 application/palemoon/base/content/abouthome/aboutHome.js delete mode 100644 application/palemoon/base/content/abouthome/aboutHome.xhtml delete mode 100644 application/palemoon/base/content/abouthome/addons.png delete mode 100644 application/palemoon/base/content/abouthome/addons@2x.png delete mode 100644 application/palemoon/base/content/abouthome/bookmarks.png delete mode 100644 application/palemoon/base/content/abouthome/bookmarks@2x.png delete mode 100644 application/palemoon/base/content/abouthome/downloads.png delete mode 100644 application/palemoon/base/content/abouthome/downloads@2x.png delete mode 100644 application/palemoon/base/content/abouthome/history.png delete mode 100644 application/palemoon/base/content/abouthome/history@2x.png delete mode 100644 application/palemoon/base/content/abouthome/noise.png delete mode 100644 application/palemoon/base/content/abouthome/restore-large.png delete mode 100644 application/palemoon/base/content/abouthome/restore-large@2x.png delete mode 100644 application/palemoon/base/content/abouthome/restore.png delete mode 100644 application/palemoon/base/content/abouthome/restore@2x.png delete mode 100644 application/palemoon/base/content/abouthome/settings.png delete mode 100644 application/palemoon/base/content/abouthome/settings@2x.png delete mode 100644 application/palemoon/base/content/abouthome/snippet1.png delete mode 100644 application/palemoon/base/content/abouthome/snippet1@2x.png delete mode 100644 application/palemoon/base/content/abouthome/snippet2.png delete mode 100644 application/palemoon/base/content/abouthome/snippet2@2x.png delete mode 100644 application/palemoon/base/content/abouthome/sync.png delete mode 100644 application/palemoon/base/content/abouthome/sync@2x.png create mode 100644 application/palemoon/components/abouthome/aboutHome.css create mode 100644 application/palemoon/components/abouthome/aboutHome.js create mode 100644 application/palemoon/components/abouthome/aboutHome.xhtml create mode 100644 application/palemoon/components/abouthome/addons.png create mode 100644 application/palemoon/components/abouthome/addons@2x.png create mode 100644 application/palemoon/components/abouthome/bookmarks.png create mode 100644 application/palemoon/components/abouthome/bookmarks@2x.png create mode 100644 application/palemoon/components/abouthome/downloads.png create mode 100644 application/palemoon/components/abouthome/downloads@2x.png create mode 100644 application/palemoon/components/abouthome/history.png create mode 100644 application/palemoon/components/abouthome/history@2x.png create mode 100644 application/palemoon/components/abouthome/jar.mn create mode 100644 application/palemoon/components/abouthome/moz.build create mode 100644 application/palemoon/components/abouthome/noise.png create mode 100644 application/palemoon/components/abouthome/restore-large.png create mode 100644 application/palemoon/components/abouthome/restore-large@2x.png create mode 100644 application/palemoon/components/abouthome/restore.png create mode 100644 application/palemoon/components/abouthome/restore@2x.png create mode 100644 application/palemoon/components/abouthome/settings.png create mode 100644 application/palemoon/components/abouthome/settings@2x.png create mode 100644 application/palemoon/components/abouthome/snippet1.png create mode 100644 application/palemoon/components/abouthome/snippet1@2x.png create mode 100644 application/palemoon/components/abouthome/snippet2.png create mode 100644 application/palemoon/components/abouthome/snippet2@2x.png create mode 100644 application/palemoon/components/abouthome/sync.png create mode 100644 application/palemoon/components/abouthome/sync@2x.png (limited to 'application') diff --git a/application/palemoon/base/content/abouthome/aboutHome.css b/application/palemoon/base/content/abouthome/aboutHome.css deleted file mode 100644 index 73c686202..000000000 --- a/application/palemoon/base/content/abouthome/aboutHome.css +++ /dev/null @@ -1,339 +0,0 @@ -%if 0 -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -%endif - -html { - font: message-box; - font-size: 100%; - background-color: hsl(0,0%,90%); - color: #000; - height: 100%; -} - -body { - margin: 0; - display: -moz-box; - -moz-box-orient: vertical; - width: 100%; - height: 100%; - background-image: url(chrome://browser/content/abouthome/noise.png), - linear-gradient(hsla(0,0%,100%,.7), hsla(0,0%,100%,.4)); -} - -input, -button { - font-size: inherit; - font-family: inherit; -} - -a { - color: -moz-nativehyperlinktext; - text-decoration: none; -} - -.spacer { - -moz-box-flex: 1; -} - -#topSection { - text-align: center; -} - -#brandLogo { - height: 192px; - width: 192px; - margin: 22px auto 31px; - background-image: url("chrome://branding/content/about-logo.png"); - background-size: 192px auto; - background-position: center center; - background-repeat: no-repeat; -} - -#searchForm { - width: 470px; -} - -#searchForm { - display: -moz-box; -} - -#searchLogoContainer { - display: -moz-box; - -moz-box-align: center; - padding-top: 2px; - -moz-padding-end: 8px; -} - -#searchLogoContainer[hidden] { - display: none; -} - -#searchEngineLogo { - display: inline-block; - height: 28px; - width: 70px; - min-width: 70px; -} - -#searchText { - -moz-box-flex: 1; - padding: 6px 8px; - background: hsla(0,0%,100%,.9) padding-box; - border: 1px solid; - border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2); - box-shadow: 0 1px 0 hsla(210,65%,9%,.02) inset, - 0 0 2px hsla(210,65%,9%,.1) inset, - 0 1px 0 hsla(0,0%,100%,.2); - border-radius: 2.5px 0 0 2.5px; -} - -#searchText:-moz-dir(rtl) { - border-radius: 0 2.5px 2.5px 0; -} - -#searchText:focus, -#searchText[autofocus] { - border-color: hsla(206,100%,60%,.6) hsla(206,76%,52%,.6) hsla(204,100%,40%,.6); -} - -#searchSubmit { - -moz-margin-start: -1px; - background: linear-gradient(hsla(0,0%,100%,.8), hsla(0,0%,100%,.1)) padding-box; - padding: 0 9px; - border: 1px solid; - border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2); - -moz-border-start: 1px solid transparent; - border-radius: 0 2.5px 2.5px 0; - box-shadow: 0 0 2px hsla(0,0%,100%,.5) inset, - 0 1px 0 hsla(0,0%,100%,.2); - cursor: pointer; - transition-property: background-color, border-color, box-shadow; - transition-duration: 150ms; -} - -#searchSubmit:-moz-dir(rtl) { - border-radius: 2.5px 0 0 2.5px; -} - -#searchText:focus + #searchSubmit, -#searchText + #searchSubmit:hover, -#searchText[autofocus] + #searchSubmit { - border-color: #59b5fc #45a3e7 #3294d5; - color: white; -} - -#searchText:focus + #searchSubmit, -#searchText[autofocus] + #searchSubmit { - background-image: linear-gradient(#4cb1ff, #1793e5); - box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset, - 0 0 0 1px hsla(0,0%,100%,.1) inset, - 0 1px 0 hsla(210,54%,20%,.03); -} - -#searchText + #searchSubmit:hover { - background-image: linear-gradient(#66bdff, #0d9eff); - box-shadow: 0 1px 0 hsla(0,0%,100%,.2) inset, - 0 0 0 1px hsla(0,0%,100%,.1) inset, - 0 1px 0 hsla(210,54%,20%,.03), - 0 0 4px hsla(206,100%,20%,.2); -} - -#searchText + #searchSubmit:hover:active { - box-shadow: 0 1px 1px hsla(211,79%,6%,.1) inset, - 0 0 1px hsla(211,79%,6%,.2) inset; - transition-duration: 0ms; -} - -#launcher { - display: -moz-box; - -moz-box-align: center; - -moz-box-pack: center; - width: 100%; - background-color: hsla(0,0%,0%,.03); - border-top: 1px solid hsla(0,0%,0%,.03); - box-shadow: 0 1px 2px hsla(0,0%,0%,.02) inset, - 0 -1px 0 hsla(0,0%,100%,.25); -} - -#launcher:not([session]), -body[narrow] #launcher[session] { - display: block; /* display separator and restore button on separate lines */ - text-align: center; - white-space: nowrap; /* prevent navigational buttons from wrapping */ -} - -.launchButton { - display: -moz-box; - -moz-box-orient: vertical; - margin: 16px 1px; - padding: 14px 6px; - min-width: 88px; - max-width: 176px; - max-height: 85px; - vertical-align: top; - white-space: normal; - background: transparent padding-box; - border: 1px solid transparent; - border-radius: 2.5px; - color: #525c66; - font-size: 75%; - cursor: pointer; - transition-property: background-color, border-color, box-shadow; - transition-duration: 150ms; -} - -body[narrow] #launcher[session] > .launchButton { - margin: 4px 1px; -} - -.launchButton:hover { - background-color: hsla(211,79%,6%,.03); - border-color: hsla(210,54%,20%,.15) hsla(210,54%,20%,.17) hsla(210,54%,20%,.2); -} - -.launchButton:hover:active { - background-image: linear-gradient(hsla(211,79%,6%,.02), hsla(211,79%,6%,.05)); - border-color: hsla(210,54%,20%,.2) hsla(210,54%,20%,.23) hsla(210,54%,20%,.25); - box-shadow: 0 1px 1px hsla(211,79%,6%,.05) inset, - 0 0 1px hsla(211,79%,6%,.1) inset; - transition-duration: 0ms; -} - -.launchButton[hidden], -#launcher:not([session]) > #restorePreviousSessionSeparator, -#launcher:not([session]) > #restorePreviousSession { - display: none; -} - -#restorePreviousSessionSeparator { - width: 3px; - height: 116px; - margin: 0 10px; - background-image: linear-gradient(hsla(0,0%,100%,0), hsla(0,0%,100%,.35), hsla(0,0%,100%,0)), - linear-gradient(hsla(211,79%,6%,0), hsla(211,79%,6%,.2), hsla(211,79%,6%,0)), - linear-gradient(hsla(0,0%,100%,0), hsla(0,0%,100%,.35), hsla(0,0%,100%,0)); - background-position: left top, center, right bottom; - background-size: 1px auto; - background-repeat: no-repeat; -} - -body[narrow] #restorePreviousSessionSeparator { - margin: 0 auto; - width: 512px; - height: 3px; - background-image: linear-gradient(to right, hsla(0,0%,100%,0), hsla(0,0%,100%,.35), hsla(0,0%,100%,0)), - linear-gradient(to right, hsla(211,79%,6%,0), hsla(211,79%,6%,.2), hsla(211,79%,6%,0)), - linear-gradient(to right, hsla(0,0%,100%,0), hsla(0,0%,100%,.35), hsla(0,0%,100%,0)); - background-size: auto 1px; -} - -#restorePreviousSession { - max-width: none; - font-size: 90%; -} - -body[narrow] #restorePreviousSession { - font-size: 80%; -} - -.launchButton::before { - display: block; - width: 32px; - height: 32px; - margin: 0 auto 6px; - line-height: 0; /* remove extra vertical space due to non-zero font-size */ -} - -#downloads::before { - content: url("chrome://browser/content/abouthome/downloads.png"); -} - -#bookmarks::before { - content: url("chrome://browser/content/abouthome/bookmarks.png"); -} - -#history::before { - content: url("chrome://browser/content/abouthome/history.png"); -} - -#addons::before { - content: url("chrome://browser/content/abouthome/addons.png"); -} - -#sync::before { - content: url("chrome://browser/content/abouthome/sync.png"); -} - -#settings::before { - content: url("chrome://browser/content/abouthome/settings.png"); -} - -#restorePreviousSession::before { - content: url("chrome://browser/content/abouthome/restore-large.png"); - height: 48px; - width: 48px; - display: inline-block; /* display on same line as text label */ - vertical-align: middle; - margin-bottom: 0; - -moz-margin-end: 8px; -} - -#restorePreviousSession:-moz-dir(rtl)::before { - transform: scaleX(-1); -} - -body[narrow] #restorePreviousSession::before { - content: url("chrome://browser/content/abouthome/restore.png"); - height: 32px; - width: 32px; -} - -/* [HiDPI] - * At resolutions above 1dppx, prefer downscaling the 2x Retina graphics - * rather than upscaling the original-size ones (bug 818940). - */ -@media not all and (max-resolution: 1dppx) { - #brandLogo { - background-image: url("chrome://branding/content/about-logo@2x.png"); - } - - .launchButton::before { - transform: scale(.5); - transform-origin: 0 0; - } - - #downloads::before { - content: url("chrome://browser/content/abouthome/downloads@2x.png"); - } - - #bookmarks::before { - content: url("chrome://browser/content/abouthome/bookmarks@2x.png"); - } - - #history::before { - content: url("chrome://browser/content/abouthome/history@2x.png"); - } - - #addons::before { - content: url("chrome://browser/content/abouthome/addons@2x.png"); - } - - #sync::before { - content: url("chrome://browser/content/abouthome/sync@2x.png"); - } - - #settings::before { - content: url("chrome://browser/content/abouthome/settings@2x.png"); - } - - #restorePreviousSession::before { - content: url("chrome://browser/content/abouthome/restore-large@2x.png"); - } - - body[narrow] #restorePreviousSession::before { - content: url("chrome://browser/content/abouthome/restore@2x.png"); - } -} - diff --git a/application/palemoon/base/content/abouthome/aboutHome.js b/application/palemoon/base/content/abouthome/aboutHome.js deleted file mode 100644 index 6ff8eee98..000000000 --- a/application/palemoon/base/content/abouthome/aboutHome.js +++ /dev/null @@ -1,227 +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 SEARCH_ENGINES = { - "DuckDuckGo": { - image: "data:image/png;base64," + - "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" + - "Ay+rC96f9fzYPqsX11mF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f2b" + - "P7Hp/+7RlZed7/rpdqM4ts+5lz5be+2txyHS/hm62Lkg39x05AenfOWejoVv9hdUkIBWTzzHqznv" + - "YumYN1fX//JnJvXBItNy7k8lftpgZm28iRVJZXM2yoiKcXx3yERqi3qxvaY/Pcqyb09kc0WQRf3i" + - "lKY8Rq5IYBF1wnFKDxtva6ZcaHONTdRffZF0Ll/iYsAEI/m6a29/qPq0b56/LZbPVjAFNpMeuvrK" + - "i2/f+ODdY9TmHXwI1dT6vSedpz3GHyvJhfN1VUMSjhljFrb/UuLBfeRzPY+hX7w/O2PzORYePYbk" + - "orcQFRXXJVBdo+Vjj7QVx5+MuAHZcPdt2vTsYw54gkKopq55yN2/vano4M/dBmQBPqvBFKiWtc56" + - "4YJlF3x3Unb96nIEUKOR2sG28usnafmErxOoHUwwGkLEiCDCNgg70paXnmPNjVdr0fCRWjJmLOEB" + - "daRXraDxj7+j9dUXjc2kBFTEuH7VSWfOrbvqpkvc0rI/Awrw2Q+mwPgdHaPX3X3rj9dNvfEom0kF" + - "VAEVdYvLtGjoAVo85ggtGf05CfcbqMGqKjGhMB9pRwEBUN/Ha23R9OrlZFatlMRrL2v73NclXb/C" + - "qJ8XMQCyJaZD1g687hdTi0aMvh+Rlv/AL9gq0Hw+3PbWnMPX3n7jlLY5s8baXDYEgIIiagIh3NIe" + - "Gqqq1EBVb9zyCtxoXDFGbT5n/PaE5ho2mtzmjeSbW/A720R9X8SwTbimf33Pb5zxUO9vTv5VoKKq" + - "/r/gK/wKbDYTTi1eNHTzH393SvPzT0/IrF5Zp2KNCFtpF8cqBba/ndVEYqmKCcfP6Xn8xEeLRx78" + - "rFtS2oCIAvx3BVMgms/H8q3N+zc9/cTYphlPf/6vIWU3ru+jnufySUTULSpujwzca9mWPcy8skMP" + - "e6Xkc4fODlb32iyOk6cb/T/N+faHj8AX2gAAAABJRU5ErkJggg==" - } -}; - -// This global tracks if the page has been set up before, to prevent double inits -var gInitialized = false; -var gObserver = new MutationObserver(function (mutations) { - for (let mutation of mutations) { - if (mutation.attributeName == "searchEngineURL") { - setupSearchEngine(); - if (!gInitialized) { - gInitialized = true; - } - return; - } - } -}); - -window.addEventListener("pageshow", function () { - // Delay search engine setup, cause browser.js::BrowserOnAboutPageLoad runs - // later and may use asynchronous getters. - window.gObserver.observe(document.documentElement, { attributes: true }); - fitToWidth(); - window.addEventListener("resize", fitToWidth); -}); - -window.addEventListener("pagehide", function() { - window.gObserver.disconnect(); - window.removeEventListener("resize", fitToWidth); -}); - -function onSearchSubmit(aEvent) -{ - let searchTerms = document.getElementById("searchText").value; - let searchURL = document.documentElement.getAttribute("searchEngineURL"); - - if (searchURL && searchTerms.length > 0) { - // Send an event that a search was performed. This was originally - // added so Firefox Health Report could record that a search from - // about:home had occurred. - let engineName = document.documentElement.getAttribute("searchEngineName"); - let event = new CustomEvent("AboutHomeSearchEvent", {detail: engineName}); - document.dispatchEvent(event); - - const SEARCH_TOKEN = "_searchTerms_"; - let searchPostData = document.documentElement.getAttribute("searchEnginePostData"); - if (searchPostData) { - // Check if a post form already exists. If so, remove it. - const POST_FORM_NAME = "searchFormPost"; - let form = document.forms[POST_FORM_NAME]; - if (form) { - form.parentNode.removeChild(form); - } - - // Create a new post form. - form = document.body.appendChild(document.createElement("form")); - form.setAttribute("name", POST_FORM_NAME); - // Set the URL to submit the form to. - form.setAttribute("action", searchURL.replace(SEARCH_TOKEN, searchTerms)); - form.setAttribute("method", "post"); - - // Create new elements for search param. - searchPostData = searchPostData.split("&"); - for (let postVar of searchPostData) { - let [name, value] = postVar.split("="); - if (value == SEARCH_TOKEN) { - value = searchTerms; - } - let input = document.createElement("input"); - input.setAttribute("type", "hidden"); - input.setAttribute("name", name); - input.setAttribute("value", value); - form.appendChild(input); - } - // Submit the form. - form.submit(); - } else { - searchURL = searchURL.replace(SEARCH_TOKEN, encodeURIComponent(searchTerms)); - window.location.href = searchURL; - } - } - - aEvent.preventDefault(); -} - - -function setupSearchEngine() -{ - // The "autofocus" attribute doesn't focus the form element - // immediately when the element is first drawn, so the - // attribute is also used for styling when the page first loads. - let searchText = document.getElementById("searchText"); - searchText.addEventListener("blur", function searchText_onBlur() { - searchText.removeEventListener("blur", searchText_onBlur); - searchText.removeAttribute("autofocus"); - }); - - let searchEngineName = document.documentElement.getAttribute("searchEngineName"); - let searchEngineInfo = SEARCH_ENGINES[searchEngineName]; - let logoElt = document.getElementById("searchEngineLogo"); - - // Add search engine logo. - if (searchEngineInfo && searchEngineInfo.image) { - logoElt.parentNode.hidden = false; - logoElt.src = searchEngineInfo.image; - logoElt.alt = searchEngineName; - searchText.placeholder = ""; - } - else { - logoElt.parentNode.hidden = true; - searchText.placeholder = searchEngineName; - } - -} - -function fitToWidth() { - if (window.scrollMaxX) { - document.body.setAttribute("narrow", "true"); - } else if (document.body.hasAttribute("narrow")) { - document.body.removeAttribute("narrow"); - fitToWidth(); - } -} diff --git a/application/palemoon/base/content/abouthome/aboutHome.xhtml b/application/palemoon/base/content/abouthome/aboutHome.xhtml deleted file mode 100644 index cb3fa634a..000000000 --- a/application/palemoon/base/content/abouthome/aboutHome.xhtml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - %htmlDTD; - - %globalDTD; - - %aboutHomeDTD; - - %browserDTD; -]> - - - - &abouthome.pageTitle; - - - - -