3

I am going through a Firefox extension code. But I am not able to understand how extension code works. Where does it start its execution? Is there a starting point like main() in C?

Casimir et Hippolyte
  • 88,009
  • 5
  • 94
  • 125
Naman
  • 991
  • 2
  • 10
  • 20

1 Answers1

1

There can be multiple situations for an addon to start.

From the top of my head i can remember the following:

  • Toolbar button - The extension only does something when you click it, so you could say that the starting point is the function that the button calls.

  • Context Menu - Same as the , but for context menu item

  • Event triggered start - The extension may be listening to page load / unload, (etc) events and start from there. In this case look for window.addEventListener(...)

Filipe Silva
  • 21,189
  • 5
  • 53
  • 68