Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ And that's what this extension aims to address:
Make a new bookmark (on your bookmark bar) with the following URL:

```
javascript:(function()%7Bdocument.querySelectorAll(%22body%20*%22).forEach(function(node)%7Bif(%5B%22fixed%22%2C%22sticky%22%5D.includes(getComputedStyle(node).position))%7Bnode.parentNode.removeChild(node)%7D%7D)%3Bdocument.querySelectorAll(%22html%20*%22).forEach(function(node)%7Bvar%20s%3DgetComputedStyle(node)%3Bif(%22hidden%22%3D%3D%3Ds%5B%22overflow%22%5D)%7Bnode.style%5B%22overflow%22%5D%3D%22visible%22%7Dif(%22hidden%22%3D%3D%3Ds%5B%22overflow-x%22%5D)%7Bnode.style%5B%22overflow-x%22%5D%3D%22visible%22%7Dif(%22hidden%22%3D%3D%3Ds%5B%22overflow-y%22%5D)%7Bnode.style%5B%22overflow-y%22%5D%3D%22visible%22%7D%7D)%3Bvar%20htmlNode%3Ddocument.querySelector(%22html%22)%3BhtmlNode.style%5B%22overflow%22%5D%3D%22visible%22%3BhtmlNode.style%5B%22overflow-x%22%5D%3D%22visible%22%3BhtmlNode.style%5B%22overflow-y%22%5D%3D%22visible%22%7D)()%3B%0A
javascript:(function()%7Bdocument.querySelectorAll(%22body%20*%22).forEach(function(node)%7Bif(%5B%22fixed%22%2C%22sticky%22%5D.includes(getComputedStyle(node).position))%7Bnode.parentNode.removeChild(node)%7D%7D)%3Bdocument.querySelectorAll(%22html%20*%22).forEach(function(node)%7Bvar%20s%3DgetComputedStyle(node)%3Bif(%22hidden%22%3D%3D%3Ds%5B%22overflow%22%5D)%7Bnode.style.setProperty(%22overflow%22%2C%22visible%22%2C%22important%22)%7Dif(%22hidden%22%3D%3D%3Ds%5B%22overflow-x%22%5D)%7Bnode.style.setProperty(%22overflow-x%22%2C%22visible%22%2C%22important%22)%7Dif(%22hidden%22%3D%3D%3Ds%5B%22overflow-y%22%5D)%7Bnode.style.setProperty(%22overflow-y%22%2C%22visible%22%2C%22important%22)%7D%7D)%3Bvar%20htmlNode%3Ddocument.querySelector(%22html%22)%3BhtmlNode.style.setProperty(%22overflow%22%2C%22visible%22%2C%22important%22)%3BhtmlNode.style.setProperty(%22overflow-x%22%2C%22visible%22%2C%22important%22)%3BhtmlNode.style.setProperty(%22overflow-y%22%2C%22visible%22%2C%22important%22)%7D)()%3B%0A
```

![Installation of kill-sticky](docs/bookmark.gif)
Expand Down
12 changes: 6 additions & 6 deletions src/kill-sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

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

var htmlNode = document.querySelector('html');
htmlNode.style['overflow'] = 'visible';
htmlNode.style['overflow-x'] = 'visible';
htmlNode.style['overflow-y'] = 'visible';
htmlNode.style.setProperty('overflow', 'visible', 'important');
htmlNode.style.setProperty('overflow-x', 'visible', 'important');
htmlNode.style.setProperty('overflow-y', 'visible', 'important');

})();