Unstick

Make fixed-position elements scroll with the page.

  1. // ==UserScript==
  2. // @name Unstick
  3. // @name:en Unstick
  4. // @namespace https://github.com/kimpeek/Unstick
  5. // @version 0.2
  6. // @description Make fixed-position elements scroll with the page.
  7. // @author kimpeek
  8. // @include *
  9. // @grant none
  10. // @icon https://raw.githubusercontent.com/kimpeek/Unstick/master/Down.ico
  11. // ==/UserScript==
  12.  
  13. (function() {
  14.  
  15. const elements = document.querySelectorAll('body *');
  16.  
  17. for (let element of elements) {
  18. if (getComputedStyle(element).position === 'fixed') {
  19. element.style.position = "absolute";
  20. }
  21. else if (getComputedStyle(element).position === 'sticky') {
  22. element.style.position = "relative";
  23. }
  24. }
  25. })();