guy cohen
guy cohen

Reputation: 1

2012 Mozilla pdf.js- Preventing window.history.replaceState in pdf.js from Reloading State in AngularJS App

I am working on an AngularJS application that integrates with pdf.js to display PDF documents. However, I'm encountering an issue where pdf.js calls window.history.replaceState, which in turn causes my AngularJS router to reload the entire display state of the application.

This is problematic because it disrupts the user experience by resetting the UI state, and I want to prevent this behavior.

Any help or guidance on this would be greatly appreciated!

What I've Tried:

I attempted to disable history management in pdf.js by setting PDFViewerApplication.pdfHistory.isEnabled = false, but it didn't fully resolve the issue. I considered intercepting replaceState calls, but I'm unsure of the best approach to prevent the state reload without breaking other parts of the application. Question: How can I prevent pdf.js from triggering a full state reload in my AngularJS app when it calls window.history.replaceState? Are there any best practices or workarounds to manage this situation effectively?

Upvotes: 0

Views: 27

Answers (0)

Related Questions