Fix-update The New Yorker (embed)

This commit is contained in:
magnolia1234 2020-12-01 21:09:05 +01:00
parent 0ea459da90
commit 516e1bce95
3 changed files with 19 additions and 3 deletions

View file

@ -6,6 +6,7 @@ Add El Comercio, Ideal & La Voz de Cadiz (Spain)
Add The Spectator USA
Fix-update El Mercurio & La Segunda (mobile)
Fix-update Telegraph.co.uk (amp pages)
Fix-update The New Yorker (embed)
Update popup (Twitter)
* v1.9.7.0 (2020-11-27)

View file

@ -730,8 +730,23 @@ else if (matchDomain(["lc.nl", "dvhn.nl"])) {
}
else if (matchDomain("newyorker.com")) {
const paywall_bar = document.querySelector('.paywall-bar');
let paywall_bar = document.querySelector('.paywall-bar');
removeDOMElement(paywall_bar);
let invisible_assets = document.querySelectorAll('.responsive-asset--invisible');
for (let asset_invisible of invisible_assets)
asset_invisible.classList.remove('responsive-asset--invisible');
let overlays = document.querySelectorAll('.aspect-ratio--overlay-container');
let noscript, html;
let parser = new DOMParser();
for (let overlay of overlays) {
overlay.classList.remove('aspect-ratio--overlay-container');
noscript = overlay.querySelector('noscript');
if (noscript) {
html = parser.parseFromString(noscript.innerHTML, 'text/html');
overlay.appendChild(html.querySelector('img'));
removeDOMElement(noscript);
}
}
}
else if (matchDomain("americanaffairsjournal.org")) {

View file

@ -18,7 +18,7 @@ function popup_show_toggle(domain) {
site_switch_span.appendChild(labelEl);
document.getElementById("site_switch").addEventListener('click', function () {
ext_api.extension.getBackgroundPage().site_switch();
open(location, '_self').close();
close();
});
}
};
@ -26,5 +26,5 @@ ext_api.extension.getBackgroundPage().popup_show_toggle_tab(popup_show_toggle);
document.getElementById("clear_cookies").addEventListener('click', function () {
ext_api.extension.getBackgroundPage().clear_cookies();
open(location, '_self').close();
close();
});