If I wrap a web app for mobile using Capacitor/desktop app in Electron, can I make Axios/fetch requests on the client-side without having to worry about CORS? #4781
Unanswered
ajaypillay
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I was wondering about the following:
If I develop a web app and wrap this for mobile with Capacitor, would I be able to fetch page contents of an external site from the user's end without having to hit my server first, for non-CORS enabled sites?
Does the same rule apply if I do this with Electron?
You can't do this traditionally unless the external site allows for CORS, so you'd have to use a proxy or some other fancy method to bypass this.
Basically I have an idea of something to develop, and because the data I'm parsing requires me to fetch raw HTML of a page (there's no API either) and CORS isn't enabled, I need to use a proxy to do this. So what I have in mind is to have the publicly available web version of this be less performant since I'll need to queue requests from every client, and if this is a non-issue if wrapped in Capacitor for mobile or Electron for desktop, then there'll be the option to use a more powerful version if it's downloaded if the user wishes not to be bogged down by this queue.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions