Trigger action upon close page

0
Hi,   I want to trigger the microflow from the ExitIntent widget upon a ‘close page’ action. The widget only works for a ‘show page’ or a ‘show form’ but a ‘close page’ does not trigger the ExitIntent microflow. Does anyone know how I can modify the widget code, to also work with a ‘close page’?   I feel the answer for modifying the widget is in this piece of code:   postCreate: function () { // console.log(this) logger.debug(this.id + ".postCreate"); // this.handle = aspect.around(window.mx.ui, "openPage", dojoLang.hitch(this, this._aroundFunc)); if(window.mx.ui.openPage) { this.handle = aspect.around(window.mx.ui, "openPage", dojoLang.hitch(this, this._aroundFunc)); } else if (window.mx.ui.openForm2) { this.handle = aspect.around(window.mx.ui, "openForm2", dojoLang.hitch(this, this._aroundFunc)); } else { console.error("Could not find the mx api function that opens a page (openPage or openForm2"); } this.handle2 = aspect.around(window.mx.ui.getContentForm(), "close", dojoLang.hitch(this, this._aroundFunc)); this._pageForm = this.mxform; }, .... I have already tried to add an ‘else if’ statement with  - window.close - window.mx.ui.close - window.mx.ui.closePage   Or if there is a similar widget / javascript snippet that works, I would love to know that.  
asked
1 answers
0

Dojo is being phased out (this looks like dojo/aspect) and in combination with react it won't work probably. Take a look at react hooks.

answered