Merge lp:~jfmoy/ubuntu-html5-theme/webview-component into lp:ubuntu-html5-theme

Proposed by Jean-Francois Moy
Status: Merged
Merged at revision: 177
Proposed branch: lp:~jfmoy/ubuntu-html5-theme/webview-component
Merge into: lp:ubuntu-html5-theme
Diff against target: 134 lines (+39/-26)
3 files modified
src/plugin/Ubuntu/WebApps/CordovaLoader.qml (+5/-0)
src/plugin/Ubuntu/WebApps/WebAppContainer.qml (+25/-16)
src/ubuntu-html5-app-launcher/main.cpp (+9/-10)
To merge this branch: bzr merge lp:~jfmoy/ubuntu-html5-theme/webview-component
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu HTML5 Theme Developers Pending
Review via email: mp+234947@code.launchpad.net

Commit message

Moved to the new Ubuntu.Web component. Some properties pointing to experimental faeture of QtWebkit (WebGL, developer extra, etc.) had to be dropped as they are not present in Ubuntu.Web.

Description of the change

Switched from the Ubuntu.Components.Extras.Browser (that uses QtWebKit) to the Ubuntu.Web component (that uses Oxide). Some experimental features that were enabled with the former component are not available in Ubuntu.Web (such as WebGL).

After generating the binary, one can test with the provided examples projects.

To post a comment you must log in.
Revision history for this message
David Barth (dbarth) wrote :

The devtools support should be present in Oxide and the new view however.

On Wed, Sep 17, 2014 at 1:55 PM, Jean-Francois Moy <
<email address hidden>> wrote:

