Auto focus address bar when homepage is set to a specific page
-
The address bar is automatically focused when the homepage is set to 'Start Page'. The address bar is not focused when the homepage is set to a 'Specific Page'. There should be a togglable option that enables or disables this autofocus.
In my case, my homepage is the bookmarks page. I often forget that the address is not autofocused and type my query in the bookmarks search bar. I suggest that this autofocus functionality be the default, but not enforced, as depending on the page and use case the user might want the page focused.
This could be achieved by a wider feature, by triggering a command chain based on an event—a new tab being created.
Edit (2023-03-24):
I wrote a script as an imperfect workaround.
Internal pages cannot be affected by user scripts or have code injected, and since the Vivaldi bookmarks internal page focuses the search box on load, the address bar has to be focused after the page is loaded, and not when the page is activated. If the page does not focus an element on load,
chrome.tabs.onActivated
can be used to achieve seamless functionality, regardless of whether the page is internal or not. If the page is not internal and focuses an element on load, code can be injected into the webpage to prevent the initial focus./** * Focus the address bar after load on new tab for `Specific Page` homepage. * * @author <https://github.com/rzjnzk> */ (function() { let newTabId; chrome.tabs.onCreated.addListener(function(tab) { newTabId = tab.id; }); chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { if( tab.url.startsWith("chrome://vivaldi-webui/startpage") && tabId === newTabId && changeInfo.status === "complete" ) { document.getElementById("urlFieldInput").focus(); } }); })();