• Robert Knight's avatar
    Make logic for waiting for PDFs to load work in PDF.js >= 2.5.207 · 77d30231
    Robert Knight authored
    f96af43d added support for PDF.js >= v2.5.207 by changing an event
    listener to use PDF.js's internal event bus rather than DOM events.
    However there was another DOM event listener for the `pagesloaded` event
    in `src/annotator/anchoring/pdf.js` that should also have been updated but was
    overlooked. This didn't cause a problem in testing with the dev server because
    the test documents load quickly enough that they are already loaded by the time
    the client's anchoring logic ran.
    
    This commit updates the way that the client listens for events from
    PDF.js to use the event bus where available and only fall back to the
    DOM in versions of PDF.js that don't support it.
    
     - Use PDF.js's event bus to listen for `documentload`/`documentloaded`
       and `pagesloaded` events
    
     - Add a fallback method to wait for event bus to become available in
       versions of PDF.js which support the eventBus but don't have the
       `initializedPromise` API
    
     - Improve the documentation around which versions of PDF.js support
       different event types and event dispatch methods
    
     - Add tests to cover the behavior from different releases of PDF.js
    
    For an overview of the different versions of PDF.js that the client
    needs to support, see https://github.com/hypothesis/client/issues/2643.
    77d30231
Name
Last commit
Last update
..
anchoring Loading commit data...
components Loading commit data...
config Loading commit data...
plugin Loading commit data...
test Loading commit data...
util Loading commit data...
.eslintrc.js Loading commit data...
adder.js Loading commit data...
annotation-counts.js Loading commit data...
annotation-sync.js Loading commit data...
delegator.js Loading commit data...
features.js Loading commit data...
frame-observer.js Loading commit data...
guest.js Loading commit data...
highlighter.js Loading commit data...
host.js Loading commit data...
icons.js Loading commit data...
index.js Loading commit data...
pdf-sidebar.js Loading commit data...
pdfjs-rendering-states.js Loading commit data...
range-util.js Loading commit data...
selections.js Loading commit data...
sidebar-trigger.js Loading commit data...
sidebar.js Loading commit data...
toolbar.js Loading commit data...