bpc-clone / bypass-paywalls-firefox-clean

MIT License
1.82k stars 71 forks source link

Request diariodenavarra.es #192

Closed david-alvarez-rosa closed 1 month ago

david-alvarez-rosa commented 1 month ago

Spanish newspaper https://www.diariodenavarra.es that can be bypass with

// Get article body
const json_script = document.querySelectorAll('script[type="application/ld+json"]')[1];
const article_body = JSON.parse(json_script.text).articleBody;

const article = document.createElement("p")
article.innerText = article_body
article.classList = ["paragraph con"];

let container = document.getElementsByClassName("content-modules")[0];
container.innerHTML = "";  // Empty container (including paywalls)
container.appendChild(article);
david-alvarez-rosa commented 1 month ago

Shorter

let a=document.createElement("p");a.innerText=JSON.parse(document.querySelectorAll('script[type="application/ld+json"]')[1].text).articleBody,c=document.getElementsByClassName("content-modules")[0];a.classList=["paragraph con"];c.innerHTML="",c.appendChild(a);
bpc-clone commented 1 month ago

Site is already part of custom sites (import) with similar ld_json fix.