I need to handle changes of url (not url hash).
A page uses window.history.pushState and window.history.replaceState to change url. Unfortunately window.onpopstate doesn't fire when url changes by JavaScript.
Usually, people override pushState and replaceState, including a call of window.onpopstate in them, but I can't use it because content scripts in Chrome extensions can't access to window object.
Maybe there is some API in Chrome extension for that?
Also I can check location.href by timer(it's very bad idea) or use DOM 3 Mutation events and observers, but it's not very good idea in this case too.
(Sorry for my poor English)
UPD: My question isn't duplicate of "Chrome extension Content Script not loaded until page is refreshed".