t-mart / kill-sticky Goto Github PK
View Code? Open in Web Editor NEWBookmarklet to remove sticky elements and restore scrolling to web pages!
Bookmarklet to remove sticky elements and restore scrolling to web pages!
https://github.com/t-mart/kill-sticky#how-the-bookmarklet-works
The code just set overflow: visible not auto, it's a little bit different
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);
})();
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".
Tested on FF 66 and Chrome 72. Scrolling broken in both browsers.
drpsychmom.com
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.