mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
27 lines
941 B
HTML
27 lines
941 B
HTML
<html>
|
|
<script>
|
|
function check(elt, expectProxy, message) {
|
|
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
|
var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
|
|
.getInterface(Components.interfaces.nsIDOMWindowUtils);
|
|
var result = ((utils.getClassName(elt) === 'Proxy') === expectProxy)
|
|
? "PASS"
|
|
: "FAIL";
|
|
|
|
parent.postMessage(result + ',' + message, '*');
|
|
}
|
|
|
|
try {
|
|
// true if same origin, throws otherwise
|
|
var sameOrigin = parent.location.href !== '';
|
|
} catch (e) {
|
|
sameOrigin = false;
|
|
}
|
|
|
|
check(frameElement, !sameOrigin,
|
|
sameOrigin
|
|
? 'no wrapper needed if same origin'
|
|
: 'wrapper needed if not same origin');
|
|
</script>
|
|
</html>
|