-
-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(new option) playlist popup button #1832
Conversation
WIP of code-charity#1805 [2] Idea is to have a popup button in every playlist menu (mini player with playlist / video page with playlist / playlist page)
changed playlist popup setting name and section
finished functionality (split into two functions) - create a popup button element - adds or updates popup buttons to the UI
🥰🥰 |
wish we could do both: merge & keep it open for bragging. |
critical! 🥳 449fbdc |
@@ -34,6 +34,9 @@ ImprovedTube.observer = new MutationObserver(function (mutationList) { | |||
for (var j = 0, k = mutation.addedNodes.length; j < k; j++) { | |||
ImprovedTube.childHandler(mutation.addedNodes[j]); | |||
} | |||
for (const node of mutation.removedNodes){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might should fix our other playlist buttons like this too @MAZ01001 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, or really every element that gets inserted into the DOM
That's how I wrote this playlist-popup button:
- One function that only creates the button (as an object) and returns it (does not insert it into the DOM)
- and another that checks if it should add a button to the current page (and adds it via 1.) or update any existing buttons
Then 2. can be called anytime since it checks for itself if it should insert something to the DOM, so I added it to every page where a button might be needed (in the ImprovedTube.childHandler
) and whenever any existing buttons got deleted by YT (the for-loop you highlighted).
More info is in #1805 section [2].
The option is under the Playlist menu and is defaulted off.
Works with (tested):
The button may reappear with some delay when it is removed by page updates.