设置标题为自己的昵称

This commit is contained in:
2023-10-05 15:18:34 +08:00
parent 0ba3bf34f8
commit c9a63d686b
1 changed files with 5 additions and 0 deletions

View File

@ -249,12 +249,17 @@
}
document.body.appendChild(nameInput)
// 设置标签为自己的头像
if (localStorage.getItem('avatar')) {
const favicon = document.createElement('link')
favicon.rel = 'icon'
favicon.href = localStorage.getItem('avatar')
document.head.appendChild(favicon)
}
// 设置标题为自己的昵称
if (localStorage.getItem('username')) {
document.title = localStorage.getItem('username')
}
</script>
</body>