evaluate Promise Custom Script
Execute custom script with a promise for DEBUG purposes (suspend version).
script is the body of an async JavaScript function. Use await for promises and return the value explicitly:
const promise = ___fp.search('abc');
const result = await promise;
return result;The result is the JSON text of the returned value, or "null" when nothing is returned.
The script runs at once, without waiting for the plan to be ready, so call it after planStatusFlow reports ExpoFpPlanStatus.Ready when it uses ___fp. There is no timeout: a promise that never settles keeps the request pending until the calling coroutine is cancelled, the plan is reloaded or the presenter is disposed. Any main frame navigation also fails the request, including one the script itself triggers (for example location.reload()), because the document that would answer it is gone.
Execute custom script with a promise for DEBUG purposes (callback version).