diff --git a/desktop-dev/import_map.json b/desktop-dev/import_map.json index 2f47d4232b..92545a6a9d 100644 --- a/desktop-dev/import_map.json +++ b/desktop-dev/import_map.json @@ -9,8 +9,6 @@ "electron": "https://esm.sh/v124/electron@25.2.0", "extract-zip": "https://esm.sh/v124/extract-zip@2.0.1", "jszip": "https://esm.sh/v124/jszip@3.10.1", - "jimp": "https://esm.sh/v124/jimp@0.22.8", - "jsqr": "https://esm.sh/v124/jsqr@1.4.0", "lit": "https://esm.sh/v124/lit@2.7.4", "lit/": "https://esm.sh/v124/lit@2.7.4/", "mime": "https://esm.sh/v124/mime@3.0.0", diff --git a/desktop-dev/src/helper/openNativeWindow.ts b/desktop-dev/src/helper/openNativeWindow.ts index 377a6fff8f..131944c62f 100644 --- a/desktop-dev/src/helper/openNativeWindow.ts +++ b/desktop-dev/src/helper/openNativeWindow.ts @@ -319,6 +319,7 @@ async function openDevToolsWindowAsFollower( devWin.moveTop(); return devWin; } + // deno-lint-ignore no-empty } catch {} /// 使用最原始的方式打开webview,放在独立的窗口中 diff --git a/desktop-dev/src/main.ts b/desktop-dev/src/main.ts index 58fc8ee96b..9edc8a94dc 100644 --- a/desktop-dev/src/main.ts +++ b/desktop-dev/src/main.ts @@ -7,7 +7,6 @@ import { setFilter } from "./helper/devtools.ts"; import { BluetoothNMM } from "./std/bluetooth/bluetooth.main.ts"; import { HttpServerNMM } from "./std/http/http-server.ts"; import { BarcodeScanningNMM } from "./sys/barcode-scanning/barcode-scanning.main.ts"; -import { BiometricsNMM } from "./sys/biometrics/biometrics.main.ts"; import { BootNMM } from "./sys/boot/boot.ts"; import { DnsNMM } from "./sys/dns/dns.ts"; import "./sys/dns/localeFileFetch.ts"; @@ -71,7 +70,7 @@ dns.install(dwebBrowser); // dns.install(new ShareNMM()); // dns.install(new HapticsNMM()); dns.install(new BarcodeScanningNMM()); -dns.install(new BiometricsNMM()); +// dns.install(new BiometricsNMM()); dns.install(new BluetoothNMM()); import { JmmNMM } from "./browser/jmm/jmm.ts"; diff --git a/desktop-dev/src/std/http/http-server.ts b/desktop-dev/src/std/http/http-server.ts index d8aec3e9e1..f5ff784050 100644 --- a/desktop-dev/src/std/http/http-server.ts +++ b/desktop-dev/src/std/http/http-server.ts @@ -89,7 +89,7 @@ export class HttpServerNMM extends NativeMicroModule { // }, 3e4 /* 30s 没有任何 body 写入的话,认为网关超时 */); const fullReqUrl = info.protocol.prefix + (req.headers["host"] ?? info.host) + req.url; - console.always("fullReqUrl", fullReqUrl); + // console.always("fullReqUrl", fullReqUrl); // 源代码 void gateway.listener.hookHttpRequest(req, res, fullReqUrl); } diff --git a/desktop-dev/src/sys/barcode-scanning/barcode-scanning.main.ts b/desktop-dev/src/sys/barcode-scanning/barcode-scanning.main.ts index ed5c104fd2..ed9723cf82 100644 --- a/desktop-dev/src/sys/barcode-scanning/barcode-scanning.main.ts +++ b/desktop-dev/src/sys/barcode-scanning/barcode-scanning.main.ts @@ -1,50 +1,33 @@ // 模拟状态栏模块-用来提供状态UI的模块 - -import Jimp from "jimp"; -import jsQR from "jsqr"; -import { Buffer } from "node:buffer"; import { NativeMicroModule } from "../../core/micro-module.native.ts"; export class BarcodeScanningNMM extends NativeMicroModule { mmid = "barcode-scanning.sys.dweb" as const; - + // barcodeDetector = new BarcodeDetectorDelegate([ + // Html5QrcodeSupportedFormats.QR_CODE, + // Html5QrcodeSupportedFormats.CODE_39, + // Html5QrcodeSupportedFormats.CODABAR, + // Html5QrcodeSupportedFormats.EAN_13, + // ]); _bootstrap = () => { - console.always(`[${this.mmid} _bootstrap]`); - let isStop = false; this.registerCommonIpcOnMessageHandler({ method: "POST", pathname: "/process", matchMode: "full", input: {}, output: "object", - handler: async (_args, _client_ipc, ipcRequest) => { - // 直接解析二维码 - return await Jimp.read(Buffer.from(await ipcRequest.body.u8a())).then( - ({ bitmap }: Jimp) => { - const result = jsQR( - bitmap.data as unknown as Uint8ClampedArray, - bitmap.width, - bitmap.height - ); - return result === null ? [] : [result.data]; - } - ); - }, + handler: async (_args, _client_ipc, ipcRequest) => {}, }); - this.registerCommonIpcOnMessageHandler({ method: "GET", - pathname: "/stop", + pathname: "/getSupportedFormats", matchMode: "full", input: {}, output: "boolean", - handler: (_args, _client_ipc, _ipcRequest) => { - // 停止及解析 - isStop = true; + handler: () => { return true; }, }); }; - _shutdown() {} } diff --git a/desktop-dev/src/sys/biometrics/biometrics.main.ts b/desktop-dev/src/sys/biometrics/biometrics.main.ts deleted file mode 100644 index 0d5eb5c637..0000000000 --- a/desktop-dev/src/sys/biometrics/biometrics.main.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { NativeMicroModule } from "../../core/micro-module.native.ts"; - -export class BiometricsNMM extends NativeMicroModule { - mmid = "biometrics.sys.dweb" as const; - - protected _bootstrap() { - console.log("biometrices", `[${this.mmid}] _bootstrap`); - this.registerCommonIpcOnMessageHandler({ - pathname: "/check", - matchMode: "full", - input: {}, - output: "boolean", - handler: () => { - return true; - }, - }); - - this.registerCommonIpcOnMessageHandler({ - pathname: "/biometrics", - matchMode: "full", - input: {}, - output: "object", - handler: async () => { - return await this.nativeFetch( - `file://mwebview.browser.dweb/plubin/biommetrices` - ); - }, - }); - } - - protected _shutdown(): unknown { - throw new Error("Method not implemented."); - } -} - -export type $ImpactLightStyle = "HEAVY" | "MEDIUM" | "LIGHT"; -export type $NotificationStyle = "SUCCESS" | "WARNING" | "ERROR"; diff --git a/plaoc/demo/src/pages/BarcodeScanning.vue b/plaoc/demo/src/pages/BarcodeScanning.vue index cf1fb112f7..40d152633e 100644 --- a/plaoc/demo/src/pages/BarcodeScanning.vue +++ b/plaoc/demo/src/pages/BarcodeScanning.vue @@ -1,8 +1,8 @@