views:

247

answers:

1

Is

<base href="http://google.com" /> 
<img src="/intl/en_ALL/images/logo.gif" /> 

supported in chrome? It works fine in firefox.

Specifically, relative image links aren't resolving to the base url.

It is for:

http://webnumbr.com/create?url=http://google.com

Tested in latest of OSX and Windows Chrome (4.0.249.78)

+6  A: 

And to answer your question about the <base> tag being supported in Chrome: it is. I created a simple HTML document:

<!DOCTYPE html> 
<html> 
  <head> 
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8"> 
    <base href="http://google.com"&gt; 
    <title>Testing base-tag</title> 
  </head> 
  <body> 
    <img src="/intl/en_ALL/images/logo.gif"> 
  </body> 
</html>

which is rendered correctly.

EDIT: PROBLEM PROBABLY DISCOVERED

I searched the Chromium bugs page for "base tag" and found two (probably the same) bugs about your problem, i.e. issue 25090 and 32134.

I suggest you file a comment in one of those (after deleting the forbidden end tag of <base>) and hope this problem is resolved soon.

EDIT 2: I made another test case and commented in this bug report.

EDIT 3: Bug seems to be resolved after upgrading to Chrome 4.0.249.89.

Marcel Korpel
Ok, then do you have any idea why my page doesn't render the image (in the Chrome version posted?)
Paul Tarjan
The only thing I can see is that the image url, according to Developer Tools, resolves to "chrome://devtools/intl/en_ALL/images/logo.gif" instead of "http://www.google.com/intl/en_ALL/images/logo.gif".
Marcel Korpel
If I click "Inspect" and go to "Properties" and "HTMLImageElement" it lists the src as "http://webnumbr.com/intl/en_ALL/images/logo.gif" and the baseURI as "http://webnumbr.com/create?url=http://google.com". But for your test page, it is correctly setting the base to be "http://google.com".
Paul Tarjan
problem is 100% solved in .89. I guess I don't have to hack around it after all! Thank you so much for your help, here's an upvote :)
Paul Tarjan