接管unigui屏蔽手机物理返回按键
如果不接管,手机一按物理返回键,会立即关闭程序。
下面是接管后,会有提示:

procedure TMainmForm.UnimFormCreate(Sender: TObject); beginUniSession.AddJS('$(document).ready(function() {'+ ' if (window.history && window.history.pushState) { '+ ' $(window).on("popstate", function() { '+ ' if (confirm("确定要退出应用吗?")) {'+ ' window.close();'+ ' } else { '+ ' window.history.pushState("forward", null, "#");'+ ' window.history.forward(1); '+ ' }'+ ' });'+ ' } '+ ' window.history.pushState("forward", null, "#"); '+ ' window.history.forward(1);'+ '}); ' );end;