Esta es la contestación más correcta que te podemos compartir, pero estúdiala detenidamente y analiza si es compatible a tu proyecto.
Ejemplo: ejemplo de InAppBrowser del complemento Cordova
var inAppBrowserRef;function showHelp(url)
var target ="_blank";
var options ="location=yes,hidden=yes,beforeload=yes";
inAppBrowserRef = cordova.InAppBrowser.open(url, target, options);
inAppBrowserRef.addEventListener('loadstart', loadStartCallBack);
inAppBrowserRef.addEventListener('loadstop', loadStopCallBack);
inAppBrowserRef.addEventListener('loaderror', loadErrorCallBack);
inAppBrowserRef.addEventListener('beforeload', beforeloadCallBack);
inAppBrowserRef.addEventListener('message', messageCallBack);functionloadStartCallBack()$('#status-message').text("loading please wait ...");functionloadStopCallBack()if(inAppBrowserRef != undefined)
inAppBrowserRef.insertCSS( code: "bodyfont-size: 25px;");
inAppBrowserRef.executeScript( code: "
var message = 'this is the message';
var messageObj = my_message: message;
var stringifiedMessageObj = JSON.stringify(messageObj);
webkit.messageHandlers.cordova_iab.postMessage(stringifiedMessageObj);");$('#status-message').text("");
inAppBrowserRef.show();function loadErrorCallBack(params)$('#status-message').text("");
var scriptErrorMesssage ="alert('Sorry we cannot open that page. Message from the server is : "
+ params.message + "');"
inAppBrowserRef.executeScript( code: scriptErrorMesssage , executeScriptCallBack);
inAppBrowserRef.close();
inAppBrowserRef = undefined;function executeScriptCallBack(params)if(params[0]== null)$('#status-message').text("Sorry we couldn't open that page. Message from the server is : '"
+ params.message + "'");function beforeloadCallBack(params, callback)if(params.url.startsWith("http://www.example.com/"))
// Load this URL in the inAppBrowser.
callback(params.url);else
// The callback is not invoked, so the page will not be loaded.
$('#status-message').text("This browser only opens pages on http://www.example.com/");function messageCallBack(params)$('#status-message').text("message received: "+params.data.my_message);
Si guardas algún recelo o capacidad de limar nuestro sección puedes ejecutar una referencia y con gusto lo ojearemos.
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)