Adblock Scroll Unblocker and Ad Elements Remover for OneJailbreak.com

Enable scrolling on pages that block it due to adblock detection and remove specific ad elements

  1. // ==UserScript==
  2. // @name Adblock Scroll Unblocker and Ad Elements Remover for OneJailbreak.com
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Enable scrolling on pages that block it due to adblock detection and remove specific ad elements
  6. // @icon https://www.google.com/s2/favicons?domain=onejailbreak.com
  7. // @author sharmanhall
  8. // @match https://onejailbreak.com/*
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Function to enable scrolling by changing body's style
  17. const enableScrolling = () => {
  18. document.body.style.overflow = 'auto';
  19. };
  20.  
  21. // Function to remove specified elements from the page
  22. const removeAdElements = () => {
  23. // Remove the 'contentInfo' div element
  24. const contentInfoElement = document.getElementById('statementBox');
  25. if (contentInfoElement) {
  26. contentInfoElement.remove();
  27. }
  28.  
  29. // Remove 'anchores' div elements containing ads
  30. const adElements = document.querySelectorAll('.anchores');
  31. adElements.forEach(el => el.remove());
  32. };
  33.  
  34. // Wait for the document to be fully loaded
  35. document.addEventListener('DOMContentLoaded', () => {
  36. // Call the functions to enable scrolling and remove ad elements
  37. enableScrolling();
  38. removeAdElements();
  39. });
  40.  
  41. // Observe for any changes that might re-disable scrolling or re-add ad elements
  42. const observer = new MutationObserver(mutations => {
  43. mutations.forEach(mutation => {
  44. // If body's style is modified, re-enable scrolling
  45. if (mutation.attributeName === 'style') {
  46. enableScrolling();
  47. }
  48. // Check and remove ad elements if they are added again
  49. removeAdElements();
  50. });
  51. });
  52.  
  53. // Configuration for the observer
  54. const config = { attributes: true, childList: true, subtree: true };
  55.  
  56. // Start observing the body element for changes in attributes and child elements
  57. observer.observe(document.body, config);
  58. })();