Welcome Getting started API Reference Samples
Welcome Getting started API Reference Samples

chrome.loginState

Important: This API works only on Chrome OS
  • Description

    Use the chrome.loginState API to read and monitor the login state.

  • Permissions
    loginState

Summary

Types

ProfileType

Enum

"SIGNIN_PROFILE", or "USER_PROFILE"

SessionState

Enum

"UNKNOWN", "IN_OOBE_SCREEN", "IN_LOGIN_SCREEN", "IN_SESSION", or "IN_LOCK_SCREEN"

Methods

getProfileType

chrome.loginState.getProfileType(callback: function)

Gets the type of the profile the extension is in.

Parameters

  • callback
    function

    The callback parameter should be a function that looks like this:

    (result: ProfileType) => {...}

getSessionState

chrome.loginState.getSessionState(callback: function)

Gets the current session state.

Parameters

  • callback
    function

    The callback parameter should be a function that looks like this:

    (result: SessionState) => {...}

Events

onSessionStateChanged

chrome.loginState.onSessionStateChanged.addListener(listener: function)

Dispatched when the session state changes. sessionState is the new session state.

Event

  • listener
    function

    The listener parameter should be a function that looks like this:

    (sessionState: SessionState) => {...}
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.