Hehe, yea, I know. I don't think manually adding a <BASE/> tag will work as expected at this point - since the "preview block" that's passed to the preview() function is just a DOM node (a <DIV/>) rather than a whole document. So while another command's preview will replace the preview content, it won't replace the <BASE/> tag in the header. So you'll end up getting command previews that have a base URL of some other command's preview.
One method I've successfully used is to parse any generated HTML code, and manually fix up any relative URLs. Here's the block of code I've used: http://pastebin.mozilla.org/614908 Some things aren't ideal. For instance, it relies on the current tab having a HTML document (not necessary guaranteed). As you can see, I haven't touched this code for awhile - it still has the old bug tracker URL. Anyway, hope that helps. - Blair On 3/02/2009 2:54 AM, amau96 wrote: > Any other way? "because one day we will ..." could be a long time :p > > > On Feb 2, 6:06 am, Blair McBride<[email protected]> wrote: >> Hopefully one day we'll get a simple API to do this automatically. >> >> See:http://ubiquity.mozilla.com/trac/ticket/356 >> >> - Blair >> >> On 2/02/2009 9:56 AM, satyr wrote: >> >>> The easiest way would be to use the BASE element. e.g.: >>> pblock.innerHTML = '<base href="http://url.of.your/choice/"/>'+ htm; >>> On Feb 2, 4:00 am, amau96<[email protected]> wrote: >>>> In my code, I use jquery to get html from a page and insert it by >>>> inner html in the preview part of ubiquity. >>>> The probleme is some link are relative, like<a href="/mypage/ >>>> look.txt">, so when I click on the link the url look like that : >>>> chrome://ubiquity/mypage/look.txt >>>> What can I do to fix this, to replace chrome://ubiquity bye the url >>>> of my choice? >>>> thanks > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ubiquity-firefox" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/ubiquity-firefox?hl=en -~----------~----~----~----~------~----~------~--~---
