* Remove the URL from storage when the tab is closed.
(tabId)
| 313 | * Remove the URL from storage when the tab is closed. |
| 314 | */ |
| 315 | function removeTab(tabId) { |
| 316 | chrome.tabs.get(tabId, tab => { |
| 317 | if (!chrome.runtime.lastError) { |
| 318 | chrome.storage.session.remove(tab.url); |
| 319 | } |
| 320 | }); |
| 321 | } |
| 322 | |
| 323 | /** |
| 324 | * Listen for a new tab being created. |