Commit d0ade277 authored by Raine Mäkeläinen's avatar Raine Mäkeläinen

Merge pull request #7 from nemomobile-packages/ua-fix

[embedlite-components] Update engadget.com to use same UA as facebook.com. Contributes to JB#32567
parents a9d02a7f b71831d2
From 717b5ff0d490afd22e444e821e9e9d9530cba8b4 Mon Sep 17 00:00:00 2001
From a4d323d8a72cb7cf8907d87a070a9ad5d8e9c677 Mon Sep 17 00:00:00 2001
From: Dmitry Rozhkov <dmitry.rozhkov@jolla.com>
Date: Thu, 21 Aug 2014 12:44:30 +0300
Subject: [PATCH 1/2] Tweak UA for Facebook to get images of proper sizes
Subject: [PATCH 1/2] Tweak UA for Facebook and Engadget to get images of
proper sizes
This user agent string (or something like this) could also
be used as a testing platform for new default user agent.
---
jscomps/UserAgentOverrideHelper.js | 4 ++++
1 file changed, 4 insertions(+)
jscomps/UserAgentOverrideHelper.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/jscomps/UserAgentOverrideHelper.js b/jscomps/UserAgentOverrideHelper.js
index 664e140..a7ea781 100644
index 5275eaf..307ff01 100644
--- a/jscomps/UserAgentOverrideHelper.js
+++ b/jscomps/UserAgentOverrideHelper.js
@@ -48,6 +48,7 @@ var UserAgent = {
@@ -48,6 +48,8 @@ var UserAgent = {
GOOGLE_MAPS_DOMAIN: /(^|\.)maps\.google\.com$/,
YOUTUBE_DOMAIN: /(^|\.)youtube\.com$/,
NOKIA_HERE_DOMAIN: /(^|\.)here\.com$/,
+ FACEBOOK_DOMAIN: /(^|\.)facebook\.com$/,
+ ENGADGET_DOMAIN: /(^|\.)engadget.com$/,
_customUA: null,
getCustomUserAgent: function() {
@@ -109,6 +110,9 @@ var UserAgent = {
@@ -105,6 +107,9 @@ var UserAgent = {
if (!ua.contains("Mobile")) {
return ua.replace("X11", "Android").replace("Unix", "Android").replace("Linux", "Mobile");
}
+ } else if (this.FACEBOOK_DOMAIN.test(aUri.host)) {
+ } else if (this.FACEBOOK_DOMAIN.test(aUri.host) || this.ENGADGET_DOMAIN.test(aUri.host)) {
+ // Facebook works best when UA is a copy of Firefox for Android, but without "Android" keyword
+ return "Mozilla/5.0 (Sailfish; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0";
}
}
--
1.9.1
2.1.4
From dfacbb1debb60cad3a4b6b22895aea80c9acbea2 Mon Sep 17 00:00:00 2001
From 3e8984ce16205a895a00af1333cd0fcac8051bcf Mon Sep 17 00:00:00 2001
From: Dmitry Rozhkov <dmitry.rozhkov@jolla.com>
Date: Fri, 31 Jul 2015 11:24:49 +0300
Subject: [PATCH 2/2] Tweak UA for Dailymotion to get working fullscreen button
......@@ -8,19 +8,19 @@ Subject: [PATCH 2/2] Tweak UA for Dailymotion to get working fullscreen button
1 file changed, 4 insertions(+)
diff --git a/jscomps/UserAgentOverrideHelper.js b/jscomps/UserAgentOverrideHelper.js
index a7ea781..34806f9 100644
index 307ff01..26193c4 100644
--- a/jscomps/UserAgentOverrideHelper.js
+++ b/jscomps/UserAgentOverrideHelper.js
@@ -49,6 +49,7 @@ var UserAgent = {
YOUTUBE_DOMAIN: /(^|\.)youtube\.com$/,
@@ -50,6 +50,7 @@ var UserAgent = {
NOKIA_HERE_DOMAIN: /(^|\.)here\.com$/,
FACEBOOK_DOMAIN: /(^|\.)facebook\.com$/,
ENGADGET_DOMAIN: /(^|\.)engadget.com$/,
+ DAILYMOTION_DOMAIN: /(^|\.)dailymotion.com$/,
_customUA: null,
getCustomUserAgent: function() {
@@ -113,6 +114,9 @@ var UserAgent = {
} else if (this.FACEBOOK_DOMAIN.test(aUri.host)) {
@@ -110,6 +111,9 @@ var UserAgent = {
} else if (this.FACEBOOK_DOMAIN.test(aUri.host) || this.ENGADGET_DOMAIN.test(aUri.host)) {
// Facebook works best when UA is a copy of Firefox for Android, but without "Android" keyword
return "Mozilla/5.0 (Sailfish; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0";
+ } else if (this.DAILYMOTION_DOMAIN.test(aUri.host)) {
......@@ -30,5 +30,5 @@ index a7ea781..34806f9 100644
}
--
1.9.1
2.1.4
......@@ -22,7 +22,7 @@ Group: Applications/Internet
License: Mozilla License
URL: https://github.com/tmeshkova/embedlite-components
Source0: %{name}-%{version}.tar.bz2
Patch0: 0001-Tweak-UA-for-Facebook-to-get-images-of-proper-sizes.patch
Patch0: 0001-Tweak-UA-for-Facebook-and-Engadget-to-get-images-of-.patch
Patch1: 0002-Tweak-UA-for-Dailymotion-to-get-working-fullscreen-b.patch
BuildRequires: xulrunner-qt5-devel >= 31.7.0.14
BuildRequires: pkgconfig(nspr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment