Hi, I have a few Cordova Apps built with VoltBuilder.
When testing I run the app in the local web browser, but of course the cordova plugins do not work.
I want to adapt the Cordova app to run fully in a web browser so I can run it inside an iframe on my website aswell.
I have this function to detect cordova or not:
document.addEventListener("DOMContentLoaded", onLoaded, False);
Function onLoaded()
console.log("Loaded");
If (window.hasOwnProperty("cordova")) = True Then
console.log("Mobile App");
Else
console.log("Web Browser App")
End If
End Function
Which seems to work, but what I now need to do is hook all the cordova functions and replace them with a browser compatible function at onLoaded, such as
document.addEventListener("DOMContentLoaded", onLoaded, False);
Function onLoaded()
console.log("Loaded");
If (window.hasOwnProperty("cordova")) = True Then
console.log("Mobile App");
Else
console.log("Web Browser App")
window.cordova = window;
cordova.InAppBrowser = window;
End If
End Function