electron icon indicating copy to clipboard operation
electron copied to clipboard

[Bug]: shell.openExternal not work at ubuntu21.04

Open eeeeeio opened this issue 3 years ago • 17 comments

Preflight Checklist

Electron Version

13.1.6

What operating system are you using?

Ubuntu

Operating System Version

ubuntu21.04

What arch are you using?

x64

Last Known Working Electron version

15.2.0

Expected Behavior

run shell.openExternal(url) open a file

Actual Behavior

run shell.openExternal(url) log ` xdg-open - opens a file or URL in the user's preferred application

Synopsis

xdg-open { file | URL }

xdg-open { --help | --manual | --version }

Use 'man xdg-open' or 'xdg-open --manual' for additional info. `

then nothing happen

but its work when I use childProcess.exec('xdg-open ' + url)

url is a file path

Testcase Gist URL

No response

Additional Information

No response

eeeeeio avatar Oct 20 '21 04:10 eeeeeio

Please use electron fiddle to provide gist URL

BlackHole1 avatar Oct 20 '21 09:10 BlackHole1

This might be #28436?

andersk avatar Nov 05 '21 04:11 andersk

I am having the same problem with electron v17.3.1. Here's a gist, generated by electron fiddle.

https://gist.github.com/5fb97f76b4a83861673125a921ab88be

It creates the following output when run on Ubuntu 21.10:

Saving files to temp directory...
Saved files to /tmp/tmp-160513-fF6OcW8KbuKe
Electron v17.3.1 started.
Starting inspector on 127.0.0.1:9229 failed: address already in use
xdg-open - opens a file or URL in the user's preferred application

Synopsis

xdg-open { file | URL }

xdg-open { --help | --manual | --version }

Use 'man xdg-open' or 'xdg-open --manual' for additional info.
Done

Changing the argument from "/home" to "file:///home" results in the expected behavior.

LindirQuenya avatar Apr 01 '22 14:04 LindirQuenya

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar Oct 05 '22 02:10 github-actions[bot]

This issue is still present in electron v21.0.1.

LindirQuenya avatar Oct 05 '22 21:10 LindirQuenya

This issue is still present in electron v21.1.0

zanzara avatar Dec 14 '22 14:12 zanzara

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar Apr 11 '23 01:04 github-actions[bot]

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

github-actions[bot] avatar Jul 11 '23 02:07 github-actions[bot]

This issue is still present in Electron v25.3.0 and v26.0.0-beta5 on Ubuntu 23.04.

LindirQuenya avatar Jul 19 '23 01:07 LindirQuenya

This might be #28436?

Based on the error message, I would assume that it isn't. It looks like electron is invoking xdg-open incorrectly.

LindirQuenya avatar Jul 19 '23 01:07 LindirQuenya

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

Still present in 27.0.2 and 28.0.0-alpha.4 on Ubuntu 23.04. Same behavior - openExternal('/home') fails with an error message, openExternal('file:///home') works fine. Is this expected behavior? Are we not supposed to be able to put file paths directly into openExternal?

LindirQuenya avatar Oct 22 '23 23:10 LindirQuenya

After inserting some logging into xdg-open, it looks like electron isn't passing it any arguments in the first case? In the second case it is passed file:///home.

LindirQuenya avatar Oct 22 '23 23:10 LindirQuenya

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

bump

BlackHole1 avatar Jan 22 '24 01:01 BlackHole1

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

Was able to reproduce the issue in Ubuntu 24.04 LTS (using latest Electron 30.0.6)

mnvr avatar May 17 '24 09:05 mnvr

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.