Request Headers (including CORS) Modifier

fbgpcnabikdbchnhloamemjepdmcfdak

Modifies request headers (including CORS) for development purposes! ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป This Extension is intended for developers and it modifies Request Headers, either through the extensionโ€™s main icon or via an exposed API. The API can be accessed from the console or sideloaded scripts (such as Tampermonkey), making it ideal for automated workflows. ๐Ÿ’ป The API includes enable() and disable() methods for toggling header modifications directly from the global namespace. You can also add, remove and clear either hostnames or headers, and the passed data can be strings, arrays, objects (for the headers) or arrays of objects. Methods include addHostname, addHostnames, removeHostname, removeHostnames, clearHostnames, addHeader, addHeaders, removeHeader, removeHeaders, clearHeaders. All API methods return a Promise that resolves to a boolean indicating success (true) or failure (false). The extension exposes a global API object window.requestHeaderModifier that allows you to control its functionality programmatically from your browser's developer console, a website's script (if allowed by CSP), or user script managers like Tampermonkey. All API methods return a Promise that resolves to a boolean indicating success (true) or failure (false). ๐Ÿ“– enable window.requestHeaderModifier.enable(); // Enables the header modification functionality. This will apply the currently saved rules. Returns true on success ๐Ÿ“– disable window.requestHeaderModifier.disable(); // Disables the header modification functionality. This will clear all active rules. Returns true on success ๐Ÿ“– addHostname window.requestHeaderModifier.addHostname(hostname); // Adds a new hostname to the list of target hostnames. If the hostname already exists, no change is made. ๐Ÿ”ค Parameter: hostname (string): The hostname to add (e.g., "api.example.com"). ๐Ÿ“– addHostnames window.requestHeaderModifier.addHostnames(hostnames); // Adds multiple hostnames to the list of target hostnames. Duplicate hostnames will be ignored. ๐Ÿ“– removeHostname window.requestHeaderModifier.removeHostname(hostname); // Removes a specific hostname from the list of target hostnames. ๐Ÿ”ค Parameter: hostname (string): The hostname to remove. ๐Ÿ“– removeHostnames window.requestHeaderModifier.removeHostnames(hostnames); // Removes multiple hostnames from the list of target hostnames. Hostnames not found will be ignored. ๐Ÿ“– clearHostnames window.requestHeaderModifier.clearHostnames(); // Clears all hostnames from the list, effectively disabling header modification for all domains until new hostnames are added. ๐Ÿ“– addHeader window.requestHeaderModifier.addHeader(header); // Adds a new custom request header or updates an existing one if a header with the same name already exists. ๐Ÿ”ค Parameter: header (string | object): The header to add. String format: "Header-Name: Header-Value" (e.g., "X-Custom-Auth: mytoken123") Object format: { "headerName": "headerValue" } (e.g., { "X-Client-ID": "app-123" }) // Updating an existing header (will overwrite "MyValue" with "NewValue") await window.requestHeaderModifier.addHeader("X-My-Header: NewValue"); ๐Ÿ“– addHeaders window.requestHeaderModifier.addHeaders(headers); // Adds multiple request headers to the list. If headers with the same names exist, their values will be updated. // Mixing formats and updating existing await window.requestHeaderModifier.addHeaders([ "Cache-Control: no-cache", { "X-My-Header": "UpdatedValue" }, // This will update X-My-Header if it exists ]); // Returns true on success ๐Ÿ“– removeHeader window.requestHeaderModifier.removeHeader(header); // Removes a specific custom request header by its name. The value part of the input is ignored for removal. ๐Ÿ”ค Parameter: header (string | object): The header to remove. Only the header name is considered for removal. String format: "Header-Name: AnyValue" (e.g., "X-My-Header: ignored") Object format: { "headerName": "ignoredValue" } (e.g., { "Content-Type": "ignored" }) ๐Ÿ“– removeHeaders window.requestHeaderModifier.removeHeaders(headers); // Removes multiple request headers from the list. Only the header name is considered for removal. Headers not found will be ignored. ๐Ÿ“– clearHeaders window.requestHeaderModifier.clearHeaders(); // Clears all custom request headers from the list. ๐Ÿฅท GitHub / Source - https://github.com/lvladikov/request-header-modifier-chrome-extension

Related extensions