Why does OneDrive js picker sometimes have null opener

回眸只為那壹抹淺笑 提交于 2020-02-05 03:57:05

问题


I am trying to integrate the OneDrive picker with our web application and after reading Nick's answer to this question on 10/02/2015 have chosen the route of using an iframe and utilizing postMessage. So after inserting the iframe with a button to open the OneDrive Picker and selecting a file, the popup window persists with just a spinner icon and there is an error in the console r is null. I know that, given this question having a form can cause this issue and I removed the form in the page loaded in the iframe but still see the error where window.opener == null (see screenshot below). Has anybody else seen this before? I had a theory that the query parameters in the URL was the cause but removing those didn't appear to resolve the issue.

Debugging onedrive.js when error occurs (and popup window persists after selecting a file):

Thanks!


回答1:


So the cause was that the iframe was being loaded in a "popover" - a div with absolute positioning that appears when a link is clicked and then disappears after the interaction is over. And when the containing div is hidden, it is causing the iframe to reload - you should try a technique descibed here



来源:https://stackoverflow.com/questions/39280709/why-does-onedrive-js-picker-sometimes-have-null-opener

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!