Skip to content
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 devtools suggestion to Apollo Client #1466

Merged
merged 1 commit into from
Mar 22, 2017
Merged

Conversation

helfer
Copy link
Contributor

@helfer helfer commented Mar 22, 2017

Gotta catch em all!

(this prints a suggestion to install the devtools to the console of Chrome users during development)

@helfer
Copy link
Contributor Author

helfer commented Mar 22, 2017

Let's roll with it :)

@helfer helfer merged commit 0d75d08 into master Mar 22, 2017
@helfer helfer deleted the devtools-suggestion branch March 22, 2017 00:52
// First check if devtools is not installed
if (typeof (window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {
// Only for Chrome
if (navigator.userAgent.indexOf('Chrome') > -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually a reliable way to detect chrome? Does anyone impersonate this string out of browsers we care about?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it's good enough. I don't think other clients impersonating Chrome matters in this case, because the main thing we want to do here is avoid printing it for innocent IE and Firefox users.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants