diff options
Diffstat (limited to 'browser/components/contextualidentity/test/browser/file_reflect_cookie_into_title.html')
-rw-r--r-- | browser/components/contextualidentity/test/browser/file_reflect_cookie_into_title.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/browser/components/contextualidentity/test/browser/file_reflect_cookie_into_title.html b/browser/components/contextualidentity/test/browser/file_reflect_cookie_into_title.html new file mode 100644 index 0000000000..cc05453507 --- /dev/null +++ b/browser/components/contextualidentity/test/browser/file_reflect_cookie_into_title.html @@ -0,0 +1,22 @@ +<html> + <head> + <meta charset="UTF-8"> + <title>title not set</title> + <script> + // if we have a query string, use it to set the cookie and localStorage + if (window.location.search.length) { + let context_name = window.location.search.substr(1); + document.cookie = "userContextId=" + context_name; + localStorage.setItem("userContext", context_name); + } + + // get the cookie + let [name, val] = document.cookie.split("="); + + // set the title to reflect the cookie and local storage values we find + document.title = "cookie=" + val + "|" + + "local=" + localStorage.getItem("userContext"); + </script> + </head> + <body></body> +</html> |