-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1528305 - Don't show an error page for unknown protocols for page…
…-triggered navigations that replace a document. r=mattwoodrow Pages apparently do this to try to open to native apps, and that on Firefox causes an error page to be shown if the app is not installed, which is pretty bad. Differential Revision: https://phabricator.services.mozilla.com/D68471 --HG-- extra : moz-landing-system : lando
- Loading branch information
Showing
6 changed files
with
81 additions
and
1 deletion.
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,15 @@ | ||
<!doctype html> | ||
<script> | ||
onbeforeunload = function() { | ||
opener.onChildBeforeUnload(); | ||
}; | ||
onload = function() { | ||
location.href = "this-protocol-is-unlikely-to-exist://foo"; | ||
setTimeout(function() { | ||
opener.onChildLoadTimedOut(); | ||
}, 1000); | ||
}; | ||
onunload = function() { | ||
opener.onChildUnload(); | ||
}; | ||
</script> |
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,27 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>Test for window.location setter to an unknown protocol (bug 1528305).</title> | ||
<script src="/tests/SimpleTest/SimpleTest.js"></script> | ||
<script> | ||
SimpleTest.waitForExplicitFinish(); | ||
let beforeunload = false; | ||
let unload = false; | ||
|
||
window.onChildBeforeUnload = function() { | ||
beforeunload = true; | ||
}; | ||
|
||
window.onChildUnload = function() { | ||
unload = true; | ||
}; | ||
|
||
let win; | ||
window.onChildLoadTimedOut = function() { | ||
ok(!unload, "shouldn't have unloaded child window"); | ||
ok(beforeunload, "should've fired a beforeunload event"); | ||
win.close(); | ||
SimpleTest.finish(); | ||
}; | ||
|
||
win = window.open("file_location_href_unknown_protocol.html"); | ||
</script> |
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