Opening some links in a new tab

I would like to develop an add-on to implement a functionality of Tab Mix Plus with the Web Extensions: open a new tab by default when:

  • entering an address or a search in the navigation bar and pressing Enter (not having to press alt-Enter)

  • clicking on a registered link, in the bookmarks or the history (left click, not having to middle-click)

In other cases (navigation from links in the tab page), the behavior would be as usual (left click stays in the tab, middle-click opens a new tab).

I reviewed the API, but my impression is that it is just not possible to do what I want (e.g., webNavigation.onBeforeNavigate will not tell me where the event came from): can someone confirm it is impossible, or put me on the right track?

Thanks.

While my general opinion is that pretty much nothing is impossible an I’d also like to give you a different answer, I’d say with the given APIs it is not possible to implement this reliably and with reasonable effort.