Merge lp:~osomon/webbrowser-app/worker-script-no-regexp into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1033
Merged at revision: 1042
Proposed branch: lp:~osomon/webbrowser-app/worker-script-no-regexp
Merge into: lp:webbrowser-app
Diff against target: 57 lines (+14/-10)
3 files modified
src/Ubuntu/Web/ua-override-worker.js (+6/-2)
src/Ubuntu/Web/ua-overrides-desktop.js (+3/-3)
src/Ubuntu/Web/ua-overrides-mobile.js (+5/-5)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/worker-script-no-regexp
Reviewer Review Type Date Requested Status
Chris Coulson Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+260073@code.launchpad.net

Commit message

Pass plain strings to the worker script instead of RegExps.

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
Chris Coulson (chrisccoulson) wrote :

This looks like it should be compatible with the Oxide change. 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/ua-override-worker.js'
2--- src/Ubuntu/Web/ua-override-worker.js 2014-10-14 09:59:13 +0000
3+++ src/Ubuntu/Web/ua-override-worker.js 2015-05-25 21:23:59 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2014 Canonical Ltd.
7+ * Copyright 2014-2015 Canonical Ltd.
8 *
9 * This file is part of webbrowser-app.
10 *
11@@ -20,7 +20,11 @@
12
13 oxide.onMessage = function(msg) {
14 if ("overrides" in msg) {
15- overrides = msg["overrides"];
16+ var o = msg["overrides"];
17+ for (var i in o) {
18+ var r = o[i];
19+ overrides.push([new RegExp(r[0]), r[1]]);
20+ }
21 }
22 }
23
24
25=== modified file 'src/Ubuntu/Web/ua-overrides-desktop.js'
26--- src/Ubuntu/Web/ua-overrides-desktop.js 2015-01-28 12:00:18 +0000
27+++ src/Ubuntu/Web/ua-overrides-desktop.js 2015-05-25 21:23:59 +0000
28@@ -19,7 +19,7 @@
29 .pragma library
30
31 var overrides = [
32- [/^https?:\/\/(www\.)?google\.com\/calendar/, "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chromium/35.0.1870.2 Chrome/35.0.1870.2 Safari/537.36"],
33- [/^http:\/\/chrome\.angrybirds\.com\//, "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/35.0.1870.2 Safari/537.36"], // http://pad.lv/1284158
34- [/^https?:\/\/(www\.)?youtube\.com\//, "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/35.0.1870.2 Safari/537.36"], // http://pad.lv/1412880
35+ ["^https?:\/\/(www\.)?google\.com\/calendar", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chromium/35.0.1870.2 Chrome/35.0.1870.2 Safari/537.36"],
36+ ["^http:\/\/chrome\.angrybirds\.com\/", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/35.0.1870.2 Safari/537.36"], // http://pad.lv/1284158
37+ ["^https?:\/\/(www\.)?youtube\.com\/", "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/35.0.1870.2 Safari/537.36"], // http://pad.lv/1412880
38 ];
39
40=== modified file 'src/Ubuntu/Web/ua-overrides-mobile.js'
41--- src/Ubuntu/Web/ua-overrides-mobile.js 2015-02-03 16:58:20 +0000
42+++ src/Ubuntu/Web/ua-overrides-mobile.js 2015-05-25 21:23:59 +0000
43@@ -19,9 +19,9 @@
44 .pragma library
45
46 var overrides = [
47- [/^https?:\/\/mail\.google\.com\//, "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4) AppleWebKit/537.36 Chromium/35.0.1870.2 Mobile Safari"],
48- [/^https?:\/\/m\.youtube\.com\//, "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chromium/35.0.1870.2 Mobile Safari/537.36"], // http://pad.lv/1228415, http://pad.lv/1415107, http://pad.lv/1417258
49- [/^http:\/\/chrome\.angrybirds\.com\//, "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chrome/35.0.1870.2 Mobile Safari/537.36"], // http://pad.lv/1284158
50- [/^https?:\/\/(\w+\.)*hsbc\.com\.br\//, "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chrome/35.0.1870.2 Mobile Safari/537.36"], // http://pad.lv/1380657
51- [/^http:\/\/(\w+\.)*espn\.(go\.)?com\//, "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chrome/35.0.1870.2 Mobile Safari/537.36"], // http://pad.lv/1316259
52+ ["^https?:\/\/mail\.google\.com\/", "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4) AppleWebKit/537.36 Chromium/35.0.1870.2 Mobile Safari"],
53+ ["^https?:\/\/m\.youtube\.com\/", "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chromium/35.0.1870.2 Mobile Safari/537.36"], // http://pad.lv/1228415, http://pad.lv/1415107, http://pad.lv/1417258
54+ ["^http:\/\/chrome\.angrybirds\.com\/", "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chrome/35.0.1870.2 Mobile Safari/537.36"], // http://pad.lv/1284158
55+ ["^https?:\/\/(\w+\.)*hsbc\.com\.br\/", "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chrome/35.0.1870.2 Mobile Safari/537.36"], // http://pad.lv/1380657
56+ ["^http:\/\/(\w+\.)*espn\.(go\.)?com\/", "Mozilla/5.0 (Linux; Ubuntu 14.04 like Android 4.4;) AppleWebKit/537.36 Chrome/35.0.1870.2 Mobile Safari/537.36"], // http://pad.lv/1316259
57 ];

Subscribers

People subscribed via source and target branches

to status/vote changes: