-
-
Save botmtl/643810e761d6ca3064d8f76360980ef0 to your computer and use it in GitHub Desktop.
Automatically skips the obnoxious "Content warning" on Blogger sites (only those with blogspot.com domains).
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 Blogger Content Warning Skip | |
// @description Automatically skips the content warning on blogspot.com sites without reloading the page | |
// @grant none | |
// @match http://*.blogspot.ca/* | |
// @match http://*.blogspot.com/* | |
// ==/UserScript== | |
var fireEvent = function(obj,evt){ | |
var fireOnThis = obj; | |
if (document.createEvent) { | |
var evObj = document.createEvent('MouseEvents'); | |
evObj.initEvent(evt, true, false); | |
fireOnThis.dispatchEvent(evObj); | |
} else if (document.createEventObject) { | |
fireOnThis.fireEvent('on' + evt); | |
} | |
} | |
var overlay = document.getElementById('injected-iframe'); | |
if (overlay) { | |
var nextSibling = overlay.nextElementSibling; | |
if (nextSibling.tagName == 'STYLE') nextSibling.parentElement.removeChild(nextSibling); | |
overlay.parentElement.removeChild(overlay); | |
} else if (window.location.href.indexOf('https://www.blogger.com/blogin.g') == 0) { | |
fireEvent(document.getElementById('continueButton'), 'click'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment