admin管理员组

文章数量:1126295

I'm trying to intercept network requests to certain domains for the entire device (only care about mac for now), not just within the electron app.

For instance, if a user goes to safari and tries to go to tiktok, they will be redirected or have the request blocked completely. Is this not possible with Electron's existing apis?

I'm trying to intercept network requests to certain domains for the entire device (only care about mac for now), not just within the electron app.

For instance, if a user goes to safari and tries to go to tiktok.com, they will be redirected or have the request blocked completely. Is this not possible with Electron's existing apis?

Share asked Jan 8 at 23:20 Peter LimPeter Lim 536 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Electron does not support intercepting network requests issued by other applications as such. It does provide some APIs like protocol that can be used to intercept network requests within the Electron application only.

That being said, Electron let's you use all Node.js APIs, including the child process API, which can be used to execute shell commands and run other applications installed on the same system. This way, you may be able to set up a local proxy server to intercept HTTP requests or change the firewall settings to block outgoing connections.

本文标签: Electron JSaccess device network requestsStack Overflow