ChromeOS APIs for Isolated Web Apps

Unofficial Draft

More details about this document
Latest published version:
none
Latest editor's draft:
https://explainers-by-googlers.github.io/chromeos-iwa-apis/
History:
Commit history
Editor:
(Google Inc.)
Feedback:
GitHub explainers-by-googlers/chromeos-iwa-apis (pull requests, new issue, open issues)

Abstract

This specification defines extensions to the Web platform available in ChromeOS. These extensions are restricted to allowlisted Isolated Web Apps running on ChromeOS.

Status of This Document

This document is a specification of ChromeOS-specific APIs for allowlisted Isolated Web Apps. It has no official standing of any kind and does not represent the support or consensus of any standards organization.

1. Introduction

ChromeOS provides specialized APIs to allowlisted Isolated Web Apps (IWAs) to enable native-like integration with the operating system. This specification defines the entry points for these APIs and the specific features exposed.

2. API Entry Points

All ChromeOS-specific Web APIs are exposed via the chromeos attribute on the Window object.

WebIDLpartial interface Window {
  [Replaceable] readonly attribute ChromeOS chromeos;
};

[Exposed=Window]
interface ChromeOS {
  readonly attribute IsolatedWebApp isolatedWebApp;
};

[Exposed=Window]
interface IsolatedWebApp {};

2.1 The chromeos attribute

The chromeos attribute exposes ChromeOS-specific APIs. This attribute must return null if the current context is not allowlisted to use any of ChromeOS IWA APIs.

2.2 The isolatedWebApp attribute

The isolatedWebApp attribute exposes APIs specific to Isolated Web Apps. This attribute must return null if the current context is not an IWA or not allowlisted to use the ChromeOS IWA APIs.

3. Window Shape API

The Window Shape API allows allowlisted IWAs to customize the shape of their window, enabling non-rectangular layouts.

3.1 Security and Privacy Considerations

Since this API allows changing the visible shape of the window, it could be used to create invisible or extremely small windows to perform malicious actions without the user's knowledge. To mitigate this:

3.2 API Extension

The Window Shape API extends the IsolatedWebApp interface.

WebIDLpartial interface IsolatedWebApp {
  Promise<undefined> setShape(sequence<DOMRectReadOnly> rects);
};

3.3 The setShape() method

The setShape(|rects|) method customizes the shape of the window. When called, the user agent does the following steps:

  1. Let promise be a new promise.
  2. Let window be the current global object.
  3. If the display mode of window is not unframed, reject promise with an InvalidStateError and return promise.
  4. If rects's size is greater than 10000, reject promise with a TypeError and return promise.
  5. Let convertedRects be an empty list of rectangles.
  6. Let hasMinimumSizeRect be false.
  7. For each rect of rects:
    1. If any of rect's x, y, width, or height is not finite, reject promise with a TypeError and return promise.
    2. If rect's width is less than 0 or rect's height is less than 0, reject promise with a TypeError and return promise.
    3. If rect's width is greater than or equal to 10 and rect's height is greater than or equal to 10, set hasMinimumSizeRect to true.
    4. append a new rectangle with x, y, width, and height set to the corresponding values from rect clamped to the range of a 32-bit signed integer, to convertedRects.
  8. If rects's size is greater than 0 and hasMinimumSizeRect is false, reject promise with a TypeError and return promise.
  9. Run these steps in parallel:
    1. Let targetWindow be the OS window associated with the current global object.
    2. If targetWindow is null, reject promise with InvalidStateError and abort these steps.
    3. If the display mode of the current global object is not unframed, reject promise with InvalidStateError and abort these steps.
    4. Ask the host operating system to set targetWindow's shape to the union of convertedRects.
    5. resolve promise with undefined.
  10. Return promise.

A. References

A.1 Informative references

[appmanifest]
Web Application Manifest. Marcos Caceres; Daniel Murphy; Christian Liebel. W3C. 7 May 2026. W3C Working Draft. URL: https://www.w3.org/TR/appmanifest/
[geometry-1]
Geometry Interfaces Module Level 1. Sebastian Zartner; Yehonatan Daniv. W3C. 4 December 2025. CRD. URL: https://www.w3.org/TR/geometry-1/
[html]
HTML Standard. Anne van Kesteren; Domenic Denicola; Dominic Farolino; Ian Hickson; Philip Jägenstedt; Simon Pieters. WHATWG. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[infra]
Infra Standard. Anne van Kesteren; Domenic Denicola. WHATWG. Living Standard. URL: https://infra.spec.whatwg.org/
[manifest-incubations]
Manifest Incubations. W3C. Draft Community Group Report. URL: https://wicg.github.io/manifest-incubations/
[permissions]
Permissions. Marcos Caceres; Mike Taylor. W3C. 6 October 2025. W3C Working Draft. URL: https://www.w3.org/TR/permissions/
[WEBIDL]
Web IDL Standard. Edgar Chen; Timothy Gu. WHATWG. Living Standard. URL: https://webidl.spec.whatwg.org/
[window-management]
Window Management. Joshua Bell; Mike Wasserman. W3C. 7 June 2024. W3C Working Draft. URL: https://www.w3.org/TR/window-management/