Created
April 27, 2018 20:29
-
-
Save N0taN3rd/b9bd1478ef043f74177735f81700d9ae to your computer and use it in GitHub Desktop.
Remove the annoying blogger preview click trap element.
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
// 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