Merge lp:~abreu-alexandre/webbrowser-app/host-support-devtools into lp:webbrowser-app

Proposed by Alexandre Abreu
Status: Merged
Approved by: Olivier Tilloy
Approved revision: no longer in the source branch.
Merged at revision: 753
Proposed branch: lp:~abreu-alexandre/webbrowser-app/host-support-devtools
Merge into: lp:webbrowser-app
Diff against target: 86 lines (+29/-0)
4 files modified
src/Ubuntu/Web/UbuntuWebContext.qml (+1/-0)
src/Ubuntu/Web/plugin.cpp (+13/-0)
src/app/browserapplication.cpp (+14/-0)
src/app/browserapplication.h (+1/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/webbrowser-app/host-support-devtools
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+236965@code.launchpad.net

Commit message

Properly setup host support when devtools inspector mode used

Description of the change

Properly setup host support when devtools inspector mode used.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Works nicely, thanks!

review: Approve
739. By PS Jenkins bot

Resync trunk

740. By Alexandre Abreu

Add a simple mechanism (simpler than the one already in place) to override user agents for a given webapp. Fixes: 1370975
Approved by: PS Jenkins bot, Olivier Tilloy

741. By Olivier Tilloy

Ship a PNG icon instead of an SVG, and install it under the app’s own data dir. Fixes: 1365408
Approved by: Ken VanDine, PS Jenkins bot

742. By Olivier Tilloy

Make an autopilot test more robust by ensuring that the drawer menu is dismissed but not clicked. Fixes: 1365304
Approved by: PS Jenkins bot

743. By Olivier Tilloy

Persistently cache favicons on disk to avoid re-downloading them across application runs. Fixes: 1340585
Approved by: PS Jenkins bot

744. By Olivier Tilloy

Ensure that at most 2 webviews are instantiated at all times, to reduce memory consumption. Fixes: 1376418
Approved by: PS Jenkins bot

745. By Alberto Mardegan

Fix handling of host cookies

Oxide (and chromium) expect host cookies to be treated in a special way: the domain in the cookie must be left empty, or an initial "." will always be added to the cookie domain. Fixes: 1371659
Approved by: Olivier Tilloy

746. By PS Jenkins bot

Releasing 0.23+14.10.20141003-0ubuntu1

747. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

Revision history for this message
Olivier Tilloy (osomon) wrote :

With the latest changes in trunk, this doesn’t merge cleanly any longer. Can you please fix this (trivial) conflict?

review: Needs Fixing
748. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

749. By Launchpad Translations on behalf of phablet-team

Launchpad automatic translations update.

750. By Alexandre Abreu

Add support for devtools host argument

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

updated

Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks good, but I have one comment (see inline) to improve code readability.

751. By Alexandre Abreu

update

Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

updated

Revision history for this message
Olivier Tilloy (osomon) wrote :

Looks good now, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Ubuntu/Web/UbuntuWebContext.qml'
--- src/Ubuntu/Web/UbuntuWebContext.qml 2014-08-11 15:13:50 +0000
+++ src/Ubuntu/Web/UbuntuWebContext.qml 2014-10-06 14:12:36 +0000
@@ -82,4 +82,5 @@
8282
83 devtoolsEnabled: webviewDevtoolsDebugPort !== -183 devtoolsEnabled: webviewDevtoolsDebugPort !== -1
84 devtoolsPort: webviewDevtoolsDebugPort84 devtoolsPort: webviewDevtoolsDebugPort
85 devtoolsIp: webviewDevtoolsDebugHost
85}86}
8687
=== modified file 'src/Ubuntu/Web/plugin.cpp'
--- src/Ubuntu/Web/plugin.cpp 2014-09-26 13:30:46 +0000
+++ src/Ubuntu/Web/plugin.cpp 2014-10-06 14:12:36 +0000
@@ -83,6 +83,18 @@
83 return port > 0 ? port : DEVTOOLS_INVALID_PORT;83 return port > 0 ? port : DEVTOOLS_INVALID_PORT;
84}84}
8585
86
87static QString getDevtoolsHost()
88{
89 QString host;
90 const char* DEVTOOLS_HOST_ENV_VAR = "UBUNTU_WEBVIEW_DEVTOOLS_HOST";
91
92 if (qEnvironmentVariableIsSet(DEVTOOLS_HOST_ENV_VAR)) {
93 host = qgetenv(DEVTOOLS_HOST_ENV_VAR);
94 }
95 return host;
96}
97
86void UbuntuBrowserPlugin::initializeEngine(QQmlEngine* engine, const char* uri)98void UbuntuBrowserPlugin::initializeEngine(QQmlEngine* engine, const char* uri)
87{99{
88 Q_UNUSED(uri);100 Q_UNUSED(uri);
@@ -102,6 +114,7 @@
102114
103 context->setContextProperty("formFactor", getFormFactor());115 context->setContextProperty("formFactor", getFormFactor());
104 context->setContextProperty("webviewDevtoolsDebugPort", getDevtoolsPort());116 context->setContextProperty("webviewDevtoolsDebugPort", getDevtoolsPort());
117 context->setContextProperty("webviewDevtoolsDebugHost", getDevtoolsHost());
105118
106 engine->addImageProvider("favicon", new FaviconImageProvider());119 engine->addImageProvider("favicon", new FaviconImageProvider());
107}120}
108121
=== modified file 'src/app/browserapplication.cpp'
--- src/app/browserapplication.cpp 2014-09-15 17:08:41 +0000
+++ src/app/browserapplication.cpp 2014-10-06 14:12:36 +0000
@@ -77,6 +77,18 @@
77 return port;77 return port;
78}78}
7979
80QString BrowserApplication::inspectorHost() const
81{
82 QString host;
83 Q_FOREACH(QHostAddress address, QNetworkInterface::allAddresses()) {
84 if (!address.isLoopback() && (address.protocol() == QAbstractSocket::IPv4Protocol)) {
85 host = address.toString();
86 break;
87 }
88 }
89 return host;
90}
91
80QString BrowserApplication::appId() const92QString BrowserApplication::appId() const
81{93{
82 Q_FOREACH(const QString& argument, m_arguments) {94 Q_FOREACH(const QString& argument, m_arguments) {
@@ -123,8 +135,10 @@
123#endif135#endif
124136
125 QString devtoolsPort = inspectorPort();137 QString devtoolsPort = inspectorPort();
138 QString devtoolsHost = inspectorHost();
126 bool inspectorEnabled = !devtoolsPort.isEmpty();139 bool inspectorEnabled = !devtoolsPort.isEmpty();
127 if (inspectorEnabled) {140 if (inspectorEnabled) {
141 qputenv("UBUNTU_WEBVIEW_DEVTOOLS_HOST", devtoolsHost.toUtf8());
128 qputenv("UBUNTU_WEBVIEW_DEVTOOLS_PORT", devtoolsPort.toUtf8());142 qputenv("UBUNTU_WEBVIEW_DEVTOOLS_PORT", devtoolsPort.toUtf8());
129 }143 }
130144
131145
=== modified file 'src/app/browserapplication.h'
--- src/app/browserapplication.h 2014-07-03 19:49:54 +0000
+++ src/app/browserapplication.h 2014-10-06 14:12:36 +0000
@@ -59,6 +59,7 @@
59private:59private:
60 QString appId() const;60 QString appId() const;
61 QString inspectorPort() const;61 QString inspectorPort() const;
62 QString inspectorHost() const;
6263
63 WebBrowserWindow *m_webbrowserWindowProxy;64 WebBrowserWindow *m_webbrowserWindowProxy;
64};65};

Subscribers

People subscribed via source and target branches

to status/vote changes: