Google neocities part 4

Change the margin of a specific div element on websites containing a specific URL

  1. // ==UserScript==
  2. // @name Google neocities part 4
  3. // @namespace https://vanced-youtube.neocities.org/2013/
  4. // @version 1.0
  5. // @description Change the margin of a specific div element on websites containing a specific URL
  6. // @match *://*/*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. // Function to change the tab margin
  14. function changeTabMargin() {
  15. const tabHeader = document.querySelector('div.gsc-tabHeader.gsc-inline-block.gsc-tabhActive[aria-label="refinement"]');
  16. if (tabHeader) {
  17. tabHeader.style.margin = '-16px 8px';
  18. }
  19. }
  20.  
  21. // Check if the current URL contains the target URL
  22. if (window.location.href.includes('https://vanced-youtube.neocities.org/2013')) {
  23. // Wait for the page to load and then change the tab margin
  24. window.addEventListener('load', changeTabMargin);
  25. }
  26. })();