-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Handling of native dialogs inconsistent with handling in Firefox…
… (closes #6815) (#2980) * fix: Handling of native dialogs inconsistent with handling in Firefox * fix test * update client/sandbox/event/unload * return test * refactor test * requests changes * requests changes * align and change titles
- Loading branch information
1 parent
bade0f6
commit 7f42798
Showing
3 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<script src="/hammerhead.js" class="script-hammerhead-shadow-ui"></script> | ||
</head> | ||
<body> | ||
<script type="text/javascript"> | ||
var hammerhead = window['%hammerhead%']; | ||
var hhPostMessage = hammerhead.sandbox.event.message.postMessage; | ||
|
||
hammerhead.utils.destLocation.forceLocation('http://localhost/sessionId/https://example.com'); | ||
hammerhead.start({ crossDomainProxyPort: 2000 }); | ||
|
||
hammerhead.on(hammerhead.EVENTS.beforeUnload, e => { | ||
hhPostMessage(window.parent, [e.prevented, '*']); | ||
}); | ||
|
||
window.addEventListener('message', function (m) { | ||
const { returnValue, needPrevent } = m.data; | ||
|
||
window.addEventListener('beforeunload', function (e) { | ||
if (needPrevent) | ||
e.preventDefault(); | ||
|
||
e.returnValue = returnValue; | ||
}); | ||
|
||
location.reload(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters