In BreezeWiki, append bw-redirect query param to Fandom links
parent
5fb980f4da
commit
0131ebcd2c
|
@ -160,7 +160,7 @@ function redirectToBreezeWiki(storage, tabId, url) {
|
|||
}
|
||||
}
|
||||
|
||||
if (url.includes('fandom.com/wiki/')) {
|
||||
if (url.includes('fandom.com/wiki/') && !url.includes('bw-redirect=no')) {
|
||||
if (!(storage.breezewikiHost ?? null)) {
|
||||
fetch('https://bw.getindie.wiki/instances.json')
|
||||
.then((response) => {
|
||||
|
|
|
@ -5,3 +5,12 @@ bwTopBanners.forEach((banner) => {
|
|||
banner.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
// Append bw-redirect query param to Fandom links
|
||||
// This allows users to click a Fandom link without being redirected back to BW
|
||||
const bwFandomLinks = document.querySelectorAll('a[href*=".fandom.com"]');
|
||||
bwFandomLinks.forEach((link) => {
|
||||
const url = new URL(link);
|
||||
url.searchParams.append('bw-redirect', 'no');
|
||||
link.href = url;
|
||||
});
|
Loading…
Reference in New Issue