Merge lp:~phablet-team/webbrowser-app/OTA-15 into lp:~phablet-team/webbrowser-app/OTA-14-vivid

Proposed by Olivier Tilloy
Status: Merged
Merged at revision: 1529
Proposed branch: lp:~phablet-team/webbrowser-app/OTA-15
Merge into: lp:~phablet-team/webbrowser-app/OTA-14-vivid
Diff against target: 250 lines (+107/-42)
8 files modified
CMakeLists.txt (+0/-5)
debian/changelog (+11/-0)
debian/control (+1/-2)
src/Ubuntu/CMakeLists.txt (+0/-8)
src/Ubuntu/Web/UbuntuWebContext.qml (+7/-1)
src/Ubuntu/Web/ua-overrides-desktop.js.in (+43/-14)
src/Ubuntu/Web/ua-overrides-mobile.js.in (+39/-12)
tests/unittests/qml/CMakeLists.txt (+6/-0)
To merge this branch: bzr merge lp:~phablet-team/webbrowser-app/OTA-15
Reviewer Review Type Date Requested Status
Ubuntu Phablet Team Pending
Review via email: mp+315484@code.launchpad.net

Commit message

* Replace chromium version in UA overrides at runtime, not at build time (LP: #1599695)
* Complete overhaul of UA overrides.
* Add UA overrides for Google+ (LP: #1656310)
* Add a UA override for Ebay (LP: #1575780)

To post a comment you must log in.
1532. By Olivier Tilloy

Add a UA override for appear.in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-07-01 13:09:27 +0000
+++ CMakeLists.txt 2017-01-25 13:24:58 +0000
@@ -11,11 +11,6 @@
11if(NOT INTLTOOL_EXTRACT)11if(NOT INTLTOOL_EXTRACT)
12 message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")12 message(FATAL_ERROR "Could not find intltool-extract, please install the intltool package")
13endif()13endif()
14find_program(XVFBRUN xvfb-run)
15if(NOT XVFBRUN)
16 message(FATAL_ERROR "Could not find xvfb-run, please install the xvfb package")
17endif()
18set(XVFB_COMMAND ${XVFBRUN} -s "-screen 0 640x480x24" -a)
1914
20# Standard install paths15# Standard install paths
21include(GNUInstallDirs)16include(GNUInstallDirs)
2217
=== modified file 'debian/changelog'
--- debian/changelog 2017-01-13 18:34:37 +0000
+++ debian/changelog 2017-01-25 13:24:58 +0000
@@ -1,3 +1,14 @@
1webbrowser-app (0.23+15.04.20170125-0ubuntu1) UNRELEASED; urgency=medium
2
3 * Replace chromium version in UA overrides at runtime,
4 not at build time (LP: #1599695)
5 * Complete overhaul of UA overrides.
6 * Add UA overrides for Google+ (LP: #1656310)
7 * Add a UA override for Ebay (LP: #1575780)
8 * Add a UA override for appear.in (LP: #1659288)
9
10 -- Olivier Tilloy <olivier.tilloy@canonical.com> Wed, 25 Jan 2017 14:23:38 +0100
11
1webbrowser-app (0.23+15.04.20160825-0ubuntu1) vivid; urgency=medium12webbrowser-app (0.23+15.04.20160825-0ubuntu1) vivid; urgency=medium
213
3 [ Florian Boucault ]14 [ Florian Boucault ]
415
=== modified file 'debian/control'
--- debian/control 2016-08-25 09:52:00 +0000
+++ debian/control 2017-01-25 13:24:58 +0000
@@ -11,7 +11,7 @@
11 dh-translations,11 dh-translations,
12 libapparmor-dev,12 libapparmor-dev,
13 libevdev-dev,13 libevdev-dev,
14 liboxideqt-qmlplugin (>= 1.15),14 liboxideqt-qmlplugin (>= 1.12),
15 libqt5sql5-sqlite,15 libqt5sql5-sqlite,
16 libudev-dev,16 libudev-dev,
17 lsb-release,17 lsb-release,
@@ -23,7 +23,6 @@
23 qml-module-qtquick2 (>= 5.4),23 qml-module-qtquick2 (>= 5.4),
24 qml-module-qtquick-layouts,24 qml-module-qtquick-layouts,
25 qml-module-qttest,25 qml-module-qttest,
26 qmlscene,
27 qt5-default,26 qt5-default,
28 qt5-qmake,27 qt5-qmake,
29 qtbase5-dev (>= 5.4),28 qtbase5-dev (>= 5.4),
3029
=== modified file 'src/Ubuntu/CMakeLists.txt'
--- src/Ubuntu/CMakeLists.txt 2016-07-01 13:06:40 +0000
+++ src/Ubuntu/CMakeLists.txt 2017-01-25 13:24:58 +0000
@@ -23,13 +23,5 @@
23 OUTPUT_VARIABLE UBUNTU_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)23 OUTPUT_VARIABLE UBUNTU_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
24add_definitions(-DUBUNTU_VERSION="${UBUNTU_VERSION}")24add_definitions(-DUBUNTU_VERSION="${UBUNTU_VERSION}")
2525
26execute_process(COMMAND ${XVFB_COMMAND} qmlscene --quit ${CMAKE_CURRENT_SOURCE_DIR}/chromium-version.qml
27 OUTPUT_VARIABLE CHROMIUM_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
28string(REGEX MATCH "\\[(.*)\\]" _ ${CHROMIUM_VERSION})
29set(CHROMIUM_VERSION ${CMAKE_MATCH_1})
30if(NOT CHROMIUM_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
31 message(FATAL_ERROR "Invalid chromium version: '${CHROMIUM_VERSION}'")
32endif()
33
34add_subdirectory(Components)26add_subdirectory(Components)
35add_subdirectory(Web)27add_subdirectory(Web)
3628
=== modified file 'src/Ubuntu/Web/UbuntuWebContext.qml'
--- src/Ubuntu/Web/UbuntuWebContext.qml 2016-06-14 18:49:01 +0000
+++ src/Ubuntu/Web/UbuntuWebContext.qml 2017-01-25 13:24:58 +0000
@@ -88,7 +88,13 @@
88 }88 }
89 if (temp !== null) {89 if (temp !== null) {
90 console.log("Loaded %1 UA override(s) from %2".arg(temp.overrides.length).arg(Qt.resolvedUrl(script)))90 console.log("Loaded %1 UA override(s) from %2".arg(temp.overrides.length).arg(Qt.resolvedUrl(script)))
91 userAgentOverrides = temp.overrides91 var chromiumVersion = Oxide.Oxide.chromiumVersion
92 var overrides = []
93 for (var o in temp.overrides) {
94 var override = temp.overrides[o]
95 overrides.push([override[0], override[1].replace(/\$\{CHROMIUM_VERSION\}/g, chromiumVersion)])
96 }
97 userAgentOverrides = overrides
92 temp.destroy()98 temp.destroy()
93 }99 }
94 }100 }
95101
=== modified file 'src/Ubuntu/Web/ua-overrides-desktop.js.in'
--- src/Ubuntu/Web/ua-overrides-desktop.js.in 2016-08-19 10:10:12 +0000
+++ src/Ubuntu/Web/ua-overrides-desktop.js.in 2017-01-25 13:24:58 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2014-2016 Canonical Ltd.2 * Copyright 2014-2017 Canonical Ltd.
3 *3 *
4 * This file is part of webbrowser-app.4 * This file is part of webbrowser-app.
5 *5 *
@@ -18,18 +18,47 @@
1818
19.pragma library19.pragma library
2020
21// Note: when changing the value of this variable, all domains which
22// use it must be carefully tested to ensure no regression.
23var chrome_desktop_override = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/${CHROMIUM_VERSION} Chrome/${CHROMIUM_VERSION} Safari/537.36";
24
21var overrides = [25var overrides = [
22 ["^https?:\/\/(www\.)?google\.com\/calendar", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chromium/@CHROMIUM_VERSION@ Chrome/@CHROMIUM_VERSION@ Safari/537.36"],26 // Google calendar
23 ["^http:\/\/chrome\.angrybirds\.com\/", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Safari/537.36"], // http://pad.lv/128415827 ["^https:\/\/calendar\.google\.com\/", chrome_desktop_override],
24 ["^https?:\/\/(www\.)?youtube\.com\/", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Safari/537.36"], // http://pad.lv/141288028 ["^https:\/\/.+\.google\.com\/calendar\/", chrome_desktop_override],
25 ["^https?:\/\/(www\.)?google\..+\/maps", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Safari/537.36"], // http://pad.lv/1503506, http://pad.lv/155164929
26 ["^https?:\/\/mail\.google\.com\/", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Safari/537.36"], // http://pad.lv/145261630 // Youtube (https://launchpad.net/bugs/1412880)
2731 ["^https:\/\/(www\.)?youtube\.com\/", chrome_desktop_override],
28 // Google hangouts (https://launchpad.net/bugs/1565055)32
29 ["^https?:\/\/hangouts\.google\.com\/", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Safari/537.36"],33 // Google maps (https://launchpad.net/bugs/1503506, https://launchpad.net/bugs/1551649)
30 ["^https?:\/\/talkgadget\.google\.com\/hangouts\/", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Safari/537.36"],34 ["^https:\/\/(www\.)?google\..+\/maps", chrome_desktop_override],
31 ["^https?:\/\/plus\.google\.com\/hangouts\/", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Safari/537.36"],35
3236 // Gmail (https://launchpad.net/bugs/1452616)
33 // Google recaptcha (https://launchpad.net/bugs/1599146)37 ["^https:\/\/mail\.google\.com\/", chrome_desktop_override],
34 ["^https:\/\/www\.google\.com\/recaptcha\/", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Safari/537.36"],38
39 // Google docs (https://launchpad.net/bugs/1643386)
40 ["^https:\/\/(docs|drive)\.google\.com\/", chrome_desktop_override],
41
42 // Google plus (https://launchpad.net/bugs/1656310)
43 ["^https:\/\/plus\.google\.com\/", chrome_desktop_override],
44
45 // Google hangouts (https://launchpad.net/bugs/1565055)
46 ["^https:\/\/hangouts\.google\.com\/", chrome_desktop_override],
47 ["^https:\/\/talkgadget\.google\.com\/hangouts\/", chrome_desktop_override],
48 ["^https:\/\/plus\.google\.com\/hangouts\/", chrome_desktop_override],
49
50 // Google recaptcha (https://launchpad.net/bugs/1599146)
51 ["^https:\/\/www\.google\.com\/recaptcha\/", chrome_desktop_override],
52
53 // (mobile) twitter (https://launchpad.net/bugs/1577834)
54 ["^https:\/\/mobile\.twitter\.com\/", chrome_desktop_override],
55
56 // meet.jit.si (https://launchpad.net/bugs/1635971)
57 ["^https:\/\/meet\.jit\.si\/", chrome_desktop_override],
58
59 // ESPN websites (https://launchpad.net/bugs/1637285)
60 ["^https?:\/\/(.+\.)?espn(fc)?\.co(m|\.uk)\/", chrome_desktop_override],
61
62 // Ebay (https://launchpad.net/bugs/1575780)
63 ["^https?:\/\/(.+\.)?ebay\.(at|be|ca|ch|cn|co\.jp|co\.th|co\.uk|com|com\.au|com\.hk|com\.my|com\.sg|com\.tw|de|es|fr|ie|in|it|nl|ph|pl|se|vn)\/", chrome_desktop_override],
35];64];
3665
=== modified file 'src/Ubuntu/Web/ua-overrides-mobile.js.in'
--- src/Ubuntu/Web/ua-overrides-mobile.js.in 2016-08-19 10:10:12 +0000
+++ src/Ubuntu/Web/ua-overrides-mobile.js.in 2017-01-25 13:24:58 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2014-2016 Canonical Ltd.2 * Copyright 2014-2017 Canonical Ltd.
3 *3 *
4 * This file is part of webbrowser-app.4 * This file is part of webbrowser-app.
5 *5 *
@@ -18,19 +18,46 @@
1818
19.pragma library19.pragma library
2020
21// Note: when changing the values of these variables, all domains which
22// use them must be carefully tested to ensure no regression.
23var android_no_device_override = "Mozilla/5.0 (Linux; Android 5.0;) AppleWebKit/537.36 Chrome/${CHROMIUM_VERSION} Mobile Safari/537.36";
24var nexus5_override = "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@; Android 5.0; Nexus 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${CHROMIUM_VERSION} Mobile Safari/537.36";
25var ubuntu_like_android_override = "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@ like Android 5.0;) AppleWebKit/537.36 Chrome/${CHROMIUM_VERSION} Mobile Safari/537.36";
26var no_android_token = "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@;) AppleWebKit/537.36 Chrome/${CHROMIUM_VERSION} Mobile Safari/537.36";
27
21var overrides = [28var overrides = [
22 ["^https?:\/\/mail\.google\.com\/", "Mozilla/5.0 (Linux; Android 5.0;) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"], // http://pad.lv/137588929 // Youtube (https://launchpad.net/bugs/1228415, https://launchpad.net/bugs/1415107, https://launchpad.net/bugs/1417258, https://launchpad.net/bugs/1499394, https://launchpad.net/bugs/1408760, https://launchpad.net/bugs/1437485)
23 ["^https?:\/\/(www|m)\.youtube\.com\/", "Mozilla/5.0 (Linux; Android 5.0;) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"], // http://pad.lv/1228415, http://pad.lv/1415107, http://pad.lv/1417258, http://pad.lv/1499394, http://pad.lv/1408760, http://pad.lv/143748530 ["^https:\/\/(www|m)\.youtube\.com\/", android_no_device_override],
24 ["^http:\/\/chrome\.angrybirds\.com\/", "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@ like Android 4.4;) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"], // http://pad.lv/128415831
25 ["^https?:\/\/(\w+\.)*hsbc\.com\.br\/", "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@ like Android 4.4;) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"], // http://pad.lv/138065732 // Gmail (https://launchpad.net/bugs/1375889)
26 ["^http:\/\/(\w+\.)*espn\.(go\.)?com\/", "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@ like Android 4.4;) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"], // http://pad.lv/131625933 ["^https:\/\/mail\.google\.com\/", android_no_device_override],
27 ["^https?:\/\/(www|m)\.facebook\.com\/", "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@; Android 5.0; Nexus 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"], // http://pad.lv/1538056, http://pad.lv/145766134
28 ["^https?:\/\/(mobile\.)?nytimes\.com\/", "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@; Android 5.0; Nexus 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"], // http://pad.lv/157362035 // Google plus (https://launchpad.net/bugs/1656310)
36 ["^https:\/\/plus\.google\.com\/", ubuntu_like_android_override],
37
29 // Google hangouts (https://launchpad.net/bugs/1565055)38 // Google hangouts (https://launchpad.net/bugs/1565055)
30 ["^https?:\/\/hangouts\.google\.com\/", "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@ like Android 4.4;) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"],39 ["^https:\/\/hangouts\.google\.com\/", ubuntu_like_android_override],
31 ["^https?:\/\/talkgadget\.google\.com\/hangouts\/", "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@ like Android 4.4;) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"],40 ["^https:\/\/talkgadget\.google\.com\/hangouts\/", ubuntu_like_android_override],
32 ["^https?:\/\/plus\.google\.com\/hangouts\/", "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@ like Android 4.4;) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Mobile Safari/537.36"],41 ["^https:\/\/plus\.google\.com\/hangouts\/", ubuntu_like_android_override],
3342
34 // Google recaptcha (https://launchpad.net/bugs/1599146)43 // Google recaptcha (https://launchpad.net/bugs/1599146)
35 ["^https:\/\/www\.google\.com\/recaptcha\/", "Mozilla/5.0 (Linux; Ubuntu @UBUNTU_VERSION@ like Android 4.4;) AppleWebKit/537.36 Chrome/@CHROMIUM_VERSION@ Safari/537.36"],44 ["^https:\/\/www\.google\.com\/recaptcha\/", ubuntu_like_android_override],
45
46 // Facebook (https://launchpad.net/bugs/1538056, https://launchpad.net/bugs/1457661)
47 ["^https:\/\/(www|m)\.facebook\.com\/", nexus5_override],
48
49 // Twitter (https://launchpad.net/bugs/1577834)
50 ["^https:\/\/mobile\.twitter\.com\/", no_android_token],
51
52 // meet.jit.si (https://launchpad.net/bugs/1635971)
53 ["^https:\/\/meet\.jit\.si\/", ubuntu_like_android_override],
54
55 // ESPN websites (https://launchpad.net/bugs/1316259)
56 ["^http:\/\/(\w+\.)*espn\.(go\.)?com\/", ubuntu_like_android_override],
57
58 // New York Times (https://launchpad.net/bugs/1573620)
59 ["^https?:\/\/(mobile\.)?nytimes\.com\/", nexus5_override],
60
61 // appear.in (https://launchpad.net/bugs/1659288)
62 ["^https:\/\/appear\.in\/", no_android_token],
36];63];
3764
=== modified file 'tests/unittests/qml/CMakeLists.txt'
--- tests/unittests/qml/CMakeLists.txt 2016-07-01 12:51:45 +0000
+++ tests/unittests/qml/CMakeLists.txt 2017-01-25 13:24:58 +0000
@@ -6,6 +6,12 @@
6find_package(Qt5QuickTest REQUIRED)6find_package(Qt5QuickTest REQUIRED)
7find_package(Qt5Sql REQUIRED)7find_package(Qt5Sql REQUIRED)
88
9find_program(XVFBRUN xvfb-run)
10if(NOT XVFBRUN)
11 message(FATAL_ERROR "Could not find xvfb-run, please install the xvfb package")
12endif()
13set(XVFB_COMMAND ${XVFBRUN} -s "-screen 0 640x480x24" -a)
14
9set(TEST tst_QmlTests)15set(TEST tst_QmlTests)
10set(SOURCES16set(SOURCES
11 ${webbrowser-common_SOURCE_DIR}/favicon-fetcher.cpp17 ${webbrowser-common_SOURCE_DIR}/favicon-fetcher.cpp

Subscribers

People subscribed via source and target branches

to all changes: