On 3/3/10 at 7:14 PM, sweetpproducti...@gmail.com (Russell Gray) wrote:

And I was thinking of taking the approach, of feeding a javascript function to 
Safari:

function hide_elements(id)
{
document.getElementById(id).style.display="none";

}

where id would be fed to the script from the adblock list(An NSArray of NSStrings). I don't know javascript, so need to figure out how to do this also)

What I was wanting to know, is how do I apply the javascript to Safari?
any help would be appreciated.

I wrote a series of blog articles on it. I was accessing WebKit from C++ at the time, and maybe the Objective-C wrappers have gotten better since I lasted looked at this (2007!), but here you go:

Calling JS functions from C++ with WebKit: <http://www.wilcoxd.com/blog/?p=94>
Calling JS functions from C++ with WebKit Part 2: 
<http://www.wilcoxd.com/blog/?p=96>
Getting/Setting JS Variables from C++ with WebKit: 
<http://www.wilcoxd.com/blog/?p=98>

Hopefully these point you in the right direction, or helps you find the new/right API

Hope this helps,
_Ryan Wilcox
--
Wilcox Development Solutions:               <http://www.wilcoxd.com>
Providing People with Solutions                       PGP: 0x2F4E9C31

_______________________________________________

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

Reply via email to