Blogger Content Warning Bypass

A user script to bypass Blogspot's Content Warning

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name          Blogger Content Warning Bypass
// @namespace     Blogger Content Warning Bypass
// @description   A user script to bypass Blogspot's Content Warning
// @version       2.0
// @icon          https://www.google.com/s2/favicons?sz=64&domain=blogger.com
// @author        kylyte
// @license       GPL-3.0
// @match         https://www.blogger.com/post-interstitial.g?blogspotURL=*
// @match         https://*.blogspot.com/*
// ==/UserScript==

(function() {
    'use strict';

    const currentUrl = window.location.href;
    if (currentUrl.includes('post-interstitial.g?blogspotURL=')) {
        function clickButton() {
            const button = document.querySelector('a.maia-button');
            if (button) {
                button.click();
            }
        }
        const observer = new MutationObserver((mutations, obs) => {
            const button = document.querySelector('a.maia-button');
            if (button) {
                button.click();
                obs.disconnect();
            }
        });
        observer.observe(document.body, {
            childList: true,
            subtree: true
        });
        document.body.style.display = 'none';
        window.addEventListener('click', clickButton);
    }

    if (currentUrl.match(/^https:\/\/.*\.blogspot\.com\/.*$/)) {
        const style = document.createElement('style');
        style.textContent = `
            @namespace url(http://www.w3.org/1999/xhtml);
            iframe#injected-iframe[src*='blogin.g'] {
                display: none !important;
            }
            body * {
                visibility: inherit !important;
            }
        `;
        document.head.appendChild(style);
    }
})();