> Jean-Francois Moy has proposed merging
> lp:~jfmoy/ubuntu-html5-theme/webview-component into lp:ubuntu-html5-theme.
>
> Commit message:
> Moved to the new Ubuntu.Web component. Some properties pointing to
> experimental faeture of QtWebkit (WebGL, developer extra, etc.) had to be
> dropped as they are not present in Ubuntu.Web.
>
> Requested reviews:
> Ubuntu HTML5 Theme Developers (ubuntu-html5-theme-devs)
>
> For more details, see:
>
> https://code.launchpad.net/~jfmoy/ubuntu-html5-theme/webview-component/+merge/234947
>
> Switched from the Ubuntu.Components.Extras.Browser (that uses QtWebKit) to
> the Ubuntu.Web component (that uses Oxide). Some experimental features that
> were enabled with the former component are not available in Ubuntu.Web
> (such as WebGL).
>
> After generating the binary, one can test with the provided examples
> projects.
> --
>
> https://code.launchpad.net/~jfmoy/ubuntu-html5-theme/webview-component/+merge/234947
> Your team Ubuntu HTML5 Theme Developers is requested to review the
> proposed merge of lp:~jfmoy/ubuntu-html5-theme/webview-component into
> lp:ubuntu-html5-theme.
>
> === modified file 'src/plugin/Ubuntu/WebApps/WebAppContainer.qml'
> --- src/plugin/Ubuntu/WebApps/WebAppContainer.qml 2014-03-29
> 15:04:02 +0000
> +++ src/plugin/Ubuntu/WebApps/WebAppContainer.qml 2014-09-17
> 11:54:21 +0000
> @@ -18,7 +18,7 @@
>
> import QtQuick 2.0
> import Ubuntu.Components 0.1
> -import Ubuntu.Components.Extras.Browser 0.1
> +import Ubuntu.Web 0.2
>
>
> /*!
> @@ -104,25 +104,11 @@
> */
> Component {
> id: webviewFallbackComponent
> - UbuntuWebView {
> + WebView {
> url: mainPage._getAppStartupIndexFileUri()
>
> - experimental.preferences.localStorageEnabled: true
> -
> experimental.preferences.offlineWebApplicationCacheEnabled: true
> -
> experimental.preferences.universalAccessFromFileURLsAllowed: true
> - experimental.preferences.webGLEnabled: true
> -
> - experimental.databaseQuotaDialog: Item {
> - Timer {
> - interval: 1
> - running: true
> - onTriggered: {
> - model.accept(model.expectedUsage)
> - }
> - }
> - }
> - // port in QTWEBKIT_INSPECTOR_SERVER enviroment variable
> - experimental.preferences.developerExtrasEnabled: true
> + preferences.localStorageEnabled: true
> + preferences.allowUniversalAccessFromFileUrls: true
> }
> }
>
>
>
>

Revision history for this message
Jean-Francois Moy (jfmoy) wrote :
Download full text (3.1 KiB)

There is no accessible property to enable that (I checked the oxide
source code:
http://bazaar.launchpad.net/~oxide-developers/oxide/oxide.trunk/view/head:/qt/core/api/oxideqwebpreferences.h);
it might be enabled by default.
On 17/09/14 18:12, David Barth wrote:
> The devtools support should be present in Oxide and the new view however.
>
> On Wed, Sep 17, 2014 at 1:55 PM, Jean-Francois Moy <
> <email address hidden>> wrote:
>
>> Jean-Francois Moy has proposed merging
>> lp:~jfmoy/ubuntu-html5-theme/webview-component into lp:ubuntu-html5-theme.
>>
>> Commit message:
>> Moved to the new Ubuntu.Web component. Some properties pointing to
>> experimental faeture of QtWebkit (WebGL, developer extra, etc.) had to be
>> dropped as they are not present in Ubuntu.Web.
>>
>> Requested reviews:
>> Ubuntu HTML5 Theme Developers (ubuntu-html5-theme-devs)
>>
>> For more details, see:
>>
>> https://code.launchpad.net/~jfmoy/ubuntu-html5-theme/webview-component/+merge/234947
>>
>> Switched from the Ubuntu.Components.Extras.Browser (that uses QtWebKit) to
>> the Ubuntu.Web component (that uses Oxide). Some experimental features that
>> were enabled with the former component are not available in Ubuntu.Web
>> (such as WebGL).
>>
>> After generating the binary, one can test with the provided examples
>> projects.
>> --
>>
>> https://code.launchpad.net/~jfmoy/ubuntu-html5-theme/webview-component/+merge/234947
>> Your team Ubuntu HTML5 Theme Developers is requested to review the
>> proposed merge of lp:~jfmoy/ubuntu-html5-theme/webview-component into
>> lp:ubuntu-html5-theme.
>>
>> === modified file 'src/plugin/Ubuntu/WebApps/WebAppContainer.qml'
>> --- src/plugin/Ubuntu/WebApps/WebAppContainer.qml 2014-03-29
>> 15:04:02 +0000
>> +++ src/plugin/Ubuntu/WebApps/WebAppContainer.qml 2014-09-17
>> 11:54:21 +0000
>> @@ -18,7 +18,7 @@
>>
>> import QtQuick 2.0
>> import Ubuntu.Components 0.1
>> -import Ubuntu.Components.Extras.Browser 0.1
>> +import Ubuntu.Web 0.2
>>
>>
>> /*!
>> @@ -104,25 +104,11 @@
>> */
>> Component {
>> id: webviewFallbackComponent
>> - UbuntuWebView {
>> + WebView {
>> url: mainPage._getAppStartupIndexFileUri()
>>
>> - experimental.preferences.localStorageEnabled: true
>> -
>> experimental.preferences.offlineWebApplicationCacheEnabled: true
>> -
>> experimental.preferences.universalAccessFromFileURLsAllowed: true
>> - experimental.preferences.webGLEnabled: true
>> -
>> - experimental.databaseQuotaDialog: Item {
>> - Timer {
>> - interval: 1
>> - running: true
>> - onTriggered: {
>> - model.accept(model.expectedUsage)
>> - }
>> - }
>> - }
>> - // port in QTWEBKIT_INSPECTOR_SERVER enviroment variable
>> - experimental.preferences.developerExtrasEnabled: true
>> + preferences.localStorageEnabled: true
>> + preferences.allowUniversalAccessFromFileUrls: true
>> }
>> ...

Read more...

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
172. By Jean-Francois Moy

Added remote debugging capabilities to the WebView, if --inspector argument is provided. Added back the appCache in the webview.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
173. By Jean-Francois Moy

Make sure dev tools properties are available at initialisation.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugin/Ubuntu/WebApps/CordovaLoader.qml'
2--- src/plugin/Ubuntu/WebApps/CordovaLoader.qml 2014-02-10 16:15:29 +0000
3+++ src/plugin/Ubuntu/WebApps/CordovaLoader.qml 2014-10-02 14:40:44 +0000
4@@ -23,6 +23,11 @@
5
6 property string htmlIndexDirectory
7
8+ // Remote Inspector Properties
9+ property string remoteInspectorEnabled
10+ property string remoteInspectorPort
11+ property string remoteInspectorHost
12+
13 // Cordova plugin instance
14 property var cordovaInstance: null
15
16
17=== modified file 'src/plugin/Ubuntu/WebApps/WebAppContainer.qml'
18--- src/plugin/Ubuntu/WebApps/WebAppContainer.qml 2014-03-29 15:04:02 +0000
19+++ src/plugin/Ubuntu/WebApps/WebAppContainer.qml 2014-10-02 14:40:44 +0000
20@@ -18,7 +18,7 @@
21
22 import QtQuick 2.0
23 import Ubuntu.Components 0.1
24-import Ubuntu.Components.Extras.Browser 0.1
25+import Ubuntu.Web 0.2
26
27
28 /*!
29@@ -42,6 +42,22 @@
30 */
31 property alias htmlIndexDirectory: cordovaWebviewProvider.htmlIndexDirectory
32
33+ /*!
34+ \preliminary
35+ The properties hold whether the remote debugging interface should be enabled for the
36+ Web View. The host ip and port for accessing the remote interface should be provided.
37+ */
38+ property alias remoteInspectorEnabled: cordovaWebviewProvider.remoteInspectorEnabled
39+ property alias remoteInspectorHost: cordovaWebviewProvider.remoteInspectorHost
40+ property alias remoteInspectorPort: cordovaWebviewProvider.remoteInspectorPort
41+
42+ /*!
43+ \preliminary
44+ The property holds the whether .
45+
46+ The path is absolute or relative to the current dir.
47+ */
48+
49 Page {
50 id: mainPage
51 anchors.fill: parent
52@@ -104,25 +120,18 @@
53 */
54 Component {
55 id: webviewFallbackComponent
56- UbuntuWebView {
57+ WebView {
58 url: mainPage._getAppStartupIndexFileUri()
59
60- experimental.preferences.localStorageEnabled: true
61- experimental.preferences.offlineWebApplicationCacheEnabled: true
62- experimental.preferences.universalAccessFromFileURLsAllowed: true
63- experimental.preferences.webGLEnabled: true
64+ preferences.localStorageEnabled: true
65+ preferences.allowUniversalAccessFromFileUrls: true
66+ preferences.appCacheEnabled: true
67
68- experimental.databaseQuotaDialog: Item {
69- Timer {
70- interval: 1
71- running: true
72- onTriggered: {
73- model.accept(model.expectedUsage)
74- }
75- }
76+ context: WebContext {
77+ devtoolsEnabled: root.remoteInspectorEnabled
78+ devtoolsIp: root.remoteInspectorHost
79+ devtoolsPort: root.remoteInspectorPort
80 }
81- // port in QTWEBKIT_INSPECTOR_SERVER enviroment variable
82- experimental.preferences.developerExtrasEnabled: true
83 }
84 }
85
86
87=== modified file 'src/ubuntu-html5-app-launcher/main.cpp'
88--- src/ubuntu-html5-app-launcher/main.cpp 2014-04-03 13:57:30 +0000
89+++ src/ubuntu-html5-app-launcher/main.cpp 2014-10-02 14:40:44 +0000
90@@ -142,6 +142,10 @@
91 QString wwwfolderArg;
92 bool maximized = false;
93
94+ QString remoteInspectorHost = "";
95+ QString remoteInspectorPort = QString::number(REMOTE_INSPECTOR_PORT);
96+ bool remoteInspectorEnabled = false;
97+
98 QStringList arguments = app.arguments();
99 arguments.pop_front();
100
101@@ -159,20 +163,13 @@
102 else
103 if (argument.contains(INSPECTOR))
104 {
105- QString host;
106+ remoteInspectorEnabled = true;
107 Q_FOREACH(QHostAddress address, QNetworkInterface::allAddresses()) {
108 if (!address.isLoopback() && (address.protocol() == QAbstractSocket::IPv4Protocol)) {
109- host = address.toString();
110+ remoteInspectorHost = address.toString();
111 break;
112 }
113 }
114- QString server;
115- if (host.isEmpty()) {
116- server = QString::number(REMOTE_INSPECTOR_PORT);
117- } else {
118- server = QString("%1:%2").arg(host, QString::number(REMOTE_INSPECTOR_PORT));
119- }
120- qputenv("QTWEBKIT_INSPECTOR_SERVER", server.toUtf8());
121 }
122 else
123 {
124@@ -225,8 +222,10 @@
125 qCritical() << "Main application component cannot be loaded.";
126 return EXIT_FAILURE;
127 }
128+ view.rootObject()->setProperty("remoteInspectorEnabled", remoteInspectorEnabled);
129+ view.rootObject()->setProperty("remoteInspectorHost", remoteInspectorHost);
130+ view.rootObject()->setProperty("remoteInspectorPort", remoteInspectorPort);
131 view.rootObject()->setProperty("htmlIndexDirectory", wwwFolder.canonicalFilePath());
132-
133 view.setTitle(QCoreApplication::applicationName());
134 view.setResizeMode(QQuickView::SizeRootObjectToView);
135

Subscribers

People subscribed via source and target branches