Blogspot Warning Bypass

bypass the content warning on blogspot/blogger sites

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         Blogspot Warning Bypass
// @namespace    http://blogger.com
// @version      1.25
// @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';

    // Check if the webpage is a Blogger/Blogspot site
    function isBloggerPage() {
        // Check for specific Blogspot attributes or meta tags
        const blogspotAttributes = ['data-blogspot-url', 'data-blogspot-url-original'];
        const hasBlogspotAttributes = blogspotAttributes.some(attr => document.querySelector(`[${attr}]`));

        // Check for specific Blogspot meta tags
        const hasBlogspotMetaTag = Array.from(document.querySelectorAll('meta[name="generator"]'))
        .some(tag => tag.getAttribute('content').toLowerCase().includes('blogger'));

        // Combine all detection methods
        return (
            hasBlogspotAttributes ||
            hasBlogspotMetaTag
        );
    }

    // 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');
        }
    }

    // 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');
        }
    }

    // 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');
    }
})();