1
votes

I am trying to create a simple electron app, that opens Google office files from Google Drive, reads the link file and creates a new window containing that google doc page.

I can make it work, if I edit info.plist after building with electron-builder to make the app accept the file extensions '.gdoc, .gsheets and .gslides'.

Is there a smarter way that doesn't involve manually editing info.plist?

1

1 Answers

0
votes

Electron-builder is supposed to be able to do that through specifying the FileAssociation. I've read of various issues with this but haven't needed it myself yet– if it works for you, please report back.

There is also the Windows only electron-regedit node module:

"File associations, file icons & open with... for electron apps

This module allows you to register your app in the windows registry, manipulate context menus & handle native open, edit, print, preview actions ect."

However for Google drive you might be looking at registering a protocol and url scheme. There is support for that electron-packager

protocol

Array of Strings

The URL protocol scheme(s) to associate the app with. For example, specifying myapp would cause URLs such as myapp://path to be opened with the app. Maps to the CFBundleURLSchemes metadata property. This option requires a corresponding protocol-name option to be specified.

protocol-name

Array of Strings

The descriptive name(s) of the URL protocol scheme(s) specified via the protocol option. Maps to the CFBundleURLName metadata property.