running javascript from obj-C

Discussion in 'Mac Programming' started by BollywooD, Mar 2, 2010.

  1. BollywooD macrumors 6502


    Apr 27, 2005
    Surfers Paradise
    (I posted this to the cocoadev mailing list, but thought id post it here also)


    I am currently trying to implement element blocking into my opensource Safari adblocker project:

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

    function hide_elements(id)

    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.

    thanks in advance

Share This Page