Why bother hard-coding JSON, when you can simply send your array to JavaScript using this simple trick:
var array = <? $array; ?>;
When the array is in JavaScript, simply JSON.parse() and alert() it, then use JNA to take a screenshot of the screen and save the popup content into a text file using Java's native String.fromWindowsScreenshot.
All that's left now is just reading text file's content using PHP, just keep in mind you'll have to set a timeout of 2 to 3 days if your user is using IE.
IIRC Windows API does let you read the text of controls on other windows (unless newer versions changed that), so it'd be possible to at least extract strings from a visible window.
94
u/Timbo_KZ Mar 28 '15
I don't get it.
Why bother hard-coding JSON, when you can simply send your array to JavaScript using this simple trick:
When the array is in JavaScript, simply
JSON.parse()andalert()it, then use JNA to take a screenshot of the screen and save the popup content into a text file using Java's nativeString.fromWindowsScreenshot.All that's left now is just reading text file's content using PHP, just keep in mind you'll have to set a timeout of 2 to 3 days if your user is using IE.