window.myVar = "myValue";
I can then access
myVar from the window context, where it returns
However, if I do the following in Applescript:
This execute statement appears to run when the script is called. No errors are thrown, and the Chrome window exists. But when I try to reference
myVar from the window context, only
undefined is ever returned. For testing purposes, I added in an alert statement after that declaration - the alert WILL fire, but
myVar remains unset.
Now, in Safari, using
myVar returns a value.
Why doesn't Chrome fire these statements when called by Applescript when it can be done manually? (Chrome 51.0.2704.84, OS X 10.11.5)