Adding Headers to Particular Domains in Edge and Chrome Kiosk Mode on Authenticated Machines
In this article, we will discuss how to add headers to particular domains in Edge and Chrome when using Kiosk mode on authenticated machines. This is a common request for organizations that want to restrict access to certain websites while still allowing access to specific resources.
Why Add Headers to Particular Domains?
Adding headers to particular domains can be useful for a number of reasons. For example, it can be used to enforce security policies, such as requiring the use of HTTPS for all connections to a particular domain. It can also be used to set caching policies, such as requiring that all content from a particular domain be cached locally.
How to Add Headers in Edge
In Edge, headers can be added to particular domains using Group Policy. To do this, follow these steps:
- Open the Group Policy Editor.
- Navigate to
Computer Configuration > Administrative Templates > Windows Components > Microsoft Edge. - Double-click on
Allow adding headersand set it toEnabled. - Click
Showand enter the name of the header and its value. - Click
OKto save the changes.
Once this policy is enabled, headers will be added to all requests made to the specified domains.
How to Add Headers in Chrome
In Chrome, headers can be added to particular domains using the chrome.webRequest API. This API allows you to intercept and modify requests before they are sent to the server. To use this API, you will need to create a Chrome extension.
Here is an example of how to use the chrome.webRequest API to add a header to requests made to a particular domain:
chrome.webRequest.onBeforeSendHeaders.addListener(
function(details) {
for (var i = 0; i < details.requestHeaders.length; ++i) {
if (details.requestHeaders[i].name === 'User-Agent') {
details.requestHeaders[i].value = 'My User Agent';
break;
}
}
return {requestHeaders: details.requestHeaders};
},
{urls: ['']},
['blocking']);
In this example, the User-Agent header is being modified for requests made to example.com. You can modify this example to add other headers or to match requests made to other domains.
Using Kiosk Mode
Kiosk mode is a special mode of operation for Windows and Chrome that allows you to restrict access to the system. In Kiosk mode, users are unable to access the desktop or other applications. This can be useful for public computers or for devices that are used for a single purpose.
To use Kiosk mode in Windows, follow these steps:
- Open the Settings app.
- Navigate to
System > Multi-tasking. - Turn on
Allow multiple appsandSet up a kiosk. - Select the app that you want to use in Kiosk mode.
To use Kiosk mode in Chrome, follow these steps:
- Open the Chrome browser.
- Navigate to
chrome://flags. - Search for
kioskand enable theEnable Kiosk Modeflag. - Restart the browser.
- Use the
--kioskcommand-line switch to start the browser in Kiosk mode.
- Adding headers to particular domains can be useful for enforcing security policies and caching policies.
- In Edge, headers can be added using Group Policy.
- In Chrome, headers can be added using the
chrome.webRequestAPI. - Kiosk mode can be used to restrict access to the system in Windows and Chrome.