[epiphany/mcatanzaro/gpu] Expose about:gpu



commit b2569974563f969fcbef692386b0e1c0d69163e6
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Fri Oct 4 10:48:20 2019 -0500

    Expose about:gpu
    
    This doesn't work properly yet:
    
     * Entering webkit://gpu into the address bar performs a search, even
    though I have added it to the non-search regex
     * It displays an insecure lock icon, which I believe is a WebKit bug.
    WebKitSecurityManager does not know that the webkit:// protocol is
    local.

 embed/ephy-embed-utils.c | 12 +++++++++---
 embed/ephy-web-view.h    |  1 +
 meson.build              |  2 +-
 3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 963569a96..1b340a83f 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -133,7 +133,8 @@ ephy_embed_utils_address_has_web_scheme (const char *address)
                      g_ascii_strncasecmp (address, "ephy-about", colonpos) &&
                      g_ascii_strncasecmp (address, "ephy-source", colonpos) &&
                      g_ascii_strncasecmp (address, "gopher", colonpos) &&
-                     g_ascii_strncasecmp (address, "inspector", colonpos));
+                     g_ascii_strncasecmp (address, "inspector", colonpos) &&
+                     g_ascii_strncasecmp (address, "webkit", colonpos));
 
   return has_web_scheme;
 }
@@ -248,8 +249,13 @@ ephy_embed_utils_normalize_address (const char *address)
   if (ephy_embed_utils_address_is_existing_absolute_filename (address))
     return g_strconcat ("file://", address, NULL);
 
-  if (g_str_has_prefix (address, "about:") && strcmp (address, "about:blank"))
-    return g_strconcat (EPHY_ABOUT_SCHEME, address + strlen ("about"), NULL);
+  if (g_str_has_prefix (address, "about:")) {
+    if (strcmp (address, "about:gpu") == 0)
+      return g_strdup ("webkit://gpu");
+
+    if (strcmp (address, "about:blank") != 0)
+      return g_strconcat (EPHY_ABOUT_SCHEME, address + strlen ("about"), NULL);
+  }
 
   if (!ephy_embed_utils_address_has_web_scheme (address)) {
     SoupURI *uri;
diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h
index 751166547..f41738f10 100644
--- a/embed/ephy-web-view.h
+++ b/embed/ephy-web-view.h
@@ -43,6 +43,7 @@ G_DECLARE_FINAL_TYPE (EphyWebView, ephy_web_view, EPHY, WEB_VIEW, WebKitWebView)
                                         "^data:.*$|" \
                                         "^file:.*$|" \
                                         "^inspector://.*$" \
+                                        "^webkit://.*$" \
                                         ")"
 
 #define EPHY_WEB_VIEW_DOMAIN_REGEX "^localhost(\\.[^[:space:]]+)?(:\\d+)?(:[0-9]+)?(/.*)?$|" \
diff --git a/meson.build b/meson.build
index 118176fc3..2f83c11b7 100644
--- a/meson.build
+++ b/meson.build
@@ -76,7 +76,7 @@ config_h = declare_dependency(
 glib_requirement = '>= 2.61.2'
 gtk_requirement = '>= 3.24.0'
 nettle_requirement = '>= 3.4'
-webkitgtk_requirement = '>= 2.26.0'
+webkitgtk_requirement = '>= 2.27.1'
 
 cairo_dep = dependency('cairo', version: '>= 1.2')
 gcr_dep = dependency('gcr-3', version: '>= 3.5.5')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]