SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot bobber205's Avatar
    Join Date
    Sep 2006
    Location
    Oregon
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XMLHttpRequest & Permissions Clarificiation

    I made a widget for Mac OS X which is basically just a webpage with Javascript and CSS. Not hard at all.

    I used a XMLHttpRequest to get a RSS feed.
    Then I added this code so that it was able to even access the file.

    Code:
    try { //allows Mozilla browsers to access
        netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
       } catch (e) {
        alert("Permission UniversalBrowserRead denied.");
       }
    That works when running on a computer locally, but not when on a webserver. What I want to know is why exactly?

    Now it's not that big of a deal it doesn't run on a web server. It takes only another few lines of PHP code to do copy the file to my server. In fact, if I had it running on a web server, I would just use PHP to begin with.

    I couldn't do that on the widget because only a small permission of users have a PHP server running at all times and I would have to get permission to write anyway.

    Why does the permission override work locally but not a webserver? Is there some permission I need to change?

    Just curious.

  2. #2
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps this will throw some light on the issue: http://forums.mozillazine.org/viewtopic.php?t=89350

  3. #3
    SitePoint Zealot bobber205's Avatar
    Join Date
    Sep 2006
    Location
    Oregon
    Posts
    113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I read as much of that as I could and this is what I got out of it.

    On a web server, someone could hack my code and do bad stuff with other's websites on it.

    But ran locally they couldn't?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •