mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-04 17:07:23 +00:00
pages/search: prevent history pollution
This commit is contained in:
parent
7a50b39f96
commit
adf6ab3305
3 changed files with 19 additions and 2 deletions
|
|
@ -2,3 +2,16 @@ browser.action.onClicked.addListener((() =>
|
|||
browser.tabs.create({
|
||||
url: '/pages/search/search.html'
|
||||
})))
|
||||
|
||||
browser.runtime.onMessage.addListener((message, sender) => {
|
||||
switch (message.action) {
|
||||
case 'closeSender':
|
||||
Promise.resolve()
|
||||
.then(() => browser.tabs.remove(sender.tab.id))
|
||||
.then(() => browser.sessions.getRecentlyClosed({maxResults: 1}))
|
||||
.then(([sessionInfo]) => browser.sessions.forgetClosedTab(
|
||||
sessionInfo.tab.windowId,
|
||||
sessionInfo.tab.sessionId))
|
||||
break
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue