From 9909e4bed0cb75a0d93acef7db4c336f2334dbe5 Mon Sep 17 00:00:00 2001 From: wangxianqiao Date: Sun, 29 Aug 2021 08:21:04 +0800 Subject: [PATCH] Fixed `loadURL` --- package.json | 2 +- src/main/window.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8093d2a..296d163 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "google-translate", - "version": "4.1.15", + "version": "4.1.16", "description": "google translate, work in any app", "main": "./dist/index.js", "scripts": { diff --git a/src/main/window.ts b/src/main/window.ts index 434abd2..94bc58c 100644 --- a/src/main/window.ts +++ b/src/main/window.ts @@ -68,9 +68,9 @@ export default class Window extends BrowserWindow { this.webContents.addListener('crashed', console.log); - internetAvailable({ retries: 3600 }) + internetAvailable({ timeout: 1000, retries: 5, port: '53', host: '114.114.114.114', domainName: 'google.com' }) .then(() => { - return new Promise(async (resolve, reject) => { + return new Promise((resolve, reject) => { // https://github.com/electron/electron/issues/20357 const testWindow = new BrowserWindow({ show: false }); testWindow.loadURL(config.translateUrl);