aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-embed-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'embed/ephy-embed-utils.c')
-rw-r--r--embed/ephy-embed-utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 4a9c44c85..5fe226309 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -119,3 +119,20 @@ ephy_embed_utils_get_title_composite (EphyEmbed *embed)
return title != NULL ? title : "";
}
+gboolean
+ephy_embed_utils_address_has_web_scheme (const char *address)
+{
+ gboolean has_web_scheme;
+
+ if (address == NULL) return FALSE;
+
+ has_web_scheme = (g_str_has_prefix (address, "http:") ||
+ g_str_has_prefix (address, "https:") ||
+ g_str_has_prefix (address, "ftp:") ||
+ g_str_has_prefix (address, "file:") ||
+ g_str_has_prefix (address, "data:") ||
+ g_str_has_prefix (address, "about:") ||
+ g_str_has_prefix (address, "gopher:"));
+
+ return has_web_scheme;
+}