Skip to content

Instantly share code, notes, and snippets.

@andrewvaughan
Last active March 2, 2024 01:44
Show Gist options
  • Save andrewvaughan/8f6f892bdbc7d5d973879ed909a4aa1e to your computer and use it in GitHub Desktop.
Save andrewvaughan/8f6f892bdbc7d5d973879ed909a4aa1e to your computer and use it in GitHub Desktop.
Javascript Bookmark Disable Double-Click Zoom
javascript:document.querySelectorAll("*").forEach(e=>{e.style["touch-action"]="manipulation"}),new MutationObserver(e=>{e.forEach(function(e){for(var o=0;o<e.addedNodes.length;o++)e.addedNodes[o].style["touch-action"]="manipulation"})}).observe(document.body,{childList:!0,subtree:!0});
javascript:document.querySelectorAll("*").forEach(l=>{l.style["touch-action"]="manipulation"});
// Update style for all existing elements
document.querySelectorAll('*').forEach(el => {
el.style["touch-action"] = "manipulation";
});
// Add the style to any DOM manipulations
(new MutationObserver(elms => {
elms.forEach(
function(elm) {
for (var i = 0; i < elm.addedNodes.length; i++) {
elm.addedNodes[i].style["touch-action"] = "manipulation";
}
}
);
}
)).observe(document.body, { childList: true, subtree: true });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment