nice. Satyr: Is your solution general or does it have many ellements specific for the example-page
On 31 Mar, 12:26, Christian Sonne <[email protected]> wrote: > Indeed - when I saw your first message, I remembered that I'd had this > particular problem myself a few times, and always just solved it (using a > similar approach to that which satyr later posted) - so I'll be pushing a > similar, but slightly more advanced solution to CmdUtils - expect it to land > in the next development (0.2pre26) > > Best regards > -- cers / Christian Sonne > > On Tue, Mar 31, 2009 at 12:22 PM, Henrik Marstrander > <[email protected]>wrote: > > > > > Thanks alot. I sense that this is something coming in future > > releases... > > > On 31 Mar, 11:42, satyr <[email protected]> wrote: > > > On Tue, Mar 31, 2009 at 4:22 PM, Henrik Marstrander <[email protected]> > > wrote: > > > > > Made this preview based command for news from "volvo ocean race" > > > > When I move the mouse over "read full story" I see there is a link, > > > > but it when you press it it doesn work (you get this url > > > > file:///news/article/2009/March/30-RIO-PUMA-JOB-LIST/index.aspx) > > > > Any idea how this may be fixed. I have the same problem in all my > > > > preview-commands > > > > That's because the links/images have relative paths. > > > You have to fix them manually (for now) like this: > > > > const URL = "http://www.volvooceanrace.org/"; > > > function abspath() { > > > var attr = this.hasAttribute("src") ? "src" : "href"; > > > var path = this.getAttribute(attr); > > > if(/^[a-z]+:/.test(path)) return; > > > this[attr] = URL + (path[0] === "/" ? path.slice(1) : path);} > > > > CmdUtils.CreateCommand({ > > > name: "volvo-news", > > > preview: function(pblock) { > > > jQuery.get(URL, function(html) { > > > pblock.innerHTML = ""; > > > jQuery(".hometeaser:nth(0)", > > html).find("a,img").each(abspath).end() > > > .appendTo(pblock); > > > }); > > > pblock.innerHTML = "First thumbnail from wists"; > > > }, > > > execute: function() { > > > Utils.openUrlInBrowser(URL); > > > } > > > > }); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
