I'm looking at lines 401-411 in url.c, and almost have it working as you suggest. My code is undoubtedly ugly and incorrect, so I might need some help with this one. Will keep trying.
The problem is that the url "" is converted to "http:/" when parsing the value from the preferences. We may leave the value "about:blank" by default (and forbid ""), but then, when opening a new tab, if the new_tab_url matches "about:blank", we set it to NULL to leave the location empty, which follows the current behavior. Maybe, something like this? + if (!url && strcmp(URL_STR(prefs.new_tab_page), "about:blank") != 0) + url = prefs.new_tab_page; So we keep url to NULL when opening "about:blank".
Right, the pre-selection doesn't seem to work with other urls. I still haven't figured out how to fix that, but am guessing that as soon as content starts to load, it deselects the text. I think the feature is still useful given that caveat, but surely there must be some solution.
The selection is lost because of this call that sets the location value: https://github.com/dillo-browser/dillo/blob/c7d5e1e071955b1009b114146014960b... I'm thinking if we really want to focus on the location bar when not opening "about:blank" as you may want to load a search engine and focus on the search input instead. I think for now this is not needed, as long as we can keep the current behavior intact by default. We can add another option later to always focus the location bar when is not an empty page. Thanks, Rodrigo.