mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1116977 - disallow link clicks during beforeunload, r=smaug
--HG-- extra : rebase_source : 48e4d19b5f76077f91432644b22c736d06ed3218
This commit is contained in:
parent
6fbdd616e8
commit
9afcd38d44
@ -13187,7 +13187,7 @@ nsDocShell::OnLinkClick(nsIContent* aContent,
|
|||||||
{
|
{
|
||||||
NS_ASSERTION(NS_IsMainThread(), "wrong thread");
|
NS_ASSERTION(NS_IsMainThread(), "wrong thread");
|
||||||
|
|
||||||
if (!IsOKToLoadURI(aURI)) {
|
if (!IsNavigationAllowed() || !IsOKToLoadURI(aURI)) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13243,7 +13243,7 @@ nsDocShell::OnLinkClickSync(nsIContent *aContent,
|
|||||||
*aRequest = nullptr;
|
*aRequest = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsOKToLoadURI(aURI)) {
|
if (!IsNavigationAllowed() || !IsOKToLoadURI(aURI)) {
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,6 +113,29 @@ var testFns = [
|
|||||||
e.target.location.replace('otherpage-location-replaced.html');
|
e.target.location.replace('otherpage-location-replaced.html');
|
||||||
return "stop";
|
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() {
|
function runNextTest() {
|
||||||
|
Loading…
Reference in New Issue
Block a user