Skip to content Skip to sidebar Skip to footer

Spoofing The Url In A Webbrowser

Let's say I get the source code of some page (e.g. http://example.com). I now want to write this source code to a WebBrowser, using something like: myWebBrowser.Navigate('about:bla

Solution 1:

You could try and insert a <base> element in the head: http://www.w3.org/TR/html4/struct/links.html#edef-BASE

How to insert the tag is dependent upon the language you're using but you should aim to get the base tag directly after the <head> so that the resulting source reads:

<head><basehref="http://example.com"/>

Of course, if there is already a <base> element in the document, you should remove that.

Solution 2:

If you try to change address bar URL, browser will navigate through that, and there's nothing you can do about that.

But, in your HTML, its possible to "fake" source URL for your resources, by using <BASE> tag.

I think this is closest you can go.

Solution 3:

You can inject a <BASE> element in your code and state that the base is http://example.com

Post a Comment for "Spoofing The Url In A Webbrowser"