Use the browser Fetch API from the main process in Electron
by sindresorhusJavaScript
Last 12 weeks · 0 commits
4 of 6 standards met
I couldn't make it work exactly the same as , as the object isn't transferred correctly through the Electron IPC. I need to figure out why. Could also maybe use a to imitate the object. Would be really nice if it worked exactly the same. Help welcome :) Electron issue: https://github.com/electron/electron/issues/9563 IssueHunt Summary lukks has been rewarded. Backers (Total: $60.00) issuehunt ($60.00) Submitted pull Requests #3 Like fetch Tips Checkout the Issuehunt explorer to discover more funded issues. Need some help from other developers? Add your repositories on IssueHunt to raise funds.
Repository: sindresorhus/electron-main-fetch. Description: Use the browser Fetch API from the main process in Electron Stars: 36, Forks: 3. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v2.0.0 (1y ago). Open PRs: 0, open issues: 0. Last activity: 1y ago. Community health: 71%. Top contributors: sindresorhus.
Fix #1. It was difficult to do real tests due /stdout behaviour, instead I did a complete example file and I also let commented a test example at the end. The POC #2 was ok but has some problems, for example, keeping the references of all the object responses forever, bodyUsed never re-updated, fails if you do double fetch without await, etc. I say all that because it's what I noticed that should be fixed. I hope this is aimed towards your goal :) IssueHunt Summary Referenced issues This pull request has been submitted to: #1: Make it work exactly like Fetch IssueHunt has been backed by the following sponsors. Become a sponsor
This is purely a proof of concept and requires quite a bit of code cleanup IMO including some thinking around having long living browserwindows as the response objects need to live in a renderer process in order to fetch their contents later. Refs #1