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

how to redirect to an application #1

Closed
dln949 opened this issue Dec 5, 2024 · 11 comments
Closed

how to redirect to an application #1

dln949 opened this issue Dec 5, 2024 · 11 comments

Comments

@dln949
Copy link

dln949 commented Dec 5, 2024

When I click on a certain hyperlink on a web page within my web browser (Brave), I'd like to redirect it to launch an application installed on my Ubuntu Jammy system. How do I do that?

@rxliuli
Copy link
Owner

rxliuli commented Dec 8, 2024

What application? Can it be opened via URL schema? For example, you can enter vscode://settings/ in the browser to jump to vscode, an example rule is

https://github.dev/* => vscode://vscode.git/clone?url=https://github.com{{pathname.input}}

After configuring this rule, clicking the link https://github.dev/rxliuli/redirector will open vscode.

@dln949
Copy link
Author

dln949 commented Dec 8, 2024

I'm trying to redirect to the flatpak application installed on my desktop computer called "Junction" - found here: https://flathub.org/apps/re.sonny.Junction - which in the terminal executes with the command,

/usr/bin/flatpak run re.sonny.Junction

I obviously do not know the correct way to set up the redirection part of the rule - or perhaps Redirector won't work for this?????

@rxliuli
Copy link
Owner

rxliuli commented Dec 8, 2024

I found its API, and you can use it through the following URL Schema

x-junction://https://github.com

For example, if you want to open the Google website using Junction, you can configure rules

(https://www.google.com/.*) => x-junction://$1

image

@dln949
Copy link
Author

dln949 commented Dec 9, 2024

Thanks much, that helped.

@dln949 dln949 closed this as completed Dec 9, 2024
@dln949 dln949 reopened this Dec 10, 2024
@dln949
Copy link
Author

dln949 commented Dec 10, 2024

Sorry, but I've run into another issue that I THINK is related, but I'm not a tech type person, so perhaps you'll say this should be a new issue.

I followed your suggestion above, using this rule within the Brave browser: (https://*) >> x-junction://$1 But, when I click on an https:// hyperlink on a web page within the Brave browser, it opens Junction, but the URL supplied to Junction has file:///home/main1 as the prefix, and after the https it is missing a : and a /. (So, for example, if in the Brave browser I click on a hyperlink on a web page for https://google.com , what is supplied to Junction is file:///home/main1/https/www.google.com instead of just https://google.com. This obviously won't work, any browser I select within Junction to open the desired web site - https://google.com in this example - will instead attempt to open file://home/main1/https/google.com, which of course will fail. On my Ubuntu system, /home/main1 is my user home directory.) How do I make Redirector send the URL to Junction without the prefix of file:///home/main1 for my home directory, and how do I also make it have https:// in the correct URL instead of simply https/ ?

@rxliuli
Copy link
Owner

rxliuli commented Dec 10, 2024

(https://*) >> x-junction://$1

Use (https://.*) instead of (https://*), note that there is an additional . in it.

image

Or you can use the URLPattern matching pattern, which supports more explicit parameters, such as

https://* => x-junction://{{inputs}}

image

Sorry for the confusion, this plugin supports two matching modes, and I should stick to one mode when giving examples.

@dln949
Copy link
Author

dln949 commented Dec 10, 2024

Thanks for your response. Sadly, none of the options you listed solved the problem, still the same problem.

Here is what I've tried:

  1. (https://*) => x-junction://$1
  2. https://* => x-junction://$1
  3. (https://.*) => x-junction://$1
  4. https://.* => x-junction://$1
  5. (https://*) => x-junction://{{inputs}}
  6. https://* => x-junction://{{inputs}}
  7. (https://.*) => x-junction://{{inputs}}
  8. https://.* => x-junction://{{inputs}}

@rxliuli
Copy link
Owner

rxliuli commented Dec 10, 2024

What will happen if you click x-junction://https://www.google.com/ directly in the browser? Can Junction be opened correctly?

@dln949
Copy link
Author

dln949 commented Dec 10, 2024

With the Redirector rule of (https://.*) => x-junction://$1 in effect, when I enter x-junction://https://www.google.com directly in the URL field of the Brave browser, Junction does open up as expected, but the URL it is receiving as shown within the Junction application is this erroneous URL: /home/main1/https/search.brave.com/search?q=x-junction%3A%2F%2Fhttps%3A%2F%2Fwww.google.com&source=desktop .

@rxliuli
Copy link
Owner

rxliuli commented Dec 10, 2024

It seems that directly opening the link has the same issue, it might be a problem with Chrome or Junction, maybe you can check sonnyp/Junction#163.

@dln949
Copy link
Author

dln949 commented Dec 10, 2024

Ok, thanks for pointing that out.

@dln949 dln949 closed this as completed Dec 10, 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