Re: How to deal with Java Script in None-GUI applications?
Re: How to deal with Java Script in None-GUI applications?
- Subject: Re: How to deal with Java Script in None-GUI applications?
- From: Andrei Tchijov <email@hidden>
- Date: Mon, 30 Jan 2006 12:32:15 -0500
Nicko,
Thanks for reply. I have tried it already and it does work
wonderfully. And you can get WebScriptObject from WebView. I guess
I need to have more fate into Apple :-).
Andrei
On Jan 30, 2006, at 12:25 PM, Nicko van Someren wrote:
On 30 Jan 2006, at 17:05, Andrei Tchijov wrote:
In my application I need to evaluate Java Script ( I need to
extract proxy settings from *.PAC file, which amounts to invoking
Java Script function defined in the file ). The problem is, that
I need to do it in command line tool. There is no GUI, there is no
WebView to which I can send windowScriptingObject. Documentation
for WebScriptObject class states that it can not be instantiated
by itself. Does it mean that I am stack? Is it possible to get
WebScriptObject without WebView object? Alternatively, is it
possible to instantiate WebView object inside command line tool?
I don't know about creating a WebScriptObject without a WebView but
there is certainly no reason I can think of why you shouldn't be
able to create a WebView without displaying it, e.g.:
WebView wv = [[WebView alloc] initWithFrame: NSMakeRect
(0,0,100,100) frameName: @"Foo" groupName: @"Bar");
[[wv mainFrame] loadHTMLString: someHTML baseURL:
someBaseURL]; // Get your PAC file in here somehow
NSString *request = [NSString stringWithFormat: @"FindProxyForURL(%
@, %@)", urlString, hostString];
theProxy = [wv stringByEvaluatingJavaScriptFromString: request];
Nicko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden