Permission denied to call method XMLHttpRequest.open

Discussion in 'Javascript' started by Une Bévue, Oct 23, 2006.

  1. Une Bévue

    Une Bévue Guest

    bon he voudrais m'essaye à écrire un widget, qui n'est autre qu'une page
    html faisant appel à XMLHttpRequest.

    pour l'instant mon Man_wgdt n'est qu'une co^pie du widget RDoc (pour
    documentation rubyà mon Man en serait l'équivalent pour le man/*nox,
    donc MacOS X.

    à part des erreur sur display que m'indique la console javascript :
    Error: Error in parsing value for property 'display'. Declaration
    dropped.
    Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.html
    Line: 0

    je ne pige pas car j'ai mis les displays dans la feuille css idoine,
    passons.

    Peut-être un bête pb de cache ???

    Mais, le problème rédibitoire et que j'ai droit à :

    Error: Error in parsing value for property 'opacity'. Declaration
    dropped.
    Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.html
    Line: 0

    qu'est-ce que ça signifie exactement ?

    je précise que je fais mes essais da,s mon répertoire ~/Sites donc les
    pages sont servies par Apache.

    au cas où qq'un aurait un tuyau...

    la page en question est là :
    <http://yvon-thoraval.com/Widgets/Man_wdgt/Man.html>

    je précise aussi que pour XMLHttpRequest je n'ai rien fait de spécial au
    niveau des ports, il n'y a pas grand chose d'ouvert à part 80, email
    in/out et telnet.
    Une Bévue, Oct 23, 2006
    #1
    1. Advertising

  2. Une Bévue

    Une Bévue Guest

    Une Bévue <> wrote:

    > on he voudrais m'essaye à écrire un widget, qui n'est autre qu'une page
    > html faisant appel à XMLHttpRequest.


    <snip french blahblah />

    > je précise aussi que pour XMLHttpRequest je n'ai rien fait de spécial au
    > niveau des ports, il n'y a pas grand chose d'ouvert à part 80, email
    > in/out et telnet.


    i do apologize for my mistaken post, here is the english version.

    i'm running under MacOS X and want to design a widget being, basically
    html+js+images.

    then in norder to trys it i put in a directory served by Apache.

    to simplify my task of starting with widgets i did a cut'n paste of the
    RDoc's one (stands for Ruby doc) mainly because i want to exercice doing
    an equivalent of it but ratger for man page.

    right on the starting block )))

    i face with an error message given by theJavaScript console :

    Error: Error in parsing value for property 'opacity'. Declaration
    dropped.
    Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.html
    Line: 0


    i should say i do have a firewall on my box and leave it untoucjed for
    this first trial because i don't what are the port number ti open, if
    any, for XMLHttpRequest, port 80 is open those related to news, mail and
    telnet too, i think that's all...


    the url of the page :
    <http://yvon-thoraval.com/Widgets/Man_wdgt/Man.html>

    (nothing really interesting to see right now except the error message,
    aznd the images from RDoc)
    Une Bévue, Oct 23, 2006
    #2
    1. Advertising

  3. Une Bévue wrote:

    > i face with an error message given by theJavaScript console :
    >
    > Error: Error in parsing value for property 'opacity'. Declaration
    > dropped.
    > Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.html
    > Line: 0


    While that console comes under the name 'JavaScript console' other
    components like the CSS parser also emit error messages to that console
    so that message above is saying that the CSS parser could not parse the
    value set for the CSS opacity property and therefore drops it.





    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Oct 23, 2006
    #3
  4. Une Bévue

    Une Bévue Guest

    Martin Honnen <> wrote:

    >
    > While that console comes under the name 'JavaScript console' other
    > components like the CSS parser also emit error messages to that console
    > so that message above is saying that the CSS parser could not parse the
    > value set for the CSS opacity property and therefore drops it.


    ah ok opacity do you mean by that display:none ???

    because the errors upon css i got iare :
    Error: Unknown property '-apple-dashboard-region'. Declaration dropped.
    Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.css
    Line: 336

    this one i can understand...

    but the others about "display" :
    Error: Error in parsing value for property 'display'. Declaration
    dropped.
    Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.html
    Line: 0

    i can't , i think it's related to some jexternal javascript playing with
    display:none|block...



    yes i've seen effectively other css errors (display on my computer then
    you mean those css errors stops javascript XmlHttpRequest ?

    or are those independant, as i believe )))
    Une Bévue, Oct 23, 2006
    #4
  5. Une Bévue

    VK Guest

    Une Bévue wrote:
    > because the errors upon css i got iare :
    > Error: Unknown property '-apple-dashboard-region'. Declaration dropped.
    > Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.css
    > Line: 336


    On your page you are using wrong syntax for JavaScript tag:
    <script type='text/javascript' src='Man.js' charset='utf-8'/>

    You cannot use this syntax except some very particular hacks which are
    not presented in your case. It knocks down the parser and it leads to
    the avalanche of error messages you see (which are meaningless in this
    case, it simply means "parser lost the idea of how to build DOM tree
    for the given page". IE just renders blank page in cases like yours.)

    Use the right syntax:

    <script type='text/javascript' src='Man.js' charset='utf-8'></script>
    VK, Oct 23, 2006
    #5
  6. Une Bévue

    Une Bévue Guest

    VK <> wrote:

    > On your page you are using wrong syntax for JavaScript tag:
    > <script type='text/javascript' src='Man.js' charset='utf-8'/>


    i think that's the syntax when running under dashbord not apache...

    > You cannot use this syntax except some very particular hacks which are
    > not presented in your case. It knocks down the parser and it leads to
    > the avalanche of error messages you see (which are meaningless in this
    > case, it simply means "parser lost the idea of how to build DOM tree
    > for the given page". IE just renders blank page in cases like yours.)
    >
    > Use the right syntax:
    >
    > <script type='text/javascript' src='Man.js' charset='utf-8'></script>


    i didn't get the denied access for XmlHttpRequest right now, but i have
    to insvestigate de code, js complains about not having :

    Error: createGenericButton is not defined
    Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.js
    Line: 49

    and alos, (may it's linked to the preceeding one) :

    Error: document.getElementById(currentPane) has no properties
    Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.js
    Line: 363

    i've to check that

    thanks for your time and your reply.
    Une Bévue, Oct 23, 2006
    #6
  7. Une Bévue

    VK Guest

    > > On your page you are using wrong syntax for JavaScript tag:
    > > <script type='text/javascript' src='Man.js' charset='utf-8'/>

    >
    > i think that's the syntax when running under dashbord not apache..


    It is not important under what is it running - it is not acceptable as
    long as the resulting page is intended to be viewed by a browser. The
    only way to override <script> tag syntax is by using well-formed XHTML
    page served with Content-Type application/xhtml+xml (but in this case
    you're xing IE out). So the generic correct answer is: this syntax is
    wrong.

    > i didn't get the denied access for XmlHttpRequest right now, but i have
    > to insvestigate de code, js complains about not having :
    >
    > Error: createGenericButton is not defined
    > Source File: http://yvon-thoraval.com/Widgets/Man_wdgt/Man.js
    > Line: 49


    ....
    <script type='text/javascript' src='enericButton.js' charset='utf-8'>
    ....
    "enericButton" ? ;-)
    VK, Oct 23, 2006
    #7
  8. Une Bévue

    Une Bévue Guest

    VK <> wrote:

    > "enericButton" ? ;-)


    ah ! bull@&it !!!

    ok no more suntax errors just the :
    Erreur : Warning: unrecognized command line flag -psn_0_3827171330

    source file :
    file:///Applications/Firefox_2_fr/Firefox_2_fr.app/Contents/MacOS/compon
    ents/nsBrowserContentHandler.js
    Ligne : 576

    mac os w complains about the psn arg this
    "components/nsBrowserContentHandler.js"

    isn't part of my cut'n paste )))

    now i face right to the pemission denied for "Erreur : uncaught
    exception: Permission callind method XMLHttpRequest.open"

    may be this is becaise this widget (my copy of RDoc) asks for online
    pages (the Ruby doc's one) and i have something to change in my Apache
    setup in order to allow xml application ?
    Une Bévue, Oct 24, 2006
    #8
  9. Une Bévue

    VK Guest

    > now i face right to the pemission denied for "Erreur : uncaught
    > exception: Permission callind method XMLHttpRequest.open"


    Mais oui, naturellement :)

    In the default security environment XMLHttpRequest is not allowed to
    communicate with other domains. JSONet can send/retrieve text data
    cross-domain but this feed format is not supported yet by Ruby.

    So to keep XMLHttpRequest approach you have to use one of regular
    server-side fixes for the cross-domain block annoyance. Either use
    mod_rewrite or a content grabber (sometimes also euphemistically called
    "server mediator").

    I'm not so strong in XUL component security policies. If it gives more
    privileges than on a regular web-page, you may wrap your call into
    try-catch block:

    try {
    req.open("GET", currentDocURL, true);
    }
    catch(SecurityException) {
    // that is default security environment
    // you are not allowed to make cross-domain calls
    // think of an alternative
    }
    VK, Oct 24, 2006
    #9
  10. Une Bévue

    Une Bévue Guest

    VK <> wrote:

    >
    > Mais oui, naturellement :)
    >
    > In the default security environment XMLHttpRequest is not allowed to
    > communicate with other domains. JSONet can send/retrieve text data
    > cross-domain but this feed format is not supported yet by Ruby.


    no ruby code at all in rdoc widget i'm experiencing with.
    >
    > So to keep XMLHttpRequest approach you have to use one of regular
    > server-side fixes for the cross-domain block annoyance. Either use
    > mod_rewrite or a content grabber (sometimes also euphemistically called
    > "server mediator").
    >
    > I'm not so strong in XUL component security policies. If it gives more
    > privileges than on a regular web-page, you may wrap your call into
    > try-catch block:
    >
    > try {
    > req.open("GET", currentDocURL, true);
    > }
    > catch(SecurityException) {
    > // that is default security environment
    > // you are not allowed to make cross-domain calls
    > // think of an alternative
    > }


    ok, i understand, then you think Dashboard has some special feature to
    allow X-domin calls ?
    (the widget i'm trying under apache is used to run under dashboard env.)

    because their are a lot of widgets like that able to load outside info
    (images, radio stream, weather...)
    Une Bévue, Oct 24, 2006
    #10
  11. Une Bévue

    VK Guest

    > > try {
    > > req.open("GET", currentDocURL, true);
    > > }
    > > catch(SecurityException) {
    > > // that is default security environment
    > > // you are not allowed to make cross-domain calls
    > > // think of an alternative
    > > }


    > ok, i understand, then you think Dashboard has some special feature to
    > allow X-domin calls ?
    > (the widget i'm trying under apache is used to run under dashboard env.)


    Oh, so this is that: <http://www.apple.com/macosx/features/dashboard/>
    ? (for some reason I mistook your code for a Gecko XUL module
    development).

    I have no idea, sorry, what Dashboard is about and how is it
    implemented. If it's something like Opera 9.x widgets
    <http://widgets.opera.com/> then you have to *install* the widget first
    (on prompt) and only then widget gets some extended privileges.

    The problem is that you are testing your code on a regular HTML page
    with default security restrictions and you are getting security
    exceptions relevant to this environment. But at the same time you are
    asking how to change the code so it would work in some all another
    environment. That is a bit too abstract ;-)
    You should install your widget on Mac first and then look what is
    working and how. In any case I can assure you right away that widgets
    (neither Macy ones nor Opera ones) do not get any extra privileges if
    just served from a server right to client's browser.
    VK, Oct 24, 2006
    #11
  12. Une Bévue

    Une Bévue Guest

    VK <> wrote:

    >
    > Oh, so this is that: <http://www.apple.com/macosx/features/dashboard/>
    > ? (for some reason I mistook your code for a Gecko XUL module
    > development).
    >
    > I have no idea, sorry, what Dashboard is about and how is it
    > implemented. If it's something like Opera 9.x widgets
    > <http://widgets.opera.com/> then you have to *install* the widget first
    > (on prompt) and only then widget gets some extended privileges.
    >
    > The problem is that you are testing your code on a regular HTML page
    > with default security restrictions and you are getting security
    > exceptions relevant to this environment. But at the same time you are
    > asking how to change the code so it would work in some all another
    > environment. That is a bit too abstract ;-)
    > You should install your widget on Mac first and then look what is
    > working and how. In any case I can assure you right away that widgets
    > (neither Macy ones nor Opera ones) do not get any extra privileges if
    > just served from a server right to client's browser.


    yes then dashbord has some special features , yes this king of widgets
    does exist on othe oses under kde i think. Also opera ones looks the
    same as apple one.

    in the mean time i've discovered a special app to develop widgets ))
    Une Bévue, Oct 24, 2006
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    5
    Views:
    147
  2. dx27s
    Replies:
    1
    Views:
    123
    Lance Dyas
    Oct 5, 2005
  3. Replies:
    0
    Views:
    151
  4. Charlie
    Replies:
    1
    Views:
    109
    Charlie
    Mar 18, 2007
  5. bleen
    Replies:
    0
    Views:
    109
    bleen
    Aug 1, 2007
Loading...

Share This Page