Skip to content

Commit

Permalink
[xulrunner] Disable SiteSpecificUserAgent.js from the build. Contribu…
Browse files Browse the repository at this point in the history
…tes to JB#39252
  • Loading branch information
rainemak committed Aug 29, 2017
1 parent ec81435 commit 41ab4bc
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
@@ -0,0 +1,63 @@
From 7aab4545f513cd082c35005b8ec3392c44ab467b Mon Sep 17 00:00:00 2001
From: Raine Makelainen <raine.makelainen@jolla.com>
Date: Tue, 29 Aug 2017 14:30:11 +0300
Subject: [PATCH 19/19] [xulrunner] Disable SiteSpecificUserAgent.js from the
build. Contributes to JB#39252

As both "general.useragent.override" and nsISiteSpecificUserAgent
are used and EmbedLite Components provides a UserAgentOverrideHelper
component that implements both complex UA override (register's handler)
and nsISiteSpecificUserAgent that is loaded on startup, let it update
also user agent string that is exposed via DOM's window.navigator.

Signed-off-by: Raine Makelainen <raine.makelainen@jolla.com>
---
dom/base/Navigator.cpp | 3 +++
dom/base/moz.build | 5 ++---
2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index 7288420..ab94e3c 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -2590,6 +2590,8 @@ Navigator::GetUserAgent(nsPIDOMWindow* aWindow, nsIURI* aURI,
{
MOZ_ASSERT(NS_IsMainThread());

+ // Pass call through to nsISiteSpecificUserAgent provided by EmbedLite Components.
+#if 0
if (!aIsCallerChrome) {
const nsAdoptingString& override =
mozilla::Preferences::GetString("general.useragent.override");
@@ -2599,6 +2601,7 @@ Navigator::GetUserAgent(nsPIDOMWindow* aWindow, nsIURI* aURI,
return NS_OK;
}
}
+#endif

nsresult rv;
nsCOMPtr<nsIHttpProtocolHandler>
diff --git a/dom/base/moz.build b/dom/base/moz.build
index 27de87b..9629be7 100644
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -375,14 +375,13 @@ EXTRA_COMPONENTS += [
'contentAreaDropListener.manifest',
'messageWakeupService.js',
'messageWakeupService.manifest',
- 'SiteSpecificUserAgent.js',
- 'SiteSpecificUserAgent.manifest',
'SlowScriptDebug.js',
'SlowScriptDebug.manifest',
]

+# Disable SiteSpecificUserAgent.js
# Firefox for Android provides an alternate version of this component
-if CONFIG['MOZ_BUILD_APP'] != 'mobile/android':
+if CONFIG['MOZ_BUILD_APP'] not in ['mobile/android', 'xulrunner']:
EXTRA_COMPONENTS += [
'SiteSpecificUserAgent.js',
'SiteSpecificUserAgent.manifest',
--
2.7.4

2 changes: 2 additions & 0 deletions rpm/xulrunner-qt5.spec
Expand Up @@ -62,6 +62,7 @@ Patch15: 0015-Update-build-version.-Contributes-to-JB-35001.patch
Patch16: 0016-Bug-1253215-Initialize-RequestSyncService-only-if-it.patch
Patch17: 0017-Don-t-print-errors-from-DataReportingService.patch
Patch18: 0018-Don-t-try-to-access-undefined-app-list-of-AppsServic.patch
Patch19: 0019-xulrunner-Disable-SiteSpecificUserAgent.js-from-the-.patch
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(pango)
Expand Down Expand Up @@ -168,6 +169,7 @@ Tests and misc files for xulrunner.
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1

mkdir -p "%BUILD_DIR"
cp -rf "%BASE_CONFIG" "%BUILD_DIR"/mozconfig
Expand Down

0 comments on commit 41ab4bc

Please sign in to comment.