Access window DOM

Hi

I am trying to export a csv file I created with fetched content. How can I access the window or document DOM to export, or do I have to do this differently?
Thanks for your help.

Kind Regards
Philipp

1 Like

Your code is running isolated so you cant access the DOM or the normal window scope.

I dont think you can do it if you use UI kit, but I have a feeling you can use a blob URL combined with custom UI and the forge bridge open(url) from New custom UI methods, Jira project page module, and scopes for product events

1 Like

I would make sure to properly test this, because esp. Chrome is very adement about blocking cross-origin forced download. We recently had to implement a same-URL proxy just to be able to allow users to export something. When you go Custom UI, I would recommend looking into FileSaver.js or StreamSaver.js as these solutions try multiple ways of starting a forced download (incl. opening a new tab if nothing else works)

3 Likes

@remie
Thanks for the suggestions. I will keep that in mind.

Update: Tried the router.open and router.navigate methods, but they also check if it is a valid webpage link. Am using now the FileSaver and works great. Thanks!

2 Likes