I'm using javascript's XMLHttpRequest object to send a request to another page (not on the same server or domainname ) I get a ns_error_failure error in firefox, but the Javascript works in Google Chrome, after searching online it seems to be because of firefox's XSS policy. Cross-Domain requests are not allowed.

Is there anyway to work around this and make the JS run in both chrome and Firefox?


Please feel free to ask for additional details you feel are needed!


Here's the code that I was using.

"use strict";

function showFixed(username)
{
    console.log("Entered script");

    var url = 'https://api-dev.bugzilla.mozilla.org/latest/bug'
        + '?quicksearch='
        + encodeURIComponent('FIXED @'+username);
    displayBug(url);
}

function showPending(username)
{
    console.log("Entered script");

    var url = 'https://api-dev.bugzilla.mozilla.org/latest/bug'
        + '?quicksearch='
        + encodeURIComponent('@'+username);
    displayBug(url);
}

function showCC(username)
{
    console.log("Entered script");

    var url = 'https://api-dev.bugzilla.mozilla.org/latest/bug'
        + '?quicksearch='
        + encodeURIComponent('cc:'+username);
    displayBug(url);
}

function displayBug(url)
{
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.open("GET",url,false);
    xmlhttp.send();
    var text = xmlhttp.responseText;

    var json = JSON.parse(text);

    for(var i=0;i<json.bugs.length;i++)
    {
        var tempRow = document.createElement('tr');

        var tempId = document.createElement('td');
        tempId.innerHTML = '<a href=\'https://bugzilla.mozilla.org/show_bug.cgi?id=' + json.bugs[i].id + '\'>'+ json.bugs[i].id + '</a>';
        var tempCreator = document.createElement('td');
        tempCreator.innerHTML = json.bugs[i].creator.real_name;
        var tempShortDesc = document.createElement('td');
        tempShortDesc.innerHTML = json.bugs[i].summary;
        var temp
Edit
Report