My own w2g extension

i ve been making my own extension which was made to count duration of playlist and how many tracks i ve added to the playlist / room and can someone tell me where are DOMs with that informations or can you hepl me in some diffrent way for example add it to the standard version of webside :))

Thanks for your feedback. Can you explain a bit more in detail what your extension does and what you need the information for?

I made extension that has a task of counting length of the playlist and counting how many videos/ songs there are. And i have all I need is it to work by the DOMs variables which is often used to has informatios of the videos but i cant find the right one. it is only for my personal usage btw:))

w2g wasn’t written for this (obviously), so this might break at any moment, but if you understand that and want to do it anyway:

Just for practice/curiosity, I found these selectors that currently work to select just 1 div, the one for the whole current playlist. That div’s children are one div for each video.

document.querySelectorAll(".space-y-1")[1]
document.querySelectorAll(".w2g-active > .w2g-playlists > * > div.space-y-1")[0]

The first seems very fragile. The second is still fragile, just in different ways.

For future use: Google’s DevTools console makes it pretty easy to just highlight the DOM element you want (so the little grey == $0 appears), type document.querySelectorAll("some CSS selector here") == $0 and play around with the selector, watching the live preview of the result.

1 Like

Thank you AySz88 a lot everythtng works fine now

yeah those code lines works but i can t find "CSS selector with informations about length of the video those from video display isnt working i ve found some but they didn t work

span[data-w2g="['displayDuration', 'text']"]

Can you helpme with those CSS selectors