Blogspot Warning Bypass

bypass the content warning on blogspot/blogger sites

当前为 2024-04-23 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

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