Detect YouTube video switching

I am developing an extension that needs to run when a user switches a YouTube video.

I tried to listen for a download or pageview, but they don't start when a user views a video and clicks another.

var tabs = require("sdk/tabs");

tabs.on('pageshow', function(tab) {
    //do something
});

      

+3


source to share


1 answer


Use a pushstate listener for history if you want this to work with any modern webapp that changes the url without refreshing the page. See my answer here



0


source







All Articles