fix fetch...

This commit is contained in:
Gabe Yuan
2023-08-04 17:56:47 +08:00
parent 7e47882d53
commit 1c8e745e29
3 changed files with 35 additions and 39 deletions

View File

@@ -9,7 +9,6 @@ import {
STOKEY_SYNC,
CACHE_NAME,
} from "./config";
import { fetchData } from "./libs/fetch";
import storage from "./libs/storage";
import { getSetting } from "./libs";
import { syncAll } from "./libs/sync";
@@ -47,7 +46,10 @@ browser.runtime.onMessage.addListener(
({ action, args }, sender, sendResponse) => {
switch (action) {
case MSG_FETCH:
fetchData(args.input, args.init, args.opts)
fetch(args.input, args.init)
.then((res) => {
return res.json();
})
.then((data) => {
sendResponse({ data });
})