Blogspot Warning Bypass

bypass the content warning on blogspot/blogger sites

Versione datata 23/04/2024. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

You will need to install an extension such as Tampermonkey to install this script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         Blogspot Warning Bypass
// @namespace    http://blogger.com
// @version      1.1
// @description  bypass the content warning on blogspot/blogger sites
// @author       elisewindbloom
// @match        *://*/*
// @icon         https://www.blogger.com/favicon.ico
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    // Function to check if "www.blogger.com" is present in the HTML
    function isBloggerPage() {
        return document.body.innerText.includes("Powered by Blogger") && document.documentElement.innerHTML.includes("www.blogger.com");
    }


    // Function to remove the injected iframe from the page
    function blockInjectedIframe() {
        var injectedIframe = document.getElementById('injected-iframe');
        if (injectedIframe) {
            injectedIframe.parentNode.removeChild(injectedIframe);
            console.log('Injected iframe with ID "injected-iframe" blocked');
        } else {
            //console.log('Injected iframe with ID "injected-iframe" not found');
        }
    }

    // Function to delete the body style
    function deleteBodyStyle() {
        var bodyStyleNode = document.evaluate('/html/body/style', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
        if (bodyStyleNode) {
            bodyStyleNode.parentNode.removeChild(bodyStyleNode);
            console.log('Node with XPath /html/body/style deleted');
        } else {
            //console.log('Node with XPath /html/body/style not found');
        }
    }

    // Check if the page is a Blogger page before executing the blocking and deletion functions
    if (isBloggerPage()) {
        blockInjectedIframe();
        deleteBodyStyle();
        console.log('Content Warning bypass complete');
    }
})();