Re:Wait, What's a Bookmarklet?
by knodi123 on Wednesday October 25, 2023 @05:38PM
(#38018747)
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",
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*)"
[ Parent
| on HN ]
Re:Wait, What's a Bookmarklet?
by zbirkenbuel on Wednesday October 25, 2023 @05:56PM
(#38018897)
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.
Re:Wait, What's a Bookmarklet?
by jaipilot747 on Wednesday October 25, 2023 @10:01PM
(#38020814)
It is still a feature in Vivaldi, Opera's spiritual successor.