diff options
author | Xan Lopez <xan@gnome.org> | 2009-11-19 20:53:42 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2009-11-19 20:53:42 +0800 |
commit | 80b1f00b99bec7a0d11312d9f429ca199f8e7132 (patch) | |
tree | 2c72e28925d8f70915e064b62003e9fe95f803c5 | |
parent | 2b432eeaec3fad0172f936dd0e42cf8360a191c2 (diff) | |
download | gsoc2013-epiphany-80b1f00b99bec7a0d11312d9f429ca199f8e7132.tar gsoc2013-epiphany-80b1f00b99bec7a0d11312d9f429ca199f8e7132.tar.gz gsoc2013-epiphany-80b1f00b99bec7a0d11312d9f429ca199f8e7132.tar.bz2 gsoc2013-epiphany-80b1f00b99bec7a0d11312d9f429ca199f8e7132.tar.lz gsoc2013-epiphany-80b1f00b99bec7a0d11312d9f429ca199f8e7132.tar.xz gsoc2013-epiphany-80b1f00b99bec7a0d11312d9f429ca199f8e7132.tar.zst gsoc2013-epiphany-80b1f00b99bec7a0d11312d9f429ca199f8e7132.zip |
ephy-embed: only fetch the document type for a page from the main frame
Otherwise we will rewrite the right document type with the document
type from other frames in the page.
Bug #602400
-rw-r--r-- | embed/ephy-embed.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index ebb5e64e4..b49ab0fc6 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -369,22 +369,25 @@ mime_type_policy_decision_requested_cb (WebKitWebView *web_view, g_return_val_if_fail (mime_type, FALSE); - type = EPHY_WEB_VIEW_DOCUMENT_OTHER; - - if (!strcmp (mime_type, "text/html")) - type = EPHY_WEB_VIEW_DOCUMENT_HTML; - else if (!strcmp (mime_type, "application/xhtml+xml")) - type = EPHY_WEB_VIEW_DOCUMENT_XML; - else if (!strncmp (mime_type, "image/", 6)) - type = EPHY_WEB_VIEW_DOCUMENT_IMAGE; - - /* FIXME: maybe it makes more sense to have an API to query the mime - * type when the load of a page starts than doing this here. - */ - /* FIXME: rename ge-document-type (and all ge- signals...) to - * something else - */ - g_signal_emit_by_name (EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (embed), "ge-document-type", type); + /* Get the mime type for the page only from the main frame */ + if (webkit_web_view_get_main_frame (web_view) == frame) { + type = EPHY_WEB_VIEW_DOCUMENT_OTHER; + + if (!strcmp (mime_type, "text/html")) + type = EPHY_WEB_VIEW_DOCUMENT_HTML; + else if (!strcmp (mime_type, "application/xhtml+xml")) + type = EPHY_WEB_VIEW_DOCUMENT_XML; + else if (!strncmp (mime_type, "image/", 6)) + type = EPHY_WEB_VIEW_DOCUMENT_IMAGE; + + /* FIXME: mayb e it makes more sense to have an API to query the mime + * type when the load of a page starts than doing this here. + */ + /* FIXME: rename ge-document-type (and all ge- signals...) to + * something else + */ + g_signal_emit_by_name (EPHY_GET_EPHY_WEB_VIEW_FROM_EMBED (embed), "ge-document-type", type); + } /* If WebKit can't handle the mime type start the download process */ |