From 367b0c114f38d5c332f5ee971ad13dd69e302dec Mon Sep 17 00:00:00 2001 From: tilpner Date: Mon, 15 Jun 2020 09:53:06 +0200 Subject: WIP towards module based configuration --- profiles/addons/qwantjunior/content-script.js | 34 ------------------- profiles/addons/qwantjunior/favicon.ico | Bin 2285 -> 0 bytes profiles/addons/qwantjunior/managed_storage.json | 20 ------------ profiles/addons/qwantjunior/manifest.json | 40 ----------------------- 4 files changed, 94 deletions(-) delete mode 100644 profiles/addons/qwantjunior/content-script.js delete mode 100644 profiles/addons/qwantjunior/favicon.ico delete mode 100644 profiles/addons/qwantjunior/managed_storage.json delete mode 100644 profiles/addons/qwantjunior/manifest.json (limited to 'profiles/addons/qwantjunior') diff --git a/profiles/addons/qwantjunior/content-script.js b/profiles/addons/qwantjunior/content-script.js deleted file mode 100644 index 01b3976..0000000 --- a/profiles/addons/qwantjunior/content-script.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; - -function changeSettings(managed) { - var preferred = managed.settings; - var userStorage = JSON.parse(localStorage.getItem('user')); - var needsReload = false; - - if (userStorage == null) { - localStorage.setItem('user', JSON.stringify({ - userSetting: preferred - })); - - needsReload = true; - } else if (userStorage.version == "2") { - var setting = userStorage.userSetting; - - for (const [key, value] of Object.entries(preferred)) { - if (setting[key] != preferred[key]) { - setting[key] = preferred[key]; - needsReload = true; - } - } - - localStorage.setItem('user', JSON.stringify(userStorage)); - } - - if (needsReload) { - location.reload(); - } -} - -browser.storage.managed - .get("settings") - .then(changeSettings); diff --git a/profiles/addons/qwantjunior/favicon.ico b/profiles/addons/qwantjunior/favicon.ico deleted file mode 100644 index 5e44aac..0000000 Binary files a/profiles/addons/qwantjunior/favicon.ico and /dev/null differ diff --git a/profiles/addons/qwantjunior/managed_storage.json b/profiles/addons/qwantjunior/managed_storage.json deleted file mode 100644 index 00afb5a..0000000 --- a/profiles/addons/qwantjunior/managed_storage.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-03/schema#", - "type": "object", - "properties": { - "settings": { - "type": "object", - "properties": { - "searchRegionKey": { - "type": "string" - }, - "searchLanguageKey": { - "type": "string" - }, - "interfaceLanguageKey": { - "type": "string" - } - } - } - } -} diff --git a/profiles/addons/qwantjunior/manifest.json b/profiles/addons/qwantjunior/manifest.json deleted file mode 100644 index f38a086..0000000 --- a/profiles/addons/qwantjunior/manifest.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "QwantJunior", - "description": "Search Qwant Junior", - "manifest_version": 2, - "version": "1.0", - "applications": { - "gecko": { - "id": "qwantjunior@search.mozilla.org" - } - }, - "hidden": true, - "icons": { - "16": "favicon.ico" - }, - "web_accessible_resources": [ - "favicon.ico" - ], - "chrome_settings_overrides": { - "search_provider": { - "is_default": true, - "name": "Qwant Junior", - "search_url": "https://www.qwantjunior.com", - "search_form": "https://www.qwantjunior.com/?q={searchTerms}", - "search_url_get_params": "q={searchTerms}", - "suggest_url": "https://api.qwant.com/egp/suggest/", - "suggest_url_get_params": "q={searchTerms}&client=opensearch" - } - }, - - "permissions": [ - "storage", - "https://www.qwantjunior.com/*" - ], - - "content_scripts": [ - { "matches": [ "https://www.qwantjunior.com/*" ], - "run_at": "document_idle", - "js": [ "content-script.js" ] } - ] -} -- cgit v1.2.3