Last active
February 15, 2020 23:43
-
-
Save maryqygao/e1c5a3331c04aa35adb36bd6b2e22c37 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 http://*.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
Fixed page not scrollable by setting
overlay: scroll
on the<body>
element.