Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SecurityError: Blocked a frame with origin, when initializing MultiWindowService on a popout window #62

Open
allanm852 opened this issue May 14, 2020 · 4 comments

Comments

@allanm852
Copy link

Hi,

I'm currently using api host with different domain name but we have already set the server header to Access-Control-Allow-Origin: * allowing any request to bypass this issue. We tested it already and its working on all calls.

But it is still erroring out on MultiWindowService function on this particular statement :
const hasInstance = rootWindow.__services.has(uniqueName) when I popped out a window.

What seems to be the problem here?

Thanks,
Allan

@allanm852 allanm852 changed the title SecurityError: Blocked a frame with origin, when initializing MultiWindowService SecurityError: Blocked a frame with origin, when initializing MultiWindowService on a popout window May 14, 2020
@martin31821
Copy link
Member

Please give more details on your setup.

  • Which browser version?
  • Angular Version?
  • OS
  • Dev or Prod build?

@allanm852
Copy link
Author

allanm852 commented May 14, 2020

Chrome Version 81.0.4044.138.
Angular 8
Window 10
Dev build
I'm using ngx-golden-layout v0.0.34. Anyways, just to give an update, it was caused by an iframe for a tool we are using to view image (collabviewer). Though we are hosting the html on the same domain we are streaming files from a different api host server and domain name. So on this particular component I've something like :

<iframe id="collabviewerframe2" name="collabviewerframe2" class="collabviewer" src="http://localhost:4200/assets/collabviewer/viewer2.html?&amp;zoom=0.5&amp;documentviewurl=https%3A%2F%2Fapi.data.com%2Fapi%2FFile%2FGetFileNativeStream%3Ft%30%26v%3Dundefined&amp;document=" frameborder="0" `scrolling="no"></iframe>

On the source url on this iframe I've query string for documentviewurl= https://api.data.com. Everytime I popout a window with this component on the layout I encounter that problem.

@martin31821
Copy link
Member

Is your problem solved or is there something I need to do in order to fix this?

@allanm852
Copy link
Author

No not yet. I think this problem occurred because the presence of iframe on the main window made the browser security to blocked the communication of the popout window with main window. So statement like rootWindow.__serviceConstructors.get(uniqueName) on the export function MultiWindowService cannot be made.

I tried to use postMessage just to communicate with the main window then pass window.__services instance but now encountering error :

ERROR TypeError: this.urlProvider.loadRequests$ is not a function
at new PluginRegistryService (plugin-registry.service.ts:88)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants