script-lab
script-lab copied to clipboard
Instead of hardcoding "officeNamespacesForIframe", deduce the namespaces automatically
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