Make browser submit additional HTTP-Header if click on hyperlink
The only modern 'sane' option here is to use a ServiceWorker.
A ServiceWorker can intercept HTTP requests for a domain you control and decorate it with more headers.
A ServiceWorker works 'outside' of a browser tab, and if multiple tabs are open with the same website, the same serviceworker will be used for all of them.
A full tutorial on how to accomplish that is definitely too much for this answer box, but intercepting and doing stuff with HTTP requests is a big use-case, so off-site sources will usually have this as an example.
I would say that this is kind of a bad idea. If you think you need this, maybe you can handle this in a different way. A common way to do this might be using cookies instead.
Adding http request header to href link with coldfusion
Try this:
<cfset httpResult = ReplaceNoCase(httpResult, '<a href="', '<a href="http://theddomain.com/', 'all')>
Add authorization header to clicked link
You can't use interceptors. Clicked link will be processed by browser request, not the system. You need attach click event handler ( with event.preventDefault() method ) to this link and send get request with your own function. Which will add headers to the request
Can we add http response headers directly into html pages
You can use meta
to replicate some of these. Normally not the ideal solution, but look into the http-equiv
attribute of meta
tags. I believe a lot of these have been deprecated in newer browsers.
Examples:
<meta http-equiv="Cache-control" content="no-cache"/>
<meta http-equiv="X-Frame-Options" content="sameorigin"/>
<meta http-equiv="pragma" content="no-cache"/>
How set HTTP *Request* header programmatically (e.g. by a -tag, link -tag, or by JavaScript)?
The XMLHTTPResponse setRequestHeader() method can be used to set HTTP request headers for an AJAX request. Various JavaScript libraries expose this function in different ways. For example, with jQuery.ajax() you would set the headers
property of the settings parameter.
Set request header of a link
Hyperlinks can not hold header information.
You may be able to set headers for an AJAX request, assuming the security conditions are met (same domain or CORS).
Take a look at the jQuery AJAX reference to learn about sending an ajax request with headers
Related Topics
Css: Stretching Background Image to 100% Width and Height of Screen
Any Way of Using Frames in HTML5
How to Make a Sticky Footer Using Flexbox in Ie11
Line Height Issue with Inline-Block Elements
How to Set the Thumbnail Image on HTML5 Video
Automatically Open <Details> Element on Id Call
How to Apply CSS Stylesheet to Single Specific Element
How to Make an Upvote/Downvote Button
Absolutely Positioned Div on Right Causing Scrollbar When the Left Doesn'T
Why Is a Div Longer Than Several Spans with the Same Content (Only in Chrome)
Set Maxlength in HTML Textarea
How to Change Content on Hover
Different CSS for Each Browser
Open a Direct File on the Hard Drive from Firefox (File:///)
Google Web Fonts and PDF Generation from HTML with Wkhtmltopdf
Make Flex Item Wrap to the Next Row with Following Items Continuing the Flow