Skip to content

Instantly share code, notes, and snippets.

@felipc
Created May 12, 2017 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipc/96b3122fc40697088505cfa4eabc097c to your computer and use it in GitHub Desktop.
Save felipc/96b3122fc40697088505cfa4eabc097c to your computer and use it in GitHub Desktop.
Testing Flash Block, Week 2:
** Using a fresh profile with Firefox 53 Release ( https://archive.mozilla.org/pub/firefox/releases/53.0/ )
(This can be tested on Nightly too, but 53 Release is preferred)
1 - set the pref "devtools.chrome.enabled" to true
2 - open Web Developer -> Browser Console
3 - Paste the following all together and press Enter.
(Note: This will put Flash in Ask-to-Activate Mode)
Preferences.set("plugins.flashBlock.enabled",true);
Preferences.set("plugin.state.flash", 1);
Preferences.set("plugins.favorfallback.mode", "follow-ctp");
Preferences.set("plugins.favorfallback.rules", "video");
Preferences.set("plugins.navigator.hidden_ctp_plugin", "");
4 - Sanity check:
- Go to translate.google.com and make sure that the infobar to activate Flash is displayed
- check that you're in Week 0 or Week 1 of the list (* instructions at the end)
5 - Open browser console again to paste and Enter:
Preferences.set("browser.safebrowsing.provider.mozilla.updateURL",Preferences.get("browser.safebrowsing.provider.mozilla.updateURL").replace("shavar.services.mozilla.com/", "shavar.stage.mozaws.net/"));
Preferences.set("browser.safebrowsing.provider.mozilla.nextupdatetime","1");
7 - Restart the browser
8 - Wait a while. You can keep an eye on the pref "browser.safebrowsing.provider.mozilla.nextupdatetime" in about:config.
Once it changes to a big value again, you're good to continue
9 - Sanity check:
- Check that you're now in Week 2 by running the checking instructions again
- go to translate.google.com and now make sure that the infobar to activate Flash is NOT displayed
10 - If everything worked correctly until now, it's all set.
You can start testing the websites requested to make sure they don't break with this new configuration.
========== Checking what's the corresponding Week for the blocklist =========
Paste all of the above lines all together in the Browser Console, and press Enter:
function checkWeek() {
let classifier = Cc['@mozilla.org/url-classifier/dbservice;1']
.getService(Ci.nsIURIClassifier);
let { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
let table = Services.prefs.getCharPref("urlclassifier.flashSubDocTable");
for (let i = 1;;i++) {
let url = `https://week${i}.flashstudy.example.com`;
let uri = NetUtil.newURI(url);
let result = classifier.classifyLocal(uri, table);
if (result == "") {
console.log(`You're in Week ${i-1} of the Flash Shield Study`);
break;
}
}
}
checkWeek();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment