Skip to content

Commit

Permalink
feat: support latest stable electron release line (#334)
Browse files Browse the repository at this point in the history
* feat: support latest stable electron release line

* fix: update package.json for vulns

* fix: some linter errors

* fix: loadURL => loadFile

* fix: final lint fixes
  • Loading branch information
codebytere authored Oct 22, 2018
1 parent a814875 commit 25d492d
Show file tree
Hide file tree
Showing 20 changed files with 1,087 additions and 2,673 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ For given versions of Electron you must depend on a very specific version range
| `~1.7.0` | `~3.7.0` |
| `~1.8.0` | `~3.8.0` |
| `^2.0.0` | `^4.0.0` |
| `^3.0.0` | _Coming Soon_ |
| `^3.0.0` | `^5.0.0` |

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

Expand Down
4 changes: 2 additions & 2 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Api.prototype.load = function () {
self.nodeIntegration = nodeIntegration
if (!nodeIntegration) {
return {
electron: {remote: {}},
electron: { remote: {} },
browserWindow: {},
webContents: {},
rendererProcess: {}
Expand Down Expand Up @@ -327,7 +327,7 @@ Api.prototype.addCapturePageSupport = function () {
var browserWindow = window[requireName]('electron').remote.getCurrentWindow()
browserWindow.capturePage.apply(browserWindow, args)
}, rect, self.requireName).then(getResponseValue).then(function (image) {
return new Buffer(image, 'base64')
return Buffer.from(image, 'base64')
})
})

Expand Down
5 changes: 3 additions & 2 deletions lib/chrome-driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,15 @@ ChromeDriver.prototype.stop = function () {
}

ChromeDriver.prototype.isRunning = function (callback) {
const cb = false
var requestOptions = {
uri: this.statusUrl,
json: true,
followAllRedirects: true
}
request(requestOptions, function (error, response, body) {
if (error) return callback(false)
if (response.statusCode !== 200) return callback(false)
if (error) return callback(cb)
if (response.statusCode !== 200) return callback(cb)
callback(body && body.status === 0)
})
}
Expand Down
Loading

0 comments on commit 25d492d

Please sign in to comment.