pnp / sp-dev-fx-controls-react

Reusable React controls for SPFx solutions
https://pnp.github.io/sp-dev-fx-controls-react/
MIT License
380 stars 379 forks source link

CORS Allowed in IFrameDialog #242

Closed superthumper closed 11 months ago

superthumper commented 5 years ago

Category

[ ] Enhancement

[ ] Bug

[x ] Question

Version

Please specify what version of the library you are using: [ 1.11.0 ]

Expected / Desired Behavior / Question

I am trying to open an IFrame that is in another domain. Is that allowed with the IFrameDialog? Doing this within a webpart is allowed, but it seems to be a problem withing the dialog.

Observed Behavior

Dialog appears. Spinner appears. Console Errors:

SCRIPT70: Permission denied IFrameDialogContent.tsx (44,16),

SEC7120: [CORS] The origin 'https://localhost:4321' failed to allow a cross-origin document resource at 'ms-appx-web:///assets/errorpages/forbidframingedge.htm#https://www.google.com/maps?width=100%25&height=600&hl=en&q=12909+Apple+View+Lane,+Burnsville,+MN+(My+Business+Name)&ie=UTF8&t&z=14&iwloc=B&output=embed'.

Steps to Reproduce

set up the iframe dialog like this in the [webpart].tsx

<IFrameDialog url={'https://maps.google.com/maps?width=100%&amp;height=600&amp;hl=en&amp;q=12909%20Apple%20View%20Lane%2C%20Burnsville%2C%20MN+(My%20Business%20Name)&amp;ie=UTF8&amp;t=&amp;z=14&amp;iwloc=B&amp;output=embed'} hidden={false}

            width={'570px'}
            height={'315px'} />
AJIXuMuK commented 5 years ago

Hi @superthumper Could you please explain what do you mean under "allowed in webpart but not allowed in dialog"?

If I do something like that in a webpart:

<iframe src={'https://www.google.com/maps'} style={{
                border: 0,
                width: '800px',
                height: '500px'
              }} />

I'll get Refused to display 'https://www.google.com/maps' in a frame because it set 'X-Frame-Options' to 'sameorigin'. and the web part will look like that:

Screen Shot 2019-05-17 at 12 18 37 PM

Same behavior as with the IFrameDialog

ghost commented 11 months ago

This issue has been automatically marked as stale because it has marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within next 7 days of this comment. Thank you for your contributions to SharePoint Developer activities.

ghost commented 11 months ago

Closing issue due no response from original author. If this issue is still occurring, please open a new issue with additional details. Notice that if you have included another related issue as additional comment on this, please open that also as separate issue, so that we can track it independently.