summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Harrison <pharrison@mythtv.org>2011-08-10 21:10:02 (GMT)
committer Paul Harrison <pharrison@mythtv.org>2011-08-10 21:10:02 (GMT)
commitf19c6108ad4b9b75fa25993a34cef1d0dbb1695d (patch)
treee8031204d4cd0c104ea504105185c634e8752780
parent40c8de1195af42669e1f42d332e8c1d0797599ff (diff)
MythBrowser: Change the user-agent string reported by the browser widget.
This replaces the name 'Safari' with 'MythBrowser' in the default user-agent string sent by MythBrowser. This fixes a problem with the BBC iPlayer thinking we are running on an unsupported mobile phone and refusing to do anything!
-rw-r--r--mythtv/libs/libmythui/mythuiwebbrowser.cpp5
-rw-r--r--mythtv/libs/libmythui/mythuiwebbrowser.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/mythtv/libs/libmythui/mythuiwebbrowser.cpp b/mythtv/libs/libmythui/mythuiwebbrowser.cpp
index 89b8b4a..1505b71 100644
--- a/mythtv/libs/libmythui/mythuiwebbrowser.cpp
+++ b/mythtv/libs/libmythui/mythuiwebbrowser.cpp
@@ -295,6 +295,11 @@ bool MythWebPage::extension(Extension extension, const ExtensionOption *option,
return false;
}
+QString MythWebPage::userAgentForUrl(const QUrl &url) const
+{
+ return QWebPage::userAgentForUrl(url).replace("Safari", "MythBrowser");
+}
+
/**
* @class MythWebView
* @brief Subclass of QWebView
diff --git a/mythtv/libs/libmythui/mythuiwebbrowser.h b/mythtv/libs/libmythui/mythuiwebbrowser.h
index 145bbbe..594e074 100644
--- a/mythtv/libs/libmythui/mythuiwebbrowser.h
+++ b/mythtv/libs/libmythui/mythuiwebbrowser.h
@@ -65,6 +65,7 @@ class MythWebPage : public QWebPage
virtual bool supportsExtension (Extension extension) const;
protected:
+ virtual QString userAgentForUrl(const QUrl &url) const;
private:
friend class MythWebView;