123456789101112131415161718192021222324252627282930 |
- import { getChromeStorage } from '@/uilts/chromeExtension.js'
- import { payAchNoticeUrl } from '@/http/configAPI'
- export const closeAchPayNoticeHandler = async () => {
- let res = await getCurrentTab();
- if(res.url.startsWith(payAchNoticeUrl)) {
- chrome.tabs.remove(
- res.id, () => {
- getChromeStorage('achPayInfo', (result) => {
- let {tab, form} = result || {};
- chrome.storage.local.remove("achPayInfo");
- if(form == 'popupPage') {
- setChromeStorage({ achPayData : JSON.stringify({
- form: 'popupPage'
- })});
- }
- if(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 || {};
- }
|