Description

Dynamically capture necessary API credentials.

This module will then provide the credentials to other modules that need to use them, through message passing.

This module must run in background context because it is using webRequest chrome API. "webRequest" permission is required in extension manifest. Also permission to read the specified domain (twitter.com) is required in manifest.

Details

Classes


new Tokens()

Members


<static> bearerToken

Returns
Details

<static> csrfToken

Returns
Details

Methods


<static> messageListener( request, sender, response )

Description

Handle incoming messages from other parts of the extension. This module will respond to requests whose body is {tokens: true} (any truthy value works).

Parameters
Name Type Description
request object

message request body

Name Type Description
tokens *

request authentication bearer and csrf tokens

sender object

message sender info; populated by browser

response function

callback function; response message will be returned over this callback

Details

<static> parseHeader()

Description

match request headers

Details

<static> getTheTokens( details )

Description

Capture the tokens on the fly

Parameters
Name Type Description
details Object

webRequest object

Details