Skip to content

Commit 25d492d

Browse files
authored
feat: support latest stable electron release line (electron-userland#334)
* feat: support latest stable electron release line * fix: update package.json for vulns * fix: some linter errors * fix: loadURL => loadFile * fix: final lint fixes
1 parent a814875 commit 25d492d

File tree

20 files changed

+1087
-2673
lines changed

20 files changed

+1087
-2673
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ For given versions of Electron you must depend on a very specific version range
3030
| `~1.7.0` | `~3.7.0` |
3131
| `~1.8.0` | `~3.8.0` |
3232
| `^2.0.0` | `^4.0.0` |
33-
| `^3.0.0` | _Coming Soon_ |
33+
| `^3.0.0` | `^5.0.0` |
3434

3535
Learn more from [this presentation](https://speakerdeck.com/kevinsawicki/testing-your-electron-apps-with-chromedriver).
3636

lib/api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Api.prototype.load = function () {
3434
self.nodeIntegration = nodeIntegration
3535
if (!nodeIntegration) {
3636
return {
37-
electron: {remote: {}},
37+
electron: { remote: {} },
3838
browserWindow: {},
3939
webContents: {},
4040
rendererProcess: {}
@@ -327,7 +327,7 @@ Api.prototype.addCapturePageSupport = function () {
327327
var browserWindow = window[requireName]('electron').remote.getCurrentWindow()
328328
browserWindow.capturePage.apply(browserWindow, args)
329329
}, rect, self.requireName).then(getResponseValue).then(function (image) {
330-
return new Buffer(image, 'base64')
330+
return Buffer.from(image, 'base64')
331331
})
332332
})
333333

lib/chrome-driver.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,15 @@ ChromeDriver.prototype.stop = function () {
111111
}
112112

113113
ChromeDriver.prototype.isRunning = function (callback) {
114+
const cb = false
114115
var requestOptions = {
115116
uri: this.statusUrl,
116117
json: true,
117118
followAllRedirects: true
118119
}
119120
request(requestOptions, function (error, response, body) {
120-
if (error) return callback(false)
121-
if (response.statusCode !== 200) return callback(false)
121+
if (error) return callback(cb)
122+
if (response.statusCode !== 200) return callback(cb)
122123
callback(body && body.status === 0)
123124
})
124125
}

0 commit comments

Comments
 (0)