Is there a way a plugin can watch for live preview updates? I'm working on a site that involves taking a URL and then getting information about that URL using an API. The URL is entered into a field in a Matrix block, and then another field in the same Matrix block is populated automatically on save. This is working, but only when the article is saved. I'd also like it to work in live preview mode. The event I'm using on save is entries.saveEntry, but I've also tried using entryRevisions.onSaveDraft, hoping that drafts were saved with live preview changes, but that didn't work.

Question:
Is there some event I can listen for that lets me know when the live preview is about to refresh? Can this be done with JavaScript in the admin instead? If so, is there documentation that describes how to do this?
You will probably have to use javascript. Something like this would work.

$('.lp-iframe').on('load', function(event) {
  console.log(event);
});


edit

Try this to bind the lp-iframe after it gets added to the page. 

$('.livepreviewbtn').on('click', bindIframe);

function bindIframe() {
  $('.livepreviewbtn').off('click', bindIframe);
  $('.lp-iframe').on('load', function(event) {
    console.log(event);
  });
}