From 30e612c58a46fb2379142bcf64a1b59eb9ef8975 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Thu, 21 Feb 2019 14:14:27 +0000 Subject: [PATCH] Adds invision script to prompt before reloading --- config/dotjs/projects.invisionapp.com.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 config/dotjs/projects.invisionapp.com.js diff --git a/config/dotjs/projects.invisionapp.com.js b/config/dotjs/projects.invisionapp.com.js new file mode 100644 index 00000000..a1ec2a75 --- /dev/null +++ b/config/dotjs/projects.invisionapp.com.js @@ -0,0 +1,7 @@ +window.addEventListener( "beforeunload", (event)=>{ + // Cancel the event as stated by the standard. + event.preventDefault(); + // Chrome requires returnValue to be set. + event.returnValue = 'This is invision, not the site. Are you sure?'; + return 'This is invision, not the site. Are you sure?'; +} );