PostgreSQLのデバッグ方法


TLドクター


monitorEvents(window, 'message')
// or
window.addEventListener('message', console.log)

コンセプト


MDN docs

The window.postMessage() method safely enables cross-origin communication between Window objects; e.g., between a page and a pop-up that it spawned, or between a page and an iframe embedded within it.


それはかなりクール、右?

デモ


ポストメッセージ使用のHere is a demo.

デバッグ


しかし、どのように我々はこれらのメッセージをデバッグできますか?
コンソールタブで次の手順を実行します
// On Safari and Chromium-based browsers
monitorEvents(window, 'message')

// On Firefox
window.addEventListener('message', console.log)
// ^ It works in all the other browsers too

If you're testing in CodeSandbox, run the command in the Console of its detached window.


結果


セットアップの後、メッセージを受信すると、次のようになります.

それだ!
私は、あなたがより多くのためにどんなポストででもこのポストとfollow meを楽しむことを望みます.