1

I'm trying to detect when my Chrome browser is finished loading a remote pdf, for instance from https://arxiv.org/pdf/2108.11353.pdf

The context is I'm working on a chrome extension and I'd like the content_script to execute some things only after the pdf is downloaded and displayed.

I'm open to using JQuery but

$(() => {})

is triggered too early and things like

window.addEventListener('load', function () {
    alert("Hello")
});

document.addEventListener("DOMContentLoaded", function(){
    alert("Hello")
});

Are not triggered at all

ted
  • 13,596
  • 9
  • 65
  • 107
  • So if I understand you correctly the answer is no? – ted Sep 18 '21 at 23:47
  • 1
    PDF files are loaded by an internal PDF viewer (in Chrome) which is not related to standard DOM events. It exposes a custom `documentLoaded` event which you can observe by reworking [this example](https://stackoverflow.com/a/61076939). – wOxxOm Sep 19 '21 at 09:40

0 Answers0