diff --git a/src/core/ApolloClient.ts b/src/core/ApolloClient.ts index 3d3f030301a..86df7098162 100644 --- a/src/core/ApolloClient.ts +++ b/src/core/ApolloClient.ts @@ -206,14 +206,25 @@ export class ApolloClient implements DataProxy { typeof window !== 'undefined' && window.document && window.top === window.self && - !(window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ && - window?.navigator?.userAgent?.indexOf('Chrome') > -1 + !(window as any).__APOLLO_DEVTOOLS_GLOBAL_HOOK__ ) { - invariant.log( - 'Download the Apollo DevTools ' + - 'for a better development experience: ' + - 'https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm', - ); + const nav = window.navigator; + const ua = nav && nav.userAgent; + let url: string | undefined; + if (typeof ua === "string") { + if (ua.indexOf("Chrome/") > -1) { + url = "https://chrome.google.com/webstore/detail/" + + "apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm"; + } else if (ua.indexOf("Firefox/") > -1) { + url = "https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/"; + } + } + if (url) { + invariant.log( + "Download the Apollo DevTools for a better development " + + "experience: " + url + ); + } } }