close unused tab after 30 minutes extension
hi i am working on Firefox extension and one of the feature is to close tabs automatically if a tab is inactive from last 30 minutes. i am not sure where to get started with this looking forward to get some suggestions.
Alle svar (3)
Hi sanam204, what is your definition of inactive?
Your extension can check when each tab was last accessed and confirm that it is not the active (focused) tab in the window. Those are properties of each tab and you can access them without any special permissions. See:
https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/tabs/Tab
However, understanding what is happening with the content in the tab may require injecting scripts into tabs, which requires a lot of permissions. I wouldn't recommend that as your "version 0.1" approach unless it's critical.
The Add-ons team has a forum for extension developers over here:
Hi jscher2000 thanks for your reply, by inactive I mean any tab which I’m not currently using (for examples I have opened 6 tabs in the browser and 2 of them i haven’t clicked from last 30 minutes so I want those 2 to get automatically closed after 30 minutes)
These exemplary extensions should help you:
https://github.com/mdn/webextensions-examples/tree/master/chill-out https://github.com/mdn/webextensions-examples/tree/master/tabs-tabs-tabs