From cd03ea7a5931c0c7412a23c590cbda1a975b8fbb Mon Sep 17 00:00:00 2001 From: groovecoder Date: Mon, 1 May 2017 10:32:51 -0500 Subject: [PATCH] start study.js --- index.js | 1 + package.json | 1 + study.js | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 study.js diff --git a/index.js b/index.js index bf70a1c..07eb8e7 100644 --- a/index.js +++ b/index.js @@ -60,6 +60,7 @@ const prefService = require("sdk/preferences/service"); const self = require("sdk/self"); const { Services } = require("resource://gre/modules/Services.jsm"); const ss = require("sdk/simple-storage"); +const study = require("study"); const { Style } = require("sdk/stylesheet/style"); const tabs = require("sdk/tabs"); const tabsUtils = require("sdk/tabs/utils"); diff --git a/package.json b/package.json index 30d562f..8a6db61 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "htmllint-cli": "^0.0.5", "jpm": "^1.2.2", "npm-run-all": "^4.0.0", + "shield-studies-addon-utils": "^2.0.0", "stylelint": "^7.9.0", "stylelint-config-standard": "^16.0.0", "stylelint-order": "^0.3.0", diff --git a/study.js b/study.js new file mode 100644 index 0000000..5b1bf9f --- /dev/null +++ b/study.js @@ -0,0 +1,35 @@ +const self = require("sdk/self"); +const { shield } = require("./node_modules/shield-studies-addon-utils/lib/index"); +const { when: unload } = require("sdk/system/unload"); + +const studyConfig = { + name: self.addonId, + days: 28, + surveyUrls: { + }, + variations: { + "control": () => {}, + "privacyOnboarding": () => {}, + "onlineAccountsOnboarding": () => {}, + "tabManagementOnboarding": () => {} + } +}; + +class ContainersStudy extends shield.Study { + isEligible () { + } + + whenEligible () { + } + + whenInstalled () { + } + + cleanup(reason) { + console.log(reason); + } +} + +const thisStudy = new ContainersStudy(studyConfig); + +unload((reason) => thisStudy.shutdown(reason));