wyeb icon indicating copy to clipboard operation
wyeb copied to clipboard

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

Open biqqthiqq opened this issue 5 years ago • 2 comments

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!

biqqthiqq avatar May 26 '20 16:05 biqqthiqq

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.

jun7 avatar May 27 '20 10:05 jun7

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.

biqqthiqq avatar May 27 '20 16:05 biqqthiqq