Compare commits

...

18 Commits

Author SHA1 Message Date
Tomo 53983aaed5
Merge 80a774db82 into ac2db4e352 2024-05-06 00:20:56 -07:00
Kevin Payravi ac2db4e352 Version 3.7.1 2024-05-03 16:22:40 +03:00
Kevin Payravi 096a870719 Additional selectors for reorder-ignore
"div[data-docid], div[data-lpage]" captures image results
2024-05-03 16:20:52 +03:00
Kevin Payravi 411763ca14 Add DFO Wiki 2024-05-03 10:08:44 +03:00
Kevin Payravi cdd509de8c Optimizing favicons 2024-05-03 03:19:40 +03:00
Kevin Payravi f57a4e44a3 Adding Rainverse 2024-05-03 03:19:14 +03:00
DrWhoFan13 1142e62840
Adding SCP: Secret Laboratory Wiki 2024-05-02 19:12:50 -05:00
DrWhoFan13 6792755dca
Added WikiTrek (IT) 2024-05-02 18:44:11 -05:00
Kevin Payravi 623eb2d149 Adjust query for non-standard search results / Fix
For identifying non-standard search results, "div[jsname]" is unreliable as Google does seem to add it to some standard search results. Replacing with checks for attributes that are more specific to Q&A dropdowns + cards.
2024-05-03 02:38:39 +03:00
Jayden 05f36d495d
re-ordering: unconditionally check for first result = indie wiki
This check should be moved outside of the searchEngineSettings if statement, because the result of it should be applied regardless of the searchEngineSettings.
2024-05-02 16:56:12 -05:00
DrWhoFan13 13be65bad8
Additional Redirects
Added an extra redirect to the Minecraft Wiki alongside one to the Micronation Wiki and two redirects to the Pathfinder Wiki
2024-05-02 16:25:42 -05:00
DrWhoFan13 2d46e8895e
Added Minecraft Story Mode Redirect 2024-05-01 19:51:27 -05:00
Kevin Payravi 5a1ac577db Adding xkcd wiki 2024-05-01 19:18:36 -05:00
Kevin Payravi cf838788b2 Splitting reordering into separate loop
We now have on loop that checks which results we want to re-order, and then a second loop that actually does the re-ordering.
2024-05-01 18:59:28 -05:00
Kevin Payravi a8c740480c Removing reverse for now, needs a closer look 2024-05-01 14:55:41 -05:00
Kevin Payravi 1f5f969750 For search re-ordering, avoid capturing Q&A
Check for JS-powered sections via div[jsname]

Co-Authored-By: Jayden <7265189+jayktaylor@users.noreply.github.com>
2024-05-01 14:50:52 -05:00
Kevin Payravi f55cd3b795 For search re-ordering, reverse at end
This avoids conflicting with the check for the first result being an indie wiki
2024-05-01 14:49:05 -05:00
Tomo 80a774db82 Add Animania Wiki (animaniamod.net/index.php/Main_Page) 2023-09-30 17:53:33 -07:00
11 changed files with 184 additions and 22 deletions

View File

