← Chrome 157 reference

v157 · enabled by default · web api · web bluetooth

Web Bluetooth: Make BluetoothRemoteGATTServer an EventTarget

Limited availability

  • Chrome · Web Bluetooth since 56 (Android) / 70 (desktop, not Linux by default); this inheritance change listed for 157
  • Edge · Web Bluetooth mirrors Chrome; inheritance change not separately reported
  • Firefox · not implemented (position: negative)
  • Safari · not implemented (position: oppose)

Not Baseline. The parent web-features entry web-bluetooth reports limited availability (webstatus.dev API, queried 2026-11-15: Chrome 70, Chrome Android 56, Edge 79; no Firefox or Safari implementation). There is no separate web-features or BCD key for the EventTarget inheritance itself. See the full table.

BluetoothRemoteGATTServer — the object you get from device.gatt, representing the GATT connection to a remote Bluetooth device — now inherits from EventTarget. It therefore gains the standard addEventListener(), removeEventListener() and dispatchEvent() methods. Nothing else about the interface changes in this feature: its purpose is to give connection-level events a home on the object that represents the connection, starting with the separately proposed maxwritewithoutresponsesizechanged event.

Check the shipping milestone before relying on it

The chromestatus milestone=157 listing files this feature under “Enabled by default”, and the detail record targets desktop, Android, WebView and iOS 157. However, the implementing change, Chromium CL 8363084, merged on 2026-11-13 at refs/heads/main@{#1743596}. According to ChromiumDash, that is after the M157 branch point (#1717349), the M158 branch point (#1727472) and the M159 branch point (#1739869), all queried 2026-11-15. Unless the change is merged back to a release branch (this page did not check for a merge-back), the first release that contains it will be later than 157. The defining spec change, WebBluetoothCG/web-bluetooth PR #672, is approved but not merged. There is no runtime flag for the inheritance: the : EventTarget in the Chromium IDL is unconditional, so detect the feature instead of checking the version number:

const serverIsEventTarget =
  "BluetoothRemoteGATTServer" in globalThis &&
  EventTarget.prototype.isPrototypeOf(BluetoothRemoteGATTServer.prototype);

at a glance

InterfaceBluetoothRemoteGATTServer (Web Bluetooth)
ChangeParent interface changes from none (prototype chain ends at Object.prototype) to EventTarget
New inherited membersaddEventListener(), removeEventListener(), dispatchEvent()
New eventsNone in this feature. The first event designed for this target, maxwritewithoutresponsesizechanged, ships as a separate feature (CL 7879985)
Exposure[Exposed=Window, SecureContext]; no workers
FlagNone (not gated by a runtime-enabled feature)
ChromeStatus5138797158334464 · tracking bug 40265040 · Intent to Ship
SpecWeb Bluetooth with PR #672 applied (preview); not yet in the published draft
Source: ChromeStatus 5138797158334464; CL 8363084; Chromium IDL. Queried 2026-11-15.

why it exists

BluetoothRemoteGATTServer represents an active GATT connection. Some state belongs to the connection rather than to the device or one characteristic: for example, the negotiated ATT_MTU, which limits how many bytes writeValueWithoutResponse() can send in one packet. Before this change the server object could not have listeners, so connection-level events had to be fired at BluetoothDevice (as gattserverdisconnected is). Making the server an EventTarget provides the standard listener API on the right object. The ChromeStatus record calls it a small preparation feature for that later work.

Source: ChromeStatus API record (motivation, web-developer view); spec PR #672.

syntax

The interface as it reads with PR #672 applied (quoted verbatim from the PR preview, head 0d80357, read 2026-11-15). This feature is the : EventTarget on the first line. The other members are pre-existing, except maxWriteWithoutResponseSize and onmaxwritewithoutresponsesizechanged, which the same PR adds but which ship as a separate Chrome feature:

[Exposed=Window, SecureContext]
interface BluetoothRemoteGATTServer : EventTarget {
  [SameObject]
  readonly attribute BluetoothDevice device;
  readonly attribute boolean connected;
  readonly attribute unsigned short maxWriteWithoutResponseSize;
  attribute EventHandler onmaxwritewithoutresponsesizechanged;
  Promise<BluetoothRemoteGATTServer> connect();
  undefined disconnect();
  Promise<BluetoothRemoteGATTService> getPrimaryService(BluetoothServiceUUID service);
  Promise<sequence<BluetoothRemoteGATTService>>
    getPrimaryServices(optional BluetoothServiceUUID service);
};

The three members gained through inheritance, as declared on EventTarget in the DOM Standard:

[Exposed=*]
interface EventTarget {
  constructor();

  undefined addEventListener(DOMString type, EventListener? callback, optional (AddEventListenerOptions or boolean) options = {});
  undefined removeEventListener(DOMString type, EventListener? callback, optional (EventListenerOptions or boolean) options = {});
  boolean dispatchEvent(Event event);
};

Called on a server as server.addEventListener(type, callback, options), server.removeEventListener(type, callback, options) and server.dispatchEvent(event). The EventTarget constructor is not inherited as a way to create servers: BluetoothRemoteGATTServer declares no constructor of its own.

the inheritance contract

Per Web IDL, declaring : EventTarget makes Object.getPrototypeOf(BluetoothRemoteGATTServer.prototype) equal EventTarget.prototype, and makes the interface object’s own prototype EventTarget. The three methods are inherited, not copied: Object.hasOwn(BluetoothRemoteGATTServer.prototype, "addEventListener") stays false, and server.addEventListener === EventTarget.prototype.addEventListener. The interface still has no constructor; new BluetoothRemoteGATTServer() throws a TypeError.

member reference

MemberReturnsFull reference
addEventListener(type, callback, options)undefinedBluetoothRemoteGATTServer.addEventListener()
removeEventListener(type, callback, options)undefinedBluetoothRemoteGATTServer.removeEventListener()
dispatchEvent(event)booleanBluetoothRemoteGATTServer.dispatchEvent()
Source: PR #672 preview (IDL quoted verbatim); DOM Standard §2.7 EventTarget; Web IDL interface prototype object; Chromium IDL.

inputs and observable effects

inputs

The inheritance change takes no arguments. It has no option, flag, header or permission to configure. All inputs go through the three inherited methods. addEventListener() and removeEventListener() take an event type string, a callback (a function, an object with handleEvent(), or null) and an optional options dictionary or capture boolean. dispatchEvent() takes an initialized Event object. The parameters are documented on each member page.

outputs and observable effects

Source: ChromeStatus API record (interop/compat risks, debuggability); CL 8363084 (updated global-interface-listing and WPT idlharness expectations).

errors

The inheritance adds no new exception paths to Web Bluetooth. The errors you can now hit come from the inherited EventTarget methods and from Web IDL:

Source: DOM §dispatchEvent(); Web IDL. Observed in local Chrome for Testing 153 (2026-11-15, before this change): new BluetoothRemoteGATTServer() threw TypeError: Failed to construct 'BluetoothRemoteGATTServer': Illegal constructor, and the prototype’s parent was Object.prototype.

context and exposure

Source: PR #672 preview IDL; Web Bluetooth gatt getter; ChromeStatus platforms; BCD.

lifecycle and event flow

Source: Web Bluetooth §Bluetooth tree and §Event types; PR #672 §Responding to MTU changes; DOM dispatch algorithm; CL 8363084.

examples

detect, connect and listen on the server

Run this from a click handler on an HTTPS page. It attaches connection-level listeners to the server once and keeps disconnect handling on the device, where that event actually fires:

const button = document.querySelector("#connect");

button.addEventListener("click", async () => {
  if (!("bluetooth" in navigator)) {
    console.log("Web Bluetooth is not available here.");
    return;
  }
  const device = await navigator.bluetooth.requestDevice({
    filters: [{ services: ["battery_service"] }],
  });
  const server = device.gatt; // the same object on every access

  // Disconnects are still fired at the device.
  device.addEventListener("gattserverdisconnected", () => {
    console.log("disconnected; server listeners stay attached");
  });

  if (EventTarget.prototype.isPrototypeOf(BluetoothRemoteGATTServer.prototype)) {
    // Connection-level events go to the server. This is the first
    // event type designed for it (shipped as a separate feature).
    server.addEventListener("maxwritewithoutresponsesizechanged", () => {
      console.log("new size:", server.maxWriteWithoutResponseSize);
    });
  }

  await server.connect();
  console.log("connected:", server.connected);
});

use the server as an app-level event bus

Because the server is now an EventTarget, your own connection code can dispatch synthetic events at it. They do not propagate, and isTrusted is false:

function announceReady(server) {
  server.dispatchEvent(new CustomEvent("app:ready", { detail: { at: Date.now() } }));
}

const controller = new AbortController();
server.addEventListener("app:ready", (event) => {
  console.log(event.target === server, event.isTrusted, event.detail.at); // true false …
}, { signal: controller.signal });

announceReady(server);
controller.abort(); // detaches the listener
Live example from the Chrome Platform Showcase: the prototype chain probe, which checks the inheritance without Bluetooth hardware (route HEAD-checked 200, 2026-11-15). Sibling concept demos: live server events (needs a BLE device), listener migration map and reconnect lifecycle.Source: chrome-platform-showcase
Source: examples written for this page against the PR #672 IDL and DOM EventTarget. Not executed against a Chrome build that contains the change; a real device connection was not exercised.

browser compatibility

BluetoothRemoteGATTServer support and the EventTarget inheritance, by browser
BrowserBluetoothRemoteGATTServer (BCD)Inherits EventTarget
Chrome (desktop)70 (partial: Linux not enabled by default); 56–69 macOS onlyListed for 157 (interim, ChromeStatus); code merged after the M159 branch point, so the first release is unknown
Chrome Android56Listed for 157 (interim); same caveat
EdgeMirrors ChromeUnknown (not separately reported)
Opera / Samsung InternetMirror ChromeUnknown
Android WebViewNo (version_added: false)Not applicable (no interface), despite the ChromeStatus WebView milestone
FirefoxNo (bug 674737)No
Safari / iOSNo (WebKit bug 101034)No

The interface column comes from BCD api/BluetoothRemoteGATTServer.json (fetched raw 2026-11-15; status experimental, standard_track). BCD has no key for the inheritance change. The methods themselves have been on EventTarget for a long time per BCD api/EventTarget.json. The inheritance column is therefore interim data from ChromeStatus, corrected by the CL position given in the shipping note. Mozilla’s position on Web Bluetooth is negative and WebKit’s is oppose. Both cover the whole API, not this change.

Source: BCD; webstatus.dev; ChromeStatus API record.

security and privacy

This change exposes only the standard EventTarget methods on an object the page could already reach. It does not give access to any more devices, services, characteristics, data or operations. The existing protections are unchanged: the permission chooser, the secure-context requirement, the service allowlist, the GATT blocklist and the "bluetooth" Permissions Policy. Events you dispatch yourself have isTrusted set to false and cannot be mistaken for UA-fired events. Registering a listener does not connect to the device or keep it connected. The only new observable is the prototype chain itself, which shows whether the browser has this change and reveals nothing about Bluetooth hardware or paired devices. ChromeStatus lists the security and privacy reviews as “Pending” (queried 2026-11-15).

Source: ChromeStatus API record (security risks; review status); Web Bluetooth §Permissions Policy; DOM dispatchEvent() (isTrusted false).

specifications

SpecificationStatus
Web Bluetooth (with PR #672)
§BluetoothRemoteGATTServer
Approved pull request, not merged (PR #672, head 0d80357 on 2026-11-02)
Web Bluetooth
§6.2 BluetoothRemoteGATTServer
Draft Community Group Report (3 June 2026). It still declares the interface without a parent
DOM Standard
§2.7 Interface EventTarget
Living Standard
Source: ChromeStatus spec maturity “Working draft” per the API record; spec text read 2026-11-15.

see also