Skip to content

5.0.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 30 Sep 22:15
fa2b2b7

Changed

  • BREAKING: Chunk large port stream messages into smaller frames by default (#68)
    • By default, ExtensionPortStream will send messages in 64MB chunks on Chromium-based browsers. When this mode is used the receiving end must also use ExtensionPortStream in its default mode:
      import { ExtensionPortStream } from "extension-port-stream";
      
      extension.runtime.onConnect.addListener(connectRemote);
      const portStream = new ExtensionPortStream(remotePort, {
        chunkSize: 0, // disable chunking
      });
      
      // Enjoy!
    • To disable chunking set the chunkSize option to 0. This will make the transport
      mostly backwards compatible with v4:
      import { ExtensionPortStream } from "extension-port-stream";
      
      extension.runtime.onConnect.addListener(connectRemote);
      const portStream = new ExtensionPortStream(remotePort, {
        chunkSize: 0, // disable chunking
      });
      
      // Enjoy!
    • message-too-large is emitted when a message is too large to send in a single postMessage call and needs to be chunked. This event is only emitted when chunking is enabled (default).
  • BREAKING: Node.js-style Buffer messages are no longer supported (#68)