Best way to write a Safari 4 Extension

Question :

Best way to write a Safari 4 Extension,

Answer :

What is the best way to write a Safari extension? I’ve written a couple XUL extensions for Firefox, and now I’d like to write versions of them for Safari. Is there a way that would allow you to add buttons or forms to the browser UI, since this is not possible with an Input manager or Service menu?


Safari plugin development is non-trivial. The interface is written in Objective-C, and most of it is not even part of WebKit (so you can’t see the source), but there’s machinery to inspect and patch the object hierarchy of a running application. It requires understanding of Cocoa and Objective-C, but no lower.

Read More  Find the highest order bit in C [duplicate]

Here’s a high level overview I had in my bookmarks of the process It goes over creating Safari plugins using Python with working (probably outdated) code. Instead of Python you can use anything that has Objective-C bindings.

There are two major parts to it:

  • You need to attach your code to a running Safari. This is typically done with SIMBL
  • Once you’re inside, you need to figure what to patch. There’s a tutorial on reversing Cocoa applications , which links to the most important tool, class-dump  (the link on wiki is broken). Class-dump gives you a complete hierarchy of Safari’s classes, where you can guess by names what, specifically, you need to patch. This is a very trial and error mode.
Read More  How do you format an unsigned long long int using printf?

Reading the links above will give you the scope of the project.

That’s the answer Best way to write a Safari 4 Extension, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you

Read More  Add .NET 2.0 SP1 as a prerequisite for deployment project