Re: How to make a remote XMLHttpRequest in an add-on? - Mozilla

This is a discussion on Re: How to make a remote XMLHttpRequest in an add-on? - Mozilla ; On Feb 12, 7:50*am, Gijs Kruitbosch wrote: > On 12/02/2010 13:03 PM, Benjamin Thompson wrote: > > > On Jan 28, 11:19 am, Benjamin Thompson *wrote: > >> I have searched for months and have exhausted myself on the available ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: How to make a remote XMLHttpRequest in an add-on?

  1. Re: How to make a remote XMLHttpRequest in an add-on?

    On Feb 12, 7:50*am, Gijs Kruitbosch wrote:
    > On 12/02/2010 13:03 PM, Benjamin Thompson wrote:
    >
    > > On Jan 28, 11:19 am, Benjamin Thompson *wrote:
    > >> I have searched for months and have exhausted myself on the available
    > >> tutorials on the web. For the life of me I can't get a Firefox add-on
    > >> to fetch remote XML data. Am I just not understanding the tutorials?
    > >> How can I get past the security barriers and actually transfer remote
    > >> information into something like a sidebar?

    >
    > >> Can anyone point me in the right direction? I'm tearing my hair out
    > >> here.

    >
    > > Is this really such an arcane topic that nobody knows an answer for
    > > this?

    >
    > I don't understand your question. Is XMLHttpRequest too hard to use?
    >
    > https://developer.mozilla.org/en/XMLHttpRequestis in the top 10 google hits,
    > and links tohttps://developer.mozilla.org/En/Using_XMLHttpRequestwhich
    > explains how to use it in an add-on (the same way you would otherwise, basically).
    >
    > You vaguely refer to "security barriers". I don't have a crystal ball anddon't
    > know what you mean. Please be specific (eg. "I use the code listed here:http://pastebin.mozilla.org/1234567and get error 'foo', is there some way to
    > fetch page X in context Y so I don't get error 'foo'?")
    >
    > I should note that your previous message can't be found by my newsgroup client,
    > so that will probably be related to the lack of responses. Furthermore, this is
    > a question for mozilla.dev.extensions, copying them and setting Followup-To: header.
    >
    > ~ Gijs


    You have accurately named the pages that show up in a Google search. I
    have read these repeatedly and as far as I can tell they do not
    discuss fetching an XML file that lives in another domain in the
    context of an add-on (referred to as "remote" unless I've been
    misinformed). Unless I have completely misunderstood these tutorials
    (a distinct possibility), XMLHttpRequest is only made for fetching
    intra-domain files. Following the directions in these tutorials has
    only resulted in null XMLHttpRequest objects from the remote URL(s) I
    am trying to fetch XML from.

    Thank you for pointing me toward the correct forum, and for pointing
    out the pastebin tool. Both should be very useful.

  2. Re: How to make a remote XMLHttpRequest in an add-on?

    To be excruciatingly specific, I'm trying to fetch book details from
    the Betterworldbooks.com site so that I can display that information
    in a sidebar. The example XML I'm trying to fetch and parse can be
    found here: http://www.betterworldbooks.com/serv...=9781577314806

    The Javascript I'm starting with, just to test whether I'm
    successfully getting the data, can be found here: http://pastebin.mozilla.org/702614

    The alert only produces the message "undefined." I very much want the
    alert to read "The Power of Now". Once I can get it to do that, I will
    have what I need to build the rest of the extension, but so far this
    is stopping me.

    Everything I've read about XMLHttpRequest suggests to me that
    requesting cross-domain data is against the security rules of Firefox.
    I know numerous add-ons fetch and manipulate data from online sources,
    so I know it must be relatively simple but for some reason I am
    completely stumped.

+ Reply to Thread