script-lab icon indicating copy to clipboard operation
script-lab copied to clipboard

Instead of hardcoding "officeNamespacesForIframe", deduce the namespaces automatically

Open Zlatkovsky opened this issue 6 years ago • 0 comments

We've had a number of instances where new namespaces are being introduced to Office.js, yet are not available in Script Lab. This has resulted in cumulative hours worth of investigation.

Solution: instead of hardcoding the particular namespaces, do a diff of for (const key in window) from before Office.js is loaded (even as a script tag) versus after it's loaded (after Office.onReady). Any namespaces that were added to window between those timeframes warrant being given to the iframe

Zlatkovsky avatar Apr 27 '19 04:04 Zlatkovsky