This commit is contained in:
Adam 2020-06-28 12:47:20 -07:00
parent 326b910182
commit 67b59dc8ae

View File

@ -80,9 +80,15 @@ if (matchDomain('rep.repubblica.it')) {
if (closeButton) { closeButton.click(); } if (closeButton) { closeButton.click(); }
} }
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const wsjLogin = document.querySelector('.wsj-snippet-login, .wsjpro-label'); const url = window.location.href;
if (wsjLogin) { const snippet = document.querySelector('.snippet-promotion');
window.location.href = window.location.href.replace('wsj.com', 'wsj.com/amp'); const wsjPro = document.querySelector('meta[name="page.site"][content="wsjpro"]');
if (snippet || wsjPro) {
if (!window.location.hash) {
if (url.includes('?')) {
window.location.href = url.replace('?', '#refreshed?');
} else { window.location.href = url + '#refreshed'; }
} else { window.location.href = window.location.href.replace('wsj.com', 'wsj.com/amp').replace('#refreshed', ''); }
} }
}); });
} else if (matchDomain('sloanreview.mit.edu')) { } else if (matchDomain('sloanreview.mit.edu')) {