File tree 1 file changed +5
-0
lines changed
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,10 @@ def milliseconds_to_datetime(m):
245
245
<script type="text/javascript">
246
246
var fscSession = {{ session|tojson }};
247
247
{% if webhook %}
248
+ window.onbeforeunload = confirmExit;
249
+ function confirmExit() {
250
+ return "You have attempted to leave this page. Are you sure?";
251
+ }
248
252
function fastspringOnPopupClosed(data) {
249
253
if (!data) return;
250
254
var xhr = new XMLHttpRequest();
@@ -253,6 +257,7 @@ def milliseconds_to_datetime(m):
253
257
xhr.onreadystatechange = function() {
254
258
if (xhr.readyState === XMLHttpRequest.DONE) {
255
259
if (xhr.status === 200) {
260
+ window.onbeforeunload = function() {};
256
261
window.location.replace("{{ request.url }}");
257
262
} else if (xhr.status === 201 || (301 <= xhr.status && xhr.status <= 303)) {
258
263
window.location.replace(xhr.getResponseHeader("Location"));
You can’t perform that action at this time.
0 commit comments