jsexecutor jse = w.CurrentJSExecutor;
The first way is to call window.cooker.external.GetData(). It is as follows.
let data = await window.cooker.external.GetData(); // This code will go well if it is in async function.
The second way is to access window.cooker.data. It is as follows.
let data = window.cooker.data;
window.cooker.data is an object defined for easy transfer of data. When you call jsexecutor.SetData(string), the arguments are also assigned to window.cooker.data.
The first object is alias of the second. it works the same whichever you use. Here, we explain the window.cooker.external as an example.
window.cooker.external has the following asynchronous functions.
In addition to this, window.cooker.data is defined as an object for communication. Note: window.chrome.webview.hostObjects.data does not exist.
The argument of Rice's jsexecutor.SetData(string) is saved for handling in window.cooker.external.GetData(), but is also assigned to window.cooker.data.
Since window.cooker.external.GetData () is an asynchronous function, there are various restrictions on receiving data, but window.cooker.data is just an object and can be easily accessed.
Links for reference