botmtl
9/28/2016 - 12:16 AM

Automatically skips the obnoxious "Content warning" on Blogger sites (only those with blogspot.com domains) — and doesn't require a page rel

Automatically skips the obnoxious "Content warning" on Blogger sites (only those with blogspot.com domains) — and doesn't require a page reload to do so. Winnah. To install using Google Chrome or Grasemonkey, click raw and you'll be prompted to install th

// ==UserScript==
// @name Blogger Content Warning Skip
// @description Automatically skips the content warning on blogspot.com sites without reloading the page
// @updateURL https://gist.github.com/botmtl/a59d6d1ffc0cfebb728c5640c5ee5293/raw/b6051fea9e418e4538b3565d32117f4fee77f98f/hide-blogger-warning.user.js
// @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');
}