A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/close below:

MessagePort: close() method - Web APIs

MessagePort: close() method

Baseline Widely available

Note: This feature is available in Web Workers.

The close() method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.

Syntax Parameters

None.

Return value

None (undefined).

Examples

In the following code block, you can see a handleMessage handler function, run when a message is sent back to this document using EventTarget.addEventListener.

channel.port1.addEventListener("message", handleMessage, false);
function handleMessage(e) {
  para.innerHTML = e.data;
  textInput.value = "";
}

channel.port1.start();

You could stop messages being sent at any time using

Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.3