google chrome extension - Open a new tab with a search expression; not URL -
i want create new tab using chrome.tabs.create
, "search term" instead of url.
when put text in chrome's omnibox, , hit alt+enter (on windows), opens new tab, using text entered "search term". actually, when "search term" can interpreted url, chrome visit url. if can't interpreted, use chrome's default search engine search term.
i want same behavior in extension. unfortunately, plugging in text in url
property of chrome.tabs.create
's createproperties
object, treat term relative url paired extension's settings url base. e.g., term "test" plugged in url value, open tab url: chrome-extension://cinkljgpekgfmlflpdobnacjglddfaap/test. (prepending search term question mark, can in omnibox force search instead of else, doesn't work either.)
how can replicate omnibox behavior in extension?
Comments
Post a Comment