You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The viewer can't be initialized when rendered inside a cross-origin iframe.
This is due to a window.top event listener and is easy to fix.
To Reproduce
Steps to reproduce the behavior:
Create a folder miew-test
Set up two web servers pointing to the same folder, to simulate a cross origin iframe.
Expected behavior
The viewer should initialize successfully.
Actual behavior
The viewer doesn't initialize successfully.
Source of the problem
The two lines below are responsible. Because we're referring to window.top, this causes a CORS error blocking the further initialization of the viewer. Replacing window.top with window fixes the problem. If it's important to keep window.top, logic should be added to prevent the initialization from crapping out completely.
Thank you for reporting the issue. We will investigate it and look for a solution to the problem. Unfortunately, replacing "window.top" with "window" would disable the behavior that we intended to implement originally. We might be ok with deprecating the original intents now but we must carefully consider all consequences.
Which miew version do you use? I'm asking because we don't have plans to make a new release soon. It would be great if you could patch your version to not be blocked by our release schedule. We are kind of limited in resources.
Describe the bug
The viewer can't be initialized when rendered inside a cross-origin iframe.
This is due to a window.top event listener and is easy to fix.
To Reproduce
Steps to reproduce the behavior:
Create a folder
miew-test
Set up two web servers pointing to the same folder, to simulate a cross origin iframe.
In one terminal run:
In another terminal run:
Create
viewer.html
with a functioning viewer:index.html
with an iframe pointing at the viewer:Expected behavior
The viewer should initialize successfully.
Actual behavior
The viewer doesn't initialize successfully.
Source of the problem
The two lines below are responsible. Because we're referring to window.top, this causes a CORS error blocking the further initialization of the viewer. Replacing
window.top
withwindow
fixes the problem. If it's important to keepwindow.top
, logic should be added to prevent the initialization from crapping out completely.Miew.js
If
window.top
can be replaced, I presume it should also be updated inObjectControls.js
:Screenshots
Context
Additional context
If you're ok with replacing
window.top
withwindow
I can submit a pull request.The text was updated successfully, but these errors were encountered: