I am write browser extension for vk.com. This site use historyAPI to change url in adress bar and load content with ajax. I need detect URL change in my extension, and don't know how =( onhashchange don't work. In arsenal i am have jquery. Ssory for my english and please help.
Asked
Active
Viewed 508 times
0
-
I believe that onhashchange may only fail if you are not on modern browser. This question probably may help: http://stackoverflow.com/questions/1930927/how-can-i-detect-an-address-bar-change-with-javascript – sajawikio Sep 04 '12 at 05:06
-
can you show us some code you've tried so far. – Ben Rowe Sep 04 '12 at 05:49
-
Shure http://pastebin.com/QnKJWn1v – propostaff Sep 05 '12 at 06:49
1 Answers
0
You should be using a progress listener in Firefox, onLocationChange
method of the listener will be called for each change in the address bar. Please do not use polling - this will both waste CPU resources and drain battery in laptops.
chrome.webNavigation
API provides a similar mechanism in Chrome. The onCommitted
event should fire when the URL changes.

Wladimir Palant
- 56,865
- 12
- 98
- 126
-
-
@dSquared: Internet Explorer doesn't have anything one could call extensions. Which is probably the reason why it isn't mentioned in the tags of this question. – Wladimir Palant Sep 05 '12 at 16:54
-
-