diff options
Diffstat (limited to 'addons')
-rw-r--r-- | addons/default.nix | 90 | ||||
-rw-r--r-- | addons/noscript/config.json | 101 | ||||
-rw-r--r-- | addons/qwantjunior/content-script.js | 34 | ||||
-rw-r--r-- | addons/qwantjunior/favicon.ico | bin | 0 -> 2285 bytes | |||
-rw-r--r-- | addons/qwantjunior/managed_storage.json | 20 | ||||
-rw-r--r-- | addons/qwantjunior/manifest.json | 40 | ||||
-rw-r--r-- | addons/ublock/config.json | 84 |
7 files changed, 369 insertions, 0 deletions
diff --git a/addons/default.nix b/addons/default.nix new file mode 100644 index 0000000..2e648ce --- /dev/null +++ b/addons/default.nix @@ -0,0 +1,90 @@ +{ pkgs, lib, fetchurl, runCommand }: + +let + # Extension IDs are used as keys, see .applications.gecko.id in manifest.json + localAddon = { id, src, settings ? null }: { + policies = { + ExtensionSettings.${id} = { + installation_mode = "force_installed"; + install_url = "file://${src}"; + }; + } // (lib.optionalAttrs (settings != null) { + "3rdparty".Extensions.${id} = settings; + }); + }; + + addon = { id, url, sha256, settings ? null }: localAddon { + inherit id settings; + src = fetchurl { + inherit url sha256; + }; + }; +in { + # This can be safe-ish, if extension installation is also disabled + disableExtensionSignatureChecking.preferences = { + xpinstall.signatures.required = false; + }; + + privacybadger = addon { + id = "jid1-MnnxcxisBPnSXQ@jetpack"; + url = "https://addons.mozilla.org/firefox/downloads/file/3509922/privacy_badger-2020.2.19-an+fx.xpi"; + sha256 = "1issggv5wl5x3a4p3q8hrhbkhgsdx9f2qzbscg6y6f75yazswc20"; + settings = { + showIntroPage = false; + }; + }; + + noscript = addon { + id = "{73a6fe31-595d-460b-a920-fcc0f8843232}"; + url = "https://addons.mozilla.org/firefox/downloads/file/3517653/noscript_security_suite-11.0.15-an+fx.xpi"; + sha256 = "0gb0a6pp0rj9jpg1094arqvcwxh1rd2m47ijawlidybm29qmyyay"; + }; + + noscriptFork = localAddon { + id = "{73a6fe31-595d-460b-a920-fcc0f8843232}"; + src = import (pkgs.fetchzip { + url = https://git.tx0.co/firefox-profiles/noscript/snapshot/noscript-63e23c676fb86f33e70d7362bf625b534ce65346.tar.xz ; + sha256 = "0f0hna8fjj7vdjgmnjkd567smg8gda8jp9sl21nz3dx0s5d0vw8f"; + }); + settings.defaultSettings = builtins.readFile ./noscript/config.json; + }; + + ublock = addon { + id = "uBlock0@raymondhill.net"; + url = "https://addons.mozilla.org/firefox/downloads/file/3509800/ublock_origin-1.25.0-an+fx.xpi"; + sha256 = "0pyna4c2b2ffh8ifjj4c8ga9b73g37pk432nyinf8majyb1fq6rc"; + settings.adminSettings = builtins.readFile ./ublock/config.json; + }; + + qwantjunior = localAddon { + id = "qwantjunior@search.mozilla.org"; + src = runCommand "addon.xpi" { nativeBuildInputs = [ pkgs.zip ]; } '' + SRC=${./qwantsearch} + cd $SRC + zip -r $out . + ''; + + settings.settings = { + searchRegionKey = "DE"; + searchLanguageKey = "de"; + interfaceLanguageKey = "de_de"; + }; + }; + + qwantjuniorSystem.policies = { + "3rdparty".Extensions."qwantjunior@search.mozilla.org".settings = { + searchRegionKey = "DE"; + searchLanguageKey = "de"; + interfaceLanguageKey = "de_de"; + }; + }; + +/* + borderify.policies = { + ExtensionSettings."borderify@example.com" = { + installation_mode = "force_installed"; + install_url = "file://${../../borderify.xpi}"; + }; + }; +*/ +} diff --git a/addons/noscript/config.json b/addons/noscript/config.json new file mode 100644 index 0000000..57e121d --- /dev/null +++ b/addons/noscript/config.json @@ -0,0 +1,101 @@ +{ + "policy": { + "DEFAULT": { + "capabilities": [ + "frame", + "fetch", + "other", + "script", + "object", + "font", + "media", + "webgl", + "ping" + ], + "temp": false + }, + "TRUSTED": { + "capabilities": [ + "script", + "object", + "media", + "frame", + "font", + "webgl", + "fetch", + "ping", + "other" + ], + "temp": false + }, + "UNTRUSTED": { + "capabilities": [], + "temp": false + }, + "sites": { + "trusted": [ + "§:addons.mozilla.org", + "§:afx.ms", + "§:ajax.aspnetcdn.com", + "§:ajax.googleapis.com", + "§:bootstrapcdn.com", + "§:code.jquery.com", + "§:firstdata.com", + "§:firstdata.lv", + "§:gfx.ms", + "§:google.com", + "§:googlevideo.com", + "§:gstatic.com", + "§:hotmail.com", + "§:live.com", + "§:live.net", + "§:maps.googleapis.com", + "§:mozilla.net", + "§:netflix.com", + "§:nflxext.com", + "§:nflximg.com", + "§:nflxvideo.net", + "§:noscript.net", + "§:outlook.com", + "§:passport.com", + "§:passport.net", + "§:passportimages.com", + "§:paypal.com", + "§:paypalobjects.com", + "§:securecode.com", + "§:securesuite.net", + "§:sfx.ms", + "§:tinymce.cachefly.net", + "§:wlxrs.com", + "§:yahoo.com", + "§:yahooapis.com", + "§:yimg.com", + "§:youtube.com", + "§:ytimg.com", + "§:qwantjunior.com", + "§:qwant.com" + ], + "untrusted": [], + "custom": {} + }, + "enforced": true, + "autoAllowTop": false + }, + "local": { + "debug": false, + "showCtxMenuItem": true, + "showCountBadge": true, + "showFullAddresses": false, + "storage": "local", + "uuid": "82ea8b50-5fb6-45c2-8748-0dc29c8d2e49" + }, + "sync": { + "global": false, + "xss": true, + "cascadeRestrictions": false, + "overrideTorBrowserPolicy": false, + "clearclick": true, + "storage": "sync" + }, + "xssUserChoices": {} +}
\ No newline at end of file diff --git a/addons/qwantjunior/content-script.js b/addons/qwantjunior/content-script.js new file mode 100644 index 0000000..01b3976 --- /dev/null +++ b/addons/qwantjunior/content-script.js @@ -0,0 +1,34 @@ +"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/addons/qwantjunior/favicon.ico b/addons/qwantjunior/favicon.ico Binary files differnew file mode 100644 index 0000000..5e44aac --- /dev/null +++ b/addons/qwantjunior/favicon.ico diff --git a/addons/qwantjunior/managed_storage.json b/addons/qwantjunior/managed_storage.json new file mode 100644 index 0000000..00afb5a --- /dev/null +++ b/addons/qwantjunior/managed_storage.json @@ -0,0 +1,20 @@ +{ + "$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/addons/qwantjunior/manifest.json b/addons/qwantjunior/manifest.json new file mode 100644 index 0000000..f38a086 --- /dev/null +++ b/addons/qwantjunior/manifest.json @@ -0,0 +1,40 @@ +{ + "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" ] } + ] +} diff --git a/addons/ublock/config.json b/addons/ublock/config.json new file mode 100644 index 0000000..67ba236 --- /dev/null +++ b/addons/ublock/config.json @@ -0,0 +1,84 @@ +{ + "timeStamp": 1583409728051, + "version": "1.25.0", + "userSettings": { + "advancedUserEnabled": true, + "alwaysDetachLogger": true, + "autoUpdate": true, + "cloudStorageEnabled": false, + "collapseBlocked": true, + "colorBlindFriendly": false, + "contextMenuEnabled": true, + "dynamicFilteringEnabled": true, + "externalLists": "", + "firewallPaneMinimized": true, + "hyperlinkAuditingDisabled": true, + "ignoreGenericCosmeticFilters": false, + "largeMediaSize": 50, + "parseAllABPHideFilters": true, + "prefetchingDisabled": true, + "requestLogMaxEntries": 1000, + "showIconBadge": true, + "tooltipsDisabled": false, + "webrtcIPAddressHidden": false + }, + "selectedFilterLists": [ + "user-filters", + "easylist", + "easyprivacy", + "malware-0", + "malware-1", + "plowe-0" + ], + "hiddenSettings": { + "allowGenericProceduralFilters": false, + "assetFetchTimeout": 30, + "autoCommentFilterTemplate": "{{date}} {{origin}}", + "autoUpdateAssetFetchPeriod": 120, + "autoUpdateDelayAfterLaunch": 180, + "autoUpdatePeriod": 7, + "blockingProfiles": "11111/#F00 11011/#C0F 11001/#00F 00001", + "cacheStorageAPI": "unset", + "cacheStorageCompression": true, + "cacheControlForFirefox1376932": "no-cache, no-store, must-revalidate", + "cnameIgnoreList": "unset", + "cnameIgnore1stParty": true, + "cnameIgnoreExceptions": true, + "cnameIgnoreRootDocument": true, + "cnameMaxTTL": 120, + "cnameReplayFullURL": false, + "cnameUncloak": true, + "consoleLogLevel": "unset", + "debugScriptlets": false, + "debugScriptletInjector": false, + "disableWebAssembly": false, + "extensionUpdateForceReload": false, + "ignoreRedirectFilters": false, + "ignoreScriptInjectFilters": false, + "filterAuthorMode": false, + "loggerPopupType": "popup", + "manualUpdateAssetFetchPeriod": 500, + "popupFontSize": "unset", + "requestJournalProcessPeriod": 1000, + "selfieAfter": 3, + "strictBlockingBypassDuration": 120, + "suspendTabsUntilReady": "unset", + "uiFlavor": "unset", + "updateAssetBypassBrowserCache": false, + "userResourcesLocation": "unset" + }, + "whitelist": [ + "about-scheme", + "chrome-extension-scheme", + "chrome-scheme", + "moz-extension-scheme", + "opera-scheme", + "vivaldi-scheme", + "wyciwyg-scheme" + ], + "netWhitelist": "about-scheme\nchrome-extension-scheme\nchrome-scheme\nmoz-extension-scheme\nopera-scheme\nvivaldi-scheme\nwyciwyg-scheme", + "dynamicFilteringString": "behind-the-scene * * noop\nbehind-the-scene * inline-script noop\nbehind-the-scene * 1p-script noop\nbehind-the-scene * 3p-script noop\nbehind-the-scene * 3p-frame noop\nbehind-the-scene * image noop\nbehind-the-scene * 3p noop", + "urlFilteringString": "", + "hostnameSwitchesString": "no-large-media: behind-the-scene false", + "userFilters": "" +}
\ No newline at end of file |