20
20
import Ubuntu.Components 0.1
21
import CordovaUbuntu 2.8
22
import Ubuntu.UnityWebApps 0.1
21
import Ubuntu.Components.Extras.Browser 0.1
26
25
\qmltype WebAppContainer
27
26
\inqmlmodule Ubuntu.WebApps 0.1
29
\brief WebAppContainer is the root Item that should be used for all HTML5 applications.
28
\brief WebAppContainer is the root element that should be used for all HTML5 applications.
55
wwwDir: root.htmlIndexDirectory
52
id: cordovaWebviewProvider
56
53
anchors.fill: parent
62
function getUnityWebappsProxies() {
63
return UnityWebAppsUtils.makeProxiesForQtWebViewBindee(cordovaView.mainWebview);
55
mainPage._onCordovaCreationError();
58
bindings.bindingMainWebview = Qt.binding(function() {
59
return cordovaInstance.mainWebview;
67
function _onCordovaCreationError() {
68
mainPage._fallbackToWebview();
74
function _fallbackToWebview() {
75
console.debug('Falling back on the plain Webview backend.')
77
webviewFallbackComponentLoader.sourceComponent = Qt.binding(function() {
78
return root.htmlIndexDirectory.length !== 0
79
? webviewFallbackComponent : null;
86
function _getAppStartupIndexFileUri() {
87
return 'file://' + root.htmlIndexDirectory + '/index.html';
70
id: webappBindingsLoader
94
id: webviewFallbackComponentLoader
72
95
anchors.fill: parent
73
sourceComponent: cordovaView.mainWebview ? webappBindingsComponent : undefined
97
bindings.bindingMainWebview = item;
80
id: webappBindingsComponent
85
injectExtraUbuntuApis: true
105
id: webviewFallbackComponent
107
url: mainPage._getAppStartupIndexFileUri()
109
experimental.preferences.localStorageEnabled: true
110
experimental.preferences.offlineWebApplicationCacheEnabled: true
111
experimental.preferences.universalAccessFromFileURLsAllowed: true
112
experimental.preferences.webGLEnabled: true
114
experimental.databaseQuotaDialog: Item {
119
model.accept(model.expectedUsage)
123
// port in QTWEBKIT_INSPECTOR_SERVER enviroment variable
124
experimental.preferences.developerExtrasEnabled: true
131
UbuntuJavascriptBindings {