dont send messages if not an iframe
This commit is contained in:
parent
4a2751839f
commit
baeeff366e
1 changed files with 15 additions and 12 deletions
|
@ -185,7 +185,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
that.postMessage = function() {
|
that.postMessage = function() {
|
||||||
return Ox.Message.post.apply(this, Ox.slice(arguments));
|
if (window !== window.top) {
|
||||||
|
return Ox.Message.post.apply(this, arguments);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
that.triggerMessage = function() {
|
that.triggerMessage = function() {
|
||||||
|
@ -272,8 +274,8 @@
|
||||||
// posting to parent, but not yet initialized
|
// posting to parent, but not yet initialized
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
that.post.apply(Ox.parent, args);
|
that.post.apply(Ox.parent, args);
|
||||||
}, 25);
|
}, 250);
|
||||||
}
|
} else {
|
||||||
Ox.forEach(
|
Ox.forEach(
|
||||||
Ox.makeObject(Ox.slice(args)),
|
Ox.makeObject(Ox.slice(args)),
|
||||||
function(data, event) {
|
function(data, event) {
|
||||||
|
@ -284,6 +286,7 @@
|
||||||
}), '*');
|
}), '*');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
that.trigger = function(self) {
|
that.trigger = function(self) {
|
||||||
|
|
Loading…
Reference in a new issue