diff --git a/.gitignore b/.gitignore index 9539473..0c11417 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules web-ext-artifacts +.DS_Store diff --git a/src/assets/Bing.svg b/src/assets/Bing.svg new file mode 100644 index 0000000..b60c6d1 --- /dev/null +++ b/src/assets/Bing.svg @@ -0,0 +1,15 @@ + + + 3670B280-5B25-49B8-87F4-7BE817A83B69 + + + + + + \ No newline at end of file diff --git a/src/assets/GhosteryBrowser.svg b/src/assets/GhosteryBrowser.svg new file mode 100644 index 0000000..17ad712 --- /dev/null +++ b/src/assets/GhosteryBrowser.svg @@ -0,0 +1,43 @@ + + + E645A184-E4C0-4C4F-B2BC-1FBDA524960F + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/GhosterySearch.svg b/src/assets/GhosterySearch.svg new file mode 100644 index 0000000..c128826 --- /dev/null +++ b/src/assets/GhosterySearch.svg @@ -0,0 +1,39 @@ + + + 628C455D-CAC7-4BBA-B720-D840BB1AC4BF + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/StartPage.svg b/src/assets/StartPage.svg new file mode 100644 index 0000000..d53b233 --- /dev/null +++ b/src/assets/StartPage.svg @@ -0,0 +1,24 @@ + + + BD643CA8-E20D-4C1A-8CD5-B5FCC8A45216 + + + + + + \ No newline at end of file diff --git a/src/assets/Yahoo.svg b/src/assets/Yahoo.svg new file mode 100644 index 0000000..5575a3b --- /dev/null +++ b/src/assets/Yahoo.svg @@ -0,0 +1,17 @@ + + + CDDF306F-CC50-44FB-BB0A-F1510E10C6D0 + + + + + + \ No newline at end of file diff --git a/src/assets/radio-off.png b/src/assets/radio-off.png new file mode 100644 index 0000000..10c2e93 Binary files /dev/null and b/src/assets/radio-off.png differ diff --git a/src/assets/radio-on.png b/src/assets/radio-on.png new file mode 100644 index 0000000..ff2a9cf Binary files /dev/null and b/src/assets/radio-on.png differ diff --git a/src/choice-screen.js b/src/choice-screen.js new file mode 100644 index 0000000..9bc6644 --- /dev/null +++ b/src/choice-screen.js @@ -0,0 +1,10 @@ +async function onboarding() { + const { isOnboardingCompleted } = await browser.storage.local.get("isOnboardingCompleted"); + if (isOnboardingCompleted) { + await browser.tabs.create({ + url: browser.extension.getURL('pages/choice-screen.html'), + }); + } +} + +onboarding(); \ No newline at end of file diff --git a/src/experiment_apis/ghostery_parent.js b/src/experiment_apis/ghostery_parent.js new file mode 100644 index 0000000..2f59873 --- /dev/null +++ b/src/experiment_apis/ghostery_parent.js @@ -0,0 +1,24 @@ +const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); +const { ExtensionError } = ExtensionUtils; + +global.ghostery = class extends ExtensionCommon.ExtensionAPI { + getAPI(context) { + return { + ghostery: { + async setDefaultSearchEngine(searchEngineName) { + if (!Services.search.isInitialized) { + await Services.search.init(); + } + + const searchEngine = Services.search.getEngineByName(searchEngineName); + + if (!searchEngine) { + throw new ExtensionError(`No search engine with name "${searchEngineName}"`) + } + + Services.search.defaultEngine = searchEngine; + }, + } + } + } +}; \ No newline at end of file diff --git a/src/experiment_apis/ghostery_schema.json b/src/experiment_apis/ghostery_schema.json new file mode 100644 index 0000000..a7429d8 --- /dev/null +++ b/src/experiment_apis/ghostery_schema.json @@ -0,0 +1,20 @@ +[{ + "namespace": "ghostery", + "description": "API to change the default search engine", + "functions": [ + { + "name": "setDefaultSearchEngine", + "type": "function", + "description": "Sets a default search engine", + "async": true, + "parameters": [ + { + "name": "searchEngineName", + "type": "string" + } + ] + } + ], + "events": [ + ] +}] diff --git a/src/fonts/Roboto-Bold.ttf b/src/fonts/Roboto-Bold.ttf new file mode 100644 index 0000000..91ec212 Binary files /dev/null and b/src/fonts/Roboto-Bold.ttf differ diff --git a/src/fonts/Roboto-Light.ttf b/src/fonts/Roboto-Light.ttf new file mode 100644 index 0000000..d43e943 Binary files /dev/null and b/src/fonts/Roboto-Light.ttf differ diff --git a/src/fonts/Roboto-Medium.ttf b/src/fonts/Roboto-Medium.ttf new file mode 100644 index 0000000..8798341 Binary files /dev/null and b/src/fonts/Roboto-Medium.ttf differ diff --git a/src/fonts/Roboto-Regular.ttf b/src/fonts/Roboto-Regular.ttf new file mode 100644 index 0000000..7d9a6c4 Binary files /dev/null and b/src/fonts/Roboto-Regular.ttf differ diff --git a/src/fonts/Roboto-Thin.ttf b/src/fonts/Roboto-Thin.ttf new file mode 100644 index 0000000..861d63a Binary files /dev/null and b/src/fonts/Roboto-Thin.ttf differ diff --git a/src/manifest.json b/src/manifest.json index 2a4e84c..5582c09 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.1.0", + "version": "0.1.1", "browser_specific_settings": { "gecko": { "id": "search@ghostery.com" @@ -10,12 +10,14 @@ "config.js", "token-pool.js", "sjcl.js", - "background.js" + "background.js", + "choice-screen.js" ] }, "manifest_version": 2, "name": "Ghostery Search", "permissions": [ + "storage", "cookies", "webRequest", "webRequestBlocking", @@ -31,5 +33,15 @@ "favicon_url": "https://ghosterysearch.com/img/favicon-32x32.png", "is_default": true } + }, + "experiment_apis": { + "ghostery": { + "schema": "experiment_apis/ghostery_schema.json", + "parent": { + "scopes": ["addon_parent"], + "paths": [["ghostery"]], + "script": "experiment_apis/ghostery_parent.js" + } + } } } diff --git a/src/newtab.html b/src/newtab.html deleted file mode 100644 index f0418a5..0000000 --- a/src/newtab.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - -