-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature Request: Open links in external browsers #22
Comments
Add preliminary "open with" support for #22
In my latest commit to master, I have made a preliminary implementation of Open With. To activate open with on Datcord:
I would like to refine this setup procedure but for now, it works. |
Hey, I installed this program via appimage, and I'm not sure what you mean by shell/command line? I tried to use the command in the terminal, and it didn't recognise it, and it didn't do anything different if I used it with the appimage file? |
@Cobradabest the newest release (0.3.2) is now available and there are now special instructions in the README for AppImages. The AppImage for Datcord now has support for arguments. The terminal is the correct place to run the commands. |
Was this patch just about making the installation of addons easier? I had already installed Open With (and still have it installed), but was hoping for a "one-click" solution. Much like if you click a link in the official Discord app (or Slack or whatever). Is that possible or just too hard? |
This patch just pre-installs the Open With extension. I was looking for another solution but I couldn't find one (there is surprisingly little documentation about this type of stuff). I am still looking for a more elegant solution for the setup. I might have to make a custom extension to do this. |
I have implemented a solution to this problem that opens every link in the default browser. I registered a custom protocol and I have setup the handler to be a bash script (linux) or a batch script (windows) which opens your default browser with the link. I will be releasing v0.4.0 with these changes. |
It turns out that this stills needs a little more work for appimages. |
Does the Linux script just run xdg-open? Because I think that's all that's required on that platform. Unsure about others. If you need help testing it, let me know. |
Yes, the script just runs xdg-open but Firefox sends the data with the name of the protocol still attached and I need to remove it. I must put an executable in the policies.json so I need to make a script to remove the protocol. I am having trouble doing this with the appimage because I can not use any environment variables or relative paths in policies.json so I need to have the script somewhere on the system in a constant and known location. |
That sounds really annoying. Sorry if these questions aren't helpful, but can you give me an example of what Firefox sends to xdg-open? Also, I take it the script can't just be in the same directory as the executable (i.e. "./script.sh" or just "script.sh")? You mention no relative paths, but maybe the current directory is an exception? Does modifying security.fileuri.strict_origin_policy to false change anything? |
@akengconsulting for example, Firefox would send |
OK thanks. I'm out of ideas for now. |
I suppose there's one more thing I can think of. On each start, maybe you can copy the script to a known location (e.g. somewhere in /tmp) and then use that for the duration of the session? Not sure how robust it would be. |
This works and it also seems like a very good way of going about this because I can have the path to the script controlled by Datcord and not static which isn't a great idea for obvious reasons. I can just add to my AppRun that copy the script to /tmp and remove the script from /tmp. I think I will also launch Datcord using a script and have that handle moving the script. |
The moving script idea works great but now I am having issues with Firefox's profiles. When I launch Firefox through the script it tells me Firefox already running. For now I am selecting the default profile when launching but this only works sometimes. |
I fixed this issue and possibly many other issues involving profiles by making datcord have it's own profile folder (.datcord instead of .mozilla). Now, things are working great and I think this is pretty much ready. |
v0.4.0. Fix #22, use cross compilation for Windows builds
It would be great to be able to open non-discord links in external browsers with one click. Currently, datcord will open links in a new window of itself (firefox, effectively). This is a little inconvenient since I mostly want to open them in my default browser. Work-arounds include:
I think that's fairly self-explanatory, but if feel free to ask questions if I haven't been specific enough.
The text was updated successfully, but these errors were encountered: