A technical limitation extension developers often deal with is their content script's DOM event listeners are not dispatched because of the document's other script listeners being dispatched first and potentially stopping propagation. In order for web extension's to truly be an extension of a browser, I think they should be able to listen to DOM events before non-extension scripts do. Currently, this is only possible by adding event listeners when your content script run_at is set to document_start, however, it is not possible when you inject a content script at other time later in the document.
I havent thought much to how this feature could be potentially toggled on/off by the extension (e.g. an extension's content script might want to listen to evens in the natural order they are propagated), nor other potential downfalls of this. Regarding the order of dispatching for all attached content scripts, it can follow the install date of the extensions, similar to how other APIs deal with this.
A technical limitation extension developers often deal with is their content script's DOM event listeners are not dispatched because of the document's other script listeners being dispatched first and potentially stopping propagation. In order for web extension's to truly be an extension of a browser, I think they should be able to listen to DOM events before non-extension scripts do. Currently, this is only possible by adding event listeners when your content script
run_at
is set todocument_start
, however, it is not possible when you inject a content script at other time later in the document.I havent thought much to how this feature could be potentially toggled on/off by the extension (e.g. an extension's content script might want to listen to evens in the natural order they are propagated), nor other potential downfalls of this. Regarding the order of dispatching for all attached content scripts, it can follow the install date of the extensions, similar to how other APIs deal with this.