polyfill-service
Version:
A polyfill combinator
1 lines • 1.01 kB
JSON
{"aliases":["caniuse:hashchange","modernizr:hashchange","default"],"browsers":{"ie":"6 - 7","safari":"4"},"dependencies":["Event"],"docs":"https://developer.mozilla.org/en-US/docs/Web/Events/hashchange","baseDir":"Event/hashchange","hasTests":true,"rawSource":"\n// Event.hashchange\n(function (global) {\n\tvar hash = global.location.hash;\n\n\tfunction poll () {\n\t\tif (hash !== global.location.hash) {\n\t\t\thash = global.location.hash;\n\n\t\t\tglobal.dispatchEvent(new Event('hashchange'));\n\t\t}\n\n\t\tsetTimeout(poll, 500);\n\t};\n\n\t// Make sure a check for 'onhashchange' in window will pass (note: setting to undefined IE<9 causes 'Not implemented' error)\n\tglobal.onhashchange = function() {};\n\n\tpoll();\n})(this);\n","minSource":"!function(n){function h(){a!==n.location.hash&&(a=n.location.hash,n.dispatchEvent(new Event(\"hashchange\"))),setTimeout(h,500)}var a=n.location.hash;n.onhashchange=function(){},h()}(this);","detectSource":"'onhashchange' in this && this.onhashchange !== null"}