Re-order indie wiki results in Google
parent
cbdd4cd863
commit
39e44da293
|
@ -3,3 +3,4 @@
|
|||
.vscode/*
|
||||
*.py
|
||||
*.pyc
|
||||
.idea/
|
||||
|
|
|
@ -2,6 +2,24 @@ if (typeof importScripts !== 'undefined') {
|
|||
importScripts('scripts/common-functions.js');
|
||||
}
|
||||
|
||||
let cachedStorage = {};
|
||||
|
||||
async function updateCachedStorage() {
|
||||
let localStorage = await chrome.storage.local.get();
|
||||
let syncStorage = await chrome.storage.sync.get();
|
||||
cachedStorage = {...localStorage, ...syncStorage};
|
||||
}
|
||||
|
||||
async function getCachedStorage() {
|
||||
if (Object.keys(cachedStorage).length === 0) {
|
||||
await updateCachedStorage();
|
||||
}
|
||||
return cachedStorage;
|
||||
}
|
||||
|
||||
// Cache Chrome's storage in memory so that we don't need to make repeated calls
|
||||
updateCachedStorage();
|
||||
|
||||
// Capture web requests
|
||||
chrome.webRequest.onBeforeSendHeaders.addListener(
|
||||
async (event) => {
|
||||
|
@ -21,6 +39,11 @@ chrome.webRequest.onBeforeSendHeaders.addListener(
|
|||
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) => {
|
||||
if (msg.action === 'updateIcon') {
|
||||
setPowerIcon(msg.value);
|
||||
} else if (msg.action === 'getStorage') {
|
||||
getCachedStorage().then((res) => {
|
||||
sendResponse(res)
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -31,6 +54,11 @@ chrome.runtime.onStartup.addListener(() => {
|
|||
});
|
||||
});
|
||||
|
||||
// Listen for changes to stored data, and updated our cached data
|
||||
chrome.storage.onChanged.addListener(() => {
|
||||
updateCachedStorage();
|
||||
})
|
||||
|
||||
// Listen for extension installed/updating
|
||||
chrome.runtime.onInstalled.addListener(async (detail) => {
|
||||
// Set initial icon state
|
||||
|
@ -150,9 +178,8 @@ function redirectToBreezeWiki(storage, tabId, url) {
|
|||
}
|
||||
|
||||
async function main(url, tabId) {
|
||||
chrome.storage.local.get((localStorage) => {
|
||||
chrome.storage.sync.get(async (syncStorage) => {
|
||||
const storage = { ...syncStorage, ...localStorage };
|
||||
let storage = await getCachedStorage();
|
||||
|
||||
if ((storage.power ?? 'on') === 'on') {
|
||||
let crossLanguageSetting = storage.crossLanguage || 'off';
|
||||
let matchingSite = await commonFunctionFindMatchingSite(url, crossLanguageSetting);
|
||||
|
@ -193,6 +220,4 @@ async function main(url, tabId) {
|
|||
redirectToBreezeWiki(storage, tabId, url);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -73,7 +74,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Minecraft_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "de-pokemon",
|
||||
|
@ -128,6 +130,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
"destination_icon": "acecombatwiki.png",
|
||||
"destination_main_page": "Ace_Combat_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -163,6 +164,7 @@
|
|||
"destination_icon": "animalcrossingpocketcampwiki.png",
|
||||
"destination_main_page": "Animal_Crossing:_Pocket_Camp_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -221,6 +223,7 @@
|
|||
"destination_icon": "anvilempireswiki.png",
|
||||
"destination_main_page": "Anvil_Empires_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -249,6 +252,7 @@
|
|||
"destination_icon": "apexlegendswiki.png",
|
||||
"destination_main_page": "Apex_Legends_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -292,6 +296,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -314,6 +319,7 @@
|
|||
"destination_icon": "arknightswiki.png",
|
||||
"destination_main_page": "Arknights_Terra_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -422,6 +428,7 @@
|
|||
"destination_icon": "astroneerwiki.png",
|
||||
"destination_main_page": "Astroneer_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -444,6 +451,7 @@
|
|||
"destination_icon": "atelierwiki.png",
|
||||
"destination_main_page": "Atelier_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -489,6 +497,7 @@
|
|||
"destination_icon": "backpackbattleswiki.png",
|
||||
"destination_main_page": "Backpack_Battles_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -609,6 +618,7 @@
|
|||
"destination_icon": "battlebitwiki.png",
|
||||
"destination_main_page": "BattleBit_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -649,6 +659,7 @@
|
|||
"destination_icon": "bellasarawiki.png",
|
||||
"destination_main_page": "The_Bella_Sara_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -745,6 +756,7 @@
|
|||
"destination_icon": "bookoftravelswiki.png",
|
||||
"destination_main_page": "Book_of_Travels_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -867,6 +879,7 @@
|
|||
"destination_icon": "calamitymodwiki.png",
|
||||
"destination_main_page": "Calamity_Mod_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -1061,6 +1074,7 @@
|
|||
"destination_icon": "cookieclickerwiki.png",
|
||||
"destination_main_page": "Cookie_Clicker_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -1103,6 +1117,7 @@
|
|||
"destination_icon": "coromonwiki.png",
|
||||
"destination_main_page": "Coromon_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -1200,6 +1215,7 @@
|
|||
"destination_icon": "darkestdungeonwiki.png",
|
||||
"destination_main_page": "Darkest_Dungeon_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -1222,6 +1238,7 @@
|
|||
"destination_icon": "deadcellswiki.png",
|
||||
"destination_main_page": "Dead_Cells_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -1244,6 +1261,7 @@
|
|||
"destination_icon": "deeprockgalacticwiki.png",
|
||||
"destination_main_page": "Deep_Rock_Galactic_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -1368,6 +1386,7 @@
|
|||
"destination_icon": "dontstarvewiki.png",
|
||||
"destination_main_page": "Don't_Starve_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -1493,6 +1512,7 @@
|
|||
"destination_icon": "dredgewiki.png",
|
||||
"destination_main_page": "DREDGE_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -1550,6 +1570,7 @@
|
|||
"destination_icon": "dyinglightwiki.png",
|
||||
"destination_main_page": "Dying_Light_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -1595,6 +1616,7 @@
|
|||
"destination_icon": "eiyudenchroniclewiki.png",
|
||||
"destination_main_page": "Eiyuden_Chronicle_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -1669,6 +1691,7 @@
|
|||
"destination_icon": "enawiki.png",
|
||||
"destination_main_page": "ENA_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -1845,6 +1868,7 @@
|
|||
"destination_icon": "farmingsimulatorwiki.png",
|
||||
"destination_main_page": "Farming_Simulator_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -1884,6 +1908,7 @@
|
|||
"destination_icon": "fearhungerwiki.png",
|
||||
"destination_main_page": "%22Fear_and_Hunger:_the_Tormentpedia%22_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -1990,6 +2015,7 @@
|
|||
"destination_icon": "fridaynightfunkinwiki.png",
|
||||
"destination_main_page": "Friday_Night_Funkin'_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -2134,6 +2160,7 @@
|
|||
"destination_icon": "galaxylifewiki.png",
|
||||
"destination_main_page": "Galaxy_Life_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -2494,6 +2521,7 @@
|
|||
"destination_icon": "hearthstonewiki.png",
|
||||
"destination_main_page": "Hearthstone_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -2557,6 +2585,7 @@
|
|||
"destination_icon": "holocurewiki.png",
|
||||
"destination_main_page": "HoloCure_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -2717,6 +2746,7 @@
|
|||
"destination_icon": "instarsandtimewiki.png",
|
||||
"destination_main_page": "In_Stars_and_Time_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -2936,6 +2966,7 @@
|
|||
"destination_icon": "lastoriginwiki.png",
|
||||
"destination_main_page": "Last_Origin_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -2957,6 +2988,7 @@
|
|||
"destination_icon": "leafblowerrevolutionwiki.png",
|
||||
"destination_main_page": "Leaf_Blower_Revolution_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -3077,6 +3109,7 @@
|
|||
"destination_icon": "themagicalmixturemillwiki.png",
|
||||
"destination_main_page": "The_Magical_Mixture_Mill_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -3243,6 +3276,7 @@
|
|||
"destination_icon": "mindhackwiki.png",
|
||||
"destination_main_page": "MINDHACK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -3293,7 +3327,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Minecraft_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "en-minetest",
|
||||
|
@ -3333,6 +3368,7 @@
|
|||
"destination_icon": "minicraftwiki.png",
|
||||
"destination_main_page": "Minicraft_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -3355,6 +3391,7 @@
|
|||
"destination_icon": "multiversuswiki.png",
|
||||
"destination_main_page": "MultiVersus_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -3466,6 +3503,7 @@
|
|||
"destination_icon": "necromergerwiki.png",
|
||||
"destination_main_page": "NecroMerger_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -3505,6 +3543,7 @@
|
|||
"destination_icon": "noitawiki.png",
|
||||
"destination_main_page": "Noita_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -3544,6 +3583,7 @@
|
|||
"destination_icon": "oldschoolrunescape.png",
|
||||
"destination_main_page": "Old_School_RuneScape_Wiki",
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/",
|
||||
"tags": [
|
||||
"official"
|
||||
]
|
||||
|
@ -3565,6 +3605,7 @@
|
|||
"destination_icon": "omegastrikerswiki.png",
|
||||
"destination_main_page": "Omega_Strikers_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -3605,6 +3646,7 @@
|
|||
"destination_icon": "paliawiki.png",
|
||||
"destination_main_page": "Palia_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -3627,6 +3669,7 @@
|
|||
"destination_icon": "palworldwiki.png",
|
||||
"destination_main_page": "Palworld_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -3684,6 +3727,7 @@
|
|||
"destination_icon": "pathologicwiki.png",
|
||||
"destination_main_page": "Pathologic_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -3705,6 +3749,7 @@
|
|||
"destination_icon": "peglinwiki.png",
|
||||
"destination_main_page": "Peglin_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -3794,6 +3839,7 @@
|
|||
"destination_icon": "plantsvszombieswiki.png",
|
||||
"destination_main_page": "Plants_vs._Zombies_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -3902,6 +3948,7 @@
|
|||
"destination_icon": "projectwingmanwiki.png",
|
||||
"destination_main_page": "Project_Wingman_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -3962,6 +4009,7 @@
|
|||
"destination_icon": "pubgwiki.png",
|
||||
"destination_main_page": "PUBG_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -4138,6 +4186,7 @@
|
|||
"destination_icon": "riskofrainwiki.png",
|
||||
"destination_main_page": "Risk_of_Rain_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -4159,6 +4208,7 @@
|
|||
"destination_icon": "riskofrain2wiki.png",
|
||||
"destination_main_page": "Risk_of_Rain_2_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -4204,6 +4254,7 @@
|
|||
"destination_icon": "runescape.png",
|
||||
"destination_main_page": "RuneScape_Wiki",
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/",
|
||||
"tags": [
|
||||
"official"
|
||||
]
|
||||
|
@ -4318,6 +4369,7 @@
|
|||
"destination_icon": "satisfactorywiki.png",
|
||||
"destination_main_page": "Satisfactory_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -4361,6 +4413,7 @@
|
|||
"destination_icon": "seaofthieveswiki.png",
|
||||
"destination_main_page": "Sea_of_Thieves_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -4454,6 +4507,7 @@
|
|||
"destination_icon": "signalis.png",
|
||||
"destination_main_page": "SIGNALIS_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -4520,6 +4574,7 @@
|
|||
"destination_icon": "sonsoftheforestwiki.png",
|
||||
"destination_main_page": "Sons_of_the_Forest_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -4559,6 +4614,7 @@
|
|||
"destination_icon": "spiritmodwiki.png",
|
||||
"destination_main_page": "Spirit_Mod_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -4701,6 +4757,7 @@
|
|||
"destination_icon": "steamworldwiki.png",
|
||||
"destination_main_page": "SteamWorld_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -4740,6 +4797,7 @@
|
|||
"destination_icon": "sugaryspirewiki.png",
|
||||
"destination_main_page": "Sugary_Spire_Wiki:Main_Page",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -4780,6 +4838,7 @@
|
|||
"destination_icon": "sunhavenwiki.png",
|
||||
"destination_main_page": "Sun_Haven_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -4801,6 +4860,7 @@
|
|||
"destination_icon": "superautopetswiki.png",
|
||||
"destination_main_page": "Super_Auto_Pets_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -4921,6 +4981,7 @@
|
|||
"destination_icon": "officialtemtemwiki.png",
|
||||
"destination_main_page": "Temtem_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -4955,6 +5016,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -4977,6 +5039,7 @@
|
|||
"destination_icon": "starlightrivermodwiki.png",
|
||||
"destination_main_page": "Starlight_River_Mod_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -5092,6 +5155,7 @@
|
|||
"destination_icon": "thoriummodwiki.png",
|
||||
"destination_main_page": "Thorium_Mod_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -5114,6 +5178,7 @@
|
|||
"destination_icon": "timberbornwiki.png",
|
||||
"destination_main_page": "Timberborn_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -5172,6 +5237,7 @@
|
|||
"destination_icon": "toontowncorporateclashwiki.png",
|
||||
"destination_main_page": "Toontown_Corporate_Clash_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -5253,6 +5319,7 @@
|
|||
"destination_icon": "towerclimbwiki.png",
|
||||
"destination_main_page": "TowerClimb_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -5295,6 +5362,7 @@
|
|||
"destination_icon": "towerunitewiki.png",
|
||||
"destination_main_page": "Tower_Unite_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -5352,6 +5420,7 @@
|
|||
"destination_icon": "trucksimulatorwiki.png",
|
||||
"destination_main_page": "Truck_Simulator_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -5436,6 +5505,7 @@
|
|||
"destination_icon": "underminewiki.png",
|
||||
"destination_main_page": "UnderMine_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -5457,8 +5527,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "undertaleyellowwiki.png",
|
||||
"destination_main_page": "Undertale_Yellow_Wiki",
|
||||
"destination_search_path": "/index.php"
|
||||
},
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/"},
|
||||
{
|
||||
"id": "en-unevendream",
|
||||
"origins_label": "Uneven Dream Fandom Wiki",
|
||||
|
@ -5549,6 +5619,7 @@
|
|||
"destination_icon": "thevoidrainsuponherheartwiki.png",
|
||||
"destination_main_page": "The_Void_Rains_Upon_Her_Heart_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -5570,6 +5641,7 @@
|
|||
"destination_icon": "vtolvr.png",
|
||||
"destination_main_page": "VTOL_VR_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -5633,6 +5705,7 @@
|
|||
"destination_icon": "warcraftwiki.png",
|
||||
"destination_main_page": "Warcraft_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -5696,6 +5769,7 @@
|
|||
"destination_icon": "wildfrostwiki.png",
|
||||
"destination_main_page": "Wildfrost_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"official"
|
||||
]
|
||||
|
@ -5717,6 +5791,7 @@
|
|||
"destination_icon": "willyousnailwiki.png",
|
||||
"destination_main_page": "Will_You_Snail_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -5739,6 +5814,7 @@
|
|||
"destination_icon": "witchhatatelierwiki.png",
|
||||
"destination_main_page": "Witch_Hat_Atelier_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"telepedia"
|
||||
]
|
||||
|
@ -5778,6 +5854,7 @@
|
|||
"destination_icon": "wizardrywiki.png",
|
||||
"destination_main_page": "Wizardry_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -74,6 +75,7 @@
|
|||
"destination_icon": "wikicalamitymodoficial.png",
|
||||
"destination_main_page": "Wiki_Calamity_Mod_en_Español",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -96,6 +98,7 @@
|
|||
"destination_icon": "coromonwiki.png",
|
||||
"destination_main_page": "Coromon_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -118,6 +121,7 @@
|
|||
"destination_icon": "deeprockgalacticwiki.png",
|
||||
"destination_main_page": "Deep_Rock_Galactic_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -138,7 +142,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Minecraft_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "es-pokemon",
|
||||
|
@ -233,6 +238,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -97,7 +98,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Minecraft_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "fr-pokemon",
|
||||
|
@ -134,6 +136,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"destination_icon": "aceswiki.png",
|
||||
"destination_main_page": "ACES_WIKI",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -37,6 +38,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -59,6 +61,7 @@
|
|||
"destination_icon": "fridaynightfunkinwiki.png",
|
||||
"destination_main_page": "Friday_Night_Funkin'_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -80,6 +83,7 @@
|
|||
"destination_icon": "noitawiki.png",
|
||||
"destination_main_page": "Noita_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -100,6 +104,7 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Minecraft_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
}
|
||||
]
|
|
@ -15,7 +15,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Minecraft_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "ko-terraria",
|
||||
|
@ -34,6 +35,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "礦藝大典",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
}
|
||||
]
|
|
@ -16,6 +16,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -78,6 +79,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"destination_icon": "acecombatwiki.png",
|
||||
"destination_main_page": "Página_principal",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -37,6 +38,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -58,7 +60,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Minecraft_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "pt-runescape",
|
||||
|
@ -76,7 +79,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "runescape.png",
|
||||
"destination_main_page": "RuneScape_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "pt-teamfortress",
|
||||
|
@ -117,6 +121,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -38,6 +39,7 @@
|
|||
"destination_icon": "calamitymodwiki.png",
|
||||
"destination_main_page": "Calamity_Mod_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -59,7 +61,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Заглавная_страница",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "ru-terraria",
|
||||
|
@ -78,6 +81,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"destination_icon": "arkwiki.png",
|
||||
"destination_main_page": "ARK_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -37,6 +38,7 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Minecraft_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
}
|
||||
]
|
|
@ -15,7 +15,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Головна_сторінка",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "uk-terraria",
|
||||
|
@ -34,6 +35,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"destination_icon": "acecombatwiki.png",
|
||||
"destination_main_page": "Ace_Combat_中文_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -37,6 +38,7 @@
|
|||
"destination_icon": "calamitymodwiki.png",
|
||||
"destination_main_page": "Calamity_Mod_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
@ -59,6 +61,7 @@
|
|||
"destination_icon": "fridaynightfunkinwiki.png",
|
||||
"destination_main_page": "Friday_Night_Funkin'_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -85,7 +88,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "minecraftwiki.png",
|
||||
"destination_main_page": "Minecraft_Wiki",
|
||||
"destination_search_path": "/"
|
||||
"destination_search_path": "/",
|
||||
"destination_content_path": "/w/"
|
||||
},
|
||||
{
|
||||
"id": "zh-noita",
|
||||
|
@ -104,6 +108,7 @@
|
|||
"destination_icon": "noitawiki.png",
|
||||
"destination_main_page": "Noita_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg"
|
||||
]
|
||||
|
@ -125,6 +130,7 @@
|
|||
"destination_icon": "terrariawiki.png",
|
||||
"destination_main_page": "Terraria_Wiki",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/wiki/",
|
||||
"tags": [
|
||||
"wiki.gg",
|
||||
"official"
|
||||
|
|
|
@ -280,7 +280,7 @@
|
|||
"scripts/common-functions.js",
|
||||
"scripts/content-search-filtering.js"
|
||||
],
|
||||
"run_at": "document_start"
|
||||
"run_at": "document_end"
|
||||
},
|
||||
{
|
||||
"matches": [
|
||||
|
|
|
@ -358,7 +358,7 @@
|
|||
"scripts/common-functions.js",
|
||||
"scripts/content-search-filtering.js"
|
||||
],
|
||||
"run_at": "document_start"
|
||||
"run_at": "document_end"
|
||||
}
|
||||
],
|
||||
"optional_permissions": ["https://*/*"],
|
||||
|
|
|
@ -11,6 +11,9 @@ chrome.storage.sync.get({ 'hiddenResultsBanner': 'on' }, (item) => {
|
|||
chrome.storage.sync.get({ 'crossLanguage': 'off' }, (item) => {
|
||||
setCrossLanguage(item.crossLanguage, false);
|
||||
});
|
||||
chrome.storage.sync.get({ 'reorderResults': 'on' }, (item) => {
|
||||
setReorder(item.reorderResults, false);
|
||||
});
|
||||
chrome.storage.sync.get({ 'openChangelog': 'off' }, (item) => {
|
||||
setOpenChangelog(item.openChangelog, false);
|
||||
});
|
||||
|
@ -85,6 +88,19 @@ function setCrossLanguage(setting, storeSetting = true) {
|
|||
}
|
||||
}
|
||||
|
||||
// Set re-order setting
|
||||
function setReorder(setting, storeSetting = true) {
|
||||
if (storeSetting) {
|
||||
chrome.storage.sync.set({ 'reorderResults': setting });
|
||||
}
|
||||
|
||||
if (setting === 'on') {
|
||||
document.getElementById('reorderResultsCheckbox').checked = true;
|
||||
} else {
|
||||
document.getElementById('reorderResultsCheckbox').checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Set open changelog setting
|
||||
function setOpenChangelog(setting, storeSetting = true) {
|
||||
if (storeSetting) {
|
||||
|
@ -129,6 +145,15 @@ document.getElementById('crossLanguageCheckbox').addEventListener('change', () =
|
|||
}
|
||||
});
|
||||
});
|
||||
document.getElementById('reorderResultsCheckbox').addEventListener('change', () => {
|
||||
chrome.storage.sync.get({ 'reorderResults': 'on' }, (item) => {
|
||||
if (item.reorderResults === 'on') {
|
||||
setReorder('off');
|
||||
} else {
|
||||
setReorder('on');
|
||||
}
|
||||
});
|
||||
});
|
||||
document.getElementById('openChangelogCheckbox').addEventListener('change', () => {
|
||||
chrome.storage.sync.get({ 'openChangelog': 'off' }, (item) => {
|
||||
if (item.openChangelog === 'on') {
|
||||
|
|
|
@ -161,6 +161,15 @@
|
|||
Unfortunately this feature does not currently work for Fextralife wikis.
|
||||
</li>
|
||||
<br />
|
||||
<li>
|
||||
<b><img src="../../images/toggle-replace.png" height="12" alt="" /> Move indie wiki results to the top of
|
||||
search results on Google</b>
|
||||
<br />
|
||||
By default, Indie Wiki Buddy will re-order the results page on Google to move indie wiki results to the top,
|
||||
if they are further down the first page of results. This allows you to find the pages you're looking for
|
||||
quicker.
|
||||
</li>
|
||||
<br />
|
||||
<li>
|
||||
<b><span aria-hidden="true">📁</span> Open changelog when Indie Wiki Buddy is updated</b>
|
||||
<br />
|
||||
|
|
|
@ -376,6 +376,14 @@
|
|||
indie English wikis there is no same-lang wiki
|
||||
</label>
|
||||
</div>
|
||||
<div class="settingToggle">
|
||||
<label>
|
||||
<input id="reorderResultsCheckbox" type="checkbox" />
|
||||
<img src="../../images/toggle-replace.png" height="12" alt="" />
|
||||
Move indie wiki results to the top of
|
||||
search results on Google
|
||||
</label>
|
||||
</div>
|
||||
<div class="settingToggle">
|
||||
<label>
|
||||
<input id="openChangelogCheckbox" type="checkbox" />
|
||||
|
|
|
@ -646,6 +646,14 @@
|
|||
indie English wikis when no same-language wiki exists
|
||||
</label>
|
||||
</div>
|
||||
<div class="settingToggle">
|
||||
<label>
|
||||
<input id="reorderResultsCheckbox" type="checkbox" />
|
||||
<img src="../../images/toggle-replace.png" height="12" alt="" />
|
||||
Move indie wiki results to the top of
|
||||
search results on Google
|
||||
</label>
|
||||
</div>
|
||||
<div class="settingToggle">
|
||||
<label>
|
||||
<input id="openChangelogCheckbox" type="checkbox" />
|
||||
|
|
|
@ -72,8 +72,8 @@ async function commonFunctionGetSiteDataByDestination() {
|
|||
return sites;
|
||||
}
|
||||
|
||||
// Load wiki data objects, with each origin having its own object
|
||||
async function commonFunctionGetSiteDataByOrigin() {
|
||||
async function populateSiteDataByOrigin() {
|
||||
// Populate with the site data
|
||||
let sites = [];
|
||||
let promises = [];
|
||||
for (let i = 0; i < LANGS.length; i++) {
|
||||
|
@ -92,6 +92,8 @@ async function commonFunctionGetSiteDataByOrigin() {
|
|||
"destination_base_url": site.destination_base_url,
|
||||
"destination_search_path": site.destination_search_path,
|
||||
"destination_content_prefix": origin.destination_content_prefix || site.destination_content_prefix || "",
|
||||
// /w/index.php?title= is the default path for a new MediaWiki install, change as accordingly in config JSON files
|
||||
"destination_content_path": site.destination_content_path || "/w/index.php?title=",
|
||||
"destination_content_suffix": origin.destination_content_suffix || site.destination_content_suffix || "",
|
||||
"destination_platform": site.destination_platform,
|
||||
"destination_icon": site.destination_icon,
|
||||
|
@ -103,21 +105,32 @@ async function commonFunctionGetSiteDataByOrigin() {
|
|||
});
|
||||
}));
|
||||
}
|
||||
|
||||
await Promise.all(promises);
|
||||
return sites;
|
||||
window.iwb_siteDataByOrigin = sites;
|
||||
return window.iwb_siteDataByOrigin;
|
||||
}
|
||||
|
||||
// Load wiki data objects, with each origin having its own object
|
||||
async function commonFunctionGetSiteDataByOrigin() {
|
||||
if (!window.iwb_siteDataByOrigin || window.iwb_siteDataByOrigin.length === 0) {
|
||||
await populateSiteDataByOrigin();
|
||||
}
|
||||
return window.iwb_siteDataByOrigin;
|
||||
}
|
||||
|
||||
// Given a URL, find closest match in our dataset
|
||||
async function commonFunctionFindMatchingSite(site, crossLanguageSetting) {
|
||||
async function commonFunctionFindMatchingSite(site, crossLanguageSetting, dest = false) {
|
||||
let base_url_key = dest ? 'destination_base_url' : 'origin_base_url';
|
||||
|
||||
let matchingSite = commonFunctionGetSiteDataByOrigin().then(sites => {
|
||||
let matchingSites = [];
|
||||
if (crossLanguageSetting === 'on') {
|
||||
matchingSites = sites.filter(el => site.replace(/.*https?:\/\//, '').startsWith(el.origin_base_url));
|
||||
matchingSites = sites.filter(el => site.replace(/.*https?:\/\//, '').startsWith(el[base_url_key]));
|
||||
} else {
|
||||
matchingSites = sites.filter(el => {
|
||||
return site.replace(/.*https?:\/\//, '').startsWith(el.origin_base_url + el.origin_content_path)
|
||||
|| site.replace(/.*https?:\/\//, '').replace(/\/$/, '') === el.origin_base_url
|
||||
}
|
||||
matchingSites = sites.filter(el =>
|
||||
site.replace(/.*https?:\/\//, '').startsWith(dest ? el[base_url_key] : (el.origin_base_url + el.origin_content_path))
|
||||
|| site.replace(/.*https?:\/\//, '').replace(/\/$/, '') === el[base_url_key]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -125,11 +138,11 @@ async function commonFunctionFindMatchingSite(site, crossLanguageSetting) {
|
|||
// Select match with longest base URL
|
||||
let closestMatch = '';
|
||||
matchingSites.forEach(site => {
|
||||
if (site.origin_base_url.length > closestMatch.length) {
|
||||
closestMatch = site.origin_base_url;
|
||||
if (site[base_url_key].length > closestMatch.length) {
|
||||
closestMatch = site[base_url_key];
|
||||
}
|
||||
});
|
||||
return matchingSites.find(site => site.origin_base_url === closestMatch);
|
||||
return matchingSites.find(site => site[base_url_key] === closestMatch);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -315,9 +315,7 @@ function displayRedirectBanner(newUrl, id, destinationName, destinationLanguage,
|
|||
}
|
||||
|
||||
function main() {
|
||||
chrome.storage.local.get((localStorage) => {
|
||||
chrome.storage.sync.get((syncStorage) => {
|
||||
const storage = { ...syncStorage, ...localStorage };
|
||||
chrome.runtime.sendMessage({action: 'getStorage'}).then((storage) => {
|
||||
// Check if extension is on:
|
||||
if ((storage.power ?? 'on') === 'on') {
|
||||
// Check if there is a pathname, to ensure we're looking at an article
|
||||
|
@ -375,7 +373,6 @@ function main() {
|
|||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
|
@ -388,42 +388,7 @@ function findClosestElement(target, elements) {
|
|||
return closestElement;
|
||||
}
|
||||
|
||||
async function filterSearchResults(searchResults, searchEngine, storage) {
|
||||
let countFiltered = 0;
|
||||
|
||||
for (let searchResult of searchResults) {
|
||||
try {
|
||||
// Check that result isn't within another result,
|
||||
// and if it is, check that the redirect button is still there
|
||||
// (some search engines will re-render and overwrite the button)
|
||||
if (!searchResult.closest('.iwb-detected') || !searchResult.closest('.iwb-detected').querySelector('.iwb-new-link-container')) {
|
||||
searchResultLink = searchResult.href || '';
|
||||
|
||||
if (!searchResultLink) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (searchEngine === 'google') {
|
||||
// Break if image result:
|
||||
if (searchResultLink.includes('imgurl=')) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Skip if result doesn't include specific tags/attributes
|
||||
// This helps avoid capturing unintended image results
|
||||
if (!(
|
||||
searchResult.querySelector('h1') ||
|
||||
searchResult.querySelector('h3') ||
|
||||
searchResult.querySelector('cite') ||
|
||||
searchResult.querySelector("div[role='link']"))) {
|
||||
searchResult.classList.add('iwb-detected');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
let crossLanguageSetting = storage.crossLanguage || 'off';
|
||||
let matchingSite = await commonFunctionFindMatchingSite(searchResultLink, crossLanguageSetting);
|
||||
if (matchingSite) {
|
||||
async function _filterSearchResult(matchingSite, searchResult, searchEngine, countFiltered, storage, reorderedHrefs) {
|
||||
// Get user's settings for the wiki
|
||||
let id = matchingSite['id'];
|
||||
let searchFilterSetting = 'replace';
|
||||
|
@ -434,7 +399,6 @@ async function filterSearchResults(searchResults, searchEngine, storage) {
|
|||
searchFilterSetting = storage.defaultSearchAction;
|
||||
}
|
||||
|
||||
if (searchFilterSetting !== 'disabled') {
|
||||
// Output stylesheet if not already done
|
||||
if (!document.querySelector('.iwb-styles')) {
|
||||
const headElement = document.querySelector('head');
|
||||
|
@ -504,13 +468,129 @@ async function filterSearchResults(searchResults, searchEngine, storage) {
|
|||
}
|
||||
|
||||
if (searchResultContainer) {
|
||||
// If this page from Fandom is the same as a re-ordered page, filter it out
|
||||
let originArticle = commonFunctionGetOriginArticle(searchResult.href, matchingSite);
|
||||
let destinationArticle = commonFunctionGetDestinationArticle(matchingSite, originArticle);
|
||||
|
||||
if (reorderedHrefs.find((href) => href.match(
|
||||
new RegExp(
|
||||
`http(s)*://${matchingSite['destination_base_url']}${matchingSite['destination_content_path']}${encodeURIComponent(destinationArticle)}`
|
||||
)
|
||||
))) {
|
||||
countFiltered += hideSearchResults(searchResultContainer, searchEngine, matchingSite, 'off');
|
||||
console.debug(`Indie Wiki Buddy has hidden a result matching ${searchResult.href} because we re-ordered an indie wiki result with a matching article`);
|
||||
} else if (searchFilterSetting !== 'disabled') {
|
||||
if (searchFilterSetting === 'hide') {
|
||||
// Else, if the user has the preference set to hide search results, hide it indiscriminately
|
||||
countFiltered += hideSearchResults(searchResultContainer, searchEngine, matchingSite, storage['hiddenResultsBanner']);
|
||||
} else {
|
||||
countFiltered += replaceSearchResults(searchResultContainer, matchingSite, searchResultLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return countFiltered;
|
||||
}
|
||||
|
||||
async function _reorderDestinationSearchResult(resultsFirstChild, matchingDest, searchResult) {
|
||||
const searchContainer = searchResult.closest('#rso > div, #main > div');
|
||||
|
||||
if (!resultsFirstChild || !searchContainer || searchContainer.classList.contains('iwb-reordered')) {
|
||||
return;
|
||||
}
|
||||
|
||||
searchContainer.classList.add('iwb-reordered');
|
||||
resultsFirstChild.insertAdjacentElement('beforebegin', searchContainer);
|
||||
}
|
||||
|
||||
async function reorderSearchResults(searchResults, searchEngine, storage) {
|
||||
const reorderResultsSetting = storage.reorderResults || 'on';
|
||||
if (reorderResultsSetting === 'off') return [];
|
||||
|
||||
let reorderedHrefs = [];
|
||||
|
||||
if (!document.body.classList.contains('iwb-reorder')) {
|
||||
document.body.classList.add('iwb-reorder');
|
||||
|
||||
// Only support Google for now
|
||||
if (searchEngine !== 'google') return;
|
||||
|
||||
// Get the first element in the results container
|
||||
let resultsFirstChild = document.querySelector('#rso > div'); // desktop
|
||||
if (!resultsFirstChild) resultsFirstChild = document.querySelector('#main > div:has(div[data-hveid])'); // FF mobile
|
||||
if (!resultsFirstChild) return;
|
||||
|
||||
let crossLanguageSetting = storage.crossLanguage || 'off';
|
||||
|
||||
for (const searchResult of searchResults) {
|
||||
try {
|
||||
if (searchResult.closest('.iwb-detected')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const searchResultLink = searchResult.href || '';
|
||||
|
||||
// Handle re-ordering of results to move destination results up the page
|
||||
let matchingDest = await commonFunctionFindMatchingSite(searchResultLink, crossLanguageSetting, true);
|
||||
if (matchingDest) {
|
||||
if (resultsFirstChild.contains(searchResult)) {
|
||||
// If this search result is inside the first child of the results container (aka, it's the first result),
|
||||
// and there is a matchingDest at this point, then an indie wiki is #1 on the search results page.
|
||||
// Therefore, we should abandon the search re-ordering.
|
||||
console.debug('Indie Wiki Buddy is not re-ordering results, as an indie wiki is already the first result.');
|
||||
break;
|
||||
} else {
|
||||
await _reorderDestinationSearchResult(resultsFirstChild, matchingDest, searchResult);
|
||||
reorderedHrefs.push(searchResultLink);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Indie Wiki Buddy failed to properly re-order search results with error: ' + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return reorderedHrefs;
|
||||
}
|
||||
|
||||
async function filterSearchResults(searchResults, searchEngine, storage, reorderedHrefs = []) {
|
||||
let countFiltered = 0;
|
||||
|
||||
for (const searchResult of searchResults) {
|
||||
try {
|
||||
// Check that result isn't within another result
|
||||
if (!searchResult.closest('.iwb-detected')) {
|
||||
searchResultLink = searchResult.href || '';
|
||||
|
||||
if (!searchResultLink) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (searchEngine === 'google') {
|
||||
// Break if image result:
|
||||
if (searchResultLink.includes('imgurl=')) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Skip if result doesn't include specific tags/attributes
|
||||
// This helps avoid capturing unintended image results
|
||||
if (!(
|
||||
searchResult.querySelector('h1') ||
|
||||
searchResult.querySelector('h3') ||
|
||||
searchResult.querySelector('cite') ||
|
||||
searchResult.querySelector("div[role='link']")))
|
||||
{
|
||||
searchResult.classList.add('iwb-detected');
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
let crossLanguageSetting = storage.crossLanguage || 'off';
|
||||
|
||||
// Handle source -> destination filtering
|
||||
let matchingSource = await commonFunctionFindMatchingSite(searchResultLink, crossLanguageSetting);
|
||||
if (matchingSource) {
|
||||
countFiltered = await _filterSearchResult(matchingSource, searchResult, searchEngine, countFiltered, storage, reorderedHrefs);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -531,32 +611,29 @@ function main(mutations = null, observer = null) {
|
|||
if (observer) {
|
||||
observer.disconnect();
|
||||
}
|
||||
chrome.storage.local.get((localStorage) => {
|
||||
chrome.storage.sync.get((syncStorage) => {
|
||||
const storage = { ...syncStorage, ...localStorage };
|
||||
chrome.runtime.sendMessage({action: 'getStorage'}).then((storage) => {
|
||||
// Check if extension is on:
|
||||
if ((storage.power ?? 'on') === 'on') {
|
||||
// Determine which search engine we're on
|
||||
if (currentURL.hostname.includes('www.google.')) {
|
||||
// Function to filter search results in Google
|
||||
function filterGoogle() {
|
||||
function filterGoogle(reorderedHrefs) {
|
||||
let searchResults = document.querySelectorAll(`
|
||||
div[data-hveid] a[href*='.fandom.com/']:first-of-type:not([role='button']):not([target='_self']),
|
||||
div[data-hveid] a[href*='.wiki.fextralife.com/']:first-of-type:not([role='button']):not([target='_self']),
|
||||
div[data-hveid] a[href*='.neoseeker.com/wiki/']:first-of-type:not([role='button']):not([target='_self'])`);
|
||||
filterSearchResults(searchResults, 'google', storage);
|
||||
filterSearchResults(searchResults, 'google', storage, reorderedHrefs);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterGoogle();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterGoogle();
|
||||
}
|
||||
}, { once: true });
|
||||
async function reorderGoogle() {
|
||||
let searchResults = document.querySelectorAll("div[data-hveid] a:first-of-type:not([role='button']):not([target='_self'])");
|
||||
return await reorderSearchResults(searchResults, 'google', storage);
|
||||
}
|
||||
|
||||
reorderGoogle().then((r) => {
|
||||
// Filtering happens after re-ordering, so that we can filter anything that matches what we re-ordered
|
||||
filterGoogle(r);
|
||||
});
|
||||
} else if (currentURL.hostname.includes('duckduckgo.com') && (currentURL.search.includes('q=') || currentURL.pathname.includes('html'))) {
|
||||
// Function to filter search results in DuckDuckGo
|
||||
function filterDuckDuckGo() {
|
||||
|
@ -564,16 +641,7 @@ function main(mutations = null, observer = null) {
|
|||
filterSearchResults(searchResults, 'duckduckgo', storage);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterDuckDuckGo();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterDuckDuckGo();
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
} else if (currentURL.hostname.endsWith('.bing.com')) {
|
||||
// Function to filter search results in Bing
|
||||
function filterBing() {
|
||||
|
@ -601,16 +669,7 @@ function main(mutations = null, observer = null) {
|
|||
filterSearchResults(searchResults, 'bing', storage);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterBing();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterBing();
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
} else if (currentURL.hostname.includes('search.brave.com')) {
|
||||
// Function to filter search results in Brave
|
||||
function filterBrave() {
|
||||
|
@ -621,16 +680,7 @@ function main(mutations = null, observer = null) {
|
|||
filterSearchResults(searchResults, 'brave', storage);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterBrave();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterBrave();
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
} else if (currentURL.hostname.includes('ecosia.org')) {
|
||||
// Function to filter search results in Ecosia
|
||||
function filterEcosia() {
|
||||
|
@ -641,16 +691,7 @@ function main(mutations = null, observer = null) {
|
|||
filterSearchResults(searchResults, 'ecosia', storage);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterEcosia();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterEcosia();
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
} else if (currentURL.hostname.includes('qwant.com')) {
|
||||
// Function to filter search results in Qwant
|
||||
function filterQwant() {
|
||||
|
@ -658,16 +699,7 @@ function main(mutations = null, observer = null) {
|
|||
filterSearchResults(searchResults, 'qwant', storage);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterQwant();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterQwant();
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
} else if (currentURL.hostname.includes('startpage.com')) {
|
||||
// Function to filter search results in Startpage
|
||||
function filterStartpage() {
|
||||
|
@ -678,16 +710,7 @@ function main(mutations = null, observer = null) {
|
|||
filterSearchResults(searchResults, 'startpage', storage);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterStartpage();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterStartpage();
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
} else if (currentURL.hostname.includes('yandex.') || currentURL.hostname.includes('ya.ru')) {
|
||||
// Function to filter search results in Yandex
|
||||
function filterYandex() {
|
||||
|
@ -698,16 +721,7 @@ function main(mutations = null, observer = null) {
|
|||
filterSearchResults(searchResults, 'yandex', storage);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterYandex();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterYandex();
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
} else if (currentURL.hostname.includes('yahoo.com')) {
|
||||
// Function to filter search results in Yahoo
|
||||
function filterYahoo() {
|
||||
|
@ -738,16 +752,7 @@ function main(mutations = null, observer = null) {
|
|||
filterSearchResults(searchResults, 'yahoo', storage);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterYahoo();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterYahoo();
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
} else if (currentURL.hostname.includes('kagi.com')) {
|
||||
// Function to filter search results in Kagi
|
||||
function filterKagi() {
|
||||
|
@ -758,16 +763,7 @@ function main(mutations = null, observer = null) {
|
|||
filterSearchResults(searchResults, 'kagi', storage);
|
||||
}
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterKagi();
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filterKagi();
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
} else if (storage.customSearchEngines) {
|
||||
function filterSearXNG() {
|
||||
let searchResults = Array.from(document.querySelectorAll('h3>a')).filter(el =>
|
||||
|
@ -796,21 +792,10 @@ function main(mutations = null, observer = null) {
|
|||
let customSearchEngines = storage.customSearchEngines;
|
||||
if (customSearchEngines[currentURL.hostname]) {
|
||||
let customSearchEnginePreset = customSearchEngines[currentURL.hostname];
|
||||
|
||||
// Wait for document to be interactive/complete:
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filter(customSearchEnginePreset);
|
||||
} else {
|
||||
document.addEventListener('readystatechange', e => {
|
||||
if (['interactive', 'complete'].includes(document.readyState)) {
|
||||
filter(customSearchEnginePreset);
|
||||
}
|
||||
}, { once: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue