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

URI handlers don't trigger when clicking link from existing page #38

Open
kqzkqz opened this issue May 26, 2020 · 2 comments
Open

URI handlers don't trigger when clicking link from existing page #38

kqzkqz opened this issue May 26, 2020 · 2 comments

Comments

@kqzkqz
Copy link

kqzkqz commented May 26, 2020

hi!

I'm playing around with some handler rules, and I have the following in my main.conf

[uri:^https://www.youtube.com/watch(.*)]
#handler cancels request before sent and
#spawns the command with a URI matched the 'uri:'
handler=mpv --profile=unpause --ytdl https://youtube.com/watch%s

this works perfectly if I start wyeb from the command line with a youtube video, but if I say, go to youtube.com and search for a video, then click on one, it doesn't trigger. (unless I reload the video after clicking on it)

is there anyway to change this behavior?

thanks!

@jun7
Copy link
Owner

jun7 commented May 27, 2020

Probably the URI is changed by javascript without loading a page. You can see the progress bar is not rendered.
wyeb checks uri settings when a page is loading. So reloading triggers it.

Hmm changing the URI handling is very heavy and supporting javascript's random behavior is difficult so much.

Currently If you don't want press key 'r' you could manage it by change of mdlbtnlinkaction(Middle button action on a link).
May be

[uri:^https://www.youtube.com/]
mdlbtnlinkaction=sh mpv --profile=unpause --ytdl $LINK

and then middle click a link.
or if you don't mind showing a video's page
mdlbtndown=sh mpv --profile=unpause --ytdl $URI
and after showing a video page, middle drag down.

Sorry the samples are not tested.

@kqzkqz
Copy link
Author

kqzkqz commented May 27, 2020

thanks for the response, that makes sense, youtube is incredibly bloated with javascript so I figured something was happening there.

thanks for the workaround though! I think what I'm going to end up trying first is to use a lightweight youtube frontend like https://invidio.us and have my handler open mpv with that URI, and eventually just disable javascript in wyeb all together once I have other sites working like twitch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants