Contents
- 1 Why are cross domain iframe requests blocked in SharePoint?
- 2 Can you make cross domain calls in SharePoint?
- 3 Why do I have to have a compatible browser to use SharePoint?
- 4 How is the cross domain library used in SharePoint?
- 5 How to bypass cross domain issues to display SharePoint Online pages?
- 6 Can you use cross domain in a SharePoint add-in?
Cross-domain iframe requests to SharePoint Online organizations are blocked. This issue occurs when one of the following conditions is true: You’re displaying SharePoint Online pages on an external site through an iframe. You’re displaying SharePoint Online pages on a SharePoint Online site that uses a different domain through an iframe.
The above changes will allow your application to make cross domain calls to SharePoint 2013 using AJAX requests successfully. In SharePoint 2016 the above will not work, and all CORS requests are blocked unless made with OAuth permissions (using Azure AD applications or the SharePoint Add-in model).
How to fix SharePoint cross site Ajax call?
Failed to load resource: the server responded with a status of 401 dev.contoso.com/_vti_bin/listdata.svc/EMSPropertyLibrary ()?$filter…… SharePoint only supports cross-site calls (CORS) for SharePoint add-ins. Since SharePoint doesn’t return the headers and responses needed, Chrome blocks the cross-site request.
If a compatible Office application or browser is not installed on a client, an error message states that the feature requires a SharePoint compatible application and web browser. Enables a user to copy a document on a SharePoint site to one or more locations on a server.
The SharePoint cross-domain library uses a hidden IFrame and a client-side proxy page hosted on SharePoint to enable client-side communication by using JavaScript. The cross-domain library is available when you reference the sp.requestexecutor.js file in your pages.
Can a SharePoint 2013 Page be displayed in an iframe?
A Page from SharePoint 2013 (on premise) can be displayed in an iframe from a Page hosted on another domain, if the following control is added to the head of the master page: However if this control is not added to the master-page, then we also get the above mentioned error.
Create a external web application and have 2 html pages (TestIframe, TestIframe2) created. The web application should be HTTPS enabled. Now edit the TestIframe2.html page and have the following code
Select Provider-hosted as the hosting option for your add-in. You can also use the cross-domain library in a SharePoint-hosted add-in. However, in a SharePoint-hosted add-in, the add-in page is already on the add-in web, in which case it wouldn’t need the cross-domain library to read the list items.