electron icon indicating copy to clipboard operation
electron copied to clipboard

Using Cordova plugins with Electron platform support

Open Arxi opened this issue 3 years ago • 6 comments

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?

Arxi avatar Aug 17 '20 12:08 Arxi

I havent looked into using cordova plugins with electron, but I will add this to the future plans list.

IT-MikeS avatar Aug 27 '20 12:08 IT-MikeS

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?

xauuug avatar Dec 08 '20 02:12 xauuug

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 )

IT-MikeS avatar Dec 08 '20 03:12 IT-MikeS

Check if Cordova is installed image

ZAHHAR-ISMAIL avatar Apr 11 '21 16:04 ZAHHAR-ISMAIL

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 avatar Feb 24 '22 09:02 trackmyapp

@trackmyapp any solution for this feature.

StevePhuc avatar Sep 05 '22 04:09 StevePhuc