Re: running javascript from obj-C
Re: running javascript from obj-C
- Subject: Re: running javascript from obj-C
- From: Ryan Wilcox <email@hidden>
- Date: Wed, 3 Mar 2010 09:11:48 -0500
On 3/3/10 at 7:14 PM, email@hidden (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 (email@hidden)
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:
This email sent to email@hidden