mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 10:08:41 +00:00
Bug 1116977 - disallow link clicks during beforeunload, r=smaug
--HG-- extra : rebase_source : 48e4d19b5f76077f91432644b22c736d06ed3218
This commit is contained in:
parent
0466d0b1fa
commit
130c675373
@ -13187,7 +13187,7 @@ nsDocShell::OnLinkClick(nsIContent* aContent,
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "wrong thread");
|
||||
|
||||
if (!IsOKToLoadURI(aURI)) {
|
||||
if (!IsNavigationAllowed() || !IsOKToLoadURI(aURI)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -13243,7 +13243,7 @@ nsDocShell::OnLinkClickSync(nsIContent *aContent,
|
||||
*aRequest = nullptr;
|
||||
}
|
||||
|
||||
if (!IsOKToLoadURI(aURI)) {
|
||||
if (!IsNavigationAllowed() || !IsOKToLoadURI(aURI)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,29 @@ var testFns = [
|
||||
e.target.location.replace('otherpage-location-replaced.html');
|
||||
return "stop";
|
||||
},
|
||||
function(e) {
|
||||
var link = e.target.createElement('a');
|
||||
link.href = "otherpage.html";
|
||||
e.target.body.appendChild(link);
|
||||
link.click();
|
||||
return "stop";
|
||||
},
|
||||
function(e) {
|
||||
var link = e.target.createElement('a');
|
||||
link.href = "otherpage.html";
|
||||
link.setAttribute("target", "_blank");
|
||||
e.target.body.appendChild(link);
|
||||
link.click();
|
||||
return "stop";
|
||||
},
|
||||
function(e) {
|
||||
var link = e.target.createElement('a');
|
||||
link.href = e.target.location.href;
|
||||
e.target.body.appendChild(link);
|
||||
link.setAttribute("target", "somearbitrarywindow");
|
||||
link.click();
|
||||
return "stop";
|
||||
},
|
||||
];
|
||||
|
||||
function runNextTest() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user