nklayman / vue-cli-plugin-electron-builder

Easily Build Your Vue.js App For Desktop With Electron
https://nklayman.github.io/vue-cli-plugin-electron-builder/
MIT License
4.12k stars 279 forks source link

Why is navigator.bluetooth undefined after packaging? #1989

Closed gentZhou closed 8 months ago

gentZhou commented 9 months ago

I need to implement Bluetooth connectivity. In development mode, I can access navigator.bluetooth without any issues. However, after packaging, navigator.bluetooth becomes undefined. When using electron-builder directly, this problem doesn't occur. Can you provide an explanation? This issue has been bothering me for a long time.

gentZhou commented 8 months ago

解决了,这串代码没加..... import { BrowserWindow, protocol, ipcMain, app, dialog, Menu } from "electron"; protocol.registerSchemesAsPrivileged([ { scheme: "app", privileges: { secure: true, standard: true } }, ]);