ITADN

open(url) fails on Fedora linux 42 due to bundled xdg-open script

#359Openrschili 创建于 2025-06-04
R
rschilicommented
The open package comes with a bundled xdg-open script. This script does not work on Fedora 42. Not sure what the problem is, but comparing against the local /usr/bin/xdg-open script I see a lot of differences. Calling the bundled script will just do nothing. There is a check in baseOpen(): ```js // Check if local `xdg-open` exists and is executable. let exeLocalXdgOpen = false; try { await fs.access(localXdgOpenPath, fsConstants.X_OK); exeLocalXdgOpen = true; } catch {} const useSystemXdgOpen = process.versions.electron || platform === 'android' || isBundled || !exeLocalXdgOpen; command = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath; ``` The useSystemXdgOpen is false because execute permissions for the bundled script are granted. The promise returned by open() seems to never resolve because of this. If I instead remove the execute permissions from the bundled script, the code snippet will start using the system's xdg-open which works fine. Not sure about the reasoning for bundling the script with this package. In this case it seems to do more harm than good. I can provide my local xdg-open script if needed for comparison. There quite many differences, so I'm not sure if this is designed to work on any system.
0 条评论