0
0
mirror of https://github.com/neon-mmd/websurfx.git synced 2024-10-18 06:22:53 -04:00
websurfx/public/static/cookies.js
2023-06-18 20:12:20 +03:00

18 lines
647 B
JavaScript

// This function is executed when any page on the website finsihes loading and
// this function retrieves the cookies if it is present on the user's machine.
// If it is available then the saved cookies is display in the cookies tab
// otherwise an appropriate message is displayed if it is not available.
document.addEventListener(
'DOMContentLoaded',
() => {
let cookie = decodeURIComponent(document.cookie)
if (cookie !== '') {
document.querySelector('.cookies input').value = cookie
} else {
document.querySelector('.cookies input').value =
'No cookies has been saved on your system'
}
},
false
)