TokenNegotiationExamples
Using an empty token.filter
Take this web page for example, which provided 2 TokenScripts (TokenA.xml and TokenB.xml) and an empty token filter (all inclusive):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="tokenscript" href="TokenA.xml"/>
<link rel="tokenscript" href="TokenB.xml"/>
<meta name="token.filter" content=""/>
<script type="module" src="tokenscript-bootstrap.js" ></script>
…
Situation | Result of the negotiation |
---|---|
If the user agent doesn't support TokenScript, and bootstrap library is used | Can only contain instances of TokenA and TokenB |
If the user agent supports TokenScript but the user doesn't have any tokens. | Can only contain instances of TokenA and TokenB |
If the user agent supports TokenScripts and already have TokenScripts cached for user's tokens TokenC and TokenD | Can contain instances of TokenA, TokenB, TokenC, and TokenD. |
Using an non-empty token.filter
Take this web page for example, which provided 2 TokenScripts (TokenA.xml and TokenB.xml) and an empty token filter (all inclusive):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="tokenscript" href="TokenA.xml"/>
<link rel="tokenscript" href="TokenB.xml"/>
<meta name="token.filter" content="expiry=*"/>
<script type="module" src="tokenscript-bootstrap.js" ></script>
…
Situation | Result of the negotiation |
---|---|
If the user agent doesn't support TokenScript, and bootstrap library is used | Can only contain instances of TokenA and TokenB |
If the user agent supports TokenScript but the user doesn't have any tokens. | Can only contain instances of TokenA and TokenB |
If the user agent supports TokenScripts and already have TokenScripts
cached for user's tokens TokenC and TokenD, where: TokenC.expiry =
2021-01-01 , and TokenB does not have expiry
attribute. |
Can contain instances of TokenA, TokenB, and TokenC |