How to know when google searches?

僤鯓⒐⒋嵵緔 提交于 2019-12-22 09:28:42

问题


I'm developing a chrome extension and I need to know when is google searching to perform an action on each search.

I've tried to listen the requests with chrome.webRequest but the cached requests aren't captured.

Evernote extension searches in my notes each time I search in Google, even if the request is cached. How are they doing it or how to make something similar?


回答1:


Here is a post on the subject http://isgeek.eu/google-chrome-extension-google-search

The trick is to use

document.addEventListener("DOMSubtreeModified", function(event){

to listen to each change on the google search page.



来源:https://stackoverflow.com/questions/17163305/how-to-know-when-google-searches

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