Named popup session test

This commit is contained in:
Stian Lund
2023-11-06 15:45:58 +01:00
parent 3da8f93421
commit 607fc43167
+14 -14
View File
@@ -5,34 +5,34 @@
</head>
<body>
<h2>Test of HTML5 localStorage and sessionStorage persistence</h2>
<h2>Test of HTML5 localStorage and sessionStorage persistence</h2>
<p>Enter data in either box and click the button to store it. If you navigate to this page in a new window or tab, or quit and relaunch your browser, localStorage will remain and sessionStorage will disappear.</p>
<p>Reload the page to verify the values are stored. Then click the button to open a popup window.</p>
<p>Popups and new tabs opened from a <code>window.open</code> event should inherit both storage values</p>
<p>Enter data in either box and click the button to store it. If you navigate to this page in a new window or tab, or quit and relaunch your browser, localStorage will remain and sessionStorage will disappear.</p>
<p>Reload the page to verify the values are stored. Then click the button to open a popup window.</p>
<p>Popups and new tabs opened from a <code>window.open</code> event should inherit both storage values</p>
<p>
<p>
Local storage:<br>
<input type="text" placeholder="nothing currently stored" size="30" id="local" />
<input type="button" onclick="store_it('local', window.localStorage);" value="Store it" />
</p>
</p>
<p>
<p>
Session storage:<br>
<input type="text" placeholder="nothing currently stored" size="30" id="session" />
<input type="button" onclick="store_it('session', window.sessionStorage);" value="Store it" />
</p>
</p>
<p id="local-warning"></p>
<p id="session-warning"></p>
<p id="local-warning"></p>
<p id="session-warning"></p>
<p>
<p>
<button onclick="window.open('index.html', '_blank', 'width=600, height=500'); return false;">Open Popup</button>
<button onclick="window.open('index.html'); return false;">Open New Tab</button>
</p>
<p>
</p>
<p>
<button onclick="window.open('index.html', 'popup', 'width=600, height=500'); return false;">Open Named Popup</button>
</p>
</p>
<script type="text/javascript" src="storage-test.js"></script>