Compare commits
10 Commits
bdd61a629b
...
2f1238a365
Author | SHA1 | Date |
---|---|---|
DrWhoFan13 | 2f1238a365 | |
DrWhoFan13 | b273c85e51 | |
DrWhoFan13 | 2d46e8895e | |
Kevin Payravi | 5a1ac577db | |
Kevin Payravi | cf838788b2 | |
Kevin Payravi | a8c740480c | |
Kevin Payravi | 1f5f969750 | |
Kevin Payravi | f55cd3b795 | |
trfunk | 0d4ae31f17 | |
Kevin Payravi | de1abf33c5 |
|
@ -1738,8 +1738,8 @@
|
|||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "liquipediadota2wiki.png",
|
||||
"destination_main_page": "Main_Page",
|
||||
"destination_search_path": "/dota2/index.php",
|
||||
"destination_content_path": "/dota2/"
|
||||
"destination_search_path": "/dota2game/index.php",
|
||||
"destination_content_path": "/dota2game/"
|
||||
},
|
||||
{
|
||||
"id": "en-dotflow",
|
||||
|
@ -3901,6 +3901,12 @@
|
|||
"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"
|
||||
}
|
||||
],
|
||||
"destination": "Minecraft Wiki",
|
||||
|
@ -5153,7 +5159,7 @@
|
|||
"destination_icon": "scpslwiki.png",
|
||||
"destination_main_page": "Main_Page",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/index.php?title="
|
||||
"destination_content_path": "/index.php?title=",
|
||||
"tags": [
|
||||
"official"
|
||||
]
|
||||
|
@ -6745,7 +6751,7 @@
|
|||
"destination_base_url": "wiki.wesnoth.org",
|
||||
"destination_platform": "mediawiki",
|
||||
"destination_icon": "thebattleforwesnothwiki.png",
|
||||
"destination_main_page": "Main_Page",
|
||||
"destination_main_page": "StartingPoints",
|
||||
"destination_search_path": "/index.php",
|
||||
"destination_content_path": "/",
|
||||
"tags": [
|
||||
|
@ -6986,6 +6992,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",
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 251 B |
|
@ -548,10 +548,7 @@ async function reorderSearchResults(searchResults, searchEngine, storage) {
|
|||
if (!resultsFirstChild) return;
|
||||
|
||||
let crossLanguageSetting = storage.crossLanguage || 'off';
|
||||
|
||||
// Re-order search results
|
||||
// This is so that higher results are re-ordered to the top last
|
||||
searchResults = searchResults.reverse();
|
||||
let resultsToSort = [];
|
||||
|
||||
for (const searchResult of searchResults) {
|
||||
try {
|
||||
|
@ -573,11 +570,23 @@ async function reorderSearchResults(searchResults, searchEngine, storage) {
|
|||
console.debug('Indie Wiki Buddy is not re-ordering results, as an indie wiki is already the first result.');
|
||||
break;
|
||||
} else {
|
||||
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(searchResultLink);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Indie Wiki Buddy failed to properly re-order search results with error: ' + e);
|
||||
}
|
||||
|
@ -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[jsname]'));
|
||||
|
||||
return await reorderSearchResults(searchResults, 'google', storage);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue