This is kirby, which stucks if the process is blocked
You can use this page to easily test if broadcast-channel and leader-election works in your browser.
User-Agent: unknownThis will send a message from the main-context, await until the iframe and the web-worker answered, then repeat until all messages have been send.
This will spawn several iframes which all want to be leader. No matter what happens, exactly one iframe should be leader.
This will send a message from the main-context to the worker and wait for a response message. This runs many times with random timings to ensure there are no edge cases where messages are missing or in the wrong order.