mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
50 lines
1.2 KiB
HTML
50 lines
1.2 KiB
HTML
<html>
|
|
<head>
|
|
<title>Test missing manifest</title>
|
|
|
|
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var gTestWin;
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
|
|
var Cc = Components.classes;
|
|
var Ci = Components.interfaces;
|
|
|
|
// Enable the offline-app permission before loading the new window
|
|
var pm = Cc["@mozilla.org/permissionmanager;1"]
|
|
.getService(Ci.nsIPermissionManager);
|
|
var uri = Cc["@mozilla.org/network/io-service;1"]
|
|
.getService(Ci.nsIIOService)
|
|
.newURI(window.location.href, null, null);
|
|
var principal = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
|
|
.getService(Ci.nsIScriptSecurityManager)
|
|
.getNoAppCodebasePrincipal(uri);
|
|
|
|
pm.addFromPrincipal(principal, "offline-app", Ci.nsIPermissionManager.ALLOW_ACTION);
|
|
|
|
// now this will properly load the manifest.
|
|
gTestWin = window.open("missing.html");
|
|
|
|
function finish()
|
|
{
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
pm.removeFromPrincipal(principal, "offline-app");
|
|
|
|
gTestWin.close();
|
|
SimpleTest.finish();
|
|
}
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
</body>
|
|
</html>
|