Skip to content

Instantly share code, notes, and snippets.

@mikeflynn
Last active August 29, 2015 14:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeflynn/11379028 to your computer and use it in GitHub Desktop.
Save mikeflynn/11379028 to your computer and use it in GitHub Desktop.
** Latest version here: https://github.com/mikeflynn/stltoday-paywall-buster ** A browser user script to prevent the STLToday.com paywall from activating by simply marking the content as free. See how to install this on your browser of choice (Chrome or Firefox are preferred) here: http://wiki.greasespot.net/Cross-browser_userscripting
// ==UserScript==
// @name "STLToday Free"
// @version 2.2
// @description "A user script to automatically bypass the paywall by marking the content as free."
// @match http://*.stltoday.com/*
// @run-at document-start
// ==/UserScript==
function updateMetaTag() {
var m = document.getElementsByTagName('meta');
if(m.length > 0) {
for(var i in m) {
if(m[i].name === '__sync_contentCategory') {
m[i].content = 'free';
}
}
} else {
setTimeout(function() { updateMetaTag(); }, 100);
}
}
function addMetaTag() {
var head = document.getElementsByTagName('head');
if(head.length > 0) {
head[0].insertAdjacentHTML('afterbegin', '<meta name="__sync_contentCategory" content="free">');
} else {
setTimeout(function() { addMetaTag(); }, 100);
}
}
function killSurvey() {
window._402nosurvey = 1;
}
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ killSurvey +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
updateMetaTag();
//addMetaTag();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment