mirror of
https://github.com/GoogleChrome/chrome-extensions-samples.git
synced 2026-03-27 13:29:34 +07:00
Updates a nunber of dependencies in a single PR. These were suggested by dependabot but updating them individually would mean the reposistory would be in a broken state until everything had merged. I'm not personally a huge fan of lowercasing doctype, but Prettier has taken an opinionated stance here and there is not a way to disable it: https://github.com/prettier/prettier/issues/15096
Chrome extension WebSocket example
This example demonstrates how to use WebSockets in a MV3 Chrome Extension. Starting with Chrome version M116, WebSocket activity will extend the service worker lifetime. In previous Chrome versions, the service worker will become inactive while waiting for messages and disconnect the WebSocket.
Running this extension
- Clone this repository.
- Load this directory in Chrome as an unpacked extension.
- Pin the extension from the extension menu.
- Click the extension's action icon to start a web socket connection.
- Click the extension's action again to stop the web socket connection.
- Check the service worker status to see when the service worker is active/inactive.