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

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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