These are chat archives for openseadragon/openseadragon

17th
Mar 2017
vin-dev
@vin-dev
Mar 17 2017 10:02

Hi all. I have a use case where I need the viewer to be in one browser window and navigator in another window and have the ability to navigate the viewer.

This is the approach I followed - I saved the instance of the viewer in window object and when navigator is opened in new window, it uses this global object to gain access to the viewer object in main window and move it around.It is working fine in Chrome and Firefox. But in IE 11, it results in out of stack trace error. On debugging, I could see that $.isPlainObject() is getting called recursively resulting in the stack error.

Any idea what could be the possible reason for this issue or is there a better approach to this use case?

Sample Code - https://plnkr.co/edit/K7WGhRipFnMgv7FpUIp6?p=preview

foobarable
@foobarable
Mar 17 2017 10:33
@iangilman You could also use the following view, whatever you like more: https://gp3.mpg.de/viewer/setInfo/REF001/10
Ian Gilman
@iangilman
Mar 17 2017 17:26
@foobarable Awesome! I've added it to the list of things to add openseadragon/site-build#159 ... no one's gotten around to adding any of them to the site in a while, though; feel free to make a PR if you'd like!
@vin-dev That's pretty wild! I'm not sure what's causing the problem though. $.isPlainObject never calls itself, so it's weird that it would be getting called recursively...
A very different approach would be to use localStorage to manage the communication between the two windows and implement the navigator fresh with just a standard viewer. You could steal code from the existing navigator, which is already built on top of the viewer code
Ian Gilman
@iangilman
Mar 17 2017 17:34
I wrote an example (not using OSD) of the localStorage trick a while ago: https://github.com/axshon/HTML-5-Ellipse-Tours/tree/master/demos/storage (unfortunately the demo site is down at the moment)
...or maybe even using the global object like you already do, but building out a fresh navigator instead of using the existing one
Or of course you could debug why OSD is blowing the stack on IE11 in this situation. I don't have any initial thoughts, but I might be able to kibitz as you get into it and find clues