Inside the a widget / javascript snippet you can access the information
`this.mxform.path`
For anyone trying to find the pop up form in a Javascript action (where you don’t have this context of a widget), to be able to use the call of a widget like Andries is mentioning above, you first need to find the relevant widgets that are in the pop up.
After playing around with the Client API functions that are non documented I found a function that returns all widgets on a page and you can then loop over those to find the ones that have widget.mxform of a pop up.
I did something similar to this:
// this gets all widgets on the page
var listOfWidgets = mxui.widget.getDescendantWidgets(document);
// empty list for forms
let forms = new Array;
// create list of forms (which you can use to find the pop up form)
for(let i = 0; i < listOfWidgets.length; i++) {
// this is the call that Andries is referring to
forms.push(listOfWidgets[i].mxform);
}
To identify the ‘current pop up’ I did a comparison of the DOM positions of the forms in the list using this: https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition