electron
electron copied to clipboard
Using Cordova plugins with Electron platform support
I have a cordova plugin which supports electron platform, together with android and ios platforms. The plugin has electron entry in its plugin.xml and a source file in ./src/electron folder.
When I do
npx cap sync
the sync correctly recognizes this cordova plugin for android and ios and copies it to the appropriate folders in native projects:
-
./android/capacitor-cordova-android-plugins/
for android, and -
./ios/capacitor-cordova-ios-plugins/
for ios.
However, no such thing happens for electron, nothing is copied as far as I can tell. I also tried
npx cap sync @capacitor-community/electron
but the cordova plugin isn't copied either.
When I try
npx cap ls
a part of the output says [info] Listing plugins for electron is not possible
.
Is this feature implemented, or is it even possible to implement?
I havent looked into using cordova plugins with electron, but I will add this to the future plans list.
Any progress related? I wanted to make an application that would list and give the user the possibility to open the file through the app, it would use this plugin (supports electron), do you know if there is another way for me do this with the electron capacitor?
Any progress related? I wanted to make an application that would list and give the user the possibility to open the file through the app, it would use this plugin (supports electron), do you know if there is another way for me do this with the electron capacitor?
You could use electron API's directly (see https://www.electronjs.org/docs/api/dialog) or a capacitor plugin ( see https://capacitorjs.com/docs/apis/filesystem )
Check if Cordova is installed
According to the cordova docs it would be possible to also use cordova plugins that support the browser.
All browser-based plugins are usable with the Electron platform. I'm using different cordova plugins with capacitor that would also support the browser. eg.:https://www.npmjs.com/package/cordova-plugin-advanced-http https://www.npmjs.com/package/cordova-plugin-inappbrowser
I have to use the cordova plugins because the capacitor plugins that are similar don't have the functionalities I need. @IT-MikeS or somebody Do you know if it would be easier to create a hook to use this cordova plugins with capacitor electron. Or is it better to just use the electron API's directly? And is there some Docs you could point me where I could maybe find an answer myself?
The docs for creating an electron plugin just explain it for capacitor plugins. Would the same workflow be possible for cordova plugins used with capacitor?
@trackmyapp any solution for this feature.