I'm trying to load a script on LinkedIn through an extension. However, it looks like it is using AJAX to render the main container every time you click on one of the links in the header.
I have this, which does not work:
$(function() {
console.log("LOADED");
$(window).on("load", () => {
$(window).on("hashchange", function(e) {
console.log("PATH CHANGED") // I want to print this every time the route changes and scrape the updated DOM
});
});
});
It makes sense since it's not using hashes. I don't know how to add a listener to path changes + scrape the updated dom.
Is there a way to do this?