Is it possible to determine if Chrome is in incognito mode via a user-script?

前端 未结 3 1872
星月不相逢
星月不相逢 2020-12-30 01:13

I asked this question before but didn\'t make it clear that I meant in user script, not in JavaScript from a webpage.So I\'ll be more clear now.

Is it possible to de

3条回答
  •  隐瞒了意图╮
    2020-12-30 01:19

    Nowadays it's quite easy to do this from a content script. Just use

    if(chrome.extension.inIncognitoContext) {
        //you're incognito
    } else {
        //you're not
    }
    

提交回复
热议问题