Allow same opener as current window
This commit is contained in:
parent
5b0ae42d13
commit
045a57491a
2 changed files with 8 additions and 8 deletions
|
@ -23,7 +23,7 @@ class Wrapper
|
|||
@wrapperWsInited = false # Wrapper notified on websocket open
|
||||
@site_error = null # Latest failed file download
|
||||
@address = null
|
||||
@opener = null
|
||||
@opener_tested = false
|
||||
|
||||
window.onload = @onLoad # On iframe loaded
|
||||
window.onhashchange = (e) => # On hash change
|
||||
|
@ -71,13 +71,13 @@ class Wrapper
|
|||
# Incoming message from inner frame
|
||||
onMessageInner: (e) =>
|
||||
# No nonce security enabled, test if window opener present
|
||||
if not window.postmessage_nonce_security and @opener == null
|
||||
if window.opener
|
||||
if not window.postmessage_nonce_security and @opener_tested == false
|
||||
if window.opener and window.opener != window
|
||||
@log "Opener present", window.opener
|
||||
@displayOpenerDialog()
|
||||
return false
|
||||
else
|
||||
@opener = false
|
||||
@opener_tested = true
|
||||
|
||||
message = e.data
|
||||
# Invalid message (probably not for us)
|
||||
|
|
|
@ -781,7 +781,7 @@ jQuery.extend( jQuery.easing,
|
|||
this.wrapperWsInited = false;
|
||||
this.site_error = null;
|
||||
this.address = null;
|
||||
this.opener = null;
|
||||
this.opener_tested = false;
|
||||
window.onload = this.onLoad;
|
||||
window.onhashchange = (function(_this) {
|
||||
return function(e) {
|
||||
|
@ -847,13 +847,13 @@ jQuery.extend( jQuery.easing,
|
|||
|
||||
Wrapper.prototype.onMessageInner = function(e) {
|
||||
var cmd, message, query;
|
||||
if (!window.postmessage_nonce_security && this.opener === null) {
|
||||
if (window.opener) {
|
||||
if (!window.postmessage_nonce_security && this.opener_tested === false) {
|
||||
if (window.opener && window.opener !== window) {
|
||||
this.log("Opener present", window.opener);
|
||||
this.displayOpenerDialog();
|
||||
return false;
|
||||
} else {
|
||||
this.opener = false;
|
||||
this.opener_tested = true;
|
||||
}
|
||||
}
|
||||
message = e.data;
|
||||
|
|
Loading…
Reference in a new issue