Commit ce3ecafe authored by Dmitry Rozhkov's avatar Dmitry Rozhkov

[embedlite-components] Add patch tweaking UA for Dailymotion

parent 3e4dcd49
From cd6d890d119b9d7c25cd19690c6a19bc4cbc07fa Mon Sep 17 00:00:00 2001
From 717b5ff0d490afd22e444e821e9e9d9530cba8b4 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] [embedlite-components] Tweak UA for Facebook to get images of
proper sizes
Subject: [PATCH 1/2] Tweak UA for Facebook to get images of proper sizes
---
jscomps/UserAgentOverrideHelper.js | 4 ++++
......@@ -31,5 +30,5 @@ index 664e140..a7ea781 100644
}
--
1.9.3
1.9.1
From dfacbb1debb60cad3a4b6b22895aea80c9acbea2 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 a7ea781..34806f9 100644
--- a/jscomps/UserAgentOverrideHelper.js
+++ b/jscomps/UserAgentOverrideHelper.js
@@ -49,6 +49,7 @@ var UserAgent = {
YOUTUBE_DOMAIN: /(^|\.)youtube\.com$/,
NOKIA_HERE_DOMAIN: /(^|\.)here\.com$/,
FACEBOOK_DOMAIN: /(^|\.)facebook\.com$/,
+ DAILYMOTION_DOMAIN: /(^|\.)dailymotion.com$/,
_customUA: null,
getCustomUserAgent: function() {
@@ -113,6 +114,9 @@ var UserAgent = {
} else if (this.FACEBOOK_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";
}
}
--
1.9.1
......@@ -6,7 +6,8 @@ Group: Applications/Internet
License: Mozilla License
URL: https://github.com/tmeshkova/embedlite-components
Source0: %{name}-%{version}.tar.bz2
Patch0: 0001-embedlite-components-Tweak-UA-for-Facebook-to-get-im.patch
Patch0: 0001-Tweak-UA-for-Facebook-to-get-images-of-proper-sizes.patch
Patch1: 0002-Tweak-UA-for-Dailymotion-to-get-working-fullscreen-b.patch
BuildRequires: xulrunner-qt5-devel >= 31.7.0.14
BuildRequires: pkgconfig(nspr)
BuildRequires: python
......@@ -25,6 +26,7 @@ EmbedLite Components required for embeded browser UI
# >> setup
%patch0 -p1
%patch1 -p1
# << setup
%build
......
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