The bug scenario is probably like this:
Desktop .exeEmbedWebpage .htmlThe webpage uses js to call the js api functions of the desktop.Fn1And then call the js api function.FN2. As a result, fn1 runs normally, but subsequent FN2 does not run.
After debugging by a colleague, the problem was solved using setTimeout.
SetTimeout (function () {window. External. FN2 () ;}, 0 );
Since setTimeout is used to reschedule an events loop, it is certain that both fn1 and FN2 conflict with each other. Later I thought about the cause of the bug:
The JS on the page calls fn1to send a notification to table .exe,Table .exe will be in the "busy" statusIn this case, other notifications sent by JS are ignored, as FN2 is not executed.
The perfect design should be the callback form, but the js api provided by table .exe is not callback + Blocking. The Desktop client should support asynchronous/queuing when receiving notifications from Js. Therefore, there is room for improvement in the js api design of 360 desktop.