diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-05-04 02:49:32 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-05-04 02:49:32 +0800 |
commit | a8903de9c29718f69cb5f847725ca09688e50474 (patch) | |
tree | 204732f77d5010e8dc5f09eb2f8afa9b519feb64 /embed/mozilla/mozilla-embed.cpp | |
parent | f4c20450ae05f307f3ccc9b673929c5759685ced (diff) | |
download | gsoc2013-epiphany-a8903de9c29718f69cb5f847725ca09688e50474.tar gsoc2013-epiphany-a8903de9c29718f69cb5f847725ca09688e50474.tar.gz gsoc2013-epiphany-a8903de9c29718f69cb5f847725ca09688e50474.tar.bz2 gsoc2013-epiphany-a8903de9c29718f69cb5f847725ca09688e50474.tar.lz gsoc2013-epiphany-a8903de9c29718f69cb5f847725ca09688e50474.tar.xz gsoc2013-epiphany-a8903de9c29718f69cb5f847725ca09688e50474.tar.zst gsoc2013-epiphany-a8903de9c29718f69cb5f847725ca09688e50474.zip |
Use the web navigation to get the URI, not the document. Fixes bug
2005-05-03 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphyBrowser.cpp:
* embed/mozilla/EphyBrowser.h:
* embed/mozilla/mozilla-embed.cpp:
Use the web navigation to get the URI, not the document.
Fixes bug #301044.
Diffstat (limited to 'embed/mozilla/mozilla-embed.cpp')
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index 016820e14..6afcdf82d 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -479,24 +479,30 @@ impl_get_location (EphyEmbed *embed, gboolean toplevel) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; - char *l; nsresult rv; - nsEmbedCString url; + nsCOMPtr<nsIURI> uri; if (toplevel) { - rv = mpriv->browser->GetDocumentUrl (url); - l = (NS_SUCCEEDED (rv) && url.Length()) ? - g_strdup (url.get()) : NULL; + rv = mpriv->browser->GetDocumentURI (getter_AddRefs (uri)); } else { - rv = mpriv->browser->GetTargetDocumentUrl (url); - l = (NS_SUCCEEDED (rv) && url.Length()) ? - g_strdup (url.get()) : NULL; + rv = mpriv->browser->GetTargetDocumentURI (getter_AddRefs (uri)); } - return l; + if (NS_FAILED (rv)) return NULL; + + nsCOMPtr<nsIURI> furi; + rv = uri->Clone (getter_AddRefs (furi)); + if (NS_FAILED (rv)) return NULL; + + furi->SetPassword (nsEmbedCString()); + + nsEmbedCString url; + furi->GetSpec (url); + + return url.Length() ? g_strdup (url.get()) : NULL; } static void |