Forked from maryqygao/latimesbypass_gm.user.js
Last active
February 15, 2020 23:44
-
-
Save ckim/722fd87c194495eccf27499edea17c14 to your computer and use it in GitHub Desktop.
LA Times Registration Wall Bypasser
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
// ==UserScript== | |
// @name LA Times Registration Wall Bypasser | |
// @namespace https://gist.github.com/kitkat2 | |
// @description Bypasses the Los Angeles Times Regsitration wall | |
// @include https://*.latimes.com/* | |
// @version 1 | |
// @grant none | |
// @require http://code.jquery.com/jquery-3.1.1.min.js | |
// ==/UserScript== | |
$(function(){ | |
console.log('LA Times Registration Wall Bypasser loading...'); | |
var observer = new MutationObserver(function(ms) { | |
ms.forEach(function(m) { | |
if (!m.addedNodes) return; | |
$.each(m.addedNodes, function(i, n) { | |
if (n.id === 'reg-overlay') { | |
console.log('LA Times Registration Wall Detected'); | |
$('#reg-overlay').remove(); | |
$('html').css('overflow', 'scroll'); | |
$('body').css('overflow', 'scroll'); | |
$(window).off('scroll'); | |
console.log('LA Times Registration Wall Removed!'); | |
return false; | |
} | |
}); | |
}); | |
}); | |
observer.observe(document.body, { | |
childList: true, | |
subtree: true, | |
attributes: false, | |
characterData: false | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment