-
Notifications
You must be signed in to change notification settings - Fork 568
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
Skip Disliked Songs #1505
Skip Disliked Songs #1505
Conversation
I highly suggest that you run that code through a code formatter, those one-liners are too long. I can help you with that if you are not sure how to do it. |
I'm not sure how I could handle that |
In some of my userscript's I've used a helper method to ensure my code runs at the correct time. const waitForElem = (selector) => {
return new Promise(resolve => {
const interval = setInterval(() => {
const elem = document.querySelector(selector);
if (!elem) return;
clearInterval(interval);
resolve(elem);
});
});
} and then const likeBtn = await waitForElem('#like-button-renderer');
// ...
.observe(likeBtn, ...) |
The button exists even if no song is selected and I think I can assume that the page is fully loaded at start(), right? |
It ain't bad to be always careful, we don't want users experiencing unexpected bugs. |
Co-authored-by: JellyBrick <shlee1503@naver.com>
Co-authored-by: JellyBrick <shlee1503@naver.com>
Co-authored-by: JellyBrick <shlee1503@naver.com>
Other than that, LGTM |
LGTM as well |
Fixes #638