@ -240,6 +240,22 @@
"miraheze"
]
},
{
"id": "en-animania",
"origins_label": "Animania Fandom Wiki",
"origins": [
{
"origin": "Animania Fandom Wiki",
"origin_base_url": "animania.fandom.com",
"origin_content_path": "/wiki/"
}
],
"destination": "Animania Wiki",
"destination_base_url": "animaniamod.net",
"destination_content_path": "/index.php/",
"destination_platform": "mediawiki",
"destination_icon": "animania.png"
},
{
"id": "en-anothereden",
"origins_label": "Another Eden Fandom Wiki",
@ -1605,6 +1621,25 @@
"destination_search_path": "/wiki/index.php",
"destination_content_path": "/wiki/"
},
{
"id": "en-dfo",
"origins_label": "Dungeon Fighter Online Fandom Wiki",
"origins": [
{
"origin": "Dungeon Fighter Online Fandom Wiki",
"origin_base_url": "dfo.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "Dungeon_Fighter_Online_Wiki"
}
],
"destination": "DFO World Wiki",
"destination_base_url": "wiki.dfo.world",
"destination_platform": "mediawiki",
"destination_icon": "dfoworldwiki.png",
"destination_content_path": "/view/",
"destination_search_path": "/index.php",
"destination_main_page": "Main_Page"
},
{
"id": "en-digimon",
"origins_label": "Digimon Fandom & Neoseeker Wikis",
@ -3798,13 +3833,19 @@
},
{
"id": "en-micronations",
"origins_label": "MicroNations Fandom Wiki",
"origins_label": "MicroNations Fandom Wikis",
"origins": [
{
"origin": "MicroNations Fandom Wiki",
"origin_base_url": "micronations.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "Main_Page"
},
{
"origin": "Micronations Fandom Wiki",
"origin_base_url": "microcountries.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "Micronations_Wiki"
}
],
"destination": "MicroWiki",
@ -3901,6 +3942,18 @@
"origin_base_url": "minecraftdungeons.wiki.fextralife.com",
"origin_content_path": "/",
"origin_main_page": "Minecraft+Dungeons+Wiki"
},
{
"origin": "Minecraft Story Mode Fandom Wiki",
"origin_base_url": "minecraftstorymode.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "Minecraft_Story_Mode_Wiki"
},
{
"origin": "Minecraft Dungeons Fandom Wiki",
"origin_base_url": "minecraftdungeons-archive.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "Minecraft:_Dungeons_Wiki"
}
],
"destination": "Minecraft Wiki",
@ -4325,13 +4378,25 @@
},
{
"id": "en-pathfinder",
"origins_label": "Pathfinder Fandom Wiki",
"origins_label": "Pathfinder Fandom & Fextra Wikis",
"origins": [
{
"origin": "Pathfinder Fandom Wiki",
"origin_base_url": "pathfinder.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "Pathfinder_Wiki"
},
{
"origin": "Pathfinder Kingmaker Fextralife Wiki",
"origin_base_url": "pathfinderkingmaker.wiki.fextralife.com",
"origin_content_path": "/",
"origin_main_page": "Pathfinder:+Kingmaker+Wiki"
},
{
"origin": "Pathfinder Wrath of the Righteous Fextralife Wiki",
"origin_base_url": "pathfinderwrathoftherighteous.wiki.fextralife.com",
"origin_content_path": "/",
"origin_main_page": "Pathfinder:+Wrath+of+the+Righteous+Wiki"
}
],
"destination": "PathfinderWiki",
@ -4719,6 +4784,34 @@
"destination_search_path": "/mediawiki/index.php",
"destination_content_path": "/wiki/"
},
{
"id": "en-raincomic",
"origins_label": "Rain (web comic) Fandom Wikis",
"origins": [
{
"origin": "Rain (web comic) Fandom Wiki",
"origin_base_url": "rain-web-comic.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "Rain_(web_comic)_Wikia"
},
{
"origin": "My Impossible Soulmate Fandom Wiki",
"origin_base_url": "myimpossiblesoulmate.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "My_Impossible_Soulmate_Wiki"
}
],
"destination": "Rainverse Wiki",
"destination_base_url": "rainverse.wiki",
"destination_platform": "mediawiki",
"destination_icon": "rainversewiki.png",
"destination_content_path": "/wiki/",
"destination_search_path": "/w/index.php",
"destination_main_page": "Rainverse_Wiki",
"tags": [
"miraheze"
]
},
{
"id": "en-rainworld",
"origins_label": "Rain World Fandom Wikis",
@ -5136,6 +5229,28 @@
"official"
]
},
{
"id": "en-scpsl",
"origins_label": "SCP: Secret Laboratory Fandom Wiki",
"origins": [
{
"origin": "SCP: Secret Laboratory Fandom Wiki",
"origin_base_url": "scp-secret-laboratory-official.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "SCP:_Secret_Laboratory_Official_Wiki"
}
],
"destination": "SCP: Secret Laboratory Wiki",
"destination_base_url": "en.scpslgame.com",
"destination_platform": "mediawiki",
"destination_icon": "scpslwiki.png",
"destination_main_page": "Main_Page",
"destination_search_path": "/index.php",
"destination_content_path": "/index.php?title=",
"tags": [
"official"
]
},
{
"id": "en-seaofthieves",
"origins_label": "Sea of Thieves Fandom Wiki",
@ -6964,6 +7079,25 @@
"destination_search_path": "/index.php",
"destination_content_path": "/w/"
},
{
"id": "en-xkcd",
"origins_label": "xkcd Fandom Wiki",
"origins": [
{
"origin": "xkcd Fandom Wiki",
"origin_base_url": "xkcd.fandom.com",
"origin_content_path": "/wiki/",
"origin_main_page": "Xkcd_Wiki"
}
],
"destination": "explain xkcd",
"destination_base_url": "www.explainxkcd.com",
"destination_platform": "mediawiki",
"destination_icon": "explainxkcd.png",
"destination_main_page": "Main_Page",
"destination_search_path": "/wiki/index.php",
"destination_content_path": "/wiki/index.php/"
},
{
"id": "en-yugioh",
"origins_label": "Yu-Gi-Oh! Fandom & Neoseeker Wikis",

View File

@ -78,5 +78,24 @@
"destination_main_page": "Home",
"destination_search_path": "/index.php",
"destination_content_path": "/"
},
{
"id": "it-startrek",
"origins_label": "Memory Alpha Fandom Wiki",
"origins": [
{
"origin": "Memory Alpha Fandom Wiki",
"origin_base_url": "memory-alpha.fandom.com/it",
"origin_content_path": "/wiki/",
"origin_main_page": "Pagina_principale"
}
],
"destination": "WikiTrek",
"destination_base_url": "wikitrek.org",
"destination_platform": "mediawiki",
"destination_icon": "wikitrek.png",
"destination_main_page": "Pagina_principale",
"destination_search_path": "/wt/index.php",
"destination_content_path": "/wiki/"
}
]
]

