WebDriverで使えるhookスクリプト
// 初期化
const __origApply = Function.prototype.apply;
const client = await new Promise((resolve) => {
Function.prototype.apply = function (thisArg, argsArray) {
if (thisArg && typeof thisArg === 'object' && thisArg.dispatch === this) {
__origApply.call(console.log, console, ['[dispatch.apply]', thisArg, argsArray]);
resolve(thisArg);