New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BrowserWindow.getDevToolsExtensions API #5965

Merged
merged 5 commits into from Jun 13, 2016

Conversation

Projects
None yet
3 participants
@kevinsawicki
Contributor

kevinsawicki commented Jun 9, 2016

Adds BrowserWindow.getDevToolsExtensions() that returns an object like so:

{
  "devtron": {
    "name": "devtron",
    "version": "1.0.0"
  }
}

Closes #5960

@kevinsawicki kevinsawicki changed the title from Add BrowserWindow.isDevToolExtensionInstalled API to Add BrowserWindow.isDevToolsExtensionInstalled API Jun 9, 2016

@zcbenz

This comment has been minimized.

Contributor

zcbenz commented Jun 10, 2016

Adding an getDevToolsExtensions API that lists all installed extensions is probably generic, it does the job of isDevToolsExtensionInstalled, and allows more usages, like removing all extensions.

@davej

This comment has been minimized.

Contributor

davej commented Jun 10, 2016

Just a thought on getDevToolsExtensions API. It might be worth considering returning something like:

[{ name: 'devtron' }, { name: 'React Developer Tools' }]

instead of:

['devtron', 'React Developer Tools']

The first example would allow properties (like version or path) to be added in the future without making a breaking change. Just a thought, feel free to discard this. 😃

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Jun 10, 2016

Adding an getDevToolsExtensions API that lists all installed extensions is probably generic, it does the job of isDevToolsExtensionInstalled, and allows more usages, like removing all extensions.

👍

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Jun 10, 2016

I've updated this pull request to add BrowserWindow.getDevToolsExtension() that returns an object with extension names as the keys and the value is an object with selected manifest fields, currently name and version.

// Check if an extension is installed with
let installed = BrowserWindow.getDevToolsExtensions().hasOwnProperty('devtron')

// Get extension names
let names = Object.keys(BrowserWindow.getDevToolsExtensions())
{
  "devtron": {
    "name": "devtron",
    "version": "1.0.0"
  }
}

@kevinsawicki kevinsawicki changed the title from Add BrowserWindow.isDevToolsExtensionInstalled API to Add BrowserWindow.getDevToolsExtensions API Jun 10, 2016

@zcbenz

This comment has been minimized.

Contributor

zcbenz commented Jun 13, 2016

👍

@zcbenz zcbenz merged commit 853d7b1 into master Jun 13, 2016

8 of 9 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
electron-linux-arm Build #3414894 succeeded in 38s
Details
electron-linux-ia32 Build #3414895 succeeded in 33s
Details
electron-linux-x64 Build #3414896 succeeded in 123s
Details
electron-mas-x64 Build #1491 succeeded in 5 min 53 sec
Details
electron-osx-x64 Build #1497 succeeded in 6 min 39 sec
Details
electron-win-ia32 Build #492 succeeded in 6 min 28 sec
Details
electron-win-x64 Build #488 succeeded in 6 min 9 sec
Details

@zcbenz zcbenz deleted the installed-extension-api branch Jun 13, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment