Commit 9ff76353 authored by Raine Makelainen's avatar Raine Makelainen

[embedlite-components] Remove UA tweaks. Contributes to JB#34904

parent 879e8d79
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 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 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/jscomps/UserAgentOverrideHelper.js b/jscomps/UserAgentOverrideHelper.js
index 5275eaf..307ff01 100644
--- a/jscomps/UserAgentOverrideHelper.js
+++ b/jscomps/UserAgentOverrideHelper.js
@@ -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() {
@@ -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) || 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";
}
}
--
2.1.4
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
---
jscomps/UserAgentOverrideHelper.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/jscomps/UserAgentOverrideHelper.js b/jscomps/UserAgentOverrideHelper.js
index 307ff01..26193c4 100644
--- a/jscomps/UserAgentOverrideHelper.js
+++ b/jscomps/UserAgentOverrideHelper.js
@@ -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() {
@@ -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)) {
+ // Fullscreen button doesn't work well without Android in UA string
+ return "Mozilla/5.0 (Android; U; Jolla; Sailfish; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0 SailfishBrowser/1.0";
}
}
--
2.1.4
......@@ -24,8 +24,6 @@ Group: Applications/Internet
License: MPLv2
URL: https://github.com/tmeshkova/embedlite-components
Source0: %{name}-%{version}.tar.bz2
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 >= %{min_xulrunner_version}
BuildRequires: pkgconfig(nspr)
BuildRequires: python
......@@ -42,9 +40,6 @@ EmbedLite Components required for embeded browser UI
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%build
NO_CONFIGURE=yes ./autogen.sh
......
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