Skip to content

Commit

Permalink
Fixed small things. apparently Fixed Instances got fixed SimonBrazell…
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Jun 16, 2022
1 parent 7b6bc78 commit 4c4c47e
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 61 deletions.
2 changes: 1 addition & 1 deletion src/assets/javascripts/imdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/assets/javascripts/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/javascripts/reuters.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/assets/javascripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
49 changes: 0 additions & 49 deletions src/instances/blocklist.json

This file was deleted.

2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
5 changes: 4 additions & 1 deletion src/pages/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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")
Expand Down
11 changes: 5 additions & 6 deletions src/pages/options/widgets/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ 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";
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';
Expand Down

0 comments on commit 4c4c47e

Please sign in to comment.