How to open file/url in external app #306

Open
opened 2026-01-29 16:36:09 +00:00 by claunia · 0 comments
Owner

Originally created by @robalexclark on GitHub (May 10, 2019).

Originally assigned to: @GregorBiswanger on GitHub.

I'm trying to open pdfs and external urls in the default browser for both applications (not within the electron app). I researched and found that there might be a way using the electron shell:

const shell = require('electron').shell;
shell.openItem("https://www.google.com");

But the about does not work 'require is not defined' I appreciate I am probably missing something fundamental here! How do you access the electron js functions from your own js files?

Originally created by @robalexclark on GitHub (May 10, 2019). Originally assigned to: @GregorBiswanger on GitHub. I'm trying to open pdfs and external urls in the default browser for both applications (not within the electron app). I researched and found that there might be a way using the electron shell: const shell = require('electron').shell; shell.openItem("https://www.google.com"); But the about does not work 'require is not defined' I appreciate I am probably missing something fundamental here! How do you access the electron js functions from your own js files?
claunia added the question label 2026-01-29 16:36:09 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#306