@@ -422,6 +422,7 @@ export const processFoundJS = async (version: string): Promise<void> => {
422422 window . setTimeout ( ( ) => processFoundJS ( version ) , 3000 ) ;
423423} ;
424424
425+ let isUserLoggedIn = false ;
425426export function startFor (
426427 origin : Origin ,
427428 excludedPathnames : Array < RegExp > = [ ] ,
@@ -441,7 +442,6 @@ export function startFor(
441442 updateCurrentState ( STATES . IGNORE ) ;
442443 return ;
443444 }
444- let isUserLoggedIn = false ;
445445 if ( isFbMsgrOrIgOrigin ( origin ) ) {
446446 // ds_user_id / c_user contains the user id of the user logged in
447447 const cookieName =
@@ -454,7 +454,7 @@ export function startFor(
454454 }
455455 } ) ;
456456 } else {
457- // only doing this check for FB and MSGR
457+ // only doing this check for FB, MSGR, and IG
458458 isUserLoggedIn = true ;
459459 }
460460 if ( isUserLoggedIn ) {
@@ -480,7 +480,7 @@ chrome.runtime.onMessage.addListener(request => {
480480 `Detected uncached script ${ request . uncachedUrl } ` ,
481481 ) ;
482482 } else if ( request . greeting === 'checkIfScriptWasProcessed' ) {
483- if ( ! ALL_FOUND_SCRIPT_TAGS . has ( request . response . url ) ) {
483+ if ( isUserLoggedIn && ! ALL_FOUND_SCRIPT_TAGS . has ( request . response . url ) ) {
484484 if (
485485 'serviceWorker' in navigator &&
486486 navigator . serviceWorker . controller ?. scriptURL === request . response . url
0 commit comments