javascript - Overriding history.pushState leads to error in opera 11 -


i'm injecting following code webpage via greasemonkey script/opera extension trap history.pushstate command, can processing whenever it's fired , still allow pushstate command continue afterwards.

(function(history){   var pushstate = history.pushstate;   history.pushstate = function(state) {        if (typeof history.onpushstate == "function") {           history.onpushstate({state: state});         }         alert('pushstate called')         return pushstate.apply(history, arguments);   } })(window.history); 

the code works fine in ff4 , chrome, in opera 11, following error, if page calls history.replacestate command:

uncaught exception: typeerror: 'window.history.replacestate' not function

does know how can fix above code work opera chrome , firefox?

in opera 11.00, revision 1156, history api supported these

>>> history. back, current, forward, go, length, navigationmode 

the full html5 history api not yet covered opera 11.00. in general if discover, explore supported, can use console mode of dragonfly, web developer tool.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -