File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change 33 */
44
55/**
6- * Check if running in Chrome (not Chromium-based browsers like Edge)
6+ * Check if running in Chrome.
77 * Google Tasks backend only works in Chrome due to chrome.identity API requirements
88 */
99export function isChrome ( ) {
10- if ( typeof chrome === 'undefined' ) {
11- return false
12- }
13-
14- // Check for Chrome-specific APIs
15- const hasChromeIdentity = chrome . identity && typeof chrome . identity . getAuthToken === 'function'
16-
17- // Chrome has a specific runtime structure
18- const isChromeRuntime = chrome . runtime && chrome . runtime . id !== undefined
19-
20- return hasChromeIdentity && isChromeRuntime
10+ return (
11+ typeof chrome !== 'undefined' &&
12+ chrome . identity ?. getAuthToken !== undefined &&
13+ chrome . runtime ?. id !== undefined
14+ )
2115}
2216
2317/**
2418 * Check if running in Firefox
2519 */
2620export function isFirefox ( ) {
27- return typeof browser !== 'undefined' && browser . runtime && browser . runtime . id !== undefined
21+ return typeof browser !== 'undefined' && browser . runtime ? .id !== undefined
2822}
2923
3024/**
You can’t perform that action at this time.
0 commit comments