How Do I Make My Electron App The Default For Opening Files?
I am making an electron app with which the user can edit .txt files. I was wondering if it was possible to make the app the default app to open .txt files with... do I add somethin
Solution 1:
You'll want to look at the electron-builder config, specifically fileAssociations.
Nutshell:
fileAssociations
allows setting ext
, which you'd set to txt
IIRC. You can also provide a descriptive name
, give it icons, and several platform-specific options.
Unrelated, but this took about a minute of searching. For reference:
- Googled for "electron app make default for opening a type of files"
- Found an Electron issue that looked promising.
- Scrolled to a reference to electron-builder, which fit your question nicely.
- Made clicky on the links, made sure it was reasonable.
- Didn't test because on wrong laptop, but seems legit.
Post a Comment for "How Do I Make My Electron App The Default For Opening Files?"