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

I made a PageRedirector project to allow opening Advanced URIs using https #190

Open
EDLLT opened this issue Oct 27, 2024 · 3 comments
Open

Comments

@EDLLT
Copy link

EDLLT commented Oct 27, 2024

https://github.com/EDLLT/PageRedirector

Can we mention it in this project's README?
(If you can't mention my project for security reasons then feel free to create a fork of it instead)
I think it'd help many people as I couldn't find any solution for it on the web

I mainly use it to link to my Obsidian vault in sites that don't allow for the "obsidian://" protocol to be processed(One, for example, is Google Tasks)

image

@Vinzent03
Copy link
Owner

Interesting and simple project to solve that issue. I've experienced that myself from time to time.
Just one note to your project, when adding the Obsidian URI or from this plugin, you need one extra layer of encoding. For example, if you want to write %20 to a file, you need one extra call to encodeUriComponent() with the obsidian URI so that it becomes https://edllt.github.io/PageRedirector/?link=obsidian%3A%2F%2Fadv-uri%3Fvault%3Dobsidian-testing%26filepath%3Ddf.md%26mode%3Dappend%26data%3D%252520 in the end.
One could use the following tool:
https://www.onlinewebtoolkit.com/url-encode-decode#decode-url-component

@EDLLT
Copy link
Author

EDLLT commented Nov 8, 2024

Interesting and simple project to solve that issue. I've experienced that myself from time to time.
Just one note to your project, when adding the Obsidian URI or from this plugin, you need one extra layer of encoding. For example, if you want to write %20 to a file, you need one extra call to encodeUriComponent() with the obsidian URI so that it becomes https://edllt.github.io/PageRedirector/?link=obsidian%3A%2F%2Fadv-uri%3Fvault%3Dobsidian-testing%26filepath%3Ddf.md%26mode%3Dappend%26data%3D%252520 in the end.
One could use the following tool:
https://www.onlinewebtoolkit.com/url-encode-decode#decode-url-component

Actually, that's not needed due to the way the javascript is encoding the url.
The only thing that's needed is to encode special characters iirc.

For that, a user could simply right click on their file and hit on "copy Obsidian URI" or "copy Advanced URI" and that'll be correctly encoded
Then, all what they'd have to do is write it as "https://edllt.github.io/PageRedirector/?link=COPIED_URI_HERE" and that should work

@Vinzent03
Copy link
Owner

By using the provided command in Obsidian the uri is correctly encoded to be called directly, but not to be passed as a query parameter. You can try it yourself by creating an uri to append <space>hello<space> to a file.

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