Blogspot Warning Bypass

bypass the content warning on blogspot/blogger sites

目前為 2024-04-23 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Blogspot Warning Bypass
  3. // @namespace http://blogger.com
  4. // @version 1.21
  5. // @description bypass the content warning on blogspot/blogger sites
  6. // @author elisewindbloom
  7. // @match *://*/*
  8. // @icon https://www.blogger.com/favicon.ico
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Function to check if "www.blogger.com" and such are present in the HTML
  17. function isBloggerPage() {
  18. return (document.body.innerHTML.includes('<a href="https://www.blogger.com" target="_blank">Blogger</a>') || document.body.innerHTML.includes('Powered by Blogger')) && document.documentElement.innerHTML.includes("//www.blogger.com");
  19. //return document.documentElement.innerHTML.includes("www.blogger.com");
  20. }
  21.  
  22.  
  23. // Function to remove the injected iframe from the page
  24. function blockInjectedIframe() {
  25. var injectedIframe = document.getElementById('injected-iframe');
  26. if (injectedIframe) {
  27. injectedIframe.parentNode.removeChild(injectedIframe);
  28. console.log('Injected iframe with ID "injected-iframe" blocked');
  29. }
  30. }
  31.  
  32. // Function to delete the body style
  33. function deleteBodyStyle() {
  34. var bodyStyleNode = document.evaluate('/html/body/style', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  35. if (bodyStyleNode) {
  36. bodyStyleNode.parentNode.removeChild(bodyStyleNode);
  37. console.log('Node with XPath /html/body/style deleted');
  38. }
  39. }
  40.  
  41. // Check if the page is a Blogger page before executing the blocking and deletion functions
  42. if (isBloggerPage()) {
  43. blockInjectedIframe();
  44. deleteBodyStyle();
  45. console.log('Content Warning bypass complete');
  46. }
  47. })();
  48.