-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5a0e25
commit 54ab9e3
Showing
5 changed files
with
17 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,13 @@ | ||
console.log("Disabling Paywall on WSJ.com"); | ||
// edit meta data | ||
document.arrive('meta[name="cx_shield"]', function() { | ||
this.setAttribute("content", "{\"campaign\":2000,\"placement\":\"cx-articlecover\", \"tag\":\"default\", \"type\":\"free\"}"); | ||
}); | ||
// make free article in first meta JSON | ||
document.arrive('script[type="application/ld+json"]', function() { | ||
let data = JSON.parse(this.innerHTML); | ||
data["isAccessibleForFree"] = "true"; | ||
data["hasPart"]["isAccessibleForFree"] = "true"; | ||
this.innerHTML = JSON.stringify(data); | ||
}); | ||
// make free article in second meta JSON | ||
document.arrive('#article_body > script[type="text/javascript"]', function() { | ||
let script = this.innerHTML; | ||
if (script.includes("var utag_data =")) { | ||
console.log("found") | ||
let data = JSON.parse(script.replace("var utag_data =", '').replace(/ /g, '').replace(/;/g, '')) | ||
data["page_access"] = "free"; | ||
data["cx_shield"] = { | ||
"campaign": 2000, | ||
"placement": "cx-articlecover", | ||
"tag": "default", | ||
"type": "free" | ||
}; | ||
this.innerHTML = "var utag_data = " + JSON.stringify(data) + ";"; | ||
} | ||
}); | ||
var url = window.location.href; | ||
var redirect = true; | ||
|
||
if (url.indexOf('?mod=rsswn') != -1) | ||
redirect = false; | ||
else if (url.indexOf('&mod=rsswn') != -1) | ||
redirect = false; | ||
|
||
// redirect | ||
if (redirect) { | ||
console.log("Disabling Paywall on " + window.location.pathname); | ||
window.location = '//' + location.host + location.pathname + '?mod=rsswn'; | ||
} |