Re: selected image in webview

2011-07-05 Thread Jens Alfke

On Jul 4, 2011, at 10:55 PM, Amy Heavey wrote:

 Is there a way to get the selected item in a webview?
 I've got a webview in my app, and I'd like to select an image and download it.

On Mac OS you can use the DOM APIs. On iOS I think you have to run JavaScript 
on the page — I don’t remember the exact method name, but there’s a method you 
pass a string containing JavaScript and it evaluates it.

—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: selected image in webview

2011-07-05 Thread Amy Heavey

Thanks,

It is for Mac OS (coredata app), but all the documentation seems to  
refer to Javascript?


I've got a webView *manWeb, and I use this to set the initial page to  
display;


	NSString *manWebString = [[Manufacturers selection]  
valueForKey:@manufacturerNewWeb];
	[[manWeb mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL  
URLWithString:manWebString]]];


Then I navigate through the pages by clicking on the links on the  
pages etc. This isn't meant to be a full browser experience, I just  
want to access my suppliers sites for quick reference.


I'm still struggling to find a way to select an image within the page.  
I'd like to simply click on an image within the webview, then a button  
in my UI to process it. I'll basically be downloading it, and saving  
the details to my app. Then I have more relationships to set etc, but  
I just can't work out how to know what image has been selected?


I'd appreciate any help,

Many Thanks

Amy



On 5 Jul 2011, at 5:07PM, Jens Alfke wrote:



On Jul 4, 2011, at 10:55 PM, Amy Heavey wrote:


Is there a way to get the selected item in a webview?
I've got a webview in my app, and I'd like to select an image and  
download it.


On Mac OS you can use the DOM APIs. On iOS I think you have to run  
JavaScript on the page — I don’t remember the exact method name, but  
there’s a method you pass a string containing JavaScript and it  
evaluates it.


—Jens___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/home%40willowtreecrafts.co.uk

This email sent to h...@willowtreecrafts.co.uk


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: selected image in webview

2011-07-05 Thread Jens Alfke

On Jul 5, 2011, at 10:38 AM, Amy Heavey wrote:

 It is for Mac OS (coredata app), but all the documentation seems to refer to 
 Javascript?

It’s a cross-language API, but there are Objective-C bindings in WebKit. Read 
the section Using the Document Object Model from Objective-C” in the WebKit 
Programming Guide.

The method to start with is -[WebFrame DOMDocument] which will return the 
document object. From there you can walk the node tree, get the selection, etc.

 I'm still struggling to find a way to select an image within the page. I'd 
 like to simply click on an image within the webview, then a button in my UI 
 to process it.

I’m not sure what the best way of doing this would be. In either case you have 
to intercept and modify the normal event handling in the view. You might have 
better luck asking on one of the webkit mailing lists on this server.

—Jens

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


selected image in webview

2011-07-04 Thread Amy Heavey

Hi,

Is there a way to get the selected item in a webview?

I've got a webview in my app, and I'd like to select an image and  
download it.


Many Thanks

Amy
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com