per

L

lovecreatesbeauty

I tried to enumerate properties of XMLHttpRequest but got an error:

Error: Permission denied for <http://192.168.122.199> to get
property
XMLHttpRequest.channel

I simply skipped in the loop in my code that property by:

if (k == "channel") continue;

I wonder if there is a way to detect the permission of properties
similar to this:

/*WRONG code*/
if (xhr.channel) {
accessable = true;
}else{
accessable = false;
}
 
D

dhtml

I tried to enumerate properties of XMLHttpRequest but got an error:

I've tried that too, and gotten similar errors in Mozilla Firefox.
Annoying.
    Error: Permission denied for <http://192.168.122.199> to get
property
         XMLHttpRequest.channel

I simply skipped in the loop in my code that property by:

    if (k == "channel") continue;

I wonder if there is a way to detect the permission of properties
similar to this:

    /*WRONG code*/
    if (xhr.channel) {
        accessable = true;
    }else{
        accessable = false;
    }
Either wrap the access, e.g. `s = xhr[name]` in a try/catch or use a
map of only the things you care about. E.g.

var importantKeys = {
method : true,
async : true,
status : true
// etc.
};

You'll probably want a new function either way.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top