Chrome extension and history.onVisited event -
UI, and every time a particular web page visits, it displays a warning dialog
I was trying with the following code without any results:
manifest Json
background.html
& lt; html & Gt; & lt; top & gt; & lt; script & gt; Chrome.history.onVisited.addListener (function (HistoryItem result) {if (result.url == "http://my.url.com") {Warning ("my message");}});
This code What's wrong in?
Thanks
Take history out of the ceremony and You are OK:
gt; Top & gt; & lt; script & gt; Chrome.history.onVisited.addListener (function) {If (result.url == "http://my.url.com/") {Warning ("My Message");}}) & lt; / script & gt; & lt; / head & gt;
Also keep in mind that I've added slash to the end of "because the result will be removed."
Comments
Post a Comment