Skip to content

Instantly share code, notes, and snippets.

@s4y
Created March 24, 2011 22:41
Show Gist options
  • Save s4y/886046 to your computer and use it in GitHub Desktop.
Save s4y/886046 to your computer and use it in GitHub Desktop.
Make Safari think that an input does not contain priceless intelligence, the safety of which must be confirmed by the user before the window or tab can be closed.
function massageInput(input){
var oldDisplay = input.style.display;
input.style.display = 'none';
input.clientLeft; // trigger layout
input.style.display = oldDisplay;
}
@s4y
Copy link
Author

s4y commented Mar 24, 2011

I’d love for a less-hacky way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment