GNOME Bugzilla – Bug 725081
Only try to build the autosearch URL for actually typed text
Last modified: 2014-03-03 14:04:20 UTC
ephy_web_view_load_url/request, always call normalize_or_autosearch urls, even for internal urls that come from the history, bookmarks or session. In those cases we only want to normalize them and in the most efficient way, if possible.
Created attachment 270163 [details] [review] embed-utils: Invert the logic of condition in ephy_embed_utils_address_has_web_scheme So that we don't need to do all the string comparisons always.
Created attachment 270164 [details] [review] embed-utils: Add ephy_embed_utils_address_is_valid Helper method used to check if a url is valid to decide whether to load it or perform a search. It's mostly the same expression used by EphyWebView, but moved to a helper function. The regular expressions used in that expression are also moved to embed-utils and they are only compiled once instead of everytime a web view is created.
Created attachment 270165 [details] [review] embed-utils: do not try to prepend http:// to normalize a URL if it already has a web scheme
Created attachment 270166 [details] [review] embed-utils: Mode ephy_web_view_normalize_or_autosearch_url to embed-utils And use it only for actually typed (or pasted) text.
Comment on attachment 270163 [details] [review] embed-utils: Invert the logic of condition in ephy_embed_utils_address_has_web_scheme This is actually useless as claudio pointed out to me, so forget this patch :-)