A script running on a webpage has no general setting that changes the browser's outgoing proxy. A browser extension can have additional permissions, but it runs under a different security and configuration model.

This distinction gets lost in old forum answers. Code using privileged Firefox internals, legacy extension modules, or abandoned add-on SDKs was never an ordinary webpage API. Pasting such a snippet into a page cannot grant those privileges.

Use the browser's extension API

A Firefox extension can use the documented proxy.settings API with the required permissions. Chrome exposes its own proxy extension API. Their configuration models differ; check the manifest requirements and supported settings for the browser you target.

An extension should also account for policies or other extensions controlling the same setting. A successful API call is not a reason to assume every destination now follows the route you intended. Inspect the resulting configuration and preserve the user's ability to restore it.

Changing a fetch URL changes the destination

A webpage can call an application server that forwards a request on its behalf, subject to the browser's web rules. In that design the browser connects to that application server. It has not installed a general browser proxy or changed the route used by unrelated tabs.

Similarly, sending a header with another IP address does not change the source address of the connection. A destination may interpret trusted forwarding metadata according to its own policy, but the network path is a separate fact.

If your goal is an IP-changing proxy for browsing, choose a suitable entry from the free proxy list and configure a supported browser proxy or an authorized extension. If your goal is one web application's remote fetch, design that feature around its actual server and browser boundaries.

Artihkkalat mat laktásit