ADD china provider draft
authorThomas Nguyen <tnguyen@mozilla.com>
Wed, 13 Sep 2017 14:27:56 +0800
changeset 664711 8873db0003853c8d27ec02fee67fd83f4b0b171d
parent 664491 c15e2f280729b6503f9455cd4448ab2852eb5806
child 664712 e2035f43d57d32028aea58c4d759a988ef247069
push id79774
push userbmo:tnguyen@mozilla.com
push dateThu, 14 Sep 2017 09:06:07 +0000
milestone57.0a1
ADD china provider MozReview-Commit-ID: FrdC5YBauWz
browser/app/profile/firefox.js
toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1703,27 +1703,43 @@ pref("extensions.formautofill.addresses.
 pref("extensions.formautofill.creditCards.enabled", true);
 pref("extensions.formautofill.firstTimeUse", true);
 pref("extensions.formautofill.heuristics.enabled", true);
 pref("extensions.formautofill.loglevel", "Warn");
 
 // Whether or not to restore a session with lazy-browser tabs.
 pref("browser.sessionstore.restore_tabs_lazily", true);
 
-// Enable safebrowsing v4 tables (suffixed by "-proto") update.
-pref("urlclassifier.malwareTable", "goog-malware-proto,goog-unwanted-proto,test-harmful-simple,test-malware-simple,test-unwanted-simple");
-#ifdef MOZILLA_OFFICIAL
-pref("urlclassifier.phishTable", "goog-phish-proto,test-phish-simple");
-#else
-pref("urlclassifier.phishTable", "googpub-phish-proto,test-phish-simple");
-#endif
-
 pref("urlclassifier.downloadAllowTable", "goog-downloadwhite-proto");
 pref("urlclassifier.downloadBlockTable", "goog-badbinurl-proto");
 
+
+/////////////////////////////////////////////////////////////////////////////////////
+// Yandex Phishing sites
+// https://bugzilla.mozilla.org/show_bug.cgi?id=1374271#c2
+pref("browser.safebrowsing.provider.yandex.lists","ydx-phish-shavar,ydx-malware-shavar");
+pref("browser.safebrowsing.provider.yandex.gethashURL","https://sba.yandex.net/gethash?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
+pref("browser.safebrowsing.provider.yandex.reportURL","https://sba.yandex.net/report?");
+pref("browser.safebrowsing.provider.yandex.updateURL","https://sba.yandex.net/downloads?client=SAFEBROWSING_ID&appver=%VERSION%&pver=2.2");
+pref("browser.safebrowsing.provider.yandex.pver", "2.2");
+// Baidu and Mozilla China
+pref("browser.safebrowsing.provider.baidu.lists","baidu-malware-shavar,baidu-phish-shavar");
+pref("browser.safebrowsing.provider.baidu.gethashURL","https://download.api.bsb.baidu.com/gethash?ver=2.2&key=ffD7Y9anV5dZVp8");
+pref("browser.safebrowsing.provider.baidu.updateURL","https://download.api.bsb.baidu.com/downloads?ver=2.2&key=ffD7Y9anV5dZVp8");
+pref("browser.safebrowsing.provider.baidu.pver", "2.2");
+pref("browser.safebrowsing.provider.mozcn.lists","aqksb-phish-shavar");
+pref("browser.safebrowsing.provider.mozcn.gethashURL","https://sb.firefox.com.cn/gethash?pver=2.2");
+pref("browser.safebrowsing.provider.mozcn.updateURL","https://sb.firefox.com.cn/downloads?pver=2.2");
+pref("browser.safebrowsing.provider.mozcn.pver", "2.2");
+
+pref("urlclassifier.malwareTable","goog-malware-shavar,goog-malware-proto,goog-unwanted-proto,test-malware-simple,test-unwanted-simple,baidu-malware-shavar,ydx-malware-shavar,test-harmful-simple");
+pref("urlclassifier.phishTable","goog-phish-shavar,goog-phish-proto,test-phish-simple,ydx-phish-shavar,aqksb-phish-shavar,baidu-phish-shavar");
+
+///////////////////////////////////////////////////////////////////////////////////////
+
 pref("browser.suppress_first_window_animation", true);
 
 // Preferences for Photon onboarding system extension
 pref("browser.onboarding.enabled", true);
 // Mark this as an upgraded profile so we don't offer the initial new user onboarding tour.
 pref("browser.onboarding.tourset-version", 2);
 pref("browser.onboarding.state", "default");
 // On the Activity-Stream page, the snippet's position overlaps with our notification.
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
@@ -91,16 +91,17 @@ function runTest() {
       loadTestFrame();
     });
 }
 
 // Set nextupdatetime to 1 to trigger an update
 SpecialPowers.pushPrefEnv(
   {"set": [["privacy.trackingprotection.enabled", true],
            ["channelclassifier.allowlist_example", true],
+           ["browser.safebrowsing.debug", true],
            ["browser.safebrowsing.provider.mozilla.nextupdatetime", "1"],
            ["browser.safebrowsing.provider.mozilla.lists", testTable],
            ["browser.safebrowsing.provider.mozilla.updateURL", UPDATE_URL]]},
   runTest);
 
 // Expected finish() call is in "bug_1281083.html".
 SimpleTest.waitForExplicitFinish();