I'm developing an office add-in using office-js (not using VSTO) and I want to access the DOM loaded in the task pane from the java script function-file used in the manifest extension points .
2 Answers
Yes, you can access the DOM loaded in the task pane from your JavaScript function-file. Think of it as if you have two browser windows or tabs and you want to communicate between them. Since the windows don't have access to a reference for one another, postMessage isn't a good solution. One option would be to use localStorage, which triggers an event on all same-domain pages when it changes.
Yes, you can access the DOM loaded in the task pane from your JavaScript function-file. Think of it as if you have two browser windows or tabs and you want to communicate between them. One option would be to use the postMessage() API to notify the task pane and include any information you'd like.
Edit: see my other answer: this solution isn't feasible since the window reference isn't available.