Remove Comick Sidebar

Removes sidebar div and extends main to take its place exactly

  1. // ==UserScript==
  2. // @name Remove Comick Sidebar
  3. // @namespace https://github.com/GooglyBlox
  4. // @version 1.0
  5. // @description Removes sidebar div and extends main to take its place exactly
  6. // @author GooglyBlox
  7. // @match https://comick.io/
  8. // @match https://comick.io/home2
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. function adjustLayout() {
  17. const mainElement = document.querySelector('main[id="main"]');
  18.  
  19. const sidebarDiv = document.querySelector('div.float-right.w-4\\/12.xl\\:w-3\\/12');
  20.  
  21. if (mainElement && sidebarDiv) {
  22. sidebarDiv.remove();
  23.  
  24. mainElement.classList.remove('md:w-8/12', 'xl:w-9/12');
  25. mainElement.classList.add('md:w-12/12', 'xl:w-12/12');
  26.  
  27. mainElement.classList.remove('md:float-left');
  28. }
  29. }
  30.  
  31. adjustLayout();
  32.  
  33. const observer = new MutationObserver(function(mutations) {
  34. adjustLayout();
  35. });
  36.  
  37. observer.observe(document.body, {
  38. childList: true,
  39. subtree: true
  40. });
  41. })();