vendredi 21 février 2020

Web push notification module odoo12

Im getting error in web push notification module. Im trying to send notification but it gives error "Uncaught ReferenceError: XMLHttpRequest is not defined" in service.worker.js. Here is my code:

    // var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
    var xmlhttp = new XMLHttpRequest();
    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            console.log('responseText:' + xmlhttp.responseText);
            try {
                var data = JSON.parse(xmlhttp.responseText);
            } catch(err) {
                console.log(err.message + " in " + xmlhttp.responseText);
                return;
            }
            callback(data);
        }
    };



Aucun commentaire:

Enregistrer un commentaire