How to get current URL in Open URL action?

92 views
Skip to first unread message

Slava Lishnevsky

unread,
Dec 24, 2023, 5:09:38 AM12/24/23
to AutoControl

xxx.jpg
How do I insert current URL in <currentURL> placeholder?
Thanks.

AutoControl support

unread,
Dec 24, 2023, 7:10:07 AM12/24/23
to AutoControl
On the right edge of the URL text box there's a popup menu that shows the placeholders you can use.
The current URL is obtained by inserting the <url> placeholder and then choosing "Current tab" in the "Apply to:" field.

image.png

However, in your particular case that won't work because y2mate.com doesn't accept the entire youtube URL. You need to pass only the video ID, which can be obtained with the following placeholder:

https://www.y2mate.com/youtube/<url.query.matches(/v=([^&]+)/)[1]>


Slava Lishnevsky

unread,
Dec 24, 2023, 12:35:13 PM12/24/23
to AutoControl
Fantastic !!
Thank you very much.

I could also use a script option
let destUrl = `https://www.y2mate.com/youtube/${location.href.split('v=')[1].split('&')[0]}`;
let result = await ACtl.openURL(destUrl);


but I like non-script better.
Amazing extension.

Reply all
Reply to author
Forward
0 new messages