So github uses "defunkt's" PJAX module (https://github.com/defunkt/jquery-pjax#events), and I'm making a firefox addon that needs to listen to the event pjax:end
So far I can do it with jquery like this:
$(document).on('pjax:end', function (t) { console.log('pjax:end'); })
however how do I do this with standard javascript functions?
document.addEventListener('pjax:end',function(){ console.log('ya'); }, true);
does not work.
for those who know firefox-addons this code code does not work:
gBrowser.contentWindow.wrappedJSObject['$'](gBrowser.contentDocument).on('pjax:end', function (t) { Cu.reportError('pjax:end'); })
it throws this error:
/* Exception: Permission denied to access property 'guid' te.event.add@https://github.global.ssl.fastly.net/assets/frameworks-752c70f2b89dcf2d1f948637afa35a3285fe6424.js:2 e.event.add@https://github.global.ssl.fastly.net/assets/frameworks-752c70f2b89dcf2d1f948637afa35a3285fe6424.js:3 .on/<@https://github.global.ssl.fastly.net/assets/frameworks-752c70f2b89dcf2d1f948637afa35a3285fe6424.js:2 .each@https://github.global.ssl.fastly.net/assets/frameworks-752c70f2b89dcf2d1f948637afa35a3285fe6424.js:1 te.prototype.each@https://github.global.ssl.fastly.net/assets/frameworks-752c70f2b89dcf2d1f948637afa35a3285fe6424.js:1 .on@https://github.global.ssl.fastly.net/assets/frameworks-752c70f2b89dcf2d1f948637afa35a3285fe6424.js:2 @Scratchpad/2:1 */