mirror of https://github.com/keeweb/keeweb
loading compatible modules in renderer process
parent
a1b8682316
commit
701bb4caa4
|
@ -14,6 +14,7 @@ const Launcher = {
|
|||
thirdPartyStoragesSupported: true,
|
||||
clipboardSupported: true,
|
||||
req: window.require,
|
||||
mainProcessModules: ['usb'],
|
||||
platform() {
|
||||
return process.platform;
|
||||
},
|
||||
|
@ -27,7 +28,12 @@ const Launcher = {
|
|||
return this.electron().remote.require(mod);
|
||||
},
|
||||
reqNative(mod) {
|
||||
return this.electron().remote.app.reqNative(mod);
|
||||
if (this.mainProcessModules.includes(mod)) {
|
||||
return this.electron().remote.app.reqNative(mod);
|
||||
} else {
|
||||
const fileName = `${mod}-${process.platform}-${process.arch}.node`;
|
||||
return this.req(`@keeweb/keeweb-native-modules/${fileName}`);
|
||||
}
|
||||
},
|
||||
openLink(href) {
|
||||
if (/^(http|https|ftp|sftp|mailto):/i.test(href)) {
|
||||
|
|
Loading…
Reference in New Issue