MozillaZine

How to know a tab is opened by New Tab button, or link click

Talk about add-ons and extension development.
hmpro74
 
Posts: 1
Joined: March 14th, 2017, 11:21 pm

Post Posted March 14th, 2017, 11:31 pm

I'm developing an add-on based on WebExtensions.
When browser open new tabs, I want to know if it is opened by user click on New Tab button, or by click on links.
I found in callback of tabs.onCreated, if tabs are opened by link click, tab.url will be "about:blank", while tab.url for tabs opened by click New Tab button will be "about:newtab" (except for the first one, the first tab opened by New Tab button, its url is "about:blank", not "about:newtab").
I posted a bug in BugZilla (https://bugzilla.mozilla.org/show_bug.cgi?id=1347028), but Firefox guys said that is not a bug.

I want to konw if there is other way to achieve my goal?

Thanks.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 1 guest