Giter Club home page Giter Club logo

kill-sticky's People

Contributors

imrekoszo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kill-sticky's Issues

It didn't work on a site so I edited the script

Here's the script I made cuz nothing worked. It finally worked when I edited body position. The class things is probably overkill.

The site in question: https://www.infoworld.com/article/3663129/deno-deploy-moves-toward-ga-adds-paid-plan.html

(() => {
  document.querySelectorAll("body *").forEach(function (node) {
    if (["fixed", "sticky"].includes(getComputedStyle(node).position)) {
      node.parentNode.removeChild(node);
    }
  });

  document.querySelectorAll("html *").forEach(function (node) {
    var s = getComputedStyle(node);
    if ("hidden" === s["overflow"]) {
      node.style["overflow"] = "visible !important";
    }
    if ("hidden" === s["overflow-x"]) {
      node.style["overflow-x"] = "visible !important";
    }
    if ("hidden" === s["overflow-y"]) {
      node.style["overflow-y"] = "visible !important";
    }
  });

  var htmlNode = document.querySelector("html");
  htmlNode.style["overflow"] = "visible !important";
  htmlNode.style["overflow-x"] = "visible !important";
  htmlNode.style["overflow-y"] = "visible !important";

  document.querySelectorAll("body *").forEach(function (node) {
    var s = getComputedStyle(node);
    if ("hidden" === s["overflow"]) {
      node.style["overflow"] = "visible !important";
    }
    if ("hidden" === s["overflow-x"]) {
      node.style["overflow-x"] = "visible !important";
    }
    if ("hidden" === s["overflow-y"]) {
      node.style["overflow-y"] = "visible !important";
    }
  });

  var bodyNode = document.querySelector("body");
  bodyNode.style["overflow"] = "visible !important";
  bodyNode.style["overflow-x"] = "visible !important";
  bodyNode.style["overflow-y"] = "visible !important";

  // attach 10 classes to body: class1, class2, ..., class10

  const range10 = [...Array(10).keys()];
  range10.forEach((i) => {
    bodyNode.classList.add(`class${i + 1}`);
  });

  // attach 10 classes to html

  range10.forEach((i) => {
    htmlNode.classList.add(`class${i + 1}`);
  });

  // create a style component and style so any body with these classes inside an html with these classes will be overflow: visible !important

  const style = document.createElement("style");
  style.innerHTML = `
  html.class1.class2.class3.class4.class5.class6.class7.class8.class9.class10 body.class1.class2.class3.class4.class5.class6.class7.class8.class9.class10 {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    position: relative !important;
  }
`;
  document.head.appendChild(style);
})();

Link to example offending page

Would be perfect if there was a link to an example page that this should "fix". I've added the bookmarklet but have no obvious way to test it except for waiting for the issue to present itself on a page "in the wild".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.