Skip to content

Commit

Permalink
Fixed chrome native message on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mantou132 committed Aug 17, 2020
1 parent 6855baf commit 45829e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion electron-builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"from": "src/bridge/target/release/bridge.exe",
"to": "./public/google-translate-bridge"
"to": "./public/google-translate-bridge.exe"
},
{
"from": "node_modules/regedit/vbs",
Expand Down
5 changes: 3 additions & 2 deletions src/main/nativeMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,13 @@ async function writeRegistryKey(browser: BrowserName, filePath: string) {
}

export function installNativeMessageManifest() {
const suffix = config.platform === 'win32' ? '.exe' : '';
const manifest = {
name: NATIVE_MANIFEST_NAME,
description: '谷歌翻译',
path: config.isDebug
? path.resolve(process.cwd(), `src/bridge/target/release/bridge${config.platform === 'win32' ? '.exe' : ''}`)
: path.resolve(__public, 'google-translate-bridge'),
? path.resolve(process.cwd(), `src/bridge/target/release/bridge${suffix}`)
: path.resolve(__public, `google-translate-bridge${suffix}`),
type: 'stdio',
};

Expand Down

0 comments on commit 45829e7

Please sign in to comment.