Handling precedence should be done by the preference manager. The most recent extension which requests permission to override a page should gain precedence. Note: multiple extensions can have precedence with chrome_url_overrides if they each request access to override different pages (e.g. both extensions should have precedence if the first overrides "about:newtab" and the second overrides "about:home").
(In reply to Matthew Wein [:mattw] from comment #0) > > The most recent extension which requests permission to override a page > should gain precedence. > This is contrary to our discussion on Tuesday. Maybe it needs to be different for page overrides than it is for preferences, but in our meeting we discussed that the earliest extension would always win in terms of precedence, so if a later extension requests a change it would *not* override an earlier one.
> This is contrary to our discussion on Tuesday. Maybe it needs to be > different for page overrides than it is for preferences, but in our meeting > we discussed that the earliest extension would always win in terms of > precedence, so if a later extension requests a change it would *not* > override an earlier one. Okay, sorry, I had it backwards, but that works too. I'm happy as long as we are consistent with either earliest or most recent taking precedence. If we could treat "about:newtab", "about:home", etc as preferences, then we wouldn't need to do anything different for page overrides.
I think it was decided in bug 1234150 comment 12 to use the most recent one. I'm fine either way as long as we stay consistent, both have their pros and cons.
I suggest that we allow user to choose which extension's override should be used, or to keep the Firefox default. Example implementation: Whenever the user installs an extension which uses "chrome_url_overrides", Firefox shows a notification which allows the user to keep the previous extension's override, or use the new one. (notification is shown even if the user wasn't previously using any extension which uses "chrome_url_overrides") Additionally, an option will be added to "about:preferences" or to "about:addons" to select which extension's override should be used for each supported override or to switch back to the Firefox default at any time.
There is also an issue that currently the new tab override does not persist across browser sessions because it is set by calling aboutNewTabService.newTabURL, but only when the manifest is read. This should be changed to call aboutNewTabService.newTabURL during onStartup() so that it resets every time the browser is restarted.