After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789776 - Allow disabling autosearch
Allow disabling autosearch
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
3.26.x
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-01 16:43 UTC by Stephen
Modified: 2018-04-26 17:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add setting to disable autosearch (3.40 KB, patch)
2017-11-01 18:17 UTC, Michael Catanzaro
none Details | Review
Add setting to disable autosearch (3.40 KB, patch)
2017-11-01 18:19 UTC, Michael Catanzaro
committed Details | Review

Description Stephen 2017-11-01 16:43:00 UTC
A URL entered as example/something ends up having the forward slash incorrectly escaped to %2F and treated as part of the domain, resulting in a canonicalisation of:

http://example%2Fsomething/

This should instead be canonicalised to:

http://example/something

In contrast Firefox for example correctly canonicalises the URL.

This happens for any number of forward slashes in the entered string (example/something/another becomes http://example%2Fsomething%2Fanother, etc.)

This doesn't happen when there is a dot in the domain (e.g. example.com/something), or when the scheme is explicitly entered (e.g. http://example/something).
Comment 1 Michael Catanzaro 2017-11-01 17:08:07 UTC
I'm trying to understand...

You say there's no problem if you enter "http://example/something". So the problem is only if you enter "example/something" and nothing else? But that triggers a web search using the default search engine, not a URI load.
Comment 2 Stephen 2017-11-01 17:38:59 UTC
Ah, you're right.

Because there's no option to entirely disable Web's heuristic-based "default search" searching (i.e. guessing if the entered text is an address or a search, as opposed to explicit bang-based searching), I have added a default search engine with a URL of "%s" (via dconf since prefs doesn't like it ;)).

One of the reasons I did this is, Web's heuristic interprets domains without dots (commonly used in intranets, e.g. "internal-server") as searches. So trying to navigate to:

internal-server/url-with-sensitive-info

Results in Web instead trying to search for the entire string.

Which of course means that using my bare "%s" hack results in the string (i.e. the slash) being escaped.

I will open a new bug for "option for no default search".
Comment 3 Michael Catanzaro 2017-11-01 17:41:40 UTC
Hmmmm, there's an existing bug (somewhere) to improve the heuristic. Let's use this bug to add an option to turn off the search.
Comment 4 Stephen 2017-11-01 17:51:38 UTC
I was thinking of repurposing this bug initially too :)

In terms of UI, the simplest change would be to not make the "Default" switch for a search engine insensitive when switched to "On", so that if the user switches it off for all engines, that would be interpreted behind the scenes as "disable heuristic, always try to resolve domain".

Pro: very minor UI change.
Con: makes "disable auto-search" very non-obvious (even its existence).

The alternative I guess would be a drop-down for default search, with a "never try to search" option.
Comment 5 Michael Catanzaro 2017-11-01 17:52:56 UTC
(In reply to Michael Catanzaro from comment #3)
> Hmmmm, there's an existing bug (somewhere) to improve the heuristic. Let's
> use this bug to add an option to turn off the search.

That's bug #757248.
Comment 6 Michael Catanzaro 2017-11-01 18:15:28 UTC
(In reply to Stephen from comment #4)
> Pro: very minor UI change.
> Con: makes "disable auto-search" very non-obvious (even its existence).
> 
> The alternative I guess would be a drop-down for default search, with a
> "never try to search" option.

Both plausible ideas. The whole dialog needs a redesign, really. I'm just happy to have a functioning search engine dialog at all.

But anyway, I'm not going to spend time messing with the dialog. You're welcome to contribute a patch if you like; otherwise, you'll have to live with a hidden setting. You can toggle it like this:

$ gsettings set org.gnome.Epiphany.web:/org/gnome/epiphany/web/ enable-autosearch false

Let me know what you think.
Comment 7 Michael Catanzaro 2017-11-01 18:17:06 UTC
Created attachment 362770 [details] [review]
Add setting to disable autosearch

On some intranets, it's important to be able to load domains with no
dot, e.g. example/something. But currently this triggers a web search if
the protocol is not explicitly specified, e.g. http://example.something.
Some users would rather disable autosearch rather than have to type out
http:// all the time, so add a hidden setting to cater to them.
Comment 8 Michael Catanzaro 2017-11-01 18:18:50 UTC
Well I messed up the commit message, let's try again.
Comment 9 Michael Catanzaro 2017-11-01 18:19:16 UTC
Created attachment 362771 [details] [review]
Add setting to disable autosearch

On some intranets, it's important to be able to load domains with no
dot, e.g. example/something. But currently this triggers a web search if
the protocol is not explicitly specified, e.g. http://example/something.
Some users would rather disable autosearch rather than have to type out
http:// all the time, so add a hidden setting to cater to them.
Comment 10 Stephen 2017-11-01 18:25:41 UTC
Fantastic, thanks! Presumably when enabled this will just make the "default search" setting unused.

I guess the "web" dconf subdirectory is for config specific to the main Web application (vs. configuration applicable/specific to web-applications)?
Comment 11 Michael Catanzaro 2017-11-01 19:19:38 UTC
(In reply to Stephen from comment #10)
> Fantastic, thanks! Presumably when enabled this will just make the "default
> search" setting unused.

Yes.

> I guess the "web" dconf subdirectory is for config specific to the main Web
> application (vs. configuration applicable/specific to web-applications)?

Not really... it's for settings that are not shared with web applications. Each web application has its own separate copy of all of these settings. Whereas most settings are shared.

I guess it maybe doesn't need to be there, since you can't search in a web application anyway, but it's where the other search engine settings are, so I'll leave it there.
Comment 12 Michael Catanzaro 2018-04-26 17:54:34 UTC
Attachment 362771 [details] pushed as 7e96228 - Add setting to disable autosearch