mirror of
https://github.com/wassname/talk.git
synced 2026-07-19 11:28:50 +08:00
15 lines
435 B
JavaScript
15 lines
435 B
JavaScript
document.addEventListener('DOMContentLoaded', () => {
|
|
// Get the auth element and parse it as JSON by decoding it.
|
|
const auth = document.getElementById('auth');
|
|
const doc = document.implementation.createHTMLDocument('');
|
|
doc.body.innerHTML = auth.innerText;
|
|
|
|
// Set the item in localStorage.
|
|
localStorage.setItem('auth', doc.body.textContent);
|
|
|
|
// Close the window.
|
|
setTimeout(() => {
|
|
window.close();
|
|
}, 50);
|
|
});
|