1

We have a Chat button on our community page using which user can communicate with Agents for their issues.

User can use the community page in normal mode as well as in incognito mode. But with latest update for chrome(Version 84) to make default option as "BLock third-party cookies in incognito mode" ,

enter image description here

when user tries to use the chat from incognito mode it receives following exception

enter image description here

It works for all other browser except chrome V-84. But when "Allow all cookies" is set, then all works fine in chrome V-84, from user prospective we don't want our users to go to this setting and enable this option and then use this Chat feature in incognito mode, please advise if we can update this browser setting using LWC while user tries to use this feature in incognito mode or is there any other way to troubleshoot this issue.


To check if user is in incognito mode we tried to use navigator but it didn't have element what we are looking for , when code execution happens through console directly it works fine but when we had added code in LWC component and tried to debug same, it returned following result. enter image description here

Navigator : enter image description here

0

I don't think its possible through the code to update chrome settings. Some of the things can be done though -

  1. Companies got control over the browser(specially Chrome), so we can set the configurations on the browser through company network/security team.
  2. Since community is used by customers, which we can't control. We can have a script to identify the chrome 84's incognito session, so that we can show custom error message page with showing proper navigation to update the setting/leave incognito.

Script to check Chrome 84'th version -

if(navigator.userAgent.indexOf('Chrome/84') > 0 ){
   alert('I am in Chrome with version 84+');
}

To check if we're in incognito or not - [Copied from - Link ]

if ('storage' in navigator && 'estimate' in navigator.storage) {
    const {usage, quota} = await navigator.storage.estimate();
    console.log(`Using ${usage} out of ${quota} bytes.`);

    if(quota < 120000000){
        console.log('Incognito')
    } else {
        console.log('Not Incognito')
    }   
} 
3
  • 1
    'storage' in navigator isn't working for us when we add this script in LWC component, I have updated my question with details. – Nachiket Deshpande Aug 3 '20 at 13:46
  • May be you can try other ways from the link. Locker is preventing that actually. – Ysr Shk Aug 3 '20 at 14:20
  • Looks like none of the options mentioned on that link is working for me. – Nachiket Deshpande Aug 3 '20 at 15:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.