зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1077874 - Only expose Major version of Firefox in SafeBrowsing. r=francois
This commit is contained in:
Родитель
3df261e948
Коммит
6651828e8c
|
@ -4999,8 +4999,8 @@ pref("browser.safebrowsing.downloads.remote.block_uncommon", true);
|
|||
pref("browser.safebrowsing.debug", false);
|
||||
|
||||
pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar");
|
||||
pref("browser.safebrowsing.provider.google.updateURL", "https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2&key=%GOOGLE_API_KEY%");
|
||||
pref("browser.safebrowsing.provider.google.gethashURL", "https://safebrowsing.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
|
||||
pref("browser.safebrowsing.provider.google.updateURL", "https://safebrowsing.google.com/safebrowsing/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2&key=%GOOGLE_API_KEY%");
|
||||
pref("browser.safebrowsing.provider.google.gethashURL", "https://safebrowsing.google.com/safebrowsing/gethash?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2");
|
||||
pref("browser.safebrowsing.provider.google.reportURL", "https://safebrowsing.google.com/safebrowsing/diagnostic?client=%NAME%&hl=%LOCALE%&site=");
|
||||
|
||||
pref("browser.safebrowsing.reportPhishMistakeURL", "https://%LOCALE%.phish-error.mozilla.com/?hl=%LOCALE%&url=");
|
||||
|
@ -5016,8 +5016,8 @@ pref("browser.safebrowsing.blockedURIs.enabled", false);
|
|||
pref("urlclassifier.blockedTable", "test-block-simple,mozplugin-block-digest256");
|
||||
|
||||
pref("browser.safebrowsing.provider.mozilla.lists", "mozstd-track-digest256,mozstd-trackwhite-digest256,mozfull-track-digest256,mozplugin-block-digest256,mozplugin2-block-digest256");
|
||||
pref("browser.safebrowsing.provider.mozilla.updateURL", "https://shavar.services.mozilla.com/downloads?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
|
||||
pref("browser.safebrowsing.provider.mozilla.gethashURL", "https://shavar.services.mozilla.com/gethash?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
|
||||
pref("browser.safebrowsing.provider.mozilla.updateURL", "https://shavar.services.mozilla.com/downloads?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2");
|
||||
pref("browser.safebrowsing.provider.mozilla.gethashURL", "https://shavar.services.mozilla.com/gethash?client=SAFEBROWSING_ID&appver=%MAJOR_VERSION%&pver=2.2");
|
||||
// Set to a date in the past to force immediate download in new profiles.
|
||||
pref("browser.safebrowsing.provider.mozilla.nextupdatetime", "1");
|
||||
// Block lists for tracking protection. The name values will be used as the keys
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
Cu.import("resource://testing-common/AppInfo.jsm", this);
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
function updateVersion(version) {
|
||||
updateAppInfo({ version });
|
||||
}
|
||||
|
||||
add_test(function test_provider_url() {
|
||||
let urls = [
|
||||
"browser.safebrowsing.provider.google.updateURL",
|
||||
"browser.safebrowsing.provider.google.gethashURL",
|
||||
"browser.safebrowsing.provider.mozilla.updateURL",
|
||||
"browser.safebrowsing.provider.mozilla.gethashURL"
|
||||
];
|
||||
|
||||
let versions = [
|
||||
"49.0",
|
||||
"49.0.1",
|
||||
"49.0a1",
|
||||
"49.0b1",
|
||||
"49.0esr",
|
||||
"49.0.1esr"
|
||||
];
|
||||
|
||||
for (let version of versions) {
|
||||
for (let url of urls) {
|
||||
updateVersion(version);
|
||||
let value = Services.urlFormatter.formatURLPref(url);
|
||||
Assert.notEqual(value.indexOf("&appver=49.0&"), -1);
|
||||
}
|
||||
}
|
||||
|
||||
run_next_test();
|
||||
});
|
|
@ -14,5 +14,6 @@ support-files =
|
|||
#skip-if = os == "mac" || os == "linux"
|
||||
[test_partial.js]
|
||||
[test_prefixset.js]
|
||||
[test_provider_url.js]
|
||||
[test_streamupdater.js]
|
||||
[test_digest256.js]
|
||||
|
|
|
@ -104,6 +104,7 @@ nsURLFormatterService.prototype = {
|
|||
NAME: function() { return this.appInfo.name; },
|
||||
ID: function() { return this.appInfo.ID; },
|
||||
VERSION: function() { return this.appInfo.version; },
|
||||
MAJOR_VERSION: function() { return this.appInfo.version.replace(/^([^\.]+\.[0-9]+[a-z]*).*/gi, "$1"); },
|
||||
APPBUILDID: function() { return this.appInfo.appBuildID; },
|
||||
PLATFORMVERSION: function() { return this.appInfo.platformVersion; },
|
||||
PLATFORMBUILDID: function() { return this.appInfo.platformBuildID; },
|
||||
|
|
Загрузка…
Ссылка в новой задаче