Hacker News new | past | comments | ask | show | jobs | submit login

I have "increment" and "decrement" bookmarklets, that look for the last-most number in a url and make it go up or down by one. I'm always surprised at how often it's useful. Oh, and I have this one called "kill sticky",

    javascript:( function(){ let i, elements = document.querySelectorAll('body *'); for (i = 0; i < elements.length; i++) { if(getComputedStyle(elements[i]).position === 'fixed' || getComputedStyle(elements[i]).position === 'sticky') { elements[i].parentNode.removeChild(elements[i]); } } document.body.style.overflow = "auto"; document.body.style.position = "static"; })()
Which deletes those annoying page-covering popups like "sign up for my newsletter" or "you need to log in (even though the content is right there*)"



I have a slightly longer one that also makes gets rid of the various `overflow:hidden` stylings since it seemed like I'd often kill an annoying popover with the content _right there_ to find that I couldn't scroll down anymore.

``` javascript:(function(){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"}if("hidden"===s["overflow-x"]){node.style["overflow-x"]="visible"}if("hidden"===s["overflow-y"]){node.style["overflow-y"]="visible"}});var htmlNode=document.querySelector("html");htmlNode.style["overflow"]="visible";htmlNode.style["overflow-x"]="visible";htmlNode.style["overflow-y"]="visible"})(); ```


GPT-4 appears to be able to cut around 180 characters off while keeping the same functionality.

   ((e,l)=>{[...e.querySelectorAll("body")].forEach((e=>{["fixed","sticky"].includes(l(e).position)&&e.parentNode.removeChild(e)})),[...e.querySelectorAll('html,[style\*="overflow"]')].forEach((e=>{["hidden"].includes(l(e).overflow)&&(e.style.overflow="visible"),["hidden"].includes(l(e)["overflow-x"])&&(e.style["overflow-x"]="visible"),["hidden"].includes(l(e)["overflow-y"])&&(e.style["overflow-y"]="visible")}));let o=e.querySelector("html");o.style.overflow=o.style["overflow-x"]=o.style["overflow-y"]="visible"})(document,getComputedStyle);
https://chat.openai.com/share/4c6710b5-9c81-415b-85fc-b33e69...


Wow!


This used to be a feature in Opera a decade ago IIRC.


It is still a feature in Vivaldi, Opera's spiritual successor.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: