views:

79

answers:

2

I am currently writing my first extension for Safari 5. I can't find a reference on what events an extension can react.

I want my extension to react on these events:

  • when a new tab is created.
  • when a new browser windows is created.
  • when the URL inside a tab changes.

Is this possible?

A: 

Here is the reference: The Windows and Tabs API

Edit: Hmm... it seems it only documents how to do some actions, not how to listen to events :-/

Arnaud Leymet
A: 

Yes. Create an Injected Script and add it as an End Script. Set the Access Level of Extension Website Access in the builder to All. Your Injected End Script will be called for every page that loads in Safari, which covers all of the cases you mentioned.

Alan Gutierrez