-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test WEE that changes a pref using an experimental API.
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
1 parent
2e60027
commit b830246
Showing
9 changed files
with
16,223 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"]] | ||
} | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.