Skip to content
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

Script focuses player when pressing any link on yt #1

Closed
lihuelworks opened this issue Jul 23, 2020 · 2 comments
Closed

Script focuses player when pressing any link on yt #1

lihuelworks opened this issue Jul 23, 2020 · 2 comments

Comments

@lihuelworks
Copy link

lihuelworks commented Jul 23, 2020

Hi. I don't know if the proyect is being mantained, but the script has been incredibly helpful, and almost essential to my Youtube usage. Thing is, I've encountered a problem when choosing certain links, for example:

  • the "view more" buttons on comments
  • the "view X replies" in comments
  • adding a video to a playlist from the sidebar
  • adding a video to watch later from the sidebar

I don't know what can be the cause of this, or if you can replicate it; but if anything can be done or if there is any way I can help debugging this, please let me know.

@lihuelworks
Copy link
Author

lihuelworks commented Jul 23, 2020

Ok, reading the script a little bit better, I think it's intended behavior. The onMouse() function specifies an event where "clicking any outside of an area" focuses the player:

    function onMouse(event) {
        // Called when mouse button is pressed over an element.
        // Debug log of mouse button event
        //console.log("YoutubeKeysFix: " + event.type + " ->", event.target);

        // click OUTSIDE OF AREAS focuses player
        //if (0 === getAreaOf(event.target))  return redirectFocus(event, playerElem);
    }

Commenting as in the snippet seems to correct the behavior. Since the script hasn't been updated in a while (Not in an accusatory manner, life happens), it's possible that the Youtube DOM has suffered some changes that made that behavior trigger for any click; or the definition of an "outside area", in the terms it was first described, changed.

Edit: Well, seems I haven't read it enough. Disabling the "if" doesn't make the script not work, but you have to click before it takes (which deletes the purpose of the script). I also forgot you cannot reopen your own closed issues, for some reason.

@Calciferz
Copy link
Owner

Calciferz commented Jan 16, 2024

Thank you for the report and apologies for not maintaining the project for so long.

7111ccf fixes this by removing the odd behavior focusing the player.
2df9e31 fixes the misidentification of the comments section.

Your comment #1 (comment) was very insightful, much appreciated!

v1.2.0 fixes this: 7111ccf

@Calciferz Calciferz reopened this Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants