Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

update document.title when ignoring video

Christian Fei298084ff88a5
diff --git a/client/components/video-element.js b/client/components/video-element.js
index 0e1c897..a95ec8b 100644
--- a/client/components/video-element.js
+++ b/client/components/video-element.js
@@ -215,7 +215,11 @@ class VideoElement extends HTMLElement {
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ id: this.video.id })
})
- .then(() => this.remove())
+ .then(() => {
+ this.remove()
+ const videoElementCount = document.querySelectorAll('video-element').length
+ document.title = `(${videoElementCount}) my-yt`
+ })
.catch((error) => {
console.error('Error ignoring video:', error)
this.classList.remove('hide')