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
- Methods
chrome.loginState.getProfileType(callback: function)
chrome.loginState.getSessionState(callback: function)
- Events
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
- callbackfunction
The callback parameter should be a function that looks like this:
(result: ProfileType) => {...}
- result
getSessionState
chrome.loginState.getSessionState(callback: function)
Gets the current session state.
Parameters
- callbackfunction
The callback parameter should be a function that looks like this:
(result: SessionState) => {...}
- result
Events
onSessionStateChanged
chrome.loginState.onSessionStateChanged.addListener(listener: function)
Dispatched when the session state changes. sessionState
is the new session state.
Event
- listenerfunction
The listener parameter should be a function that looks like this:
(sessionState: SessionState) => {...}
- sessionState