From 4c4c47e82f6f0cd3ec5861f6903f721d16d94aa8 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Thu, 16 Jun 2022 11:37:42 +0300 Subject: [PATCH] Fixed small things. apparently Fixed Instances got fixed #337 --- src/assets/javascripts/imdb.js | 2 +- src/assets/javascripts/maps.js | 2 +- src/assets/javascripts/reuters.js | 2 +- src/assets/javascripts/utils.js | 2 +- src/instances/blocklist.json | 49 ---------------------------- src/manifest.json | 2 +- src/pages/background/background.js | 5 ++- src/pages/options/widgets/general.js | 11 +++---- 8 files changed, 14 insertions(+), 61 deletions(-) delete mode 100644 src/instances/blocklist.json diff --git a/src/assets/javascripts/imdb.js b/src/assets/javascripts/imdb.js index 9b0efe4..a388660 100644 --- a/src/assets/javascripts/imdb.js +++ b/src/assets/javascripts/imdb.js @@ -133,7 +133,7 @@ function initDefaults() { let dataJson = JSON.parse(data); redirects.libremdb = dataJson.libremdb; browser.storage.local.set({ - disableImdb: false, + disableImdb: true, imdbProtocol: "normal", imdbRedirects: redirects, diff --git a/src/assets/javascripts/maps.js b/src/assets/javascripts/maps.js index 7d886ea..57add6f 100644 --- a/src/assets/javascripts/maps.js +++ b/src/assets/javascripts/maps.js @@ -8,7 +8,7 @@ const targets = /^https?:\/{2}(((www|maps)\.)?(google\.).*(\/maps)|maps\.(google let redirects = { 'osm': { "normal": [ - "https://openstreetmap.org" + "https://www.openstreetmap.org" ] }, 'facil': { diff --git a/src/assets/javascripts/reuters.js b/src/assets/javascripts/reuters.js index 9afb67a..1af8149 100644 --- a/src/assets/javascripts/reuters.js +++ b/src/assets/javascripts/reuters.js @@ -86,7 +86,7 @@ function redirect(url, type, initiator) { function initDefaults() { return new Promise(resolve => { browser.storage.local.set({ - disableReuters: false, + disableReuters: true, reutersProtocol: "normal", reutersRedirects: redirects, diff --git a/src/assets/javascripts/utils.js b/src/assets/javascripts/utils.js index 0b8bfe4..ac22ed7 100644 --- a/src/assets/javascripts/utils.js +++ b/src/assets/javascripts/utils.js @@ -49,7 +49,7 @@ function updateInstances() { searchHelper.setRedirects({ 'searx': instances.searx, 'searxng': instances.searxng, 'whoogle': instances.whoogle }); wikipediaHelper.setRedirects(instances.wikiless); mediumHelper.setRedirects(instances.scribe); - quoraHelper.setRedirects(instances.query); + quoraHelper.setRedirects(instances.quetre); libremdbHelper.setRedirects(instances.libremdb); sendTargetsHelper.setRedirects(instances.send); tiktokHelper.setRedirects(instances.proxiTok); diff --git a/src/instances/blocklist.json b/src/instances/blocklist.json deleted file mode 100644 index 8b7fc62..0000000 --- a/src/instances/blocklist.json +++ /dev/null @@ -1,49 +0,0 @@ -[ - "https://invidious.kavin.rocks", - "https://invidious.lunar.icu", - "https://piped.kavin.rocks", - "https://piped.tokhmi.xyz", - "https://piped.moomoo.me", - "https://piped.syncpundit.com", - "https://piped.mha.fi", - "https://piped.shimul.me", - "https://nitter.nixnet.services", - "https://nitter.domain.glass", - "https://birdsite.xanny.family", - "https://nitter.moomoo.me", - "https://notabird.site", - "https://fuckthesacklers.network", - "https://nitter.govt.land", - "https://nitter.winscloud.net", - "https://twtr.bch.bar", - "https://nitter.lunar.icu", - "https://twitter.dr460nf1r3.org", - "https://bib.actionsack.com", - "https://libreddit.domain.glass", - "https://r.nf", - "https://libreddit.flux.industries", - "https://lr.oversold.host", - "https://libreddit.hu", - "https://lr.stilic.ml", - "https://reddi.tk", - "https://r.walkx.org", - "https://libreddit.yonalee.eu", - "https://libreddit.winscloud.net", - "https://libreddit.lunar.icu", - "https://r.ahwx.org", - "https://reddit.dr460nf1r3.org", - "https://teddit.domain.glass", - "https://wiki.604kph.xyz", - "https://wikiless.lunar.icu", - "https://lingva.lunar.icu", - "https://searx.josie.lol", - "https://searx.org", - "https://searx.run", - "https://searx.albony.xyz", - "https://search.albony.xyz", - "https://search.garudalinux.org", - "https://search.dr460nf1r3.org", - "https://whoogle.lunar.icu", - "https://rimgo.lunar.icu", - "https://i.actionsack.com" -] \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index d52bc34..fa29250 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_extensionName__", "description": "__MSG_extensionDescription__", - "version": "2.1.0", + "version": "2.2.0", "manifest_version": 2, "browser_specific_settings": { "gecko": { diff --git a/src/pages/background/background.js b/src/pages/background/background.js index e3e34f8..d6c81f2 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -31,7 +31,6 @@ browser.runtime.onInstalled.addListener( fetch('/instances/blacklist.json').then(response => response.text()).then(async data => { browser.storage.local.clear( () => { - browser.storage.local.set({ cloudflareBlackList: JSON.parse(data).cloudflare }, () => { browser.storage.local.set({ authenticateBlackList: JSON.parse(data).authenticate }, @@ -60,6 +59,10 @@ browser.runtime.onInstalled.addListener( }); }) }; + function initDefault(){ + + } + // if (details.reason == 'install') { if (details.reason == 'install' || (details.reason == "update" && details.previousVersion != browser.runtime.getManifest().version)) { if (details.reason == "update") diff --git a/src/pages/options/widgets/general.js b/src/pages/options/widgets/general.js index a4c5c9d..0daeb90 100644 --- a/src/pages/options/widgets/general.js +++ b/src/pages/options/widgets/general.js @@ -16,6 +16,7 @@ import wikipediaHelper from "../../../assets/javascripts/wikipedia.js"; import mediumHelper from "../../../assets/javascripts/medium.js"; import quoraHelper from "../../../assets/javascripts/quora.js"; import libremdbHelper from "../../../assets/javascripts/imdb.js"; +import reutersHelper from "../../../assets/javascripts/reuters.js"; import imgurHelper from "../../../assets/javascripts/imgur.js"; import tiktokHelper from "../../../assets/javascripts/tiktok.js"; import sendTargetsHelper from "../../../assets/javascripts/sendTargets.js"; @@ -23,14 +24,12 @@ import peertubeHelper from "../../../assets/javascripts/peertube.js"; import lbryHelper from "../../../assets/javascripts/lbry.js"; let updateInstancesElement = document.getElementById("update-instances"); -updateInstancesElement.addEventListener("click", () => { +updateInstancesElement.addEventListener("click", async () => { let oldHtml = updateInstancesElement.innerHTML updateInstancesElement.innerHTML = '...'; - if (utils.updateInstances()) { - updateInstancesElement.innerHTML = 'Done!'; - new Promise(resolve => setTimeout(resolve, 1500)).then( // sleep 1500ms - () => updateInstancesElement.innerHTML = oldHtml - ) + if (await utils.updateInstances()) { + updateInstancesElement.innerHTML = oldHtml; + location.reload(); } else updateInstancesElement.innerHTML = 'Failed Miserabely';