How to trigger focus to the Google Chrome address bar (OmniBox)?

浪尽此生 提交于 2020-05-12 01:41:52

问题


I am making a Google Chrome extension that overrides the New Tab (the page that appears when the user opens a new tab or window).

I want to trigger the focus on the Google's address bar on a button click. I've read the chrome.omnibox docs, but I haven't found a method that triggers its focus.

Is there a trick how I can do that?


回答1:


The answer is: No!

I've tried a million workarounds and tricks, but nothing helped.

My conclusion is that this action is considered to be a security (and privacy) vulnerability, and therefore is not allowed.



来源:https://stackoverflow.com/questions/44586548/how-to-trigger-focus-to-the-google-chrome-address-bar-omnibox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!