Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Does not seem to play nice with ui-router #12

Open
gerob311 opened this issue Jul 15, 2016 · 12 comments
Open

Does not seem to play nice with ui-router #12

gerob311 opened this issue Jul 15, 2016 · 12 comments

Comments

@gerob311
Copy link

I was trying to use this directive in an application that has several ui-router states. I'm using the directive inside a dialogue box that could be opened from any state.

After using the pdf viewer, any state transitions would kick me back to my initial state, making the application unusable until the page was refreshed. I did notice that after opening the pdf viewer, it would change the title in the browser tab from the application's name, to the title of the pdf that was opened, and I checked a stack trace that seemed to imply that fireUrlChange() was causing the unexpected state transition. I was not able to determine why though.

@jasny
Copy link
Member

jasny commented Jul 20, 2016

@gerob311 We're using ui-router as well, but aren't experiencing these issues.

Please create a jsfiddle which demonstrates the problem.

@paulthegeek
Copy link

@gerob311 Have you tested this in other browsers? I am seeing a similar issue, but it seems to only happen in Chrome? Safari and Firefox seems to work fine.

@ciriac
Copy link

ciriac commented Aug 8, 2016

I'm encountering this same exact issue. Seems to only be happening in Chrome. Any update regarding this?

@ciriac
Copy link

ciriac commented Aug 8, 2016

Managed to do a quick fix for now.

I'm preventing the pdf viewer to update the window title by manually setting PDFViewerApplication.isViewerEmbedded to true. This works for my current configuration.

@josh256
Copy link

josh256 commented Aug 18, 2016

@ciriac so far, your quick fix in Chrome seems to work, thanks!

@bw7432
Copy link

bw7432 commented Sep 8, 2016

Managed to do a quick fix for now.

I'm preventing the pdf viewer to update the window title by manually setting PDFViewerApplication.isViewerEmbedded to true. This works for my current configuration.

Where should this be put? I'm having the same issue. Routes are not working correctly.

@ciriac
Copy link

ciriac commented Sep 9, 2016

@bw7432 This needs to be done in the source file of pdf.js. The library does not expose this option. It's just checking if the window parent is not equal to window and this does not play nicely with Angular's ui-router.

Search for this line (should be around line number 16301):
isViewerEmbedded: (window.parent !== window)

And change it to:
isViewerEmbedded: true

@bw7432
Copy link

bw7432 commented Sep 9, 2016

@ciriac, thanks for clarifying. Works perfectly, thanks so much!

@alexburkhay
Copy link

alexburkhay commented Apr 13, 2017

any updates on this? Could we set it to true in pdf.js-viewer or pass some config somehow. (This library is a bower component in my project and all components ignored in git). Thanks.

@jasny
Copy link
Member

jasny commented Apr 13, 2017

Added it to our TODO list.

@Matcrash
Copy link

Matcrash commented Oct 4, 2017

Any news on this issue ? Same situation than @alexburkhay ... Thanks

@rvmladenov
Copy link

Hi there ... is that option available now ? I am experiencing this same thing and I do not want to edit the vendor file.

julamb added a commit to julamb/pdf.js-viewer that referenced this issue Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants