How to cancel/abort export to csv

Hello,
I am developing an Atlassian-Connect app to customize the export to CSV. I want to add a button to Cancel the Export at any time by the user. Is there a way to cancel all export operations (like getting data from Assets API, calculations, etc.) by just clicking the Cancel button? I think that would be possible from a Modal window (when closing the modal), but what if my app runs in a new page (not modal) and want to Cancel everything from that page?

Thanks,
Edgar