diff --git a/src/api.js b/src/api.js index ec7d3cd..0756788 100644 --- a/src/api.js +++ b/src/api.js @@ -11,4 +11,7 @@ browser.runtime.onMessageExternal.addListener(async (message, sender) => { if (message === "getMetrics") { return getMetrics(); } + if (message.type === "setDefaultSearch") { + return browser.ghostery.setDefaultSearchEngine(message.search); + } }); diff --git a/src/choice-screen.js b/src/choice-screen.js deleted file mode 100644 index 8c21b44..0000000 --- a/src/choice-screen.js +++ /dev/null @@ -1,10 +0,0 @@ -async function onboarding() { - const { isOnboardingCompleted } = await browser.storage.local.get("isOnboardingCompleted"); - if (DEBUG || !isOnboardingCompleted) { - await browser.tabs.create({ - url: browser.extension.getURL('pages/choice-screen.html'), - }); - } -} - -onboarding(); \ No newline at end of file diff --git a/src/fonts/Roboto-Bold.ttf b/src/fonts/Roboto-Bold.ttf deleted file mode 100644 index 91ec212..0000000 Binary files a/src/fonts/Roboto-Bold.ttf and /dev/null differ diff --git a/src/fonts/Roboto-Light.ttf b/src/fonts/Roboto-Light.ttf deleted file mode 100644 index d43e943..0000000 Binary files a/src/fonts/Roboto-Light.ttf and /dev/null differ diff --git a/src/fonts/Roboto-Medium.ttf b/src/fonts/Roboto-Medium.ttf deleted file mode 100644 index 8798341..0000000 Binary files a/src/fonts/Roboto-Medium.ttf and /dev/null differ diff --git a/src/fonts/Roboto-Regular.ttf b/src/fonts/Roboto-Regular.ttf deleted file mode 100644 index 7d9a6c4..0000000 Binary files a/src/fonts/Roboto-Regular.ttf and /dev/null differ diff --git a/src/fonts/Roboto-Thin.ttf b/src/fonts/Roboto-Thin.ttf deleted file mode 100644 index 861d63a..0000000 Binary files a/src/fonts/Roboto-Thin.ttf and /dev/null differ diff --git a/src/manifest.json b/src/manifest.json index 6cbe1f7..ab18d63 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.2.2", + "version": "0.2.3", "browser_specific_settings": { "gecko": { "id": "search@ghostery.com" @@ -11,7 +11,6 @@ "token-pool.js", "sjcl.js", "background.js", - "choice-screen.js", "metrics.js", "api.js", "status.js" diff --git a/src/pages/choice-screen.html b/src/pages/choice-screen.html deleted file mode 100644 index 8d0bb27..0000000 --- a/src/pages/choice-screen.html +++ /dev/null @@ -1,311 +0,0 @@ - - - - Search Engine Choice - - - - - -
- -
-
-

Welcome! Choose your default search

-

Pick a default search engine for all your searches.

-
- -
- - -
-
- - Ad-free private search - (Recommended) -
-
-
- -
- - -
-
- - Ad-supported private search -
-
-
- -
- - -
-
- - Ad-supported non-private search -
-
-
- -
- - -
-
- - Ad-supported non-private search -
-
-
-
-
- - - - - - \ No newline at end of file diff --git a/src/pages/common.js b/src/pages/common.js deleted file mode 100644 index eb182c4..0000000 --- a/src/pages/common.js +++ /dev/null @@ -1,43 +0,0 @@ -document.addEventListener('DOMContentLoaded', () => { - const engines = [...document.querySelectorAll('.engine')]; - engines.forEach(engine => { - engine.addEventListener('click', async () => { - const name = engine.dataset.modal; - const modal = document.querySelector(`#${name}-modal`); - modal.classList.remove('hidden'); - }); - }); - - const cancelButtons = [...document.querySelectorAll('.modal .cancel-button')]; - cancelButtons.forEach(button => { - button.addEventListener('click', closeModals); - }); - const confirmButtons = [...document.querySelectorAll('.modal .confirm-button')]; - confirmButtons.forEach(button => { - const name = button.dataset.name; - button.addEventListener('click', selectSearchEngine.bind(null, name)); - }); -}); - -async function selectSearchEngine(name) { - await browser.ghostery.setDefaultSearchEngine(name); - const currentTab = await browser.tabs.getCurrent(); - await browser.storage.local.set({ - isOnboardingCompleted: true, - }); - if (name === browser.runtime.getManifest()["chrome_settings_overrides"]["search_provider"].name) { - browser.tabs.update(currentTab.id, { - url: "https://glowstery.com/account", - }); - } else { - await browser.tabs.create({}); - browser.tabs.remove(currentTab.id); - } -} - -function closeModals() { - const modals = [...document.querySelectorAll('.modal')]; - modals.forEach(modal => { - modal.classList.add('hidden'); - }); -} \ No newline at end of file