Skip to content

Commit

Permalink
Test WEE that changes a pref using an experimental API.
Browse files Browse the repository at this point in the history
Based on prior work in the Shield Studies Addon Template repo (mozilla/shield-studies-addon-template#55) and Shield Studies Addon Utils repo (mozilla/shield-studies-addon-utils#120).

This was just a proof-of-concept for me to understand the basics of creating experimental APIs for use in WebExtension Experiments (WEEs).

This WEE simply sets the "browser.privatebrowsing.autostart" boolean preference to "true" via an experimental "prefchange" WebExtension API.
  • Loading branch information
biancadanforth committed Apr 5, 2018
1 parent 2e60027 commit b830246
Show file tree
Hide file tree
Showing 9 changed files with 16,223 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
src/privileged/shieldUtils/jsm/StudyUtils.jsm
src/privileged/shieldUtils/jsm/PioneerUtils.jsm
4 changes: 4 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"use strict";

// call a method from the experimental API
browser.prefchange.setBoolPref("browser.privatebrowsing.autostart", true);
39 changes: 39 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{

"manifest_version": 2,
"name": "Shield Study WebExtension Experiment",
"version": "1.0",

"description": "A Shield Study WebExtension Experiment to change a preference in Firefox.",

"applications": {
"gecko": {
"id": "[email protected]",
"strict_min_version": "59.0"
}
},

"background": {
"scripts": ["background.js"]
},

"experiment_apis": {
"study": {
"schema": "./privileged/study/schema.json",
"parent": {
"scopes": ["addon_parent"],
"script": "./privileged/study/api.js",
"paths": [["study"]]
}
},
"prefchange": {
"schema": "./privileged/prefchange/schema.json",
"parent": {
"scopes": ["addon_parent"],
"script": "./privileged/prefchange/api.js",
"paths": [["prefchange"]]
}
}
}

}
Loading

0 comments on commit b830246

Please sign in to comment.