Skip to content

Instantly share code, notes, and snippets.

@N0taN3rd
Created April 27, 2018 20:29
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 N0taN3rd/b9bd1478ef043f74177735f81700d9ae to your computer and use it in GitHub Desktop.
Save N0taN3rd/b9bd1478ef043f74177735f81700d9ae to your computer and use it in GitHub Desktop.
Remove the annoying blogger preview click trap element.
// what substring in the URL indicates to us that we are editing the blog post
let isPostPreview = 'post-preview'
// the query selector to use for referencing the click trap element
let querySelectorForClickTrap = '.blogger-clickTrap'
// how long should the delay be before we attempt to remove the click trap element
let wait = 3000
if (window.location.href.indexOf(isPostPreview) !== -1) {
setTimeout(() => {
console.log('nukeClickTrap')
let it = document.querySelector(querySelectorForClickTrap)
if (it) {
it.remove()
console.log('removed')
} else {
console.log('not removed')
}
}, wait)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment