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

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

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

mercurial