# How do I set a Referer (HTMLViewer) ?

**URL:** <https://forum.xojo.com/t/how-do-i-set-a-referer-htmlviewer/24005>\
**Category:** General\
**Created:** [May 3, 2015, 11:22am UTC](https://forum.xojo.com/t/how-do-i-set-a-referer-htmlviewer/24005 "2015-05-03T11:22:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [May 3, 2015, 11:22am UTC](https://forum.xojo.com/t/how-do-i-set-a-referer-htmlviewer/24005/1 "2015-05-03T11:22:11Z")

</div>

I saw in the docs how to set a UserAgent, but failed to get the way to set a `Referer` in a `HTMLViewer`.

Is it possible within Xojo ?

---

<div class="post-metadata">

**Author:** ![Ashot\_Khachatryan](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/5fc32e/32.png) [@Ashot\_Khachatryan](https://forum.xojo.com/u/Ashot_Khachatryan)\
**Post date:** [May 3, 2015, 12:07pm UTC](https://forum.xojo.com/t/how-do-i-set-a-referer-htmlviewer/24005/2 "2015-05-03T12:07:44Z")

</div>

Xojo’s HTMLViewer is very limited, you cannot add custom Internet Headers.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [May 3, 2015, 12:29pm UTC](https://forum.xojo.com/t/how-do-i-set-a-referer-htmlviewer/24005/3 "2015-05-03T12:29:30Z")

</div>

I found an answer using JavaScript that compiles, but I do not know if it really works, yet:

`delete window.document.referrer;
        window.document. __defineGetter__ ('referrer', function () {
            return "yoururl.com";
        });`

BTW: I just noticed that referer is noted referrer and since I do not have Xojo handly

I put the above JavaScript into a string and called it using HTMLViewer1.ExecuteJavaScript (from memory).

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:44pm UTC](https://forum.xojo.com/t/how-do-i-set-a-referer-htmlviewer/24005/4 "2020-10-29T17:44:33Z")

</div>


