let hasDetectedShopify = false ; const scripts = document . querySelectorAll ( 'script' ) ; for ( let i = 0 ; i < scripts . length ; i ++ ) { const content = scripts [ i ] . textContent ; if ( typeof content === 'string' ) { if ( /Shopify\.shop\s*=/ . test ( content ) ) { hasDetectedShopify = true ; break ; } } } chrome . runtime . sendMessage ( { type : 'detect-shopify' , hasDetectedShopify , } ) ; if ( document . location . search . includes ( 'shopify_employee' ) ) { chrome . runtime . sendMessage ( { type : 'detect-shopify-employee' , hasDetectedShopifyEmployee : true , } ) ; }