summaryrefslogtreecommitdiff
path: root/browser-plugin
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2010-05-05 17:50:52 +0100
committerBastien Nocera <hadess@hadess.net>2010-05-05 17:50:52 +0100
commitae5e1b16592a34f824713d655def63660f45100a (patch)
treed3029ae6b50638b9d6da1d5a2ace3432a1db7454 /browser-plugin
parent386142b4de7d6ce15448e50b32ba714a57090df7 (diff)
Fix URL parameter usage in GMP plugin
The URL parameter is never the baseURI, it's the same as the SRC parameter, so some websites use both. Add support for the actual "baseURL" parameter instead. Fixes playback at: http://www.ta3.com/sk/relacie/23_hlavne-spravy/9167_hlavne-spravy-z-27-aprila https://bugzilla.gnome.org/show_bug.cgi?id=617639
Diffstat (limited to 'browser-plugin')
-rw-r--r--browser-plugin/totemPlugin.cpp26
-rw-r--r--browser-plugin/totemPlugin.h1
2 files changed, 25 insertions, 2 deletions
diff --git a/browser-plugin/totemPlugin.cpp b/browser-plugin/totemPlugin.cpp
index a30ffcc8..25cf7ff1 100644
--- a/browser-plugin/totemPlugin.cpp
+++ b/browser-plugin/totemPlugin.cpp
@@ -1042,7 +1042,6 @@ totemPlugin::RequestStream (bool aForceViewer)
/* Prefer filename over src */
if (mURLURI) {
requestURI = mURLURI;
- baseURI = mSrcURI; /* FIXME: that correct? */
}
#endif /* TOTEM_GMP_PLUGIN */
@@ -1655,7 +1654,23 @@ totemPlugin::SetURL (const char* aURL)
mURLURI = g_strdup (aURL);
- /* FIXME: what is the correct base for the URL param? mSrcURI or mBaseURI? */
+ /* FIXME: security checks? */
+ /* FIXMEchpe: resolve the URI here? */
+}
+
+void
+totemPlugin::SetBaseURL (const char *aBaseURL)
+{
+ g_free (mBaseURI);
+
+ /* Don't allow empty URL */
+ if (!aBaseURL || !aBaseURL[0]) {
+ mBaseURI = NULL;
+ return;
+ }
+
+ mBaseURI = g_strdup (aBaseURL);
+
/* FIXME: security checks? */
/* FIXMEchpe: resolve the URI here? */
}
@@ -2006,6 +2021,12 @@ totemPlugin::Init (NPMIMEType mimetype,
if (filename) {
SetURL (filename);
}
+
+ /* http://msdn.microsoft.com/en-us/library/dd564090(v=VS.85).aspx */
+ const char *base = (const char *) g_hash_table_lookup (args, "baseurl");
+ if (base)
+ SetBaseURL (base);
+
#endif /* TOTEM_GMP_PLUGIN */
#ifdef TOTEM_NARROWSPACE_PLUGIN
@@ -2141,6 +2162,7 @@ totemPlugin::Init (NPMIMEType mimetype,
/* Dump some disagnostics */
D ("mSrcURI: %s", mSrcURI ? mSrcURI : "");
+ D ("mBaseURI: %s", mBaseURI ? mBaseURI : "");
D ("mCache: %d", mCache);
D ("mControllerHidden: %d", mControllerHidden);
D ("mShowStatusbar: %d", mShowStatusbar);
diff --git a/browser-plugin/totemPlugin.h b/browser-plugin/totemPlugin.h
index 1cd33d10..d42b9e19 100644
--- a/browser-plugin/totemPlugin.h
+++ b/browser-plugin/totemPlugin.h
@@ -284,6 +284,7 @@ class totemPlugin {
#ifdef TOTEM_GMP_PLUGIN
public:
void SetURL (const char* aURL);
+ void SetBaseURL (const char* aBaseURL);
const char* URL() const { return mURLURI; }
private: