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
1=== modified file 'src/Ubuntu/Web/UbuntuWebContext.qml'
2--- src/Ubuntu/Web/UbuntuWebContext.qml 2014-08-11 15:13:50 +0000
3+++ src/Ubuntu/Web/UbuntuWebContext.qml 2014-10-06 14:12:36 +0000
4@@ -82,4 +82,5 @@
5
6 devtoolsEnabled: webviewDevtoolsDebugPort !== -1
7 devtoolsPort: webviewDevtoolsDebugPort
8+ devtoolsIp: webviewDevtoolsDebugHost
9 }
10
11=== modified file 'src/Ubuntu/Web/plugin.cpp'
12--- src/Ubuntu/Web/plugin.cpp 2014-09-26 13:30:46 +0000
13+++ src/Ubuntu/Web/plugin.cpp 2014-10-06 14:12:36 +0000
14@@ -83,6 +83,18 @@
15 return port > 0 ? port : DEVTOOLS_INVALID_PORT;
16 }
17
18+
19+static QString getDevtoolsHost()
20+{
21+ QString host;
22+ const char* DEVTOOLS_HOST_ENV_VAR = "UBUNTU_WEBVIEW_DEVTOOLS_HOST";
23+
24+ if (qEnvironmentVariableIsSet(DEVTOOLS_HOST_ENV_VAR)) {
25+ host = qgetenv(DEVTOOLS_HOST_ENV_VAR);
26+ }
27+ return host;
28+}
29+
30 void UbuntuBrowserPlugin::initializeEngine(QQmlEngine* engine, const char* uri)
31 {
32 Q_UNUSED(uri);
33@@ -102,6 +114,7 @@
34
35 context->setContextProperty("formFactor", getFormFactor());
36 context->setContextProperty("webviewDevtoolsDebugPort", getDevtoolsPort());
37+ context->setContextProperty("webviewDevtoolsDebugHost", getDevtoolsHost());
38
39 engine->addImageProvider("favicon", new FaviconImageProvider());
40 }
41
42=== modified file 'src/app/browserapplication.cpp'
43--- src/app/browserapplication.cpp 2014-09-15 17:08:41 +0000
44+++ src/app/browserapplication.cpp 2014-10-06 14:12:36 +0000
45@@ -77,6 +77,18 @@
46 return port;
47 }
48
49+QString BrowserApplication::inspectorHost() const
50+{
51+ QString host;
52+ Q_FOREACH(QHostAddress address, QNetworkInterface::allAddresses()) {
53+ if (!address.isLoopback() && (address.protocol() == QAbstractSocket::IPv4Protocol)) {
54+ host = address.toString();
55+ break;
56+ }
57+ }
58+ return host;
59+}
60+
61 QString BrowserApplication::appId() const
62 {
63 Q_FOREACH(const QString& argument, m_arguments) {
64@@ -123,8 +135,10 @@
65 #endif
66
67 QString devtoolsPort = inspectorPort();
68+ QString devtoolsHost = inspectorHost();
69 bool inspectorEnabled = !devtoolsPort.isEmpty();
70 if (inspectorEnabled) {
71+ qputenv("UBUNTU_WEBVIEW_DEVTOOLS_HOST", devtoolsHost.toUtf8());
72 qputenv("UBUNTU_WEBVIEW_DEVTOOLS_PORT", devtoolsPort.toUtf8());
73 }
74
75
76=== modified file 'src/app/browserapplication.h'
77--- src/app/browserapplication.h 2014-07-03 19:49:54 +0000
78+++ src/app/browserapplication.h 2014-10-06 14:12:36 +0000
79@@ -59,6 +59,7 @@
80 private:
81 QString appId() const;
82 QString inspectorPort() const;
83+ QString inspectorHost() const;
84
85 WebBrowserWindow *m_webbrowserWindowProxy;
86 };

Subscribers

People subscribed via source and target branches

to status/vote changes: