steal focus from chrome omnibox on new tab


Author: yifei / Created: June 18, 2017, 11:02 a.m. / Modified: June 18, 2017, 11:02 a.m. / Edit

chrome set focus to the omni box when you create a new tab, although there is an api to replace the new tab page. you can't steal the focus from the omni box in the new tab page simply. there are two work-arounds.

if you are creating a new tab programmatically

https://stackoverflow.com/questions/42178723/chrome-extension-creating-new-tab-and-taking-focus-to-page

if you are creating a new tab by click new tab button

https://stackoverflow.com/questions/17598778/how-to-steal-focus-from-the-omnibox-in-a-chrome-extension-on-the-new-tab-page


有任何问题可以发邮件到 kongyifei (at) gmail.com 讨论