BIN
favicons/en/animania.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

BIN
favicons/en/explainxkcd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

BIN
favicons/en/scpsclwiki.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 577 B

BIN
favicons/it/wikitrek.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

View File

@ -1,6 +1,6 @@
{
"name": "Indie Wiki Buddy",
"version": "3.7.0",
"version": "3.7.1",
"description": "Indie Wiki Buddy helps you discover quality, independent wikis through alerts, redirects, and search filtering.",
"permissions": [
"storage",

View File

@ -1,6 +1,6 @@
{
"name": "Indie Wiki Buddy",
"version": "3.7.0",
"version": "3.7.1",
"description": "Indie Wiki Buddy helps you discover quality, independent wikis through alerts, redirects, and search filtering.",
"permissions": [
"storage",

View File

@ -19,7 +19,7 @@ function addDOMChangeObserver(callback, searchEngine, storage) {
const wrappedCallback = (mutations, observer) => {
callback(searchEngine, storage, mutations, observer);
};
const domObserver = new MutationObserver(wrappedCallback);
domObserver.observe(document.body, config);
}
@ -548,11 +548,8 @@ async function reorderSearchResults(searchResults, searchEngine, storage) {
if (!resultsFirstChild) return;
let crossLanguageSetting = storage.crossLanguage || 'off';
let resultsToSort = [];
// Re-order search results
// This is so that higher results are re-ordered to the top last
searchResults = searchResults.reverse();
for (const searchResult of searchResults) {
try {
if (searchResult.closest('.iwb-detected')) {
@ -564,24 +561,36 @@ async function reorderSearchResults(searchResults, searchEngine, storage) {
// 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;
}
let searchEngineSettings = await commonFunctionDecompressJSON(storage.searchEngineSettings || {});
if (searchEngineSettings[matchingDest.id] !== 'disabled') {
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, searchResult);
reorderedHrefs.push(searchResultLink);
}
resultsToSort.push(searchResult);
}
}
} catch (e) {
console.log('Indie Wiki Buddy failed to properly re-order search results with error: ' + e);
}
}
// Reverse order of resultsToSort,
// to restore top-down order.
resultsToSort = resultsToSort.reverse();
for (const searchResult of resultsToSort) {
try {
await reorderDestinationSearchResult(resultsFirstChild, searchResult);
reorderedHrefs.push(searchResult.href);
} catch (e) {
console.log('Indie Wiki Buddy failed to properly re-order search results with error: ' + e);
}
}
}
return reorderedHrefs;
@ -664,7 +673,7 @@ function startFiltering(searchEngine, storage, mutations = null, observer = null
let searchResults = document.querySelectorAll("div[data-hveid] a:first-of-type:not([role='button']):not([target='_self'])");
// Remove any matches that are not "standard" search results - this could've been done with :has() but limited browser support right now
searchResults = Array.from(searchResults).filter((e) => !e.closest('g-section-with-header'));
searchResults = Array.from(searchResults).filter((e) => !e.closest('g-section-with-header, div[aria-expanded], div[data-q], div[data-minw], div[data-num-cols], div[data-docid], div[data-lpage]'));
return await reorderSearchResults(searchResults, 'google', storage);
}
@ -881,4 +890,4 @@ if (currentURL.hostname.includes('www.google.')) {
checkIfEnabled('yahoo');
} else if (currentURL.hostname.includes('kagi.com')) {
checkIfEnabled('kagi');
}
}