
Product
Rust Support in Socket Is Now Generally Available
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.
electron-main-fetch
Advanced tools
Use the browser
Fetch APIfrom the main process in Electron
npm install electron-main-fetch
Requires Electron 30 or later.
import fetch from 'electron-main-fetch';
const response = await fetch('https://api.ipify.org');
console.log(await response.text());
//=> '170.56.15.35'
Same options as Fetch
{
type: 'cors',
url: 'https://api.ipify.org/',
redirected: false,
status: 200,
ok: true,
statusText: 'OK',
bodyUsed: false,
headers: {
keys: [Function],
entries: [Function],
values: [Function],
get: [Function],
has: [Function],
set: [Function],
append: [Function],
delete: [Function]
},
clone: [Function],
arrayBuffer: [Function],
json: [Function],
text: [Function]
}
FetchWe don't have direct access to the body stream, so there is no body property. There are some methods that are not useful in Node.js, like formData(), redirect(), etc. Some other methods are not very cross-browser compatible, so they are less common to use.
Missing:
bodyblob()formData()error()A small difference is that our .clone() method is async.
FAQs
Use the browser Fetch API from the main process in Electron
We found that electron-main-fetch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket’s Rust and Cargo support is now generally available, providing dependency analysis and supply chain visibility for Rust projects.

Security News
Chrome 144 introduces the Temporal API, a modern approach to date and time handling designed to fix long-standing issues with JavaScript’s Date object.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.