toolkit/devtools/server/tests/browser/storage-updates.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 <!DOCTYPE HTML>
michael@0 2 <html>
michael@0 3 <!--
michael@0 4 Bug 965872 - Storage inspector actor with cookies, local storage and session storage.
michael@0 5 -->
michael@0 6 <head>
michael@0 7 <meta charset="utf-8">
michael@0 8 <title>Storage inspector blank html for tests</title>
michael@0 9 </head>
michael@0 10 <body>
michael@0 11 <script>
michael@0 12
michael@0 13 window.addCookie = function(name, value, path, domain, expires, secure) {
michael@0 14 var cookieString = name + "=" + value + ";";
michael@0 15 if (path) {
michael@0 16 cookieString += "path=" + path + ";";
michael@0 17 }
michael@0 18 if (domain) {
michael@0 19 cookieString += "domain=" + domain + ";";
michael@0 20 }
michael@0 21 if (expires) {
michael@0 22 cookieString += "expires=" + expires + ";";
michael@0 23 }
michael@0 24 if (secure) {
michael@0 25 cookieString += "secure=true;";
michael@0 26 }
michael@0 27 document.cookie = cookieString;
michael@0 28 };
michael@0 29
michael@0 30 window.removeCookie = function(name) {
michael@0 31 document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
michael@0 32 }
michael@0 33
michael@0 34 window.clear = function() {
michael@0 35 var cookies = document.cookie;
michael@0 36 for (var cookie of cookies.split(";")) {
michael@0 37 removeCookie(cookie.split("=")[0]);
michael@0 38 }
michael@0 39 localStorage.clear();
michael@0 40 sessionStorage.clear();
michael@0 41 }
michael@0 42 </script>
michael@0 43 </body>
michael@0 44 </html>

mercurial