Skip to content

Commit eaa7904

Browse files
committed
fix: 🐛 修复识别广告功能未生效的 bug
1 parent fc681b4 commit eaa7904

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/userscript/import.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ const selfImportSync = (name: string) => {
7474
importModule.set(moduleName, handleCode(getResource(moduleName)));
7575
return `moduleMap['${moduleName}']`;
7676
});
77+
const moduleCode = handleCode(code);
7778

7879
let workerCode = `const moduleMap = {};\n`;
7980
for (const [moduleName, code] of importModule) {
@@ -89,7 +90,7 @@ moduleMap['${moduleName}'] = {};
8990
}
9091
workerCode += `
9192
const exports = {};
92-
${handleCode(code)}
93+
${moduleCode}
9394
moduleMap['Comlink'].expose(exports);`;
9495

9596
const codeUrl = URL.createObjectURL(

src/worker/detectAd/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ const getQrCode = (img: Uint8ClampedArray, width: number, height: number) => {
5454
const text = new TextDecoder().decode(Uint8Array.from(binaryData));
5555
mainFn.log(`检测到二维码: ${text}`);
5656
return text;
57-
} catch {
57+
} catch (error) {
58+
mainFn.log(error);
5859
return undefined;
5960
}
6061
};

0 commit comments

Comments
 (0)