Skip to content

Instantly share code, notes, and snippets.

@mikker
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save mikker/ee4454f39d28c53d3ce2 to your computer and use it in GitHub Desktop.

Select an option

Save mikker/ee4454f39d28c53d3ce2 to your computer and use it in GitHub Desktop.
(function() {
'use strict'
// Disclaimer: Politiken is a good newspaper. If you use their website
// a lot you should make an account and probably also a subscription to
// keep them going. https://politiken.dk/bruger/opret
function hideOrWait() {
var elm = document.querySelector('.dit-modal-overlay--transparent') // find overlay
if (!elm) return setTimeout(hideOrWait, 50) // break and try in 5 msecs if it isn't there yet
elm.remove() // remove black overlay
document.body.className = '' // bring back body scroll
// stupid elements eg. the one hiding "related articles"
var stupidElements = document.querySelectorAll('.not-logged-in')
for(var i in stupidElements) { stupidElements[i].remove() }
}
hideOrWait() // start waiting for the blackout
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment