This repository has been archived by the owner on Sep 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Add custom fetch for Electron #218
Open
jdgjsag67251
wants to merge
8
commits into
capacitor-community:main
Choose a base branch
from
jdgjsag67251:electron
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
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>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1718da7 should remediate somewhat
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 ? |
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.