From 4c1099771caba798573f147fc08e5a474fc7a81b Mon Sep 17 00:00:00 2001 From: Hygna Date: Fri, 16 Sep 2022 19:33:39 +0100 Subject: More ejs progress --- src/pages/options/index.ejs | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/pages/options/index.ejs (limited to 'src/pages/options/index.ejs') diff --git a/src/pages/options/index.ejs b/src/pages/options/index.ejs new file mode 100644 index 00000000..c17d1f0a --- /dev/null +++ b/src/pages/options/index.ejs @@ -0,0 +1,13 @@ + + + <%- include('../widgets/head') %> + +
+ <%- include('../widgets/links', {config: config}) %> + <%- include('widgets/general', {config: config}) %> + <%- include('widgets/services', {config: config}) %> + <%- include('widgets/about') %> +
+ + + -- cgit 1.4.1 From 978e07930705e87b04d0eafe86233bb62fb36c03 Mon Sep 17 00:00:00 2001 From: Hygna Date: Sun, 18 Sep 2022 17:03:54 +0100 Subject: Converted index.html to ejs --- package.json | 3 +- src/assets/images/general-icon.svg | 3 + src/assets/images/imdb-icon.svg | 57 + src/assets/images/imdb.svg | 57 - src/assets/images/imgur-icon.png | Bin 0 -> 26675 bytes src/assets/images/imgur.png | Bin 26675 -> 0 bytes src/assets/images/medium-icon.svg | 10 +- src/assets/images/quora-icon.png | Bin 0 -> 5499 bytes src/assets/images/quora.png | Bin 5499 -> 0 bytes src/assets/images/reuters-icon.svg | 1 + src/assets/images/reuters.svg | 1 - src/assets/images/send-icon.svg | 51 - src/assets/images/sendTargets-icon.svg | 51 + src/assets/images/youtube-music-icon.png | Bin 25903 -> 0 bytes src/assets/images/youtubeMusic-icon.png | Bin 0 -> 25903 bytes src/assets/javascripts/services.js | 3 +- src/assets/javascripts/utils.js | 7 +- src/config/config.json | 822 ++-- src/pages/options/index.ejs | 10 +- src/pages/options/index.html | 6767 +++++++++++++++------------- src/pages/options/index.pug | 36 - src/pages/options/widgets/about.pug | 17 - src/pages/options/widgets/general.ejs | 97 + src/pages/options/widgets/general.pug | 210 - src/pages/options/widgets/imdb.pug | 26 - src/pages/options/widgets/imgur.pug | 27 - src/pages/options/widgets/instagram.pug | 27 - src/pages/options/widgets/lbry.pug | 39 - src/pages/options/widgets/maps.pug | 32 - src/pages/options/widgets/medium.pug | 26 - src/pages/options/widgets/peertube.pug | 26 - src/pages/options/widgets/quora.pug | 26 - src/pages/options/widgets/reddit.pug | 48 - src/pages/options/widgets/reuters.pug | 26 - src/pages/options/widgets/search.pug | 85 - src/pages/options/widgets/sendTargets.pug | 26 - src/pages/options/widgets/services.ejs | 43 +- src/pages/options/widgets/services.js | 3 +- src/pages/options/widgets/tiktok.pug | 26 - src/pages/options/widgets/translate.pug | 48 - src/pages/options/widgets/twitter.pug | 33 - src/pages/options/widgets/wikipedia.pug | 26 - src/pages/options/widgets/youtube.pug | 103 - src/pages/options/widgets/youtubeMusic.pug | 49 - src/pages/widgets/links.ejs | 4 +- 45 files changed, 4264 insertions(+), 4688 deletions(-) create mode 100644 src/assets/images/imdb-icon.svg delete mode 100644 src/assets/images/imdb.svg create mode 100644 src/assets/images/imgur-icon.png delete mode 100644 src/assets/images/imgur.png create mode 100644 src/assets/images/quora-icon.png delete mode 100644 src/assets/images/quora.png create mode 100644 src/assets/images/reuters-icon.svg delete mode 100644 src/assets/images/reuters.svg delete mode 100644 src/assets/images/send-icon.svg create mode 100644 src/assets/images/sendTargets-icon.svg delete mode 100644 src/assets/images/youtube-music-icon.png create mode 100644 src/assets/images/youtubeMusic-icon.png delete mode 100644 src/pages/options/index.pug delete mode 100644 src/pages/options/widgets/about.pug create mode 100644 src/pages/options/widgets/general.ejs delete mode 100644 src/pages/options/widgets/general.pug delete mode 100644 src/pages/options/widgets/imdb.pug delete mode 100644 src/pages/options/widgets/imgur.pug delete mode 100644 src/pages/options/widgets/instagram.pug delete mode 100644 src/pages/options/widgets/lbry.pug delete mode 100644 src/pages/options/widgets/maps.pug delete mode 100644 src/pages/options/widgets/medium.pug delete mode 100644 src/pages/options/widgets/peertube.pug delete mode 100644 src/pages/options/widgets/quora.pug delete mode 100644 src/pages/options/widgets/reddit.pug delete mode 100644 src/pages/options/widgets/reuters.pug delete mode 100644 src/pages/options/widgets/search.pug delete mode 100644 src/pages/options/widgets/sendTargets.pug delete mode 100644 src/pages/options/widgets/tiktok.pug delete mode 100644 src/pages/options/widgets/translate.pug delete mode 100644 src/pages/options/widgets/twitter.pug delete mode 100644 src/pages/options/widgets/wikipedia.pug delete mode 100644 src/pages/options/widgets/youtube.pug delete mode 100644 src/pages/options/widgets/youtubeMusic.pug (limited to 'src/pages/options/index.ejs') diff --git a/package.json b/package.json index 50872aac..ee0d9089 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,8 @@ "test": "web-ext lint --source-dir ./src/ || true", "pug": "pug ./src/pages/options/*.pug ./src/pages/popup/ -P -w", "prettier": "npx prettier --write .", - "instances": "python3 src/instances/get_instances.py; git update-index --assume-unchanged src/instances/blacklist.json src/instances/data.json" + "instances": "python3 src/instances/get_instances.py; git update-index --assume-unchanged src/instances/blacklist.json src/instances/data.json", + "ejs": "npx ejs src/pages/options/index.ejs -f src/config/config.json -o src/pages/options/index.html" }, "repository": { "type": "git", diff --git a/src/assets/images/general-icon.svg b/src/assets/images/general-icon.svg index e69de29b..55c5f8bc 100644 --- a/src/assets/images/general-icon.svg +++ b/src/assets/images/general-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/assets/images/imdb-icon.svg b/src/assets/images/imdb-icon.svg new file mode 100644 index 00000000..a3f4103c --- /dev/null +++ b/src/assets/images/imdb-icon.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + diff --git a/src/assets/images/imdb.svg b/src/assets/images/imdb.svg deleted file mode 100644 index a3f4103c..00000000 --- a/src/assets/images/imdb.svg +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - - - diff --git a/src/assets/images/imgur-icon.png b/src/assets/images/imgur-icon.png new file mode 100644 index 00000000..c23a45b2 Binary files /dev/null and b/src/assets/images/imgur-icon.png differ diff --git a/src/assets/images/imgur.png b/src/assets/images/imgur.png deleted file mode 100644 index c23a45b2..00000000 Binary files a/src/assets/images/imgur.png and /dev/null differ diff --git a/src/assets/images/medium-icon.svg b/src/assets/images/medium-icon.svg index 2939a189..72612486 100644 --- a/src/assets/images/medium-icon.svg +++ b/src/assets/images/medium-icon.svg @@ -1,5 +1,5 @@ - - - - - \ No newline at end of file + + + + + diff --git a/src/assets/images/quora-icon.png b/src/assets/images/quora-icon.png new file mode 100644 index 00000000..d2a06954 Binary files /dev/null and b/src/assets/images/quora-icon.png differ diff --git a/src/assets/images/quora.png b/src/assets/images/quora.png deleted file mode 100644 index d2a06954..00000000 Binary files a/src/assets/images/quora.png and /dev/null differ diff --git a/src/assets/images/reuters-icon.svg b/src/assets/images/reuters-icon.svg new file mode 100644 index 00000000..aab389c3 --- /dev/null +++ b/src/assets/images/reuters-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/images/reuters.svg b/src/assets/images/reuters.svg deleted file mode 100644 index aab389c3..00000000 --- a/src/assets/images/reuters.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/images/send-icon.svg b/src/assets/images/send-icon.svg deleted file mode 100644 index 2ed80a06..00000000 --- a/src/assets/images/send-icon.svg +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - diff --git a/src/assets/images/sendTargets-icon.svg b/src/assets/images/sendTargets-icon.svg new file mode 100644 index 00000000..2ed80a06 --- /dev/null +++ b/src/assets/images/sendTargets-icon.svg @@ -0,0 +1,51 @@ + + + + + + + + + diff --git a/src/assets/images/youtube-music-icon.png b/src/assets/images/youtube-music-icon.png deleted file mode 100644 index a33df696..00000000 Binary files a/src/assets/images/youtube-music-icon.png and /dev/null differ diff --git a/src/assets/images/youtubeMusic-icon.png b/src/assets/images/youtubeMusic-icon.png new file mode 100644 index 00000000..a33df696 Binary files /dev/null and b/src/assets/images/youtubeMusic-icon.png differ diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index b7ee2205..70928786 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -11,7 +11,8 @@ async function getConfig() { fetch("/config/config.json") .then(response => response.text()) .then(data => { - config = JSON.parse(data) + const tmp = JSON.parse(data) + config = tmp.config resolve() }) }) diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 9c5947a7..7337a13d 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -23,6 +23,10 @@ function getRandomInstance(instances) { return instances[~~(instances.length * Math.random())] } +function camelCase(str) { + return str.charAt(0).toUpperCase() + str.slice(1) +} + let cloudflareBlackList = [] let authenticateBlackList = [] let offlineBlackList = [] @@ -107,9 +111,6 @@ function protocolHost(url) { } async function processDefaultCustomInstances(target, name, protocol, document) { - function camelCase(str) { - return str.charAt(0).toUpperCase() + str.slice(1) - } let latencyKey = `${name}Latency` let instancesLatency let nameProtocolElement = document.getElementById(name).getElementsByClassName(protocol)[0] diff --git a/src/config/config.json b/src/config/config.json index 97fd838c..7c391552 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -1,439 +1,459 @@ { - "networks": { - "clearnet": { - "tld": "org", - "name": "Clearnet" - }, - "tor": { - "tld": "onion", - "name": "Tor" - }, - "i2p": { - "tld": "i2p", - "name": "I2P" + "config": { + "networks": { + "clearnet": { + "tld": "org", + "name": "Clearnet" + }, + "tor": { + "tld": "onion", + "name": "Tor" + }, + "i2p": { + "tld": "i2p", + "name": "I2P" + }, + "loki": { + "tld": "loki", + "name": "Lokinet" + } }, - "loki": { - "tld": "loki", - "name": "Lokinet" - } - }, - "services": { - "youtube": { - "frontends": { - "invidious": { - "preferences": { - "cookies": ["PREFS"] + "services": { + "youtube": { + "frontends": { + "invidious": { + "preferences": { + "cookies": ["PREFS"] + } + }, + "piped": { + "preferences": { + "localstorage": [ + "bufferGoal", + "comments", + "disableLBRY", + "enabledCodecs", + "hl", + "homepage", + "instance", + "listen", + "minimizeDescription", + "playerAutoPlay", + "proxyLBRY", + "quality", + "region", + "selectedSkip", + "sponsorblock", + "theme", + "volume", + "watchHistory" + ] + } + }, + "pipedMaterial": { + "preferences": { + "localstorage": ["PREFERENCES"] + } + }, + "cloudtube": { + "preferences": { + "token": "token", + "fetchEndpoint": "/api/settings", + "setEndpoint": "/settings" + } } }, - "piped": { - "preferences": { - "localstorage": [ - "bufferGoal", - "comments", - "disableLBRY", - "enabledCodecs", - "hl", - "homepage", - "instance", - "listen", - "minimizeDescription", - "playerAutoPlay", - "proxyLBRY", - "quality", - "region", - "selectedSkip", - "sponsorblock", - "theme", - "volume", - "watchHistory" - ] - } + "singleInstanceFrontends": ["freetube", "yatte"], + "targets": [ + "^https?:\\/{2}(www\\.|music\\.|m\\.|)youtube.com(\\(?!iframe_api)/.*|$)", + "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", + "^https?:\\/{2}(i|s)\\.ytimg.com\\/vi\\/.*\\/..*", + "^https?:\\/{2}(www\\.|music\\.|)youtube.com\\/watch?v=..*", + "^https?:\\/{2}youtu\\.be\\/..*", + "^https?:\\/{2}(www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" + ], + "name": "Youtube", + "options": { + "disabled": false, + "redirectType": "both", + "frontend": "invidious", + "embedFrontend": "invidious" }, - "pipedMaterial": { - "preferences": { - "localstorage": ["PREFERENCES"] + "imageType": "png", + "embeddable": true + }, + "youtubeMusic": { + "frontends": { + "beatbump": { + "preferences": { + "localstorage": ["settings"], + "indexeddb": "beatbump" + } + }, + "hyperpipe": { + "preferences": { + "localstorage": ["api", "authapi", "codec", "locale", "next", "pipedapi", "quality", "theme", "vol"], + "indexeddb": ["hyperpipedb"] + } } }, - "cloudtube": { - "preferences": { - "token": "token", - "fetchEndpoint": "/api/settings", - "setEndpoint": "/settings" - } - } - }, - "singleInstanceFrontends": ["freetube", "yatte"], - "targets": [ - "^https?:\\/{2}(www\\.|music\\.|m\\.|)youtube.com(\\(?!iframe_api)/.*|$)", - "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(i|s)\\.ytimg.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(www\\.|music\\.|)youtube.com\\/watch?v=..*", - "^https?:\\/{2}youtu\\.be\\/..*", - "^https?:\\/{2}(www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" - ], - "name": "Youtube", - "options": { - "disabled": false, - "redirectType": "both", - "frontend": "invidious", - "embedFrontend": "invidious" - }, - "imageType": "png", - "embeddable": true - }, - "youtubeMusic": { - "frontends": { - "beatbump": {}, - "hyperpipe": {} - }, - "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], - "name": "YT Music", - "options": { - "disabled": false, - "frontend": "beatbump" + "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], + "name": "YT Music", + "options": { + "disabled": false, + "frontend": "beatbump" + }, + "imageType": "png", + "embeddable": false }, - "imageType": "png", - "embeddable": false - }, - "twitter": { - "frontends": { - "nitter": { - "preferences": { - "cookies": [ - "theme", - "infiniteScroll", - "stickyProfile", - "bidiSupport", - "hideTweetStats", - "hideBanner", - "hidePins", - "hideReplies", - "squareAvatars", - "mp4Playback", - "hlsPlayback", - "proxyVideos", - "muteVideos", - "autoplayGifs", - "replaceInstagram", - "replaceReddit", - "replaceTwitter", - "replaceYouTube" - ] + "twitter": { + "frontends": { + "nitter": { + "preferences": { + "cookies": [ + "theme", + "infiniteScroll", + "stickyProfile", + "bidiSupport", + "hideTweetStats", + "hideBanner", + "hidePins", + "hideReplies", + "squareAvatars", + "mp4Playback", + "hlsPlayback", + "proxyVideos", + "muteVideos", + "autoplayGifs", + "replaceInstagram", + "replaceReddit", + "replaceTwitter", + "replaceYouTube" + ] + } } - } - }, - "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], - "name": "Twitter", - "options": { - "disabled": false, - "redirectType": "both" + }, + "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], + "name": "Twitter", + "options": { + "disabled": false, + "redirectType": "both" + }, + "imageType": "png", + "embeddable": true }, - "imageType": "png", - "embeddable": true - }, - "instagram": { - "frontends": { - "bibliogram": { - "preferences": { - "token": "token", - "fetchEndpoint": "/settings.json", - "setEndpoint": "/applysettings" + "instagram": { + "frontends": { + "bibliogram": { + "preferences": { + "token": "token", + "fetchEndpoint": "/settings.json", + "setEndpoint": "/applysettings" + } } - } - }, - "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], - "name": "Instagram", - "options": { "disabled": false }, - "imageType": "png", - "embeddable": false - }, - "tiktok": { - "frontends": { - "proxiTok": {} + }, + "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], + "name": "Instagram", + "options": { "disabled": false }, + "imageType": "png", + "embeddable": false }, - "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], - "name": "TikTok", - "options": { "disabled": false }, - "imageType": "png", - "embeddable": false - }, - "reddit": { - "frontends": { - "libreddit": { - "preferences": { - "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] + "tiktok": { + "frontends": { + "proxiTok": { + "preferences": { + "cookies": ["api-test_endpoints", "theme"] + } } }, - "teddit": { - "preferences": { - "cookies": [ - "collapse_child_comments", - "domain_instagram", - "domain_twitter", - "domain_youtube", - "flairs", - "highlight_controversial", - "nsfw_enabled", - "post_media_max_height", - "show_upvoted_percentage", - "show_upvotes", - "theme", - "videos_muted" - ] - } - } + "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], + "name": "TikTok", + "options": { "disabled": false }, + "imageType": "png", + "embeddable": false }, - "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], - "name": "Reddit", - "options": { - "disabled": false, - "frontend": "libreddit" - }, - "imageType": "png", - "embeddable": false - }, - "imgur": { - "frontends": { - "rimgo": { - "preferences": {} - } - }, - "targets": ["^https?:\\/{2}([im]\\.)?imgur\\.(com|io)(\\/|$)"], - "name": "Imgur", - "options": { "disabled": false }, - "imageType": "png", - "embeddable": false - }, - "wikipedia": { - "frontends": { - "wikiless": { - "preferences": { - "cookies": ["theme", "default_lang"] + "reddit": { + "frontends": { + "libreddit": { + "preferences": { + "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] + } + }, + "teddit": { + "preferences": { + "cookies": [ + "collapse_child_comments", + "domain_instagram", + "domain_twitter", + "domain_youtube", + "flairs", + "highlight_controversial", + "nsfw_enabled", + "post_media_max_height", + "show_upvoted_percentage", + "show_upvotes", + "theme", + "videos_muted" + ] + } } - } - }, - "targets": ["^https?:\\/{2}([a-z]+\\.)*wikipedia\\.org"], - "name": "Wikipedia", - "options": { "disabled": true }, - "imageType": "svg", - "embeddable": false - }, - "medium": { - "frontends": { - "scribe": { - "preferences": {} - } + }, + "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], + "name": "Reddit", + "options": { + "disabled": false, + "frontend": "libreddit" + }, + "imageType": "png", + "embeddable": false }, - "targets": [ - "(?:.*\\.)*(? - <%- include('../widgets/head') %> + <%- include('src/pages/widgets/head') %> + <%- include('src/pages/widgets/links', {config: config}) %>
- <%- include('../widgets/links', {config: config}) %> - <%- include('widgets/general', {config: config}) %> - <%- include('widgets/services', {config: config}) %> - <%- include('widgets/about') %> + <%- include('src/pages/options/widgets/general', {config: config}) %> + <%- include('src/pages/options/widgets/services', {config: config}) %> + <%- include('src/pages/options/widgets/about') %>
diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 5c0aedd5..8908c9bf 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -1,3189 +1,3600 @@ - - - - - General - - + + + + + General + + + - + +
+
+

General

+
+
+
+

Theme

+ +
+
+

+ +
+
+
+

Fallback to normal if no instances are available for the current protocol

+ +
+
+
+

+ +
+
+
+

Latency Threshold

+ + +
+
+
+

+
+
+
+
+   +   +
+ +
+
+
+ +
+ +     + + +   + Export Settings    + + + + + Reset Settings +
+
+
+

Customize Popup

+
+ + +
+ + +
+
+

Youtube

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + +
+
+

Embed Frontend

+ +
+
+ + +
+

Redirect Type

+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
-

General

-
-
-
-

Theme

- -
-
-

- -
-
-
-

Fallback to normal if no instances are available for the current protocol

- -
-
-
-

- -
- -
-

Latency Threshold

- - -
-
-
-

-
-
-
-
-   -   -
- -
-
-
- -
- -     - - -   - Export Settings    - - - - - Reset Settings -
-
-
-

Customize Popup

-
- - -
-
-
-

YouTube

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-

Embedded Videos Frontend

- -
-
-
-

Redirect Type

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

YouTube Music

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Twitter

-
-
-
-

Enable

- -
-
-

Redirect Type

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Instagram

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

TikTok

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Reddit

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Imgur

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Wikipedia

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Medium

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Quora

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

IMDb

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Reuters

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

PeerTube

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

LBRY

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-

Redirect Type

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Search

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-

Note: To use Search, make LibRedirect the Default Search Engine

-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Translate

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Maps

-
-
-
-

Enable

- -
-
-

Frontend

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
-
-

Send Files

-
-
-
-

Enable

- -
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
- - -
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
-
-
- -
-
+ + +
+ +
+ +
+ + +
+ + + +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + + +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ + + +
+
+

YT Music

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Twitter

+
+
+
+

Enable

+ +
+ + + +
+

Redirect Type

+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Instagram

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
-

About

-
-
- -
+ + + + +
+ + + +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + + + + +
+
+

TikTok

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Reddit

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Imgur

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Wikipedia

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Medium

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Quora

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

IMDb

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Reuters

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

PeerTube

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

LBRY

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+

Redirect Type

+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Search

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Translate

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Maps

+
+
+
+

Enable

+ +
+ +
+

Frontend

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ +
+
+

Send Files

+
+
+
+

Enable

+ +
+ + + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+
+

Default Instances

+
+
+
+
+

Custom Instances

+
+
+
+ + +
+
+
+ +
+ +
+ +
+ + + +
+
+

About

+
+
+ +
+ - \ No newline at end of file + diff --git a/src/pages/options/index.pug b/src/pages/options/index.pug deleted file mode 100644 index 3711fdac..00000000 --- a/src/pages/options/index.pug +++ /dev/null @@ -1,36 +0,0 @@ -doctype html -html#elementToShowWithJavaScript(lang="en") - head - meta(charset='utf-8') - meta(name="viewport" content="width=device-width, initial-scale=1") - link(rel="icon" type="image/x-icon" href="../../../assets/images/libredirect.svg") - link(href="../stylesheets/styles.css" rel="stylesheet") - title General - - script(type="module" src="./init.js") - body.option(dir="auto") - include ../widgets/links.pug - +links('general') - div#pages - include ./widgets/general.pug - include ./widgets/youtube.pug - include ./widgets/youtubeMusic.pug - include ./widgets/twitter.pug - include ./widgets/instagram.pug - include ./widgets/tiktok.pug - include ./widgets/reddit.pug - include ./widgets/imgur.pug - include ./widgets/wikipedia.pug - include ./widgets/medium.pug - include ./widgets/quora.pug - include ./widgets/imdb.pug - include ./widgets/reuters.pug - include ./widgets/peertube.pug - include ./widgets/lbry.pug - include ./widgets/search.pug - include ./widgets/translate.pug - include ./widgets/maps.pug - include ./widgets/sendTargets.pug - include ./widgets/about.pug - - script(type="module" src="./index.js") diff --git a/src/pages/options/widgets/about.pug b/src/pages/options/widgets/about.pug deleted file mode 100644 index 954522bb..00000000 --- a/src/pages/options/widgets/about.pug +++ /dev/null @@ -1,17 +0,0 @@ -section#about_page.option-block - .some-block.option-block - h1(data-localise="__MSG_about__") About - hr - .about - .some-block.option-block - h4 Donate: ♥️ - h4 https://libredirect.github.io/donate - .some-block.option-block - h4 FAQ: - h4 https://libredirect.github.io/faq - .some-block.option-block - h4 Docs: - h4 https://libredirect.github.io/docs - .some-block.option-block - h4 Source Code: - h4 https://libredirect.github.io/source_code \ No newline at end of file diff --git a/src/pages/options/widgets/general.ejs b/src/pages/options/widgets/general.ejs new file mode 100644 index 00000000..05ef0959 --- /dev/null +++ b/src/pages/options/widgets/general.ejs @@ -0,0 +1,97 @@ +
+
+

General

+
+
+
+

Theme

+ +
+
+

+ +
+
+
+

Fallback to normal if no instances are available for the current protocol

+ +
+
+
+

+ +
+
+
+

Latency Threshold

+ + +
+
+
+

+
+
+
+
+   +   +
+ +
+
+
+ +
+ +     + + +   + Export Settings    + + + + + Reset Settings +
+
+
+

Customize Popup

+
+ + +
diff --git a/src/pages/options/widgets/general.pug b/src/pages/options/widgets/general.pug deleted file mode 100644 index be3d495e..00000000 --- a/src/pages/options/widgets/general.pug +++ /dev/null @@ -1,210 +0,0 @@ -section#general_page.option-block - .some-block.option-block - h1(data-localise="__MSG_general__") General - hr - - .some-block.option-block - h4(data-localise="__MSG_theme__") Theme - select#theme - option(value="DEFAULT" data-localise="__MSG_system__") System - option(value="light" data-localise="__MSG_light__") Light - option(value="dark" data-localise="__MSG_dark__") Dark - - //- .some-block.option-block - h4 Tor Browser - input#firstPartyIsolate(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_protocol__") - select#protocol - option(value="clearnet" data-localise="__MSG_normal__") Clearnet - option(value="tor") Tor - option(value="i2p") I2P - option(value="loki") Lokinet - - #protocol-fallback - .some-block.option-block - h4(data-localise="__MSG_protocolFallback__") Fallback to normal if no instances are available for the current protocol - input#protocol-fallback-checkbox(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_autoRedirect__") - input#auto-redirect(type="checkbox") - - form - .some-block.option-block - h4(data-localise="__MSG_latencyThreshold") Latency Threshold - output#latency-output(for="latencyInput" name="latencyOutput") - input#latency-input(type="range" min="50" max="5000" value="1000" name="latencyInput" step="50") - - .some-block.option-block - h4(data-localise="__MSG_exceptions__") - - form#custom-exceptions-instance-form - .some-block.option-block - .some-block(style="padding:0;") - input#exceptions-custom-instance(placeholder="https://www.google.com" type="url") - |  - select#exceptions-custom-instance-type - option(value="url") URL - option(value="regex") Regex - |  - button#exceptions-add-instance.add(type="submit") - svg(xmlns="http://www.w3.org/2000/svg" height="20px" viewBox="0 0 24 24" width="20px" fill="currentColor") - path(d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z") - - #exceptions-custom-checklist.checklist - - .buttons.buttons-inline - a#update-instances.button.button-inline - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z") - x(data-localise="__MSG_updateInstances__") Update Instances - - |    - - .buttons.buttons-inline - - label#import_settings_text.button.button-inline(for="import-settings") - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z") - |  - x(data-localise="__MSG_importSettings__") Import Settings - input#import-settings.button.button-inline(type="file" style="display:none;") - - |    - - a#export-settings.button.button-inline - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M10.09 15.59L11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67l-2.58 2.59zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z") - |  - x(data-localise="__MSG_exportSettings__") Export Settings - - |    - - a#reset-settings.button.button-inline - svg(xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M12,5V2L8,6l4,4V7c3.31,0,6,2.69,6,6c0,2.97-2.17,5.43-5,5.91v2.02c3.95-0.49,7-3.85,7-7.93C20,8.58,16.42,5,12,5z") - path(d="M6,13c0-1.65,0.67-3.15,1.76-4.24L6.34,7.34C4.9,8.79,4,10.79,4,13c0,4.08,3.05,7.44,7,7.93v-2.02 C8.17,18.43,6,15.97,6,13z") - x(data-localise="__MSG_resetSettings__") Reset Settings - hr - - .some-block.option-block - h4(data-localise="__MSG_customPopup__") Customize Popup - - #popup-frontends-checklist.checklist-popup - div - div - img(src="../../../assets/images/youtube-icon.png") - x(data-localise="__MSG_youtube__") YouTube - input#youtube(type="checkbox") - div - div - img(src="../../../assets/images/youtube-music-icon.png") - x(data-localise="__MSG_ytmusic__") YoutubeMusic - input#youtubeMusic(type="checkbox") - div - div - img(src="../../../assets/images/twitter-icon.png") - x(data-localise="__MSG_twitter__") Twitter - input#twitter(type="checkbox") - - div - div - img(src="../../../assets/images/instagram-icon.png") - x(data-localise="__MSG_instagram__") Instagram - input#instagram(type="checkbox") - - div - div - img(src="../../../assets/images/tiktok-icon.png") - x(data-localise="__MSG_tiktok__") TikTok - input#tiktok(type="checkbox") - - div - div - img(src="../../../assets/images/imgur.png") - x(data-localise="__MSG_imgur__") Imgur - input#imgur(type="checkbox") - - div - div - img(src="../../../assets/images/reddit-icon.png") - x(data-localise="__MSG_reddit__") Reddit - input#reddit(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor") - path(d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z") - x(data-localise="__MSG_search__") Search - input#search(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor") - path(d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04zM18.5 10h-2L12 22h2l1.12-3h4.75L21 22h2l-4.5-12zm-2.62 7l1.62-4.33L19.12 17h-3.24z") - x(data-localise="__MSG_translate__") Translate - input#translate(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor") - path(d="M20.5 3l-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5zM10 5.47l4 1.4v11.66l-4-1.4V5.47zm-5 .99l3-1.01v11.7l-3 1.16V6.46zm14 11.08l-3 1.01V6.86l3-1.16v11.84z") - x(data-localise="__MSG_maps__") Maps - input#maps(type="checkbox") - - div - div - img(src="../../../assets/images/wikipedia-icon.svg") - x(data-localise="__MSG_wikipedia__") Wikipedia - input#wikipedia(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1770 1000" fill="currentColor") - circle(cx="500" cy="500" r="500") - ellipse(ry="475" rx="250" cy="501" cx="1296") - ellipse(cx="1682" cy="502" rx="88" ry="424") - x(data-localise="__MSG_medium__") Medium - input#medium(type="checkbox") - - div - div - img(src="../../../assets/images/quora.png") - x(data-localise="__MSG_quora__") Quora - input#quora(type="checkbox") - - div - div - img(src="../../../assets/images/imdb.svg") - x(data-localise="__MSG_imdb__") IMDb - input#imdb(type="checkbox") - - div - div - img(src="../../../assets/images/reuters.svg") - x(data-localise="__MSG_reuters__") Reuters - input#reuters(type="checkbox") - - div - div - img(src="../../../assets/images/peertube-icon.svg") - x(data-localise="__MSG_peertube__") PeerTube - input#peertube(type="checkbox") - - div - div - img(src="../../../assets/images/lbry-icon.png") - x(data-localise="__MSG_lbry__") LBRY - input#lbry(type="checkbox") - - div - div - svg(xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor") - path(d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z") - x(data-localise="__MSG_sendFiles__") Send Files - input#sendTargets(type="checkbox") - - - script(type="module" src="./widgets/general.js") diff --git a/src/pages/options/widgets/imdb.pug b/src/pages/options/widgets/imdb.pug deleted file mode 100644 index 67eb8eca..00000000 --- a/src/pages/options/widgets/imdb.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#imdb_page.option-block - .some-block.option-block - h1(data-localise="__MSG_imdb__") IMDb - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#imdb-enable(type="checkbox") - - #libremdb - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://libremdb.com') - include ../../widgets/latency.pug - +latency('libremdb') - .tor - include ../../widgets/instances.pug - +instances('http://libremdb.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://libremdb.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://libremdb.loki') - - script(type="module" src="./widgets/imdb.js") diff --git a/src/pages/options/widgets/imgur.pug b/src/pages/options/widgets/imgur.pug deleted file mode 100644 index 46c497ec..00000000 --- a/src/pages/options/widgets/imgur.pug +++ /dev/null @@ -1,27 +0,0 @@ -section#imgur_page.option-block - .some-block.option-block - h1(data-localise="__MSG_imgur__") Imgur - hr - - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#imgur-enable(type="checkbox") - - #rimgo - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://rimgo.com') - include ../../widgets/latency.pug - +latency('rimgo') - .tor - include ../../widgets/instances.pug - +instances('http://rimgo.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://rimgo.onion') - .loki - include ../../widgets/instances.pug - +instances('http://rimgo.loki') - - script(type="module" src="./widgets/imgur.js") diff --git a/src/pages/options/widgets/instagram.pug b/src/pages/options/widgets/instagram.pug deleted file mode 100644 index 702aa651..00000000 --- a/src/pages/options/widgets/instagram.pug +++ /dev/null @@ -1,27 +0,0 @@ -section#instagram_page.option-block - .some-block.option-block - h1(data-localise="__MSG_instagram__") Instagram - hr - - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#instagram-enable(type="checkbox") - - #bibliogram - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://bibliogram.com') - include ../../widgets/latency.pug - +latency('bibliogram') - .tor - include ../../widgets/instances.pug - +instances('https://bibliogram.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://bibliogram.onion') - .loki - include ../../widgets/instances.pug - +instances('http://bibliogram.loki') - - script(type="module" src="./widgets/instagram.js") diff --git a/src/pages/options/widgets/lbry.pug b/src/pages/options/widgets/lbry.pug deleted file mode 100644 index 9f01ebc6..00000000 --- a/src/pages/options/widgets/lbry.pug +++ /dev/null @@ -1,39 +0,0 @@ -section#lbry_page.option-block - .some-block.option-block - h1(data-localise="__MSG_lbry__") LBRY - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#lbry-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#lbry-frontend - option(value="librarian") Librarian - option(value="lbryDesktop" data-localise="__MSG_lbryDesktop__") LBRY Desktop - - .some-block.option-block - h4(data-localise="__MSG_redirectType__") Redirect Type - select#lbry-redirect_type - option(value="both" data-localise="__MSG_both__") both - option(value="sub_frame" data-localise="__MSG_onlyEmbedded__") Only Embedded - option(value="main_frame" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded - - #librarian - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://librarian.com') - include ../../widgets/latency.pug - +latency('librarian') - .tor - include ../../widgets/instances.pug - +instances('https://librarian.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://librarian.onion') - .loki - include ../../widgets/instances.pug - +instances('http://librarian.loki') - - script(type="module" src="./widgets/lbry.js") diff --git a/src/pages/options/widgets/maps.pug b/src/pages/options/widgets/maps.pug deleted file mode 100644 index 66d0d411..00000000 --- a/src/pages/options/widgets/maps.pug +++ /dev/null @@ -1,32 +0,0 @@ -section#maps_page.option-block - .some-block.option-block - h1(data-localise="__MSG_maps__") Maps - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#maps-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#maps-frontend - option(value="osm") OpenStreetMap - option(value="facil") Facil Map - - #facil - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://facilmap.com') - include ../../widgets/latency.pug - +latency('facil') - .tor - +instances('http://facilmap.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://facilmap.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://facilmap.loki') - - script(type="module" src="./widgets/maps.js") diff --git a/src/pages/options/widgets/medium.pug b/src/pages/options/widgets/medium.pug deleted file mode 100644 index 60223fdf..00000000 --- a/src/pages/options/widgets/medium.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#medium_page.option-block - .some-block.option-block - h1(data-localise="__MSG_medium__") Medium - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#medium-enable(type="checkbox") - - #scribe - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://scribe.com') - include ../../widgets/latency.pug - +latency('scribe') - .tor - include ../../widgets/instances.pug - +instances('http://scribe.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://scribe.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://scribe.loki') - - script(type="module" src="./widgets/medium.js") diff --git a/src/pages/options/widgets/peertube.pug b/src/pages/options/widgets/peertube.pug deleted file mode 100644 index 2b818df4..00000000 --- a/src/pages/options/widgets/peertube.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#peertube_page.option-block - .some-block.option-block - h1(data-localise="__MSG_peertube__") PeerTube - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#peertube-enable(type="checkbox") - - #simpleertube - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://simpleertube.com') - include ../../widgets/latency.pug - +latency('simpleertube') - .tor - include ../../widgets/instances.pug - +instances('http://simpleertube.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://simpleertube.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://simpleertube.loki') - - script(type="module" src="./widgets/peertube.js") diff --git a/src/pages/options/widgets/quora.pug b/src/pages/options/widgets/quora.pug deleted file mode 100644 index 7c3c52ac..00000000 --- a/src/pages/options/widgets/quora.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#quora_page.option-block - .some-block.option-block - h1(data-localise="__MSG_quora__") Quora - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#quora-enable(type="checkbox") - - #quetre - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://quetre.com') - include ../../widgets/latency.pug - +latency('quetre') - .tor - include ../../widgets/instances.pug - +instances('http://quetre.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://quetre.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://quetre.loki') - - script(type="module" src="./widgets/quora.js") diff --git a/src/pages/options/widgets/reddit.pug b/src/pages/options/widgets/reddit.pug deleted file mode 100644 index 24c437f4..00000000 --- a/src/pages/options/widgets/reddit.pug +++ /dev/null @@ -1,48 +0,0 @@ -section#reddit_page.option-block - .some-block.option-block - h1(data-localise="__MSG_reddit__") Reddit - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#reddit-enable(type="checkbox") - - .some-block.option-block - h4#frontend(data-localise="__MSG_frontend__") Frontend - select#reddit-frontend - option(value="libreddit") Libreddit - option(value="teddit") Teddit - - #libreddit - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://libreddit.com') - include ../../widgets/latency.pug - +latency('libreddit') - .tor - include ../../widgets/instances.pug - +instances('http://libreddit.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://libreddit.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://libreddit.loki') - - #teddit - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://teddit.com') - +latency('teddit') - .tor - include ../../widgets/instances.pug - +instances('http://teddit.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://teddit.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://teddit.loki') - - script(type="module" src="./widgets/reddit.js") diff --git a/src/pages/options/widgets/reuters.pug b/src/pages/options/widgets/reuters.pug deleted file mode 100644 index 985965a1..00000000 --- a/src/pages/options/widgets/reuters.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#reuters_page.option-block - .some-block.option-block - h1(data-localise="__MSG_reuters__") Reuters - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#reuters-enable(type="checkbox") - - #neuters - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://neuters.com') - include ../../widgets/latency.pug - +latency('neuters') - .tor - include ../../widgets/instances.pug - +instances('http://neuters.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://neuters.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://neuters.loki') - - script(type="module" src="./widgets/reuters.js") diff --git a/src/pages/options/widgets/search.pug b/src/pages/options/widgets/search.pug deleted file mode 100644 index f449e0db..00000000 --- a/src/pages/options/widgets/search.pug +++ /dev/null @@ -1,85 +0,0 @@ -section#search_page.option-block - .some-block.option-block - h1(data-localise="__MSG_search__") Search - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#search-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#search-frontend - option(value="searxng") SearXNG - option(value="searx") SearX - option(value="whoogle") Whoogle - option(value="librex") LibreX - - .some-block - h4(data-localise="__MSG_searchNote__") Note: To use Search, make LibRedirect the Default Search Engine - - #searx - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://searx.com') - include ../../widgets/latency.pug - +latency('searx') - .tor - include ../../widgets/instances.pug - +instances('http://searx.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://searx.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://searx.loki') - - #searxng - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://searxng.com') - +latency('searxng') - .tor - include ../../widgets/instances.pug - +instances('http://searxng.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://searxng.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://searxng.loki') - - #whoogle - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://whoogle.com') - +latency('whoogle') - .tor - include ../../widgets/instances.pug - +instances('http://whoogle.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://whoogle.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://whoogle.loki') - - #librex - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://librex.com') - +latency('librex') - .tor - include ../../widgets/instances.pug - +instances('http://librex.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://librex.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://librex.loki') - - script(type="module" src="./widgets/search.js") diff --git a/src/pages/options/widgets/sendTargets.pug b/src/pages/options/widgets/sendTargets.pug deleted file mode 100644 index e7676b37..00000000 --- a/src/pages/options/widgets/sendTargets.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#sendTargets_page.option-block - .some-block.option-block - h1(data-localise="__MSG_sendFiles__") Send Files - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#sendTargets-enable(type="checkbox") - - #send - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://send.com') - include ../../widgets/latency.pug - +latency('send') - .tor - include ../../widgets/instances.pug - +instances('http://send.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://send.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://send.loki') - - script(type="module" src="./widgets/sendTargets.js") diff --git a/src/pages/options/widgets/services.ejs b/src/pages/options/widgets/services.ejs index a1b0a538..aed5872b 100644 --- a/src/pages/options/widgets/services.ejs +++ b/src/pages/options/widgets/services.ejs @@ -1,5 +1,5 @@ -<% config.services.forEach(service=>{ %> -
+<% for (const service in config.services) { %> +

<%= config.services[service].name %>

@@ -8,33 +8,35 @@

Enable

+ <% if ((Object.keys(config.services[service].frontends).length > 1) || config.services[service].singleInstanceFrontends) { %>

Frontend

- <% if (config.services[service].embeddable) { %> - <% if (config.services[service].singleInstanceFrontends) { %> + <% } %> + <% if ((config.services[service].singleInstanceFrontends) && (Object.keys(config.services[service].frontends).length > 1)) { %>
-

Embedded Videos Frontend

+

Embed Frontend

<% } %> + <% if (config.services[service].embeddable) { %>

Redirect Type

- @@ -42,9 +44,9 @@
<% } %>
- <% config.services[service].frontends.forEach(frontend=>{ %> + <% for (const frontend in config.services[service].frontends) { %>
- <% config.networks.forEach(network=>{ %> + <% for (const network in config.networks) { %>

Default Instances

@@ -56,7 +58,7 @@
- +
<% } %>
- <% }); %> - <% }); %> + <% }; %> +
+ <% }; %>
-<% }); %> +<% }; %> diff --git a/src/pages/options/widgets/services.js b/src/pages/options/widgets/services.js index 5f370a18..c7955b40 100644 --- a/src/pages/options/widgets/services.js +++ b/src/pages/options/widgets/services.js @@ -12,7 +12,8 @@ async function getConfig() { fetch("/config/config.json") .then(response => response.text()) .then(data => { - config = JSON.parse(data) + const tmp = JSON.parse(data) + config = tmp.config resolve() }) }) diff --git a/src/pages/options/widgets/tiktok.pug b/src/pages/options/widgets/tiktok.pug deleted file mode 100644 index 986bd270..00000000 --- a/src/pages/options/widgets/tiktok.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#tiktok_page.option-block - .some-block.option-block - h1(data-localise="__MSG_tiktok__") TikTok - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#tiktok-enable(type="checkbox") - - #proxiTok - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://proxitok.com') - include ../../widgets/latency.pug - +latency('proxiTok') - .tor - include ../../widgets/instances.pug - +instances('http://proxitok.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://proxitok.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://proxitok.loki') - - script(type="module" src="./widgets/tiktok.js") diff --git a/src/pages/options/widgets/translate.pug b/src/pages/options/widgets/translate.pug deleted file mode 100644 index 40d42bca..00000000 --- a/src/pages/options/widgets/translate.pug +++ /dev/null @@ -1,48 +0,0 @@ -section#translate_page.option-block - .some-block.option-block - h1(data-localise="__MSG_translate__") Translate - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#translate-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#translate-frontend - option(value="simplyTranslate") SimplyTranslate - option(value="lingva") Lingva - - hr - #simplyTranslate - .clearnet - include ../../widgets/instances.pug - +instances('https://simplytranslate.org') - include ../../widgets/latency.pug - +latency('simplyTranslate') - .tor - include ../../widgets/instances.pug - +instances('http://hxecvvetgrznmprg.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://simplytranslate.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://simplytranslate.loki') - - #lingva - .clearnet - include ../../widgets/instances.pug - +instances('https://lingvatranslate.com') - +latency('lingva') - .tor - include ../../widgets/instances.pug - +instances('http://lingvatranslate.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://lingvatranslate.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://lingvatranslate.loki') - - - script(type="module" src="./widgets/translate.js") diff --git a/src/pages/options/widgets/twitter.pug b/src/pages/options/widgets/twitter.pug deleted file mode 100644 index fa7f1320..00000000 --- a/src/pages/options/widgets/twitter.pug +++ /dev/null @@ -1,33 +0,0 @@ -section#twitter_page.option-block - .some-block.option-block - h1(data-localise="__MSG_twitter__") Twitter - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#twitter-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_redirectType__") Redirect Type - select#twitter-redirect_type - option(value="both" data-localise="__MSG_both__") both - option(value="sub_frame" data-localise="__MSG_onlyEmbedded__") Only Embedded - option(value="main_frame" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded - - #nitter - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://nitter.com') - include ../../widgets/latency.pug - +latency('nitter') - .tor - include ../../widgets/instances.pug - +instances('http://nitter.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://nitter.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://nitter.loki') - - script(type="module" src="./widgets/twitter.js") diff --git a/src/pages/options/widgets/wikipedia.pug b/src/pages/options/widgets/wikipedia.pug deleted file mode 100644 index a0ad37c3..00000000 --- a/src/pages/options/widgets/wikipedia.pug +++ /dev/null @@ -1,26 +0,0 @@ -section#wikipedia_page.option-block - .some-block.option-block - h1(data-localise="__MSG_wikipedia__") Wikipedia - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#wikipedia-enable(type="checkbox") - - #wikiless - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://wikiless.com') - include ../../widgets/latency.pug - +latency('wikiless') - .tor - include ../../widgets/instances.pug - +instances('http://wikiless.onion') - .i2p - include ../../widgets/instances.pug - +instances('https://wikiless.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://wikiless.loki') - - script(type="module" src="./widgets/wikipedia.js") diff --git a/src/pages/options/widgets/youtube.pug b/src/pages/options/widgets/youtube.pug deleted file mode 100644 index cf48d9be..00000000 --- a/src/pages/options/widgets/youtube.pug +++ /dev/null @@ -1,103 +0,0 @@ -section#youtube_page.option-block - .some-block.option-block - h1(data-localise="__MSG_youtube__") YouTube - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#youtube-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#youtube-frontend - option(value="invidious") Invidious - option(value="piped") Piped - option(value="pipedMaterial") Piped-Material - option(value="cloudtube") CloudTube - option(value="freetube") FreeTube - option(value="yatte") Yattee - - #youtube-embedded_frontend - .some-block.option-block - h4(data-localise="__MSG_embeddedVids__") Embedded Videos Frontend - select#youtube-embed_frontend - option(value="invidious") Invidious - option(value="piped") Piped - option(value="pipedMaterial") Piped-Material - option(value="cloudtube") CloudTube - - .some-block.option-block - h4(data-localise="__MSG_redirectType__") Redirect Type - select#youtube-redirect_type - option(value="both" data-localise="__MSG_both__") both - option(value="onlyEmbedded" data-localise="__MSG_onlyEmbedded__") Only Embedded - option(value="onlyNotEmbedded" data-localise="__MSG_onlyNotEmbedded__") Only Not Embedded - - #invidious - hr - .clearnet - include ../../widgets/instances.pug - +instances('http://invidious.com') - include ../../widgets/latency.pug - +latency('invidious') - .tor - include ../../widgets/instances.pug - +instances('http://invidious.onion') - .i2p - include ../../widgets/instances.pug - +instances('http://invidious.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://invidious.loki') - - #piped - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://piped.com') - include ../../widgets/latency.pug - +latency('piped') - .tor - +instances('http://piped.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://piped.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://piped.loki') - - #pipedMaterial - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://piped-material.com') - include ../../widgets/latency.pug - +latency('pipedMaterial') - .tor - +instances('http://piped-material.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://piped-material.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://piped-material.loki') - - #cloudtube - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://cloudtube.com') - include ../../widgets/latency.pug - +latency('cloudtube') - .tor - +instances('http://cloudtube.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://cloudtube.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://cloudtube.loki') - - script(type="module" src="./widgets/youtube.js") diff --git a/src/pages/options/widgets/youtubeMusic.pug b/src/pages/options/widgets/youtubeMusic.pug deleted file mode 100644 index 9c2c08cf..00000000 --- a/src/pages/options/widgets/youtubeMusic.pug +++ /dev/null @@ -1,49 +0,0 @@ -section#youtubeMusic_page.option-block - .some-block.option-block - h1(data-localise="__MSG_ytmusic__") YouTube Music - hr - .some-block.option-block - h4(data-localise="__MSG_enable__") Enable - input#youtubeMusic-enable(type="checkbox") - - .some-block.option-block - h4(data-localise="__MSG_frontend__") Frontend - select#youtubeMusic-frontend - option(value="beatbump") Beatbump - option(value="hyperpipe") Hyperpipe - - #beatbump - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://beatbump.org') - include ../../widgets/latency.pug - +latency('beatbump') - .tor - +instances('http://beatbump.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://beatbump.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://beatbump.loki') - - #hyperpipe - hr - .clearnet - include ../../widgets/instances.pug - +instances('https://hyperpipe.org') - include ../../widgets/latency.pug - +latency('hyperpipe') - .tor - +instances('http://hyperpipe.onion') - include ../../widgets/instances.pug - .i2p - include ../../widgets/instances.pug - +instances('http://hyperpipe.i2p') - .loki - include ../../widgets/instances.pug - +instances('http://hyperpipe.loki') - - script(type="module" src="./widgets/youtubeMusic.js") diff --git a/src/pages/widgets/links.ejs b/src/pages/widgets/links.ejs index eacfe91b..fe0cd37c 100644 --- a/src/pages/widgets/links.ejs +++ b/src/pages/widgets/links.ejs @@ -1,7 +1,7 @@ -- cgit 1.4.1 From 0c1595ec3a0f8f38f322f2e70598dbe208151554 Mon Sep 17 00:00:00 2001 From: Hygna Date: Mon, 19 Sep 2022 17:30:39 +0100 Subject: Changes Made get_instances.py more efficient Further work to get widgets/services.js to work properly --- src/assets/javascripts/services.js | 33 +- src/config/config.json | 171 ++-- src/instances/get_instances.py | 484 ++++-------- src/pages/options/index.ejs | 10 +- src/pages/options/index.html | 1326 ++++++++++---------------------- src/pages/options/widgets/general.ejs | 12 +- src/pages/options/widgets/services.ejs | 61 +- src/pages/options/widgets/services.js | 58 +- src/pages/widgets/links.ejs | 4 +- 9 files changed, 793 insertions(+), 1366 deletions(-) (limited to 'src/pages/options/index.ejs') diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 70928786..affe0d1a 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -28,8 +28,8 @@ function init() { //cur = current for (const service in config.services) { options[service] = {} - browser.storage.local.get([`disable${utils.camelCase(service)}`, `${service}RedirectType`, `${service}Frontend`], r => { - options[service].disabled = r["disable" + utils.camelCase(service)] + browser.storage.local.get([`${utils.camelCase(service)}Enable`, `${service}RedirectType`, `${service}Frontend`], r => { + options[service].enabled = r[utils.camelCase(service) + "Enable"] options[service].frontend = r[service + "Frontend"] options[service].redirectType = r[service + "RedirectType"] // console.log(r) @@ -60,19 +60,19 @@ function all(service) { return tmp } -getConfig() +await getConfig() init() browser.storage.onChanged.addListener(init) function redirect(url, type, initiator) { let randomInstance - let frontend = options[service].frontend + let frontend let network = options.network let networkFallback = options.networkFallback - let redirectType = options[service].redirectType + let redirectType if (url.pathname == "/") return for (const service in config.services) { - if (options[service].disabled && !disableOverride) continue + if (!options[service].enabled && !disableOverride) continue let targets = service.targets if (targets == "datajson") { browser.storage.local.get(`${service}Targets`, (targets = r[service + "Targets"])) @@ -81,11 +81,18 @@ function redirect(url, type, initiator) { if (initiator && (all(service).includes(initiator.origin) || targets.includes(initiator.host))) continue if (!targets.some(rx => rx.test(url.href))) continue if (type != redirectType && type != "both") continue + + frontend = options[service].frontend + redirectType = options[service].redirectType + // browser.storage.local.get(`${service}Frontend`, (frontend = r[service + "Frontend"])) - let instanceList = [...[service + utils.camelCase(network) + "RedirectsChecks"], ...[service + utils.camelCase(network) + "CustomRedirects"]] - if (instanceList.length === 0 && networkFallback) instanceList = [...[service + "ClearnetRedirectsChecks"], ...[service + "ClearnetCustomRedirects"]] - if (instanceList.length === 0 && redirects.indexOf(frontend) != -1) return - randomInstance = utils.getRandomInstance(instanceList) + + if (config.services[service].frontends[frontend].instanceList) { + let instanceList = [...[frontend + utils.camelCase(network) + "RedirectsChecks"], ...[frontend + utils.camelCase(network) + "CustomRedirects"]] + if (instanceList.length === 0 && networkFallback) instanceList = [...[frontend + "ClearnetRedirectsChecks"], ...[frontend + "ClearnetCustomRedirects"]] + if (instanceList.length === 0 && redirects.indexOf(frontend) != -1) return + randomInstance = utils.getRandomInstance(instanceList) + } } // Here is a (temperory) space for defining constants required in 2 or more switch cases. @@ -114,7 +121,7 @@ function redirect(url, type, initiator) { .replace("/watch?v=", "/listen?id=") .replace("/channel/", "/artist/") .replace("/playlist?list=", "/playlist/VL") - .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=song") + .replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/") + "?filter=all") case "hyperpipe": return `${randomInstance}${url.pathname}${url.search}`.replace(/\/search\?q=.*/, searchQuery => searchQuery.replace("?q=", "/")) case "bibliogram": @@ -386,7 +393,7 @@ function initDefaults() { // console.log(redirects) // console.log(config) browser.storage.local.set({ - redirects, + redirects: redirects.invidious, }) browser.storage.local.get(["cloudflareBlackList", "authenticateBlackList", "offlineBlackList"], async r => { // console.log(r) @@ -395,7 +402,7 @@ function initDefaults() { browser.storage.local.set({ [service + "Targets"]: redirects[service] }) } for (const defaultOption in config.services[service].defaults) { - browser.storage.local.set({ [defaultOption]: config.services[service].defaults[defaultOption] }) + browser.storage.local.set({ [service + camelCase(defaultOption)]: config.services[service].defaults[defaultOption] }) } for (const frontend in config.services[service].frontends) { let clearnetChecks = redirects[frontend].clearnet diff --git a/src/config/config.json b/src/config/config.json index 7c391552..d0bf7edd 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -24,7 +24,10 @@ "invidious": { "preferences": { "cookies": ["PREFS"] - } + }, + "name": "Invidious", + "embeddable": true, + "instanceList": true }, "piped": { "preferences": { @@ -48,19 +51,38 @@ "volume", "watchHistory" ] - } + }, + "name": "Piped", + "embeddable": true, + "instanceList": true }, "pipedMaterial": { "preferences": { "localstorage": ["PREFERENCES"] - } + }, + "name": "Piped-Material", + "embeddable": false, + "instanceList": true }, "cloudtube": { "preferences": { "token": "token", "fetchEndpoint": "/api/settings", "setEndpoint": "/settings" - } + }, + "name": "CloudTube", + "embeddable": false, + "instanceList": true + }, + "freetube": { + "name": "FreeTube", + "embeddable": false, + "instanceList": false + }, + "yattee": { + "name": "Yattee", + "embeddable": false, + "instanceList": false } }, "singleInstanceFrontends": ["freetube", "yatte"], @@ -74,7 +96,7 @@ ], "name": "Youtube", "options": { - "disabled": false, + "enabled": true, "redirectType": "both", "frontend": "invidious", "embedFrontend": "invidious" @@ -88,19 +110,23 @@ "preferences": { "localstorage": ["settings"], "indexeddb": "beatbump" - } + }, + "name": "Beatbump", + "instanceList": true }, "hyperpipe": { "preferences": { "localstorage": ["api", "authapi", "codec", "locale", "next", "pipedapi", "quality", "theme", "vol"], "indexeddb": ["hyperpipedb"] - } + }, + "name": "HyperPipe", + "instanceList": true } }, "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], "name": "YT Music", "options": { - "disabled": false, + "enabled": true, "frontend": "beatbump" }, "imageType": "png", @@ -130,13 +156,16 @@ "replaceTwitter", "replaceYouTube" ] - } + }, + "name": "Nitter", + "embeddable": true, + "instanceList": true } }, "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], "name": "Twitter", "options": { - "disabled": false, + "enabled": true, "redirectType": "both" }, "imageType": "png", @@ -149,12 +178,14 @@ "token": "token", "fetchEndpoint": "/settings.json", "setEndpoint": "/applysettings" - } + }, + "name": "Bibliogram", + "instanceList": false } }, "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], "name": "Instagram", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "png", "embeddable": false }, @@ -163,12 +194,14 @@ "proxiTok": { "preferences": { "cookies": ["api-test_endpoints", "theme"] - } + }, + "name": "ProxiTok", + "instanceList": true } }, "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], "name": "TikTok", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "png", "embeddable": false }, @@ -177,7 +210,9 @@ "libreddit": { "preferences": { "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] - } + }, + "name": "Libreddit", + "instanceList": true }, "teddit": { "preferences": { @@ -195,13 +230,15 @@ "theme", "videos_muted" ] - } + }, + "name": "Teddit", + "instanceList": true } }, "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], "name": "Reddit", "options": { - "disabled": false, + "enabled": true, "frontend": "libreddit" }, "imageType": "png", @@ -210,12 +247,14 @@ "imgur": { "frontends": { "rimgo": { - "preferences": {} + "preferences": {}, + "name": "rimgo", + "instanceList": true } }, "targets": ["^https?:\\/{2}([im]\\.)?imgur\\.(com|io)(\\/|$)"], "name": "Imgur", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "png", "embeddable": false }, @@ -224,19 +263,23 @@ "wikiless": { "preferences": { "cookies": ["theme", "default_lang"] - } + }, + "name": "Wikiless", + "instanceList": true } }, "targets": ["^https?:\\/{2}([a-z]+\\.)*wikipedia\\.org"], "name": "Wikipedia", - "options": { "disabled": true }, + "options": { "enabled": false }, "imageType": "svg", "embeddable": false }, "medium": { "frontends": { "scribe": { - "preferences": {} + "preferences": {}, + "name": "Scribe", + "instanceList": true } }, "targets": [ @@ -260,7 +303,7 @@ "^writingcooperative\\.com " ], "name": "Medium", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "svg", "embeddable": false }, @@ -269,12 +312,14 @@ "quetre": { "preferences": { "localstorage": ["theme"] - } + }, + "name": "Quetre", + "instanceList": true } }, "targets": ["^https?:\\/{2}([a-z]+\\.)*quora\\.com.*"], "name": "Quora", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "png", "embeddable": false }, @@ -283,36 +328,42 @@ "libremdb": { "preferences": { "localstorage": ["theme"] - } + }, + "name": "libremdb", + "instanceList": true } }, "targets": ["^https?:\\/{2}(?:www\\.|)imdb\\.com.*"], "name": "IMDb", - "options": { "disabled": true }, + "options": { "enabled": false }, "imageType": "svg", "embeddable": false }, "reuters": { "frontends": { "neuters": { - "preferences": {} + "preferences": {}, + "name": "Neuters", + "instanceList": true } }, "targets": ["^https?:\\/{2}(www\\.|)reuters\\.com.*"], "name": "Reuters", - "options": { "disabled": true }, + "options": { "enabled": false }, "imageType": "svg", "embeddable": false }, "peertube": { "frontends": { "simpleertube": { - "preferences": {} + "preferences": {}, + "name": "SimpleerTube", + "instanceList": true } }, "targets": "datajson", "name": "PeerTube", - "options": { "disabled": true }, + "options": { "enabled": false }, "imageType": "svg", "embeddable": false }, @@ -322,14 +373,21 @@ "preferences": { "cookies": ["nsfw", "theme"], "localstorage": ["autoplay", "autoplayNextVid", "collapseComments", "plyr", "sb_categories", "showRelated"] - } + }, + "name": "Librarian", + "embeddable": true, + "instanceList": true + }, + "lbryDesktop": { + "name": "LBRY Desktop", + "embeddable": false, + "instanceList": false } }, - "singleInstanceFrontends": ["lbryDesktop"], "targets": ["^https?:\\/{2}odysee\\.com", "^https?:\\/{2}lbry\\.tv"], "name": "LBRY", "options": { - "disabled": true, + "enabled": false, "frontend": "librarian", "redirectType": "both" }, @@ -359,7 +417,9 @@ "theme", "tokens" ] - } + }, + "name": "SearX", + "instanceList": true }, "searxng": { "preferences": { @@ -384,21 +444,27 @@ "theme", "tokens" ] - } + }, + "name": "SearXNG", + "instanceList": true }, "whoogle": { - "preferences": {} + "preferences": {}, + "name": "Whoogle", + "instanceList": true }, "librex": { "preferences": { "cookies": ["bibliogram", "disable_special", "invidious", "libreddit", "nitter", "proxitok", "theme", "wikiless"] - } + }, + "name": "LibreX", + "instanceList": true } }, "targets": ["^https?:\\/{2}search\\.libredirect\\.invalid"], "name": "Search", "options": { - "disabled": false, + "enabled": true, "frontend": "searxng" }, "imageType": "svg", @@ -409,18 +475,22 @@ "simplyTranslate": { "preferences": { "cookies": ["from_lang", "to_lang", "tts_enabled", "use_text_fields"] - } + }, + "name": "SimplyTranslate", + "instanceList": true }, "lingva": { "preferences": { "localstorage": ["isauto", "source", "target"] - } + }, + "name": "Lingva", + "instanceList": true } }, "targets": ["^https?:\\/{2}translate\\.google(\\.[a-z]{2,3}){1,2}\\/"], "name": "Translate", "options": { - "disabled": false, + "enabled": true, "frontend": "simplyTranslate" }, "imageType": "svg", @@ -429,14 +499,19 @@ "maps": { "frontends": { "facil": { - "preferences": {} + "preferences": {}, + "name": "FacilMap", + "instanceList": true + }, + "osm": { + "name": "OpenStreetMap", + "instanceList": false } }, - "singleInstanceFrontends": ["osm"], "targets": ["^https?:\\/{2}(((www|maps)\\.)?(google\\.).*(\\/maps)|maps\\.(google\\.).*)"], "name": "Maps", "options": { - "disabled": false, + "enabled": true, "frontend": "osm" }, "imageType": "svg", @@ -445,12 +520,14 @@ "sendTargets": { "frontends": { "send": { - "preferences": {} + "preferences": {}, + "name": "Send", + "instanceList": "true" } }, "targets": ["^https?:\\/{2}send\\.libredirect\\.invalid\\/$", "^https?:\\/{2}send\\.firefox\\.com\\/$", "^https?:\\/{2}sendfiles\\.online\\/$"], "name": "Send Files", - "options": { "disabled": false }, + "options": { "enabled": true }, "imageType": "svg", "embeddable": false } diff --git a/src/instances/get_instances.py b/src/instances/get_instances.py index a95eb46f..770f2581 100644 --- a/src/instances/get_instances.py +++ b/src/instances/get_instances.py @@ -3,12 +3,10 @@ import requests import json from urllib.parse import urlparse -from bs4 import BeautifulSoup import re from colorama import Fore, Back, Style from urllib.parse import urlparse import socket -import subprocess mightyList = {} @@ -18,6 +16,11 @@ torRegex = startRegex + "onion" + endRegex i2pRegex = startRegex + "i2p" + endRegex lokiRegex = startRegex + "loki" + endRegex authRegex = "https?:\/{2}\S+:\S+@(?:[^\s\/]+\.)+[a-zA-Z0-9]+" + endRegex +config = {} + +with open('./config/config.json') as file: + config = file + def filterLastSlash(urlList): tmp = {} @@ -102,70 +105,162 @@ def is_offline(url): except: return False +def fetchCache(frontend, name) : + # json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) + with open('./src/instances/data.json') as file: + mightyList[frontend] = json.load(file).frontend + print(Fore.ORANGE + 'Failed' + Style.RESET_ALL + ' to fetch ' + name) + +def fetchFromFile(frontend, name): + #json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) + with open('./src/instances/' + frontend + '.json') as file: + mightyList[frontend] = json.load(file) + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + +def fetchJsonList(frontend, name, url, urlItem): + try: + r = requests.get(url) + rJson = json.loads(r.text) + _list = {} + for network in config.networks: + _list[network] = [] + if type(urlItem) is 'str': + for item in rJson: + if urlItem is not None: + tmpUrl = item[urlItem] + else: + tmpUrl = item + if tmpUrl.strip() == "": + continue + elif re.search(torRegex, tmpUrl): + _list['tor'].append(tmpUrl) + elif re.search(i2pRegex, tmpUrl): + _list['i2p'].append(tmpUrl) + elif re.search(lokiRegex, tmpUrl): + _list['loki'].append(tmpUrl) + else: + _list['clearnet'].append(tmpUrl) + else: + for i in range(config.networks.length): + # The expected order is the same as in config.json. If the frontend doesn't have any instances for a specified network, use None + if urlItem != None: + for item in rJson: + if network in item: + if item[network].strip() != "": + _list[config.networks[i]].append(item[urlItem[i]]) + + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) + +def fetchRegexList(frontend, name, url, regex): + try: + r = requests.get(url) + _list = {} + for network in config.networks: + _list[network] = [] + + tmp = re.findall(regex, r.text) + + for item in tmp: + if item.strip() == "": + continue + elif re.search(torRegex, item): + _list['tor'].append(item) + elif re.search(i2pRegex, item): + _list['i2p'].append(item) + elif re.search(lokiRegex, item): + _list['loki'].append(item) + else: + _list['clearnet'].append(item) + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) + +def fetchTextList(frontend, name, url, prepend): + try: + r = requests.get(url) + tmp = r.text.strip().split('\n') + + _list = {} + for network in config.networks: + _list[network] = [] + + for item in tmp: + item = prepend + item + if re.search(torRegex, item): + _list['tor'].append(item) + elif re.search(i2pRegex, item): + _list['i2p'].append(item) + elif re.search(lokiRegex, item): + _list['loki'].append(item) + else: + _list['clearnet'].append(item) + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) + def invidious(): - r = requests.get('https://api.invidious.io/instances.json') - rJson = json.loads(r.text) - invidiousList = {} - invidiousList['clearnet'] = [] - invidiousList['tor'] = [] - invidiousList['i2p'] = [] - invidiousList['loki'] = [] - for instance in rJson: - if instance[1]['type'] == 'https': - invidiousList['clearnet'].append(instance[1]['uri']) - elif instance[1]['type'] == 'onion': - invidiousList['tor'].append(instance[1]['uri']) - mightyList['invidious'] = invidiousList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Invidious') + name = 'Invidious' + frontend = 'invidious' + try: + _list = {} + _list['clearnet'] = [] + _list['tor'] = [] + _list['i2p'] = [] + _list['loki'] = [] + r = requests.get('https://api.invidious.io/instances.json') + rJson = json.loads(r.text) + for instance in rJson: + if instance[1]['type'] == 'https': + _list['clearnet'].append(instance[1]['uri']) + elif instance[1]['type'] == 'onion': + _list['tor'].append(instance[1]['uri']) + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) def piped(): - r = requests.get( - 'https://raw.githubusercontent.com/wiki/TeamPiped/Piped/Instances.md') - - tmp = re.findall( - '(?:[^\s\/]+\.)+[a-zA-Z]+ (?:\(Official\) )?\| (https:\/{2}(?:[^\s\/]+\.)+[a-zA-Z]+) \| ', r.text) - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - for item in tmp: - try: - url = requests.get(item, timeout=5).url - if url.strip("/") == item: + frontend = 'piped' + name = 'Piped' + try: + _list = {} + _list['clearnet'] = [] + _list['tor'] = [] + _list['i2p'] = [] + _list['loki'] = [] + r = requests.get( + 'https://raw.githubusercontent.com/wiki/TeamPiped/Piped/Instances.md') + + tmp = re.findall( + '(?:[^\s\/]+\.)+[a-zA-Z]+ (?:\(Official\) )?\| (https:\/{2}(?:[^\s\/]+\.)+[a-zA-Z]+) \| ', r.text) + for item in tmp: + try: + url = requests.get(item, timeout=5).url + if url.strip("/") == item: + continue + else: + _list['clearnet'].append(url) + except: continue - else: - _list['clearnet'].append(url) - except: - continue - mightyList['piped'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Piped') + mightyList[frontend] = _list + print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + name) + except: + fetchCache(frontend, name) def pipedMaterial(): - r = requests.get( - 'https://raw.githubusercontent.com/mmjee/Piped-Material/master/README.md') - - tmp = re.findall( - r"\| (https?:\/{2}(?:\S+\.)+[a-zA-Z0-9]*) +\|", r.text) - pipedMaterialList = {} - pipedMaterialList['clearnet'] = [] - pipedMaterialList['tor'] = [] - pipedMaterialList['i2p'] = [] - pipedMaterialList['loki'] = [] - for item in tmp: - pipedMaterialList['clearnet'].append(item) - mightyList['pipedMaterial'] = pipedMaterialList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'pipedMaterial') + fetchRegexList('pipedMaterial', 'Piped-Material', 'https://raw.githubusercontent.com/mmjee/Piped-Material/master/README.md', r"\| (https?:\/{2}(?:\S+\.)+[a-zA-Z0-9]*) +\|") def cloudtube(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/cloudtube.json') as file: - mightyList['cloudtube'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'CloudTube') + fetchCache('cloudtube', 'Cloudtube') def proxitok(): @@ -186,19 +281,7 @@ def proxitok(): def send(): - r = requests.get( - 'https://gitlab.com/timvisee/send-instances/-/raw/master/README.md') - tmp = re.findall( - r"- ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z0-9]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}", r.text) - sendList = {} - sendList['clearnet'] = [] - sendList['tor'] = [] - sendList['i2p'] = [] - sendList['loki'] = [] - for item in tmp: - sendList['clearnet'].append(item) - mightyList['send'] = sendList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Send') + fetchRegexList('send', 'Send', 'https://gitlab.com/timvisee/send-instances/-/raw/master/README.md', r"- ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z0-9]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}") def nitter(): @@ -230,150 +313,35 @@ def nitter(): def bibliogram(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/bibliogram.json') as file: - mightyList['bibliogram'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Bibliogram') + fetchFromFile('bibliogram', 'Bibliogram') def libreddit(): - r = requests.get( - 'https://raw.githubusercontent.com/spikecodes/libreddit/master/README.md') - libredditList = {} - libredditList['clearnet'] = [] - libredditList['tor'] = [] - libredditList['i2p'] = [] - libredditList['loki'] = [] - - tmp = re.findall( - r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|", r.text) - - for item in tmp: - if re.search(torRegex, item): - libredditList['tor'].append(item) - else: - libredditList['clearnet'].append(item) - mightyList['libreddit'] = libredditList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'LibReddit') + fetchRegexList('libreddit', 'Libreddit', 'https://raw.githubusercontent.com/spikecodes/libreddit/master/README.md', r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|") def teddit(): - r = requests.get( - 'https://codeberg.org/teddit/teddit/raw/branch/main/instances.json') - rJson = json.loads(r.text) - tedditList = {} - tedditList['clearnet'] = [] - tedditList['tor'] = [] - tedditList['i2p'] = [] - tedditList['loki'] = [] - for item in rJson: - url = item['url'] - if url != '': - tedditList['clearnet'].append(url) - if 'onion' in item: - onion = item['onion'] - if onion != '': - tedditList['tor'].append(onion) - - mightyList['teddit'] = tedditList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Teddit') + fetchJsonList('teddit', 'Teddit', 'https://codeberg.org/teddit/teddit/raw/branch/main/instances.json', ['url', 'onion', 'i2p', None]) def wikiless(): - r = requests.get('https://wikiless.org/instances.json') - rJson = json.loads(r.text) - wikilessList = {} - wikilessList['clearnet'] = [] - wikilessList['tor'] = [] - wikilessList['i2p'] = [] - wikilessList['loki'] = [] - for item in rJson: - if 'url' in item: - if item['url'].strip() != "": - wikilessList['clearnet'].append(item['url']) - if 'onion' in item: - if item['onion'].strip() != "": - wikilessList['tor'].append(item['onion']) - if 'i2p' in item: - if item['i2p'].strip() != "": - wikilessList['i2p'].append(item['i2p']) - mightyList['wikiless'] = wikilessList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Wikiless') + fetchJsonList('wikiless', 'Wikiless', 'https://wikiless.org/instances.json', ['url', 'onion', 'i2p', None]) def scribe(): - r = requests.get( - 'https://git.sr.ht/~edwardloveall/scribe/blob/main/docs/instances.json') - rJson = json.loads(r.text) - scribeList = {} - scribeList['clearnet'] = [] - scribeList['tor'] = [] - scribeList['i2p'] = [] - scribeList['loki'] = [] - for item in rJson: - scribeList['clearnet'].append(item) - mightyList['scribe'] = scribeList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Scribe') + fetchJsonList('scribe', 'Scribe', 'https://git.sr.ht/~edwardloveall/scribe/blob/main/docs/instances.json', None) def quetre(): - r = requests.get( - 'https://raw.githubusercontent.com/zyachel/quetre/main/README.md') - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - - tmp = re.findall( - r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|", r.text) - - - for item in tmp: - if re.search(torRegex, item): - _list['tor'].append(item) - else: - _list['clearnet'].append(item) - mightyList['quetre'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Quetre') + fetchRegexList('quetre', 'Quetre', 'https://raw.githubusercontent.com/zyachel/quetre/main/README.md', r"\| \[.*\]\(([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)\)*\|*[A-Z]{0,}.*\|.*\|") def libremdb(): - r = requests.get( - 'https://raw.githubusercontent.com/zyachel/libremdb/main/README.md') - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - - tmp = re.findall( - r"\| ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)*\|*[A-Z]{0,}.*\|.*\|", r.text) + fetchRegexList('libremdb', 'libremdb', 'https://raw.githubusercontent.com/zyachel/libremdb/main/README.md', r"\| ([-a-zA-Z0-9@:%_\+.~#?&//=]{2,}\.[a-z]{2,}\b(?:\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?)*\|*[A-Z]{0,}.*\|.*\|") - for item in tmp: - if item.strip() == "": - continue - if re.search(torRegex, item): - _list['tor'].append(item) - else: - _list['clearnet'].append(item) - - mightyList['libremdb'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Libremdb') - def simpleertube(): - r = requests.get('https://simple-web.org/instances/simpleertube') - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - for item in r.text.strip().split('\n'): - _list['clearnet'].append('https://' + item) - - mightyList['simpleertube'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'SimpleerTube') + fetchTextList('simpleertube', 'SimpleerTube', 'https://simple-web.org/instances/simpleertube', 'https://') def simplytranslate(): @@ -403,19 +371,7 @@ def simplytranslate(): def linvgatranslate(): - r = requests.get( - 'https://raw.githubusercontent.com/TheDavidDelta/lingva-translate/main/instances.json') - rJson = json.loads(r.text) - lingvaList = {} - lingvaList['clearnet'] = [] - lingvaList['tor'] = [] - lingvaList['i2p'] = [] - lingvaList['loki'] = [] - for item in rJson: - lingvaList['clearnet'].append(item) - - mightyList['lingva'] = lingvaList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'LinvgaTranslate') + fetchJsonList('lingva', 'LingvaTranslate', 'https://raw.githubusercontent.com/TheDavidDelta/lingva-translate/main/instances.json', None) def searx_searxng(): @@ -454,140 +410,34 @@ def searx_searxng(): def whoogle(): - r = requests.get( - 'https://raw.githubusercontent.com/benbusby/whoogle-search/main/misc/instances.txt') - tmpList = r.text.strip().split('\n') - whoogleList = {} - whoogleList['clearnet'] = [] - whoogleList['tor'] = [] - whoogleList['i2p'] = [] - whoogleList['loki'] = [] - for item in tmpList: - if re.search(torRegex, item): - whoogleList['tor'].append(item) - elif re.search(torRegex, item): - whoogleList['i2p'].append(item) - else: - whoogleList['clearnet'].append(item) - mightyList['whoogle'] = whoogleList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Whoogle') + fetchTextList('whoogle', 'Whoogle', 'https://raw.githubusercontent.com/benbusby/whoogle-search/main/misc/instances.txt', '') def librex(): - r = requests.get( - 'https://raw.githubusercontent.com/hnhx/librex/main/README.md') - _list = {} - _list['clearnet'] = [] - _list['tor'] = [] - _list['i2p'] = [] - _list['loki'] = [] - - tmp = re.findall( - r"\| {1,2}\[(?:(?:[a-zA-Z0-9]+\.)+[a-zA-Z]{2,}|✅)\]\((https?:\/{2}(?:[a-zA-Z0-9]+\.)+[a-zA-Z0-9]{2,})", r.text) - - for item in tmp: - if item.strip() == "": - continue - elif re.search(torRegex, item): - _list['tor'].append(item) - elif re.search(i2pRegex, item): - _list['i2p'].append(item) - else: - _list['clearnet'].append(item) - mightyList['librex'] = _list - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Librex') + fetchRegexList('librex', 'LibreX', 'https://raw.githubusercontent.com/hnhx/librex/main/README.md', r"\| {1,2}\[(?:(?:[a-zA-Z0-9]+\.)+[a-zA-Z]{2,}|✅)\]\((https?:\/{2}(?:[a-zA-Z0-9]+\.)+[a-zA-Z0-9]{2,})") def rimgo(): - r = requests.get( - 'https://codeberg.org/video-prize-ranch/rimgo/raw/branch/main/instances.json') - rJson = json.loads(r.text) - rimgoList = {} - rimgoList['clearnet'] = [] - rimgoList['tor'] = [] - rimgoList['i2p'] = [] - rimgoList['loki'] = [] - for item in rJson: - if 'url' in item: - rimgoList['clearnet'].append(item['url']) - if 'onion' in item: - rimgoList['tor'].append(item['onion']) - if 'i2p' in item: - rimgoList['i2p'].append(item['i2p']) - mightyList['rimgo'] = rimgoList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Rimgo') + fetchJsonList('rimgo', 'rimgo', 'https://codeberg.org/video-prize-ranch/rimgo/raw/branch/main/instances.json', ['url', 'onion', 'i2p', None]) def librarian(): - r = requests.get( - 'https://codeberg.org/librarian/librarian/raw/branch/main/instances.json') - rJson = json.loads(r.text) - librarianList = {} - librarianList['clearnet'] = [] - librarianList['tor'] = [] - librarianList['i2p'] = [] - librarianList['loki'] = [] - instances = rJson['instances'] - for item in instances: - url = item['url'] - if url.strip() == "": - continue - elif re.search(torRegex, url): - librarianList['tor'].append(url) - elif re.search(i2pRegex, url): - librarianList['i2p'].append(url) - elif re.search(lokiRegex, url): - librarianList['loki'].append(url) - else: - librarianList['clearnet'].append(url) - mightyList['librarian'] = librarianList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Librarian') - + fetchJsonList('librarian', 'Librarian', 'https://codeberg.org/librarian/librarian/raw/branch/main/instances.json', 'url') def neuters(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/neuters.json') as file: - mightyList['neuters'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Neuters') + fetchFromFile('neuters', 'Neuters') def beatbump(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/beatbump.json') as file: - mightyList['beatbump'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Beatbump') + fetchFromFile('beatbump', 'Beatbump') def hyperpipe(): - r = requests.get( - 'https://codeberg.org/Hyperpipe/pages/raw/branch/main/api/frontend.json') - rJson = json.loads(r.text) - hyperpipeList = {} - hyperpipeList['clearnet'] = [] - hyperpipeList['tor'] = [] - hyperpipeList['i2p'] = [] - hyperpipeList['loki'] = [] - for item in rJson: - url = item['url'] - if url.strip() == "": - continue - elif re.search(torRegex, url): - hyperpipeList['tor'].append(url) - elif re.search(i2pRegex, url): - hyperpipeList['i2p'].append(url) - elif re.search(lokiRegex, url): - hyperpipeList['loki'].append(url) - else: - hyperpipeList['clearnet'].append(url) - mightyList['hyperpipe'] = hyperpipeList - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'Hyperpipe') + fetchJsonList('hyperpipe', 'Hyperpipe', 'https://codeberg.org/Hyperpipe/pages/raw/branch/main/api/frontend.json', 'url') def facil(): - json_object = json.dumps(mightyList, ensure_ascii=False, indent=2) - with open('./src/instances/facil.json') as file: - mightyList['facil'] = json.load(file) - print(Fore.GREEN + 'Fetched ' + Style.RESET_ALL + 'FacilMap') + fetchFromFile('facil', 'FacilMap') def peertube(): diff --git a/src/pages/options/index.ejs b/src/pages/options/index.ejs index 0240f992..e0ce3c3c 100644 --- a/src/pages/options/index.ejs +++ b/src/pages/options/index.ejs @@ -1,12 +1,12 @@ - <%- include('src/pages/widgets/head') %> + <%- include('src/pages/widgets/head') -%> - <%- include('src/pages/widgets/links', {config: config}) %> + <%- include('src/pages/widgets/links', {config: config}) -%>
- <%- include('src/pages/options/widgets/general', {config: config}) %> - <%- include('src/pages/options/widgets/services', {config: config}) %> - <%- include('src/pages/options/widgets/about') %> + <%- include('src/pages/options/widgets/general', {config: config}) -%> + <%- include('src/pages/options/widgets/services', {config: config}) -%> + <%- include('src/pages/options/widgets/about') -%>
diff --git a/src/pages/options/index.html b/src/pages/options/index.html index 8908c9bf..df6bec2a 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -8,50 +8,29 @@ General - -
@@ -69,16 +48,12 @@

+
@@ -145,126 +120,108 @@

Customize Popup

- - -
+

Youtube


Enable

- +
-

Frontend

- +

Frontend

+
- - -
+

Embed Frontend

- - -
+

Redirect Type

- - - + +
- -
- -
- -
+
+
+

Default Instances

@@ -359,8 +294,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -392,10 +324,8 @@
- -
- -
+
+

Default Instances

@@ -415,10 +345,8 @@
- -
- -
+
+

Default Instances

@@ -438,14 +366,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -465,8 +390,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -498,10 +420,8 @@
- -
- -
+
+

Default Instances

@@ -521,10 +441,8 @@
- -
- -
+
+

Default Instances

@@ -544,14 +462,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -571,8 +486,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -604,10 +516,8 @@
- -
- -
+
+

Default Instances

@@ -627,10 +537,8 @@
- -
- -
+
+

Default Instances

@@ -650,14 +558,11 @@
- -
+ - -
- -
+
+

Default Instances

@@ -677,8 +582,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -710,10 +612,8 @@
- -
- -
+
+

Default Instances

@@ -733,10 +633,8 @@
- -
- -
+
+

Default Instances

@@ -756,13 +654,11 @@
- -
+ - +
-

YT Music

@@ -770,28 +666,20 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -811,8 +699,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -844,10 +729,8 @@
- -
- -
+
+

Default Instances

@@ -867,10 +750,8 @@
- -
- -
+
+

Default Instances

@@ -890,14 +771,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -917,8 +795,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -950,10 +825,8 @@
- -
- -
+
+

Default Instances

@@ -973,10 +846,8 @@
- -
- -
+
+

Default Instances

@@ -996,13 +867,11 @@
- -
+ - +
-

Twitter

@@ -1010,25 +879,19 @@

Enable

- +
- - - -
+

Redirect Type

- - - + +
- -
- -
- -
+
+
+

Default Instances

@@ -1048,8 +911,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1081,10 +941,8 @@
- -
- -
+
+

Default Instances

@@ -1104,10 +962,8 @@
- -
- -
+
+

Default Instances

@@ -1127,13 +983,11 @@
- -
+
- +
-

Instagram

@@ -1141,121 +995,11 @@

Enable

- +
- - - -
- -
- -
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
- -
- - -
- -
- -
-
-

Default Instances

-
-

-
-

Custom Instances

-
-
-
- - -
-
-
-
- -
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
- -
- -
-
-

Default Instances

-
-
-
-
-

Custom Instances

-
-
-
- - -
-
-
- -
- -
-
-

TikTok

@@ -1263,16 +1007,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -1292,8 +1031,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1325,10 +1061,8 @@
- -
- -
+
+

Default Instances

@@ -1348,10 +1082,8 @@
- -
- -
+
+

Default Instances

@@ -1371,13 +1103,11 @@
- -
+
- +
-

Reddit

@@ -1385,28 +1115,20 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -1426,8 +1148,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1459,10 +1178,8 @@
- -
- -
+
+

Default Instances

@@ -1482,10 +1199,8 @@
- -
- -
+
+

Default Instances

@@ -1505,14 +1220,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1532,8 +1244,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1565,10 +1274,8 @@
- -
- -
+
+

Default Instances

@@ -1588,10 +1295,8 @@
- -
- -
+
+

Default Instances

@@ -1611,13 +1316,11 @@
- -
+ - +
-

Imgur

@@ -1625,16 +1328,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -1654,8 +1352,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1687,10 +1382,8 @@
- -
- -
+
+

Default Instances

@@ -1710,10 +1403,8 @@
- -
- -
+
+

Default Instances

@@ -1733,13 +1424,11 @@
- -
+
- +
-

Wikipedia

@@ -1747,16 +1436,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -1776,8 +1460,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1809,10 +1490,8 @@
- -
- -
+
+

Default Instances

@@ -1832,10 +1511,8 @@
- -
- -
+
+

Default Instances

@@ -1855,13 +1532,11 @@
- -
+
- +
-

Medium

@@ -1869,16 +1544,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -1898,8 +1568,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -1931,10 +1598,8 @@
- -
- -
+
+

Default Instances

@@ -1954,10 +1619,8 @@
- -
- -
+
+

Default Instances

@@ -1977,13 +1640,11 @@
- -
+
- +
-

Quora

@@ -1991,16 +1652,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -2020,8 +1676,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2053,10 +1706,8 @@
- -
- -
+
+

Default Instances

@@ -2076,10 +1727,8 @@
- -
- -
+
+

Default Instances

@@ -2099,13 +1748,11 @@
- -
+
- +
-

IMDb

@@ -2113,16 +1760,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -2142,8 +1784,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2175,10 +1814,8 @@
- -
- -
+
+

Default Instances

@@ -2198,10 +1835,8 @@
- -
- -
+
+

Default Instances

@@ -2221,13 +1856,11 @@
- -
+
- +
-

Reuters

@@ -2235,16 +1868,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -2264,8 +1892,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2297,10 +1922,8 @@
- -
- -
+
+

Default Instances

@@ -2320,10 +1943,8 @@
- -
- -
+
+

Default Instances

@@ -2343,13 +1964,11 @@
- -
+
- +
-

PeerTube

@@ -2357,16 +1976,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -2386,8 +2000,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2419,10 +2030,8 @@
- -
- -
+
+

Default Instances

@@ -2442,10 +2051,8 @@
- -
- -
+
+

Default Instances

@@ -2465,13 +2072,11 @@
- -
+
- +
-

LBRY

@@ -2479,37 +2084,37 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
+
+
+

Embed Frontend

+ +
+
+

Redirect Type

- - - + +
- -
- -
- -
+
+
+

Default Instances

@@ -2529,8 +2134,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2562,10 +2164,8 @@
- -
- -
+
+

Default Instances

@@ -2585,10 +2185,8 @@
- -
- -
+
+

Default Instances

@@ -2608,13 +2206,11 @@
- -
+
- +
-

Search

@@ -2622,32 +2218,22 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -2667,8 +2253,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2700,10 +2283,8 @@
- -
- -
+
+

Default Instances

@@ -2723,10 +2304,8 @@
- -
- -
+
+

Default Instances

@@ -2746,14 +2325,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2773,8 +2349,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2806,10 +2379,8 @@
- -
- -
+
+

Default Instances

@@ -2829,10 +2400,8 @@
- -
- -
+
+

Default Instances

@@ -2852,14 +2421,11 @@
- -
+ - -
- -
+
+

Default Instances

@@ -2879,8 +2445,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -2912,10 +2475,8 @@
- -
- -
+
+

Default Instances

@@ -2935,10 +2496,8 @@
- -
- -
+
+

Default Instances

@@ -2958,14 +2517,11 @@
- -
+ - -
- -
+
+

Default Instances

@@ -2985,8 +2541,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3018,10 +2571,8 @@
- -
- -
+
+

Default Instances

@@ -3041,10 +2592,8 @@
- -
- -
+
+

Default Instances

@@ -3064,13 +2613,11 @@
- -
+ - +
-

Translate

@@ -3078,28 +2625,20 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -3119,8 +2658,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3152,10 +2688,8 @@
- -
- -
+
+

Default Instances

@@ -3175,10 +2709,8 @@
- -
- -
+
+

Default Instances

@@ -3198,14 +2730,11 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3225,8 +2754,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3258,10 +2784,8 @@
- -
- -
+
+

Default Instances

@@ -3281,10 +2805,8 @@
- -
- -
+
+

Default Instances

@@ -3304,13 +2826,11 @@
- -
+ - +
-

Maps

@@ -3318,28 +2838,20 @@

Enable

- +
-

Frontend

- +

Frontend

+
- - - -
- -
- -
+
+
+

Default Instances

@@ -3359,8 +2871,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3392,10 +2901,8 @@
- -
- -
+
+

Default Instances

@@ -3415,10 +2922,8 @@
- -
- -
+
+

Default Instances

@@ -3438,13 +2943,11 @@
- -
+
- +
-

Send Files

@@ -3452,16 +2955,11 @@

Enable

- +
- - - -
- -
- -
+
+
+

Default Instances

@@ -3481,8 +2979,7 @@
- -
+
- -
- -
+
+

Default Instances

@@ -3514,10 +3009,8 @@
- -
- -
+
+

Default Instances

@@ -3537,10 +3030,8 @@
- -
- -
+
+

Default Instances

@@ -3560,15 +3051,13 @@
- -
+
- +
-

About

@@ -3593,7 +3082,6 @@
- diff --git a/src/pages/options/widgets/general.ejs b/src/pages/options/widgets/general.ejs index 05ef0959..d68a2280 100644 --- a/src/pages/options/widgets/general.ejs +++ b/src/pages/options/widgets/general.ejs @@ -14,10 +14,10 @@

+
@@ -84,14 +84,14 @@

Customize Popup

diff --git a/src/pages/options/widgets/services.ejs b/src/pages/options/widgets/services.ejs index aed5872b..bc75f288 100644 --- a/src/pages/options/widgets/services.ejs +++ b/src/pages/options/widgets/services.ejs @@ -1,4 +1,4 @@ -<% for (const service in config.services) { %> +<% for (const service in config.services) { -%>

<%= config.services[service].name %>

@@ -6,47 +6,47 @@

Enable

- +
- <% if ((Object.keys(config.services[service].frontends).length > 1) || config.services[service].singleInstanceFrontends) { %> + <% if (Object.keys(config.services[service].frontends).length > 1) { %>
-

Frontend

- +

Frontend

+
- <% } %> - <% if ((config.services[service].singleInstanceFrontends) && (Object.keys(config.services[service].frontends).length > 1)) { %> -
+ <% if (config.services[service].embeddable) { _%> +

Embed Frontend

- <% } %> - <% if (config.services[service].embeddable) { %> + <% } _%> + <% } _%> + <% if (config.services[service].embeddable) { _%>

Redirect Type

- - - + +
- <% } %> + <% } _%>
- <% for (const frontend in config.services[service].frontends) { %> + <% for (const frontend in config.services[service].frontends) { -%> + <% if (config.services[service].frontends[frontend].instanceList) { _%>
- <% for (const network in config.networks) { %> + <% for (const network in config.networks) { -%>

Default Instances

@@ -67,7 +67,7 @@
- <% if (network == "clearnet") { %> + <% if (network == "clearnet") { _%>
- <% } %> + <% } _%>
- <% }; %> + <% } %>
- <% }; %> + <% } _%> + <% } %>
-<% }; %> +<% } %> diff --git a/src/pages/options/widgets/services.js b/src/pages/options/widgets/services.js index c7955b40..4a53a749 100644 --- a/src/pages/options/widgets/services.js +++ b/src/pages/options/widgets/services.js @@ -1,13 +1,10 @@ import utils from "../../../assets/javascripts/utils.js" -// const frontends = new Array("librarian") -// const protocols = new Array("clearnet", "tor", "i2p", "loki") - let config, network, divs = {} -async function getConfig() { +function getConfig() { return new Promise(resolve => { fetch("/config/config.json") .then(response => response.text()) @@ -19,7 +16,7 @@ async function getConfig() { }) } -getConfig() +await getConfig() browser.storage.local.get("network", r => { network = r.network @@ -27,45 +24,50 @@ browser.storage.local.get("network", r => { function changeFrontendsSettings(service) { for (const frontend in config.services[service].frontends) { - const frontendDiv = document.getElementById(frontend) - if (frontend == divs[service].frontend.value) { - frontendDiv.style.display = "block" - } else { - frontendDiv.style.display = "none" + if (config.services[service].frontends[frontend].instanceList && config.services[service].frontends.length > 1) { + const frontendDiv = document.getElementById(frontend) + if (divs[service].frontend == null) { + console.log(frontend) + } + if (frontend == divs[service].frontend.value) { + frontendDiv.style.display = "block" + } else { + frontendDiv.style.display = "none" + } } } } function changeNetworkSettings(selectedNetwork) { for (const frontend in config.frontends) { - const frontendDiv = document.getElementById(frontend) - for (const network in config.networks) { - const networkDiv = frontendDiv.getElementsByClassName(network)[0] - if (network == selectedNetwork) { - networkDiv.style.display = "block" - } else { - networkDiv.style.display = "none" + if (config.services[service].frontends[frontend].instanceList) { + const frontendDiv = document.getElementById(frontend) + for (const network in config.networks) { + const networkDiv = frontendDiv.getElementsByClassName(network)[0] + if (network == selectedNetwork) { + networkDiv.style.display = "block" + } else { + networkDiv.style.display = "none" + } } } } } -for (service in config.services) { +for (const service in config.services) { + divs[service] = {} divs[service][service] = document.getElementById(`${service}_page`) for (const option in config.services[service].options) { divs[service][option] = document.getElementById(`${service}-${option}`) browser.storage.local.get([`${service + utils.camelCase(option)}`], r => { - if (typeof config.services[service].options[option] == "boollean") divs[service][option].checked = !r[service + utils.camelCase(option)] + if (typeof config.services[service].options[option] == "boollean") divs[service][option].checked = r[service + utils.camelCase(option)] else divs[service][option].value = !r[service + utils.camelCase(option)] }) divs[service][option].addEventListener("change", () => { - if (typeof config.services[service].options[option] == "boollean") { - browser.storage.local.set({ [service + utils.camelCase(option)]: !divs[service][option].checked }) - } else { - browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].value }) - } + if (typeof config.services[service].options[option] == "boollean") browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].checked }) + else browser.storage.local.set({ [service + utils.camelCase(option)]: divs[service][option].value }) changeFrontendsSettings() }) } @@ -74,9 +76,11 @@ for (service in config.services) { changeNetworkSettings(network) for (const frontend in config.services[service].frontends) { - for (const network in config.networks) { - utils.processDefaultCustomInstances(service, frontend, network, document) + if (config.services[service].frontends[frontend].instanceList) { + for (const network in config.networks) { + utils.processDefaultCustomInstances(service, frontend, network, document) + } + utils.latency(service, frontend, document, location) } - utils.latency(service, frontend, document, location) } } diff --git a/src/pages/widgets/links.ejs b/src/pages/widgets/links.ejs index fe0cd37c..c28d3668 100644 --- a/src/pages/widgets/links.ejs +++ b/src/pages/widgets/links.ejs @@ -1,7 +1,7 @@ -- cgit 1.4.1 From 378fab21c081735311f4b3dab9d3423d955b400b Mon Sep 17 00:00:00 2001 From: Hygna Date: Mon, 26 Sep 2022 18:32:32 +0100 Subject: Changes Changed some regex Made ejs no longer need extra config member variable Added url reversal --- src/assets/javascripts/services.js | 42 +- src/assets/javascripts/utils.js | 8 +- src/config/config.json | 1012 ++++++++++++++++----------------- src/instances/get_instances.py | 30 +- src/pages/options/index.ejs | 6 +- src/pages/options/widgets/general.js | 3 +- src/pages/options/widgets/services.js | 3 +- src/pages/popup/popup.ejs | 4 +- src/pages/popup/popup.js | 3 +- src/pages/widgets/links.ejs | 8 +- 10 files changed, 556 insertions(+), 563 deletions(-) (limited to 'src/pages/options/index.ejs') diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 309d5528..25e998d2 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -11,8 +11,7 @@ async function getConfig() { fetch("/config/config.json") .then(response => response.text()) .then(data => { - const tmp = JSON.parse(data) - config = tmp.config + config = JSON.parse(data) resolve() }) }) @@ -55,7 +54,7 @@ function all(service) { for (const frontend in config.services[service].frontends) { if (config.services[service].frontends[frontend].instanceList) { for (const network in config.networks) { - tmp.push(...redirects[frontend][network]) + tmp.push(...redirects[frontend][network], ...options[frontend][network].custom) } } else if (config.services[service].frontends[frontend].singleInstance != undefined) tmp.push(config.services[service].frontends[frontend].singleInstance) } @@ -168,10 +167,10 @@ function redirect(url, type, initiator) { } else if (url.pathname.split("/").includes("tweets")) return `${randomInstance}${url.pathname.replace("/tweets", "")}${url.search}` else if (url.host == "t.co") return `${randomInstance}/t.co${url.pathname}` else return `${randomInstance}${url.pathname}${url.search}` - case "yatte": + case "yattee": return url.href.replace(/^https?:\/{2}/, "yattee://") case "freetube": - return `freetube://https://youtube.com${url.pathname}${url.search}` + return `freetube://https://youtu.be${url.pathname}${url.search}`.replace(/watch\?v=/, "") case "simplyTranslate": return `${randomInstance}/${url.search}` case "osm": { @@ -462,9 +461,9 @@ function switchInstance(url) { return new Promise(async resolve => { await init() await getConfig() + const protocolHost = utils.protocolHost(url) for (const service in config.services) { if (!options[service].enabled) continue - const protocolHost = utils.protocolHost(url) if (!all(service).includes(protocolHost)) continue let instancesList = [...options[options[service].frontend][options.network].checks, ...options[options[service].frontend][options.network].custom] @@ -485,15 +484,44 @@ function switchInstance(url) { // This is to make instance switching work when the instance depends on the pathname, eg https://darmarit.org/searx // Doesn't work because of .includes array method, not a top priotiry atm resolve(oldUrl.replace(oldInstance, randomInstance)) + return } resolve() }) } +function reverse(url) { + return new Promise(async resolve => { + await init() + await getConfig() + let protocolHost = utils.protocolHost(url) + let currentService + for (const service in config.services) { + if (!all(service).includes(protocolHost)) continue + currentService = service + } + switch (currentService) { + case "instagram": + if (url.pathname.startsWith("/p")) resolve(`https://instagram.com${url.pathname.replace("/p", "")}${url.search}`) + if (url.pathname.startsWith("/u")) resolve(`https://instagram.com${url.pathname.replace("/u", "")}${url.search}`) + case "youtube": + case "imdb": + case "imgur": + case "tiktok": + case "twitter": + resolve(config.services[currentService].url + url.pathname + url.search) + return + default: + resolve() + return + } + }) +} + export default { redirect, initDefaults, computeService, switchInstance, - init, + reverse, } diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 371838ff..c28af018 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -408,13 +408,7 @@ function copyRaw(test, copyRawElement) { return } - let newUrl = await youtubeHelper.reverse(url) - if (!newUrl) newUrl = await twitterHelper.reverse(url) - if (!newUrl) newUrl = await instagramHelper.reverse(url) - if (!newUrl) newUrl = await tiktokHelper.reverse(url) - if (!newUrl) newUrl = await quoraHelper.reverse(url) - if (!newUrl) newUrl = await libremdbHelper.reverse(url) - if (!newUrl) newUrl = await imgurHelper.reverse(url) + let newUrl = await servicesHelper.reverse(url) if (newUrl) { resolve(newUrl) diff --git a/src/config/config.json b/src/config/config.json index 84f430fa..ca835d51 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -1,548 +1,546 @@ { - "config": { - "networks": { - "clearnet": { - "tld": "org", - "name": "Clearnet" - }, - "tor": { - "tld": "onion", - "name": "Tor" - }, - "i2p": { - "tld": "i2p", - "name": "I2P" - }, - "loki": { - "tld": "loki", - "name": "Lokinet" - } + "networks": { + "clearnet": { + "tld": "org", + "name": "Clearnet" }, - "services": { - "youtube": { - "frontends": { - "invidious": { - "preferences": { - "cookies": ["PREFS"] - }, - "name": "Invidious", - "embeddable": true, - "instanceList": true - }, - "piped": { - "preferences": { - "localstorage": [ - "bufferGoal", - "comments", - "disableLBRY", - "enabledCodecs", - "hl", - "homepage", - "instance", - "listen", - "minimizeDescription", - "playerAutoPlay", - "proxyLBRY", - "quality", - "region", - "selectedSkip", - "sponsorblock", - "theme", - "volume", - "watchHistory" - ] - }, - "name": "Piped", - "embeddable": true, - "instanceList": true - }, - "pipedMaterial": { - "preferences": { - "localstorage": ["PREFERENCES"] - }, - "name": "Piped-Material", - "embeddable": false, - "instanceList": true - }, - "cloudtube": { - "preferences": { - "token": "token", - "fetchEndpoint": "/api/settings", - "setEndpoint": "/settings" - }, - "name": "CloudTube", - "embeddable": false, - "instanceList": true + "tor": { + "tld": "onion", + "name": "Tor" + }, + "i2p": { + "tld": "i2p", + "name": "I2P" + }, + "loki": { + "tld": "loki", + "name": "Lokinet" + } + }, + "services": { + "youtube": { + "frontends": { + "invidious": { + "preferences": { + "cookies": ["PREFS"] }, - "freetube": { - "name": "FreeTube", - "embeddable": false, - "instanceList": false + "name": "Invidious", + "embeddable": true, + "instanceList": true + }, + "piped": { + "preferences": { + "localstorage": [ + "bufferGoal", + "comments", + "disableLBRY", + "enabledCodecs", + "hl", + "homepage", + "instance", + "listen", + "minimizeDescription", + "playerAutoPlay", + "proxyLBRY", + "quality", + "region", + "selectedSkip", + "sponsorblock", + "theme", + "volume", + "watchHistory" + ] }, - "yattee": { - "name": "Yattee", - "embeddable": false, - "instanceList": false - } + "name": "Piped", + "embeddable": true, + "instanceList": true }, - "targets": [ - "^https?:\\/{2}(?:www\\.|m\\.|)youtube.com(?!iframe_api\\/.*)", - "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(?:i|s)\\.ytimg.com\\/vi\\/.*\\/..*", - "^https?:\\/{2}(?:www\\.|music\\.|)youtube.com\\/watch?v=..*", - "^https?:\\/{2}youtu\\.be\\/..*", - "^https?:\\/{2}(?:www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" - ], - "name": "Youtube", - "options": { - "enabled": true, - "redirectType": "both", - "frontend": "invidious", - "embedFrontend": "invidious" + "pipedMaterial": { + "preferences": { + "localstorage": ["PREFERENCES"] + }, + "name": "Piped-Material", + "embeddable": false, + "instanceList": true }, - "imageType": "png", - "embeddable": true, - "url": "https://youtube.com" - }, - "youtubeMusic": { - "frontends": { - "beatbump": { - "preferences": { - "localstorage": ["settings"], - "indexeddb": "beatbump" - }, - "name": "Beatbump", - "instanceList": true + "cloudtube": { + "preferences": { + "token": "token", + "fetchEndpoint": "/api/settings", + "setEndpoint": "/settings" }, - "hyperpipe": { - "preferences": { - "localstorage": ["api", "authapi", "codec", "locale", "next", "pipedapi", "quality", "theme", "vol"], - "indexeddb": ["hyperpipedb"] - }, - "name": "HyperPipe", - "instanceList": true - } + "name": "CloudTube", + "embeddable": false, + "instanceList": true }, - "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], - "name": "YT Music", - "options": { - "enabled": true, - "frontend": "beatbump" + "freetube": { + "name": "FreeTube", + "embeddable": false, + "instanceList": false }, - "imageType": "png", - "embeddable": false, - "url": "https://music.youtube.com" + "yattee": { + "name": "Yattee", + "embeddable": false, + "instanceList": false + } }, - "twitter": { - "frontends": { - "nitter": { - "preferences": { - "cookies": [ - "theme", - "infiniteScroll", - "stickyProfile", - "bidiSupport", - "hideTweetStats", - "hideBanner", - "hidePins", - "hideReplies", - "squareAvatars", - "mp4Playback", - "hlsPlayback", - "proxyVideos", - "muteVideos", - "autoplayGifs", - "replaceInstagram", - "replaceReddit", - "replaceTwitter", - "replaceYouTube" - ] - }, - "name": "Nitter", - "embeddable": true, - "instanceList": true - } - }, - "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], - "name": "Twitter", - "options": { - "enabled": true, - "redirectType": "both" - }, - "imageType": "png", - "embeddable": true, - "url": "https://twitter.com" + "targets": [ + "^https?:\\/{2}(?:www\\.|m\\.|)youtube.com(?!iframe_api\\/.*)", + "^https?:\\/{2}img\\.youtube.com\\/vi\\/.*\\/..*", + "^https?:\\/{2}(?:i|s)\\.ytimg.com\\/vi\\/.*\\/..*", + "^https?:\\/{2}(?:www\\.|music\\.|)youtube.com\\/watch?v=..*", + "^https?:\\/{2}youtu\\.be\\/..*", + "^https?:\\/{2}(?:www\\.|)(youtube|youtube-nocookie)\\.com\\/embed\\/..*" + ], + "name": "Youtube", + "options": { + "enabled": true, + "redirectType": "both", + "frontend": "invidious", + "embedFrontend": "invidious" }, - "instagram": { - "frontends": { - "bibliogram": { - "preferences": { - "token": "token", - "fetchEndpoint": "/settings.json", - "setEndpoint": "/applysettings" - }, - "name": "Bibliogram", - "instanceList": true - } + "imageType": "png", + "embeddable": true, + "url": "https://youtube.com" + }, + "youtubeMusic": { + "frontends": { + "beatbump": { + "preferences": { + "localstorage": ["settings"], + "indexeddb": "beatbump" + }, + "name": "Beatbump", + "instanceList": true }, - "targets": ["^https?:\\/{2}(www\\.)?instagram\\.com"], - "name": "Instagram", - "options": { "enabled": true }, - "imageType": "png", - "embeddable": false, - "url": "https://instagram.com" + "hyperpipe": { + "preferences": { + "localstorage": ["api", "authapi", "codec", "locale", "next", "pipedapi", "quality", "theme", "vol"], + "indexeddb": ["hyperpipedb"] + }, + "name": "HyperPipe", + "instanceList": true + } }, - "tiktok": { - "frontends": { - "proxiTok": { - "preferences": { - "cookies": ["api-test_endpoints", "theme"] - }, - "name": "ProxiTok", - "instanceList": true - } - }, - "targets": ["^https?:\\/{2}(www\\.|)tiktok\\.com.*"], - "name": "TikTok", - "options": { "enabled": true }, - "imageType": "png", - "embeddable": false, - "url": "https://tiktok.com" + "targets": ["^https?:\\/{2}music\\.youtube\\.com(\\/.*|$)"], + "name": "YT Music", + "options": { + "enabled": true, + "frontend": "beatbump" }, - "reddit": { - "frontends": { - "libreddit": { - "preferences": { - "cookies": ["theme", "front_page", "layout", "wide", "post_sort", "comment_sort", "show_nsfw", "autoplay_videos", "use_hls", "hide_hls_notification", "subscriptions", "filters"] - }, - "name": "Libreddit", - "instanceList": true + "imageType": "png", + "embeddable": false, + "url": "https://music.youtube.com" + }, + "twitter": { + "frontends": { + "nitter": { + "preferences": { + "cookies": [ + "theme", + "infiniteScroll", + "stickyProfile", + "bidiSupport", + "hideTweetStats", + "hideBanner", + "hidePins", + "hideReplies", + "squareAvatars", + "mp4Playback", + "hlsPlayback", + "proxyVideos", + "muteVideos", + "autoplayGifs", + "replaceInstagram", + "replaceReddit", + "replaceTwitter", + "replaceYouTube" + ] }, - "teddit": { - "preferences": { - "cookies": [ - "collapse_child_comments", - "domain_instagram", - "domain_twitter", - "domain_youtube", - "flairs", - "highlight_controversial", - "nsfw_enabled", - "post_media_max_height", - "show_upvoted_percentage", - "show_upvotes", - "theme", - "videos_muted" - ] - }, - "name": "Teddit", - "instanceList": true - } - }, - "targets": ["^https?:\\/{2}(www\\.|old\\.|np\\.|new\\.|amp\\.|)reddit\\.com", "^https?:\\/{2}(i\\.|preview\\.)redd\\.it"], - "name": "Reddit", - "options": { - "enabled": true, - "frontend": "libreddit" - }, - "imageType": "png", - "embeddable": false, - "url": "https://reddit.com" + "name": "Nitter", + "embeddable": true, + "instanceList": true + } }, - "imgur": { - "frontends": { - "rimgo": { - "name": "rimgo", - "instanceList": true - } - }, - "targets": ["^https?:\\/{2}([im]\\.)?imgur\\.(com|io)(\\/|$)"], - "name": "Imgur", - "options": { "enabled": true }, - "imageType": "png", - "embeddable": false, - "url": "https://imgur.com" - }, - "wikipedia": { - "frontends": { - "wikiless": { - "preferences": { - "cookies": ["theme", "default_lang"] - }, - "name": "Wikiless", - "instanceList": true - } - }, - "targets": ["^https?:\\/{2}(?:[a-z]+\\.)*wikipedia\\.org"], - "name": "Wikipedia", - "options": { "enabled": false }, - "imageType": "svg", - "embeddable": false, - "url": "https://wikipedia.com" + "targets": ["^https?:\\/{2}(www\\.|mobile\\.|)twitter\\.com", "^https?:\\/{2}(pbs\\.|video\\.|)twimg\\.com", "^https?:\\/{2}platform\\.twitter\\.com/embed", "^https?:\\/{2}t\\.co"], + "name": "Twitter", + "options": { + "enabled": true, + "redirectType": "both" }, - "medium": { - "frontends": { - "scribe": { - "name": "Scribe", - "instanceList": true - } - }, - "targets": [ - "(?:.*\\.)*(? <%- include('src/pages/widgets/head') -%> - <%- include('src/pages/widgets/links', {config: config}) -%> + <%- include('src/pages/widgets/links', {services: services}) -%>
- <%- include('src/pages/options/widgets/general', {config: config}) -%> - <%- include('src/pages/options/widgets/services', {config: config}) -%> + <%- include('src/pages/options/widgets/general', {config: {networks, services}}) -%> + <%- include('src/pages/options/widgets/services', {config: {networks, services}}) -%> <%- include('src/pages/options/widgets/about') -%>
diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index 2249f830..cfc95df2 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -22,8 +22,7 @@ async function getConfig() { fetch("/config/config.json") .then(response => response.text()) .then(data => { - const tmp = JSON.parse(data) - config = tmp.config + config = JSON.parse(data) resolve() }) }) diff --git a/src/pages/options/widgets/services.js b/src/pages/options/widgets/services.js index b595943e..dbb66dec 100644 --- a/src/pages/options/widgets/services.js +++ b/src/pages/options/widgets/services.js @@ -9,8 +9,7 @@ function getConfig() { fetch("/config/config.json") .then(response => response.text()) .then(data => { - const tmp = JSON.parse(data) - config = tmp.config + config = JSON.parse(data) resolve() }) }) diff --git a/src/pages/popup/popup.ejs b/src/pages/popup/popup.ejs index efb73e5c..5b3bb026 100644 --- a/src/pages/popup/popup.ejs +++ b/src/pages/popup/popup.ejs @@ -8,13 +8,13 @@
- <%- include('src/pages/widgets/switches', {config: config}) -%> + <%- include('src/pages/widgets/switches', {config: {networks, services}}) -%>

- <%- include('src/pages/widgets/switches', {config: config}) -%> + <%- include('src/pages/widgets/switches', {config: {networks, services}}) -%>

<% }; -%>
<%- include ('src/assets/images/about-icon.svg') %>About
-- cgit 1.4.1