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

Implement "goldendict://nice" url scheme handler for windows and linux #227

Merged
merged 2 commits into from
Nov 28, 2022

Conversation

shenlebantongying
Copy link
Collaborator

@shenlebantongying shenlebantongying commented Nov 27, 2022

To test this, try goldendict://nice on explore.exe's address bar, browser or any editor that supports hyperlinks.

This is an unobvious feature, probably we should document it somewhere, like the wiki or put it in "changes.md" which seems not updated anymore.

If the goldendict already running, GD will use the popup to show the result.

Related:

Fixes #221
Fixes goldendict/goldendict#735

@shenlebantongying shenlebantongying changed the title Implement "goldendict://nice" url scheme handler for windows Implement "goldendict://nice" url scheme handler for windows and linux Nov 27, 2022
@shenlebantongying
Copy link
Collaborator Author

shenlebantongying commented Nov 27, 2022

To test Linux version:

  • install everything to /usr/ or /usr/local
  • run sudo update-desktop-database (depends on how a distro works)
  • try xdg-open goldendict://nice

Limitations on linux:

In certain applications like vscode and kde's dolphin, they seems to limit what kinds of link they recognize.

Links in Libreoffice & sublime text & emacs & terminals that supports links, users can just click the link.

.appimage user probably must do what obsidian do https://help.obsidian.md/Advanced+topics/Using+obsidian+URI#Installing+Obsidian+URI

@TCLiuu
Copy link

TCLiuu commented Jul 10, 2023

Is it possible to make this feature available on macOS?
I have read this document, but I still don't know how to do it.
https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app

@shenlebantongying
Copy link
Collaborator Author

Would love to have this feature available on macOS, but I don't know how, and I have little to no idea about macOS development.

Help needed.

@Crissium
Copy link

Crissium commented Nov 2, 2023

I asked about this feature yesterday because I could not get it working and the comment was deleted after I discovered that I had foolishly used the old generation GoldenDict to test it. Sorry about that. But now I have encountered a real problem.

Let me re-introduce some background information first. Diogenes is a popular tool to browse classical texts, and users have been crying for GoldenDict integration for years. I am trying to add that feature by creating a link like <a href="goldendict://$word">GoldenDict</a>. But both Firefox and Chrome URI-encode the href, turning goldendict://οὐετερανός into goldendict://%CE%BF%E1%BD%90%CE%B5%CF%84%CE%B5%CF%81%CE%B1%CE%BD%CF%8C%CF%82. GoldenDict seems unable to handle such URLs and the search term is decoded as CE�ὐετερανός (notice that only the first letter is not properly decoded). Am I doing it in the wrong way? Or is it a real issue and I should open one instead? By the way, xdg-open goldendict://οὐετερανός works very well.

Anyway, thanks for this extremely useful feature!

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