PharmaLedger-IMI / acdc-components

UC4 Anti-Counterfeiting Data Collaboration
MIT License
3 stars 4 forks source link

Create a "onDismounted" callback interface for SSAPPs #35

Open TrueMedHemmo opened 1 year ago

TrueMedHemmo commented 1 year ago

As it stands, code and callbacks to an initialized SSAPP can linger because of insufficient sanitation when the SSAPP is closed.

There are two cases where these issues are triggered: closing the SSAPP from the "x" and when the SSAPP closes itself.

The first case has no workaround. Second case can be worked around by the SSAPP developer for most part by closing all callbacks and behaviours it initialized.

A key example of how this can be a problem:

Solution: Implement "onDismounted" callback that gets called by the EPI core application when "x" is pressed or the SSAPP window is closed in any way.

It should be possible to send messages downstream even though the SSAPP is technically an iFrame mount. https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage

It would be up to the SSAPP developer to implement a receiver for this.