Is it possible to transfer the window object from an injected script to a global.html page?
I am attempting to pass the window object as part of an object to the global page. However, when I try to dispatch the message from the "load" listener function, it results in a type error.
Below is the code:
window.addEventListener("load", onDocLoad);
function onDocLoad()
{
var msg = new Object();
msg.url = window.location.href; // This part works fine
.....
msg.win = window; // When this line is included, it throws a type error at safari.self.tab.dispatchMessage("XXX",msg);
safari.self.tab.dispatchMessage("XXX",msg);
}
The message dispatching functions correctly and other data can be passed without any errors, except for the window object. How should I go about fixing this issue?