Use existing cordova app as a Web App?

This seems to work

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

Just need to work in the others now.