mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-01-15 09:30:20 +00:00
#619: M1258041 M1285428 M1274685 (thanks @OlgaTPark)
This commit is contained in:
parent
af9a8236e8
commit
c2d4942155
@ -3,7 +3,8 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
const TEST_LIST = "test-track-simple";
|
||||
const BASE_LIST_ID = "base";
|
||||
const CONTENT_LIST_ID = "content";
|
||||
const TRACK_SUFFIX = "-track-digest256";
|
||||
const TRACKING_TABLE_PREF = "urlclassifier.trackingTable";
|
||||
const LISTS_PREF_BRANCH = "browser.safebrowsing.provider.mozilla.lists.";
|
||||
@ -132,7 +133,12 @@ var gBlocklistManager = {
|
||||
shouldProceed = !cancelQuit.data;
|
||||
|
||||
if (shouldProceed) {
|
||||
let trackingTable = TEST_LIST + "," + selected.id + TRACK_SUFFIX;
|
||||
let trackingTable = Services.prefs.getCharPref(TRACKING_TABLE_PREF);
|
||||
if (selected.id != CONTENT_LIST_ID) {
|
||||
trackingTable = trackingTable.replace("," + CONTENT_LIST_ID + TRACK_SUFFIX, "");
|
||||
} else {
|
||||
trackingTable += "," + CONTENT_LIST_ID + TRACK_SUFFIX;
|
||||
}
|
||||
Services.prefs.setCharPref(TRACKING_TABLE_PREF, trackingTable);
|
||||
Services.prefs.setCharPref(UPDATE_TIME_PREF, 42);
|
||||
|
||||
@ -193,11 +199,8 @@ var gBlocklistManager = {
|
||||
},
|
||||
|
||||
_getActiveList: function () {
|
||||
let activeList = Services.prefs.getCharPref(TRACKING_TABLE_PREF);
|
||||
activeList = activeList.replace(TEST_LIST, "");
|
||||
activeList = activeList.replace(",", "");
|
||||
activeList = activeList.replace(TRACK_SUFFIX, "");
|
||||
return activeList.trim();
|
||||
let trackingTable = Services.prefs.getCharPref(TRACKING_TABLE_PREF);
|
||||
return trackingTable.includes(CONTENT_LIST_ID) ? CONTENT_LIST_ID : BASE_LIST_ID;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -4847,28 +4847,28 @@ pref("urlclassifier.malwareTable", "goog-malware-shavar,goog-unwanted-shavar,tes
|
||||
pref("urlclassifier.phishTable", "goog-phish-shavar,test-phish-simple");
|
||||
pref("urlclassifier.downloadBlockTable", "");
|
||||
pref("urlclassifier.downloadAllowTable", "");
|
||||
pref("urlclassifier.disallow_completions", "test-malware-simple,test-phish-simple,test-unwanted-simple,test-track-simple,test-trackwhite-simple,test-forbid-simple,goog-downloadwhite-digest256,mozstd-track-digest256,mozstd-trackwhite-digest256,mozfull-track-digest256");
|
||||
pref("urlclassifier.disallow_completions", "test-malware-simple,test-phish-simple,test-unwanted-simple,test-track-simple,test-trackwhite-simple,test-block-simple,goog-downloadwhite-digest256,base-track-digest256,mozstd-trackwhite-digest256,content-track-digest256,mozplugin-block-digest256,mozplugin2-block-digest256");
|
||||
|
||||
// The table and update/gethash URLs for Safebrowsing phishing and malware
|
||||
// checks.
|
||||
pref("urlclassifier.trackingTable", "test-track-simple,mozstd-track-digest256");
|
||||
pref("urlclassifier.trackingTable", "test-track-simple,base-track-digest256");
|
||||
pref("urlclassifier.trackingWhitelistTable", "test-trackwhite-simple,mozstd-trackwhite-digest256");
|
||||
|
||||
// The table and global pref for blocking access to sites forbidden by policy
|
||||
pref("browser.safebrowsing.forbiddenURIs.enabled", false);
|
||||
pref("urlclassifier.forbiddenTable", "test-forbid-simple");
|
||||
|
||||
pref("browser.safebrowsing.provider.mozilla.lists", "mozstd-track-digest256,mozstd-trackwhite-digest256,mozfull-track-digest256");
|
||||
pref("browser.safebrowsing.provider.mozilla.lists", "base-track-digest256,mozstd-trackwhite-digest256,content-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");
|
||||
// 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
|
||||
// to lookup the localized name in preferences.properties.
|
||||
pref("browser.safebrowsing.provider.mozilla.lists.mozstd.name", "mozstdName");
|
||||
pref("browser.safebrowsing.provider.mozilla.lists.mozstd.description", "mozstdDesc");
|
||||
pref("browser.safebrowsing.provider.mozilla.lists.mozfull.name", "mozfullName");
|
||||
pref("browser.safebrowsing.provider.mozilla.lists.mozfull.description", "mozfullDesc");
|
||||
pref("browser.safebrowsing.provider.mozilla.lists.base.name", "mozstdName");
|
||||
pref("browser.safebrowsing.provider.mozilla.lists.base.description", "mozstdDesc");
|
||||
pref("browser.safebrowsing.provider.mozilla.lists.content.name", "mozfullName");
|
||||
pref("browser.safebrowsing.provider.mozilla.lists.content.description", "mozfullDesc");
|
||||
|
||||
// Allow users to ignore Safe Browsing warnings.
|
||||
pref("browser.safebrowsing.allowOverride", true);
|
||||
|
@ -81,6 +81,12 @@ this.SafeBrowsing = {
|
||||
let providerName = this.listToProvider[listname];
|
||||
let provider = this.providers[providerName];
|
||||
|
||||
if (!providerName || !provider) {
|
||||
log("No provider info found for " + listname);
|
||||
log("Check browser.safebrowsing.provider.[google/mozilla].lists");
|
||||
return;
|
||||
}
|
||||
|
||||
listManager.registerTable(listname, providerName, provider.updateURL, provider.gethashURL);
|
||||
},
|
||||
|
||||
@ -272,9 +278,14 @@ this.SafeBrowsing = {
|
||||
for (let i = 0; i < trackingProtectionLists.length; ++i) {
|
||||
if (this.trackingEnabled) {
|
||||
listManager.enableUpdate(trackingProtectionLists[i]);
|
||||
listManager.enableUpdate(trackingProtectionWhitelists[i]);
|
||||
} else {
|
||||
listManager.disableUpdate(trackingProtectionLists[i]);
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < trackingProtectionWhitelists.length; ++i) {
|
||||
if (this.trackingEnabled) {
|
||||
listManager.enableUpdate(trackingProtectionWhitelists[i]);
|
||||
} else {
|
||||
listManager.disableUpdate(trackingProtectionWhitelists[i]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user