Compare commits

...

7 Commits

Author SHA1 Message Date
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
6 changed files with 110 additions and 17 deletions

View File

@ -3798,13 +3798,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",
@ -3907,6 +3913,12 @@
"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",
@ -4331,13 +4343,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",
@ -4725,6 +4749,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",
@ -5142,6 +5194,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",
@ -7168,4 +7242,4 @@
"miraheze"
]
}
]
]

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/"
}
]
]

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

@ -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);
}
@ -561,17 +561,17 @@ 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 {
resultsToSort.push(searchResult);
}
resultsToSort.push(searchResult);
}
}
} catch (e) {
@ -586,7 +586,7 @@ async function reorderSearchResults(searchResults, searchEngine, storage) {
for (const searchResult of resultsToSort) {
try {
await reorderDestinationSearchResult(resultsFirstChild, searchResult);
reorderedHrefs.push(searchResultLink);
reorderedHrefs.push(searchResult.href);
} catch (e) {
console.log('Indie Wiki Buddy failed to properly re-order search results with error: ' + e);
}
@ -673,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, div[jsname]'));
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]'));
return await reorderSearchResults(searchResults, 'google', storage);
}
@ -890,4 +890,4 @@ if (currentURL.hostname.includes('www.google.')) {
checkIfEnabled('yahoo');
} else if (currentURL.hostname.includes('kagi.com')) {
checkIfEnabled('kagi');
}
}