Re: Google Chrome: Set variable to result of JavaScript
Re: Google Chrome: Set variable to result of JavaScript
- Subject: Re: Google Chrome: Set variable to result of JavaScript
- From: Emmanuel LEVY <email@hidden>
- Date: Wed, 13 Jul 2011 01:30:31 +0200
For those interested, Smile's web window receives a "pageloaded" event
when the page is safe.
Emmanuel
On Jul 13, 2011, at 1:13 AM, Christopher Stone wrote:
Hey Brennan,
On Jul 12, 2011, at 14:26, email@hidden wrote:
Yes, it's critical to get the return value from javascript. I have
reported this too, because it's a show stopper.
Good for you.
...but they have a 'loading' boolean for the tab object which is
very useful (and sorely missing in Safari).
There's a work-around for that:
property SITE_URL : "http://www.google.com"
tell application "Safari"
-- LOAD URL
set myDoc to (make new document with properties {URL:SITE_URL})
-- WAIT FOR LOADING COMPLETE
delay 1
repeat while (do JavaScript "document.readyState" in document 1) is
not "complete"
delay 0.5
end repeat
end tell
If they could go as far as modelling the http activity for all
linked/embedded content in a given page/tab (or -gasp- the DOM
itself mapped into the dictionary) it would be terrific.
You can access anything in the DOM that Javascript can get to in
Safari, so Apple is unlikely improve that aspect of its dictionary.
BTW has anyone tried 'Fake' (seems to be AppleScript wrapper for
webkit, offering greasemonkey type functionality). Any comments?
Fake is very interesting, under active development, and rather like
automator in concept. The developer Todd Ditchendorf seems to be a
good guy and is responsive to feedback on the Fake list. I've been
watching it progress for about a year now.
I was going to wait for Fake to hit version 2.0 before I spent the
$30.00, but I'll probably plunk down the bucks pretty soon. (It's
at v1.8 now.)
--
Best Regards,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden