mirror of https://github.com/keeweb/keeweb.git
canUseNativeModules
This commit is contained in:
parent
58296dd896
commit
75671a0a8a
|
@ -4,15 +4,16 @@ import { Logger } from 'util/logger';
|
|||
import { Launcher } from 'comp/launcher';
|
||||
import { AppSettingsModel } from 'models/app-settings-model';
|
||||
import { YubiKeyVendorId } from 'const/hardware';
|
||||
import { Features } from 'util/features';
|
||||
|
||||
const logger = new Logger('usb-listener');
|
||||
|
||||
const UsbListener = {
|
||||
supported: Launcher && !(process.platform === 'win32' && !process.arch.includes('64')),
|
||||
supported: Launcher && Features.canUseNativeModules,
|
||||
attachedYubiKeys: 0,
|
||||
|
||||
init() {
|
||||
if (!Launcher) {
|
||||
if (!this.supported) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,8 @@ const Features = {
|
|||
isLocal: location.origin.indexOf('localhost') >= 0,
|
||||
needFixClicks: /Edge\/14/.test(navigator.appVersion),
|
||||
canUseWasmInWebWorker: !isDesktop && !/Chrome/.test(navigator.appVersion),
|
||||
canUseNativeModules:
|
||||
isDesktop && !(process.platform === 'win32' && !process.arch.includes('64')),
|
||||
|
||||
supportsTitleBarStyles() {
|
||||
return this.isMac;
|
||||
|
|
|
@ -29,7 +29,7 @@ const KdbxwebInit = {
|
|||
if (!global.WebAssembly) {
|
||||
return Promise.reject('WebAssembly is not supported');
|
||||
}
|
||||
if (Launcher && Launcher.reqNative && AppSettingsModel.nativeArgon2) {
|
||||
if (Features.canUseNativeModules && AppSettingsModel.nativeArgon2) {
|
||||
const ts = logger.ts();
|
||||
const argon2 = Launcher.reqNative('argon2');
|
||||
logger.debug('Native argon2 runtime loaded (main thread)', logger.ts(ts));
|
||||
|
|
|
@ -3,7 +3,7 @@ import { AppSettingsModel } from 'models/app-settings-model';
|
|||
import { YubiKeyOtpModel } from 'models/external/yubikey-otp-model';
|
||||
import template from 'templates/settings/settings-devices.hbs';
|
||||
import { Links } from 'const/links';
|
||||
import { UsbListener } from '../../comp/app/usb-listener';
|
||||
import { UsbListener } from 'comp/app/usb-listener';
|
||||
|
||||
class SettingsDevicesView extends View {
|
||||
template = template;
|
||||
|
|
Loading…
Reference in New Issue