capacitor-community / electron

Deploy your Capacitor apps to Linux, Mac, and Windows desktops, with the Electron platform! 🖥️
https://capacitor-community.github.io/electron/
MIT License
338 stars 59 forks source link

Using Cordova plugins with Electron platform support #51

Open Arxi opened 4 years ago

Arxi commented 4 years ago

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:

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?

IT-MikeS commented 4 years ago

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

xauuug commented 3 years ago

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?

IT-MikeS commented 3 years ago

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 )

ZAHHAR-ISMAIL commented 3 years ago

Check if Cordova is installed image

trackmyapp commented 2 years ago

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?

StevePhuc commented 2 years ago

@trackmyapp any solution for this feature.