bypass the content warning on blogspot/blogger sites
当前为
// ==UserScript==
// @name Blogspot Warning Bypass
// @namespace http://blogger.com
// @version 1.0
// @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.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');
}
})();