Skip to content

Commit

Permalink
Fixed firefox native messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
mantou132 committed Oct 16, 2020
1 parent 24b775c commit b2fe3f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
"to": "./public/vbs"
}
],
"publish": {
"provider": "github",
"vPrefixedTagName": false
},
"win": {
"icon": "./public/icon.png"
},
Expand Down
9 changes: 7 additions & 2 deletions src/main/nativeMessage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/camelcase */
import process from 'process';
import os from 'os';
import path from 'path';
Expand Down Expand Up @@ -49,11 +48,17 @@ function getNativeMessageDir(browser: BrowserName) {
return '.config/chromium/NativeMessagingHosts';
}
case 'win32':
return app.getPath('userData');
// 位置在注册表指定
return path.resolve(
app.getPath('userData'),
'NativeMessagingHosts',
browser === 'Firefox' ? 'Firefox' : 'Chrome',
);
}
}

function getNativeMessageAllowedExtension(browser: BrowserName) {
/* eslint-disable @typescript-eslint/camelcase */
const allowed_extensions = ['{fa233117-785b-4da4-a4a2-6f5312c6381b}'];
const allowed_origins = ['chrome-extension://hjaohjgedndjjaegicnfikppfjbboohf/'];
if (process.env.TEMP_EXT) {
Expand Down

0 comments on commit b2fe3f9

Please sign in to comment.