lefengyang
2026-08-20 d01a28cb030b2cb0ff1d42273c877a0f728519a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import {setMsgMethod, StorageLocal} from "gs-br-ext";
import {ITestService, StationId, TaskReserveKey} from "/src-com";
import {executeSearch} from "../task-fn/executeSearch";
import {RemoteTask} from "../lib/RemoteTask";
import {executeDetail} from "../task-fn/executeDetail";
import {executeTask} from "../executeTask";
 
 
setMsgMethod<ITestService>({
    async thisActiveTab() {
        // console.log((await chrome.tabs.query({active: true, currentWindow: true}))?.[0])
    },
    async testSearch(param) {
        return await executeSearch(param)
    },
    async fetchTask() {
        return await RemoteTask.get(!!(await StorageLocal.getValue(TaskReserveKey)));
    },
    async executeTask() {
        return await executeTask(!!(await StorageLocal.getValue(TaskReserveKey)));
    },
    executeDetail
})