Talk:FUEL/Additions

From MozillaWiki
Jump to: navigation, search

Navigation Event Registry

I propose a central registry for extensions that wish to be notified when certain pages are loaded in the browser. An extension could simply register a callback function to handle browser events related to a specified URL or URL Pattern. The central registry could handle monitoring navigation events and notifying any registered callbacks when matching URLs/Patterns are accessed. This could reduce duplication of code and I believe it would also lower overhead when multiple extensions are installed which listen for specific domains or URL patterns.
In the case of individual extensions handling this on their own you end up with several event listeners that fire for every single page load event, each event handler will compare the URL to see if it matches a page that the extension is interested in. When each of the extensions are only listening for a small subset of possible URL patterns the end result is lots of wasted lookups with only occasional benefits.
Anyone please correct me if I am making incorrect assumptions or if I am otherwise misguided. If I have not overlooked something major then I think that this could be of great benefit for some extension authors as well as the users of said extensions.
--- 20after4 00:47, 18 May 2007 (PDT)