neutralinojs / neutralino.js

JavaScript API for Neutralinojs

Home Page:https://neutralino.js.org/docs/api/overview

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

native mode curl integration in neutralino or fetch with cors disabled

tridoxx opened this issue · comments

hello, I hope you are well, I would like to know if in the future you are thinking of integrating something like javascript fetch, natively, with cors disabled, since I would like to develop using this framework, and it generates cors errors, another way is to integrate curl, in a way something like neutralino.app.curl or neutralino.app.fetch . Or I would like to know how much it would cost in money to contribute so that they can do this as a priority. I'm waiting for your answers

I agree. But rather I think two cases can be considered:

Option 1: Custom API

Rather, than disabling cors, maybe it should be a c++ wrapper around curl or some request package, that is exposed via Neutralino.app.request or some such name.

Then we have to consider additional things for the implementation:

  • are we expecting to receive/send cookies and headers as well?
  • are we expecting to set/store cookie responses received, to the client as well?
  • any other I may have missed

Option 2: Disabling the Webview Adherence to CORS

I think election has an option where you can bypass the browser cors and just send the request. Of course, it is a dangerous thing if developers do not know what they are doing, so I picture Neutralino having a section in their security page detailing the dangers around it if devs do not know what they are doing.

In both cases, this should be an option the dev will have to explicitly enable in the neutralino.config.json file.

Maybe if I knew c++ I could do the first option. We use a fork of the https://github.com/webview/webview library for the desktop app so I'll have to depend on the possibility there with them if option 2 is to be considered.