This repository was archived by the owner on Sep 26, 2022. It is now read-only.
Add custom fetch for Electron#218
Open
jdgjsag67251 wants to merge 8 commits intocapacitor-community:mainfrom
Open
Add custom fetch for Electron#218jdgjsag67251 wants to merge 8 commits intocapacitor-community:mainfrom
jdgjsag67251 wants to merge 8 commits intocapacitor-community:mainfrom
Conversation
The default fetch method is restricted by the browser context in which the app runs. This means that all requests are subjected to CORS and other web security mechanisms. This can sometimes be a pain, so this library now uses node-fetch in Electron contexts.
jdgjsag67251
commented
Jan 7, 2022
electron/src/index.ts
Outdated
| }; | ||
|
|
||
| class FetchHelper { | ||
| private static _responses = new Map<string, Response>(); |
Author
There was a problem hiding this comment.
It is important that _getResponse (getBuffer, getText, getJson, getBlob) gets called; otherwise there could be a memory leak... The client side library will always do this, but this function is also exported to be used separately...
Contributor
|
Wow! This looks excellent. When I get some time, I'll test, approve, and merge it into the v1 branch. Thanks for your contribution 😄 |
- Added 'dispose' method(s) - Added FinalizationRegistry
|
Any updates on this ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The default fetch method is restricted by the browser context in which the app runs. This means that all requests are subjected to CORS and other web security mechanisms. This can sometimes be a pain, so with this pull-request this library now uses node-fetch in Electron contexts.