Discards one or more tabs.
Some browsers automatically "discard" tabs that they don't think are likely to be needed by the user soon. The tab stays visible in the tabstrip and the browser remembers its state, so if the user selects a tab that has been discarded, it is immediately restored.
The details of exactly what is discarded are browser-specific, but in general, discarding a tab enables the browser to free some of the memory occupied by that tab.
The tabs.discard()
API enables an extension to discard one or more tabs. It's not possible to discard the currently active tab, or a tab whose document contains a beforeunload
listener that would display a prompt.
This is an asynchronous function that returns a Promise
.