Вопрос

I have a Firefox OS app that makes calls to cross domain pages and downloads data to display on the app, wich all works fine because I used the systemXHR permission and appended the { mozSystem: true } on every XMLHttpRequest.

Then I attached the Flurry script, made the FlurryAgent calls in the .js of the app and started recieving the info from the events on the Flurry Event Logs when I ran it on the Firefox OS Simulator. When I tried to install my app on a Firefox OS device, the Flurry session never starts and the app never loads.

I don't understand why Flurry works on the simulator and not on the device. I checked a lot of times for the internet connection on the device, wich works fine for the browser and other apps that were already installed. And my app worked fine on the device before I had attached Flurry.

Here is a sample of my code:

HTML:

<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>My App</title>
    <link rel="stylesheet" href="js/jquery.mobile-1.3.2.min.css" />
    <script src="js/jquery-1.10.2.min.js"></script>
    <script src="js/jquery.mobile-1.3.2.min.js"></script>
    <link rel="stylesheet" href="css/mystyle.css" />
    <script src="https://cdn.flurry.com/js/flurry.js"></script>
    <script src="js/app.js"></script>


</head> 


<body> 

.js

$(document).on('pagebeforecreate', '[data-role="page"]', function(){    
    if ($(this).attr('id')=="splash"){
        $.mobile.allowCrossDomainPages = true;
    }
});
$(document).on('pageinit', '[data-role="page"]', function(){    
    console && console.log($(this).attr('id') + " - pageinit!!");
    if ($(this).attr('id')=="splash"){
        FlurryAgent.startSession("7ZFX9Z4CVT66KJBVP7CF"); //Here is were it crashes
        alert("Inicio sesion flurry");
        console && console.log($(this).attr('id') + "- Entro al if para el timer");
        var timer = window.setTimeout(next, 10000);
    } 
});

If there is anything else that you need to help me figure out what happens, let me know. The device I'm using is a Qualcomm model, especifically Peak and has the OS version: Boot2Gecko 1.1.1.0hd-GP

Это было полезно?

Решение

This may be a CSP issue. Have a look at: https://developer.mozilla.org/en-US/Apps/CSP?redirectlocale=en-US&redirectslug=Apps%2FCSP Specifically Remote scripts are banned.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top