JavaScript
--
Questions
--
Followers
Top Experts
I would prefer that the 'referer' field be blank in the visited web access logs. Â I understand that in the parent web page I can specify the HTTP_REFERER and the value I specify will show up as the 'referer' in the web access log, not the URL of the parent page. Ideally, I would like that value to be blank.
Note that when a user types a URL into the 'Address' field of his browser, the 'referer' value is blank in the web access log of the visited site. That is what I am trying to achieve when the visit to the site was caused by a link on the parent page.
I have no control over the pages visited or their log formats as they could be anywhere on the web.
Thanks
Sam G
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
<a href="http://www.abcd.com/anypage.html">Click here</a>
or
<a href="http://www.abcd.com/anypage.html"><img src="SomeImage.gif"</a>
then change your href to
<a href="#" onclick="GoToSite('http://www.abcd.com/anypage.html')">Clic
and have a function
<script language="javascript">
function GoToSite(URL)
{
  location.href = URL; // If you open the linked page in the current window;
  //window.open(URL, "NewWindow"); // If you open the linked page in the new window;
}
</script>
This way the linked site will not receive the HTTP_REFERER.
<a href="#" onclick="GoToSite('http://www.abcd.com/anypage.html')">Clic
to
<a href="#" onclick="GoToSite('http://www.abcd.com/anypage.html');return false;">Click here</a>
in the last post.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
<a href="http://www.abcd.com/anypage.html" onclick="self.location.hre
easily added to an existing link, and it gives the usual advance indication of where the user is going in the status line.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
So here is the script I use to GET the HTML of the target page, and it is this action that always sends the 'referer' to the visited server's access log: Â
childWindow[i] = window.open("",thisWindowN
var xmlHttp = new ActiveXObject("MICROSOFT.X
xmlHttp.open("GET", targetURL, false);
xmlHttp.send(null);
Then the ResponseText is written to childWindow[i] to display the page
What I notice, is that if I open the target URL using a normal 'window.open', no referer is logged in the access log of the visited server. Referer is blank, as if I typed the URL into the 'Address' of the browser. This is the bahavior that I am trying to make happen when I retrieve using ActiveX as above.
I keep reading snippets about how you can set the 'referer' for a web page using HTTP_REFERER in the HEAD, and that value will appear in the web access logs of any visited sites, not the actual Address of the page. However, it's not clear to me how or where you set that variable.
Thanks again.
Sam G
xmlHttp.setRequestHeader("
but this doesn't work.
http://www.perfectxml.com/msxmlAnswers.asp?Row_ID=61






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
Is there a way to see the exact header that is constructed and sent to the server? That way we may be able to figure out how the Referer information is sent (or not).
Sam
sorry.
The only reason I can think of is if you wish to hide your site from a third party you are taking content from (thereby breaching their copyright). Â If so you should probably check the member guidelines.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
<?php       // file named  redirect.php
header( "Location: "Â .$_GET['file'] );
exit;
?>
and your link rewritten as:
<a href="redirect.php?file=http://somesite.com/path/page.html">
Have you the resources to test something like that ?
JakobA, this header is not set if we do a location.href="http://SomeSite.com/Somepage.html" so what you have believed is true. It is only that this object is somehow not allowing to reset the header.
I want to hide the referer because most of the linked sites are the worst kind of junk merchants (which I am NOT promoting, quite the opposite), and they could use the referer to go back to the web page on which resides my email address. I can't just do a normal window.open because any script in the opened page would execute and create a mess of pop-ups or worse.
Sam






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
This question is becoming very weird :-))
If your email address is in clear text on a page then address harvesting bots will find it. Trying to hide a link isn't going to do much good. Try a decent spam filter instead. I get very good results from Spam Assassin.
Please help me find a way to block the referer! According to all that I read it should be possible, and in fact, security is enhanced when a website does not know if a person came direct or through a link in another page. Why should any website know about any other pages that I have visited?
Weird Sam

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
best JakobA
There are plenty of reasons, but if you want to stop sites finding out where YOU came from then configure your browser not to send a referrer or filter it out with a proxy server.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
I performed a small test that proved that the Referer value sent to the server is an identical copy of the string in the Address bar of IE. For example, if my site is 'http://MyMainSite.com', and I change it to 'http://MyMainSite.com#MiddleOfPage', then the value of Referer in the web access log is 'http://MyMainSite.com#MiddleOfPage'. I guess that's not too startling, is it?
However, is there a way in which we can change the location value of the parent window without causing it to do a reload? If so, then we could change location to, for example, blank before the GET and then change it back to the correct value after the HTML is loaded. Whenever I have tried this, IE immediately reloads upon a change of location and screws everything up. Is there a way to set location and supporess reload, just while the GET is being executed?
Sam
I just know there has to be a way to do it, but clearly it isn't obvious!
Thanks for your persistence,
Sam

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
makeSafe.php
<?
$url = $HTTP_GET_VARS['url'];
header("Location: $url");
?>
and create your links like this:
href="http://somewhere.com/makeSafe.php?url=http://www.site.net/"
I can't see why it wouldn't work even with your special controls in ActiveX;
You could make your "window.open" related function add this prefix (....makeSafe.php) to each href passed as argument;
Any progress with that?
// I tested this on both by local and external server supporting php and it worked...
Put this code in a .vbs file
set xmlHttp = CreateObject("Microsoft.XM
call xmlHttp.open("GET", "http://AnySite", false)
call xmlHttp.setRequestHeader("
call xmlHttp.send()
responseText = xmlHttp.responseText
MsgBox(Right(responseText,
and you will see that the referer is changed.
In the parent page, I created a function in VBscript:
<SCRIPT LANGUAGE="VBScript">
Function getHTML(targetURL)
 set xmlHttp = CreateObject("Microsoft.XM
 call xmlHttp.open("GET", targetURL, false)
 call xmlHttp.setRequestHeader("
 call xmlHttp.send()
End Function
</SCRIPT>
Then I called the function from JavaScript, also in the parent page. And again the location of the parent window was sent as the referer.
I found a mention on some other website that "NONE" was a special vlaue that would suppress the referer, but it comes through no matter what. I tried several other values, including real URLs and "".
This is a very persistent problem!
Sam






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
I think we're getting there!
Thanks
Sam
1. I could understand IE preventing the assignment of another domain to Referer, since it would allow JavaScript to pin the "blame" for a referral on a totally uninvolved domain. However, it should be possible to BLOCK sending the Referer in JavaScript, since that would add to privacy by preventing the server discovering the visitor's recent browsing history.
2. If JavaScript uses 'window.open', then no Referer is sent. Why should one method block the Referer and another method make it impossible to block the Referer?
Of course, it isn't the first time that Microsoft has left glaring contradictions and inconsistencies in its products ;-(
I see 2 possibilities, although I don't know how to do either:
1. Could server-side JavaScript or VBscript help us? I am completely ignorant in this area, but I could learn quickly.
2. Could I donwload a .VBS file along with the web page, and execute it from within IE so that it is able to create a null Referer as above?
I know we'll solve this probelm, since we are not trying to do anything that is fundamentally pernicious.
Thanks
Sam

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
I found a Microsoft article that seems to comtradict what we are seeing here:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q178066&
The article states "This prevents local file names from being sent inadvertently to Web servers when linking from local content to Web sites that might snoop on such information." And yet when I go from my web page on local hard disk to the server, I see the entire path to the file in the Referer field ("file://C:\\Documents%20a
Can anyone make any sense of this?
Sam
1. The website is running on Linux/Apache, which I assume means that I don't have IIS. Is that correct? I can relocate to an NT/IIS server if necessary.
2. I am not familiar with ASP (although by tonight I will be!). How do I run the server-side ASP script from client-side JavaScript? How do I pass parameters to it, such as the target URL? How do I know when it has completed its job and I can advance to the next URL?
I'll start working on this approach and let you know what happens.
Cheers,
Sam
2) Learning ASP is not that big a deal but I am not sure if that would really help you in what you are trying to do.
Whatever you use for server side ASP/JSP/Perl/PHP..., please note that all server side script does is to produce HTML. The only difference is that it can change that HTML in each request. So a simple server side script like
<html>
<body>
...
My name is <% =GetMyName() %>.
...
</body>
</html>
will call GetMyName function and get the name from database/file or compute it (if it can!) and then generate
<html>
<body>
...
My name is Generated Name.
...
</body>
</html>
which it will send to the browser. So you do not call server side script from client side or vice versa. All server side script do is to generate HTML (and may be javascript code also) at run time. I hope I gave you enough insight of how server side script works and now it is up to you to decide if it can help you in doing what you are doing. Generally every solution involves a good mix of server side and client side scripting.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
I'll let you know what happens.
Please let me know if you have any more ideas.
Cheers
Sam
I am now struggling with getting the ASP child window to tell the parent window when it has finished GETting all the HTML. However, the big problem has been solved.
Thanks again.
Sam
JavaScript
--
Questions
--
Followers
Top Experts
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.