Selkies

lib/page-url

The page URL as the client reads and hands it on.

Its fragment holds a keyword that picks the display or the sharing role (#display2-right, #shared, #player2) and may hold the session token as a token= item beside it (#display2-right&token=<t>), in either order. Everything that reads the fragment reads the keyword alone (urlFragmentKeyword), so no hash parser sees the token and none logs it; a window this page opens for the session carries a fragment token on in its own fragment (fragmentWithSessionToken), and a sharing link starts from the page without any token (shareablePageURL).

Functions

readUrlFragment()

function readUrlFragment(): object;

Defined in: lib/page-url.js:29

Splits the page URL's fragment into its keyword and its token.

Items are &-separated; the token is the token= item, percent-decoded as a query value is, and the keyword is the first other item.

Returns

object

The keyword with its #, or '' without one, and the token, or ''.

keyword
keyword: string;
token
token: string;

urlFragmentKeyword()

function urlFragmentKeyword(): string;

Defined in: lib/page-url.js:53

The display or sharing keyword of the page URL's fragment, without the token that may ride beside it.

Returns

string

The keyword with its #, or '' when there is none.


fragmentWithSessionToken()

function fragmentWithSessionToken(keyword): string;

Defined in: lib/page-url.js:64

The fragment for another page of this session, such as the second display's window: the keyword, then the page's token when it came in the fragment. A query token stays in the query, which the caller keeps.

Parameters

ParameterTypeDescription
keywordstringThe keyword without its # (display2-right).

Returns

string

#keyword, with &token= added for a fragment token.


shareablePageURL()

function shareablePageURL(): string;

Defined in: lib/page-url.js:75

The page URL a sharing link starts from: this page without its fragment and without a token query parameter, so a link handed to someone else never carries the sharer's own credential.

Returns

string