Update contentScript.js

Missed parent div class
master
alastairR 2019-11-06 12:40:18 +13:00 committed by GitHub
parent f3a7c92e9d
commit 52590cd578
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -36,6 +36,7 @@ if (window.location.href.indexOf("bizjournals.com") !== -1) {
if (paywall) {
paywall.classList.remove('premium-content');
paywall.classList.add('full-content');
removeClassesByPrefix(paywall, 'QUnW');
var paras = paywall.querySelectorAll("p, span, h2, div");
for (var i = paras.length -1; i > -1; i--) {
removeClassesByPrefix(paras[i], 'QUnW');
@ -142,7 +143,8 @@ function removeDOMElement(...elements) {
}
}
function removeClassesByPrefix(el, prefix) {
function removeClassesByPrefix(el, prefix)
{
for(var i = el.classList.length - 1; i >= 0; i--) {
if(el.classList[i].startsWith(prefix)) {
el.classList.remove(el.classList[i]);