Add support for <base> tag

If impossible to remove base tag from the document, one can add the following lines to add support for base tag.