12345678910111213141516171819202122 |
- import { getChromeStorage } from '@/uilts/chromeExtension.js'
- export const closeAchPayNoticeHandler = async () => {
- let {id} = await getCurrentTab();
- chrome.tabs.remove(
- id, () => {
- getChromeStorage('achPayInfo', (res) => {
- chrome.storage.local.remove("achPayInfo");
- if(res && res.tab) {
- chrome.tabs.highlight({ windowId: res.tab.windowId, tabs: res.tab.index })
- }
- })
- }
- )
- }
- const getCurrentTab = async () => {
- let queryOptions = { active: true, lastFocusedWindow: true };
- let [tab] = await chrome.tabs.query(queryOptions);
- return tab || {};
- }
|