Skip to content

Commit

Permalink
Suggest Firefox Apollo DevTools as well as Chrome. (#7461)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamn authored Dec 11, 2020
1 parent df7e5a5 commit dbf2c66
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/core/ApolloClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,25 @@ export class ApolloClient<TCacheShape> 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
);
}
}
}

Expand Down

0 comments on commit dbf2c66

Please sign in to comment.