Avoiding Safari exit confirmation dialog for dirty forms

Safari asks close confirmation if a form field isn't clean

Safari asks for your confirmation if you accidentally try to close a page if you filled a form but never submitted. This saved my day more than once and it’s undoubtedly helpful.

The problem is that if you’re sending the form via ajax Safari still thinks you’re loosing some data. Luckily the fix is easy:

var postBody = document.querySelector('textarea.post-body')
postBody.defaultValue = postBody.value

and the browser tries to search your .dev domain on the web…

When I use Google Chrome or Safari with Pow and type in a .dev URL (Pow top-level domains), there are some conditions why the browser tries to search the web for the text of the URL instead of going to the URL.  Continue reading “and the browser tries to search your .dev domain on the web…”