From 3cf6d2b2d73b3b09fb268a2b3927d920883745fb Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Wed, 4 Apr 2018 03:17:39 -0400 Subject: Sync Pale Moon code --- application/palemoon/app/blocklist.xml | 14 +++++- .../palemoon/app/macbuild/Contents/Info.plist.in | 5 ++ application/palemoon/base/content/browser.js | 54 +++++++++++++++++++++ application/palemoon/base/content/browser.xul | 2 +- application/palemoon/base/content/content.js | 6 ++- application/palemoon/base/content/tabbrowser.xml | 13 ++++- .../palemoon/branding/shared/pref/uaoverrides.inc | 2 +- application/palemoon/components/nsBrowserGlue.js | 4 +- .../components/sessionstore/nsSessionStartup.js | 11 +++-- application/palemoon/fonts/EmojiOneMozilla.ttf | Bin 1227260 -> 0 bytes application/palemoon/fonts/README.txt | 8 +-- application/palemoon/fonts/TwemojiMozilla.ttf | Bin 0 -> 1075912 bytes application/palemoon/fonts/moz.build | 2 +- .../locales/en-US/chrome/browser/browser.dtd | 1 - .../en-US/chrome/browser/browser.properties | 2 + 15 files changed, 108 insertions(+), 16 deletions(-) delete mode 100644 application/palemoon/fonts/EmojiOneMozilla.ttf create mode 100644 application/palemoon/fonts/TwemojiMozilla.ttf (limited to 'application/palemoon') 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 @@ - @@ -2441,6 +2441,18 @@ xmlns="http://www.mozilla.org/2006/addons-blocklist"> + + + + + + + + + + + + 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 @@ LSApplicationCategoryType public.app-category.productivity + LSEnvironment + + MallocNanoZone + 0 + LSMinimumSystemVersion 10.6 LSMinimumSystemVersionByArchitecture diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index 34b91b6cb..5a832c077 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -336,6 +336,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. @@ -968,6 +1010,11 @@ 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(); @@ -1313,6 +1360,13 @@ var gBrowserInit = { Services.obs.removeObserver(gXPInstallObserver, "addon-install-complete"); 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) { diff --git a/application/palemoon/base/content/browser.xul b/application/palemoon/base/content/browser.xul index f83010023..3044ce675 100644 --- a/application/palemoon/base/content/browser.xul +++ b/application/palemoon/base/content/browser.xul @@ -410,7 +410,7 @@ @@ -3022,6 +3032,7 @@ this._outerWindowIDBrowserMap.set(this.mCurrentBrowser.outerWindowID, this.mCurrentBrowser); } + messageManager.addMessageListener("DOMWebNotificationClicked", this); ]]> 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/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index 705593b59..8fc24c7d3 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -1213,7 +1213,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 +1395,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/sessionstore/nsSessionStartup.js b/application/palemoon/components/sessionstore/nsSessionStartup.js index 024246619..7f07e9050 100644 --- a/application/palemoon/components/sessionstore/nsSessionStartup.js +++ b/application/palemoon/components/sessionstore/nsSessionStartup.js @@ -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/fonts/EmojiOneMozilla.ttf b/application/palemoon/fonts/EmojiOneMozilla.ttf deleted file mode 100644 index 50356509d..000000000 Binary files a/application/palemoon/fonts/EmojiOneMozilla.ttf and /dev/null 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 Binary files /dev/null and b/application/palemoon/fonts/TwemojiMozilla.ttf differ diff --git a/application/palemoon/fonts/moz.build b/application/palemoon/fonts/moz.build index 93d07120b..314d41bd0 100644 --- a/application/palemoon/fonts/moz.build +++ b/application/palemoon/fonts/moz.build @@ -7,5 +7,5 @@ if CONFIG['OS_ARCH'] in ('WINNT'): DIST_SUBDIR = '' FINAL_TARGET_FILES.fonts += [ - 'EmojiOneMozilla.ttf' + 'TwemojiMozilla.ttf' ] diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.dtd b/application/palemoon/locales/en-US/chrome/browser/browser.dtd index fe5f64854..0225f422b 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. -- - diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.properties b/application/palemoon/locales/en-US/chrome/browser/browser.properties index 5f75502ed..8b3fea4d5 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 -- cgit v1.2.3