javascript:(function(){document.querySelectorAll("body…
Jump to turn (7)
- 1javascript:(function(){document.querySelectorAll("body ").forEach(function(node)
- 2what's the ... at the beginning for
- 3how much smaller did you make it?
- 4can you check that they perform the same function?
- 5please make those adjustments, but keep the code as small as possible
- 6can you check that this code performs the same function as the original original
- 7how does the size compare?
- User
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"})(); can you make this javascript smaller without reducing functionality
- Assistant
Certainly! Here's a more concise version of the provided JavaScript:
────────────────────────────────────────────────────────────────────
javascriptCopy codejavascript:(()=>{[...document.querySelectorAll('body,[style*="overflow"]')].forEach(e=>{let s=}})})();