Blogger Content Warning Bypass

A user script to bypass Blogspot's Content Warning

  1. // ==UserScript==
  2. // @name Blogger Content Warning Bypass
  3. // @namespace Blogger Content Warning Bypass
  4. // @description A user script to bypass Blogspot's Content Warning
  5. // @version 2.0
  6. // @icon https://www.google.com/s2/favicons?sz=64&domain=blogger.com
  7. // @author kylyte
  8. // @license GPL-3.0
  9. // @match https://www.blogger.com/post-interstitial.g?blogspotURL=*
  10. // @match https://*.blogspot.com/*
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. const currentUrl = window.location.href;
  17. if (currentUrl.includes('post-interstitial.g?blogspotURL=')) {
  18. function clickButton() {
  19. const button = document.querySelector('a.maia-button');
  20. if (button) {
  21. button.click();
  22. }
  23. }
  24. const observer = new MutationObserver((mutations, obs) => {
  25. const button = document.querySelector('a.maia-button');
  26. if (button) {
  27. button.click();
  28. obs.disconnect();
  29. }
  30. });
  31. observer.observe(document.body, {
  32. childList: true,
  33. subtree: true
  34. });
  35. document.body.style.display = 'none';
  36. window.addEventListener('click', clickButton);
  37. }
  38.  
  39. if (currentUrl.match(/^https:\/\/.*\.blogspot\.com\/.*$/)) {
  40. const style = document.createElement('style');
  41. style.textContent = `
  42. @namespace url(http://www.w3.org/1999/xhtml);
  43. iframe#injected-iframe[src*='blogin.g'] {
  44. display: none !important;
  45. }
  46. body * {
  47. visibility: inherit !important;
  48. }
  49. `;
  50. document.head.appendChild(style);
  51. }
  52. })();