const IS_CHROME = navigator . userAgent . indexOf ( 'Firefox' ) < 0 ; export function isDev ( origin ) { return ( origin . includes ( 'shop1.myshopify' ) || origin . includes ( 'shop1-fast.myshopify' ) ) ; } export function getThemeId ( ) { return new Promise ( resolve => { chrome . devtools . inspectedWindow . eval ( 'Shopify.theme.id' , ( result ) => resolve ( result ) ) ; } ) ; } export type BrowserTheme = 'dark' | 'light' ; export function getBrowserTheme ( ) { if ( IS_CHROME ) { return chrome . devtools . panels . themeName === 'dark' ? 'dark' : 'light' ; } else if ( chrome . devtools && chrome . devtools . panels ) { switch ( chrome . devtools . panels . themeName ) { case 'dark' : return 'dark' ; default : return 'light' ; } } else { return 'light' ; } }