简体   繁体   中英

Accessing Search Query Text in Google Chrome Browser with Chrome Extension

I'm building a Chrome extension for myself. I want to access my search bar so that I can feed my queries into my own private ingest server (for realtime processing).

How does one access text entered into the search bar in Chrome? I started here https://developer.chrome.com/extensions/devguide but it's unclear where to actually access the query text.

You can only do so with a custom keyword preceeding the search.

There is chrome.omnibox API that allows you to do it, but you have to specify a keyword that needs to be entered first before you start receiving events.

Google specifically does not want you to spy on all searches.


Alternatively, you could try and tap into the requests sent as part of search suggestions with webRequest API . I doubt it will be a robust solution though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM