Cuando ejecuté el proyecto en el navegador Chrome, las solicitudes de ajax funcionaron bien, pero cuando instalé la aplicación en Android, las solicitudes ya no funcionan. Este es el código:
var xhr=new XMLHttpRequest() xhr.onerror=function(){ var message=alert(txt('Please turn on mobile data or Wi-Fi','Ligue os dados moveis ou Wi-Fi')) } xhr.onreadystatechange=function (){ if (this.status== 200 && this.readyState == 4){ alert("trye") eval(xhr.responseText) } } xhr.open("POST",`http://dpreaction.ml?i=js`) xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded') xhr.send()el archivo config.xml
<?xml version='1.0' encoding='utf-8'?> <widget id="com.teste.teste" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>DP Reaction</name> <description>Inrease your things</description> <author email="gilluisfrancisco70@gmail.com" href="http://dpreaction.ml"> DP Reaction </author> <content src="index.html" /> <allow-intent href="*" /> <access origin="*" /> <allow-naviation href="*" /> </widget>Y esta es mi etiqueta:
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">