This repository has been archived by the owner on Oct 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
124 additions
and
10 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
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,33 @@ | ||
{ | ||
"name": "A Small Shield Addon", | ||
"description": "Demo of shield-studies-addon-utils", | ||
"version": "1.0.0", | ||
"manifest_version": 2, | ||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]", | ||
"strict_min_version": "60.0" | ||
} | ||
}, | ||
"experiment_apis": { | ||
"study": { | ||
"schema": "./privileged/study/schema.json", | ||
"parent": { | ||
"scopes": ["addon_parent"], | ||
"script": "./privileged/study/api.js", | ||
"paths": [["study"]] | ||
} | ||
} | ||
}, | ||
"background": { | ||
"scripts": ["studySetup.js", "background.js"] | ||
}, | ||
"icons": { | ||
"48": "icons/shield-icon.svg" | ||
}, | ||
"browser_action": { | ||
"browser_style": true, | ||
"default_icon": "icons/shield-icon.svg", | ||
"default_title": "Send A Ping" | ||
} | ||
} |
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
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,63 @@ | ||
|
||
this.study = class extends ExtensionAPI { | ||
getAPI(context) { | ||
return { | ||
|
||
async configure ( studySetup ) { | ||
return undefined; | ||
} | ||
|
||
async simpleDeterministicVariation ( weightedVariations, fraction ) { | ||
return "styleA"; | ||
} | ||
|
||
async endStudy ( anEnding ) { | ||
return "endingName"; | ||
} | ||
|
||
async permissions ( ) { | ||
return {"shield":true,"pioneer":false}; | ||
} | ||
|
||
async userInfo ( ) { | ||
return undefined; | ||
} | ||
|
||
async sendTelemetry ( payload, type ) { | ||
return "undefined"; | ||
} | ||
|
||
async getTelemetry ( telemetrySelectionOptions ) { | ||
return [{"pingType":"main"}]; | ||
} | ||
|
||
async setActiveExperiment ( ) { | ||
return undefined; | ||
} | ||
|
||
async unsetActiveExperiment ( ) { | ||
return undefined; | ||
} | ||
|
||
async getPref ( prefName ) { | ||
return "someValue"; | ||
} | ||
|
||
async setPref ( prefName, prefType ) { | ||
return "someValue"; | ||
} | ||
|
||
async watchPref ( prefName, prefType ) { | ||
return "[A function]"; | ||
} | ||
|
||
async surveyUrl ( baseUrl ) { | ||
return "https://example.com?version=59.0"; | ||
} | ||
|
||
async validateJSON ( anObject, schema ) { | ||
return {"isValid":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