safer-indie-wiki-buddy/scripts/content-breezewiki.js

16 lines
589 B
JavaScript
Raw Normal View History

// Hide Indie Wiki Buddy promo banner
const bwTopBanners = document.querySelectorAll('.bw-top-banner');
bwTopBanners.forEach((banner) => {
2024-02-27 09:43:55 +00:00
if (banner.innerText.includes('affiliated browser extension')) {
banner.style.display = 'none';
}
});
// Append "fandom allow" 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('fandom', 'allow');
2024-02-27 09:43:55 +00:00
link.href = url;
});