From 74784f2182a37d53e8a0c98164107a58fa01d437 Mon Sep 17 00:00:00 2001 From: Patrick Kettner Date: Thu, 14 Dec 2023 16:30:11 -0500 Subject: [PATCH 01/14] create specification for window.browser --- specification/window.browser.html | 1673 +++++++++++++++++++++++++++++ 1 file changed, 1673 insertions(+) create mode 100644 specification/window.browser.html diff --git a/specification/window.browser.html b/specification/window.browser.html new file mode 100644 index 00000000..c2e9801b --- /dev/null +++ b/specification/window.browser.html @@ -0,0 +1,1673 @@ + + + + + window.browser + + + + + + + + + + + + + + + +
+

+

window.browser

+

Unofficial Proposal Draft,

+
+ More details about this document +
+
+
This version: +
https://patrickkettner.github.io/window.browser +
Editor: +
(Google) +
+
+
+
+ +
+
+
+

Abstract

+

This specification reserves the window.browser namespace for use by WebExtensions.

+
+

Status of this document

+
+

This specification was published by the WebExtensions Community Group. + It is not a W3C Standard nor is it on the W3C Standards Track. + + Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. + + Learn more about W3C Community and Business Groups.

+

+
+
+ +
+
+

Introduction

+ This section is non-normative. +

Modern WebExtensions are an evolution of a system originally introduced in + Chrome version 3. In that system, any API that was added was put under the + `chrome` namespace. When WebExtensions were adopted outside of Chromium, other + vendors used the more neutral `browser` namespace. That `browser` is now + considered to canonically correct namespace for all WebExtension APIs. + Some interactions with WebExtensions (such as external messaging from content + scripts to background processes) necessitate the exposure of this namespace + to the web. + Given that, this document defines `window.browser` as reserved for the use of + APIs designed to interact with WebExtensions. The specifics of what + APIs within `window.browser` are at present intentionally undefined, and are + left up to User Agent implementation.

+
+
+

window.browser API

+

browser is UA defined attribute exposed on window. When implemented, + it MUST be used only for WebExtension related functionality.

+
+
partial interface Window {
+  readonly attribute short browser;
+};
+
+
+
+

Conformance

+

Document conventions

+

Conformance requirements are expressed + with a combination of descriptive assertions + and RFC 2119 terminology. + The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” + in the normative parts of this document + are to be interpreted as described in RFC 2119. + However, for readability, + these words do not appear in all uppercase letters in this specification.

+

All of the text of this specification is normative + except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

+

Examples in this specification are introduced with the words “for example” + or are set apart from the normative text + with class="example", + like this:

+
+ +

This is an example of an informative example.

+
+

Informative notes begin with the word “Note” + and are set apart from the normative text + with class="note", + like this:

+

Note, this is an informative note.

+
+ +

Index

+

Terms defined by this specification

+ +

Terms defined by reference

+ +

References

+

Normative References

+
+
[COMPAT] +
Mike Taylor. Compatibility Standard. Living Standard. URL: https://compat.spec.whatwg.org/ +
[FETCH] +
Anne van Kesteren. Fetch Standard. Living Standard. URL: https://fetch.spec.whatwg.org/ +
[HTML] +
Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/ +
[RFC2119] +
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119 +
[WEBIDL] +
Edgar Chen; Timothy Gu. Web IDL Standard. Living Standard. URL: https://webidl.spec.whatwg.org/ +
+

IDL Index

+
partial interface Window {
+  readonly attribute short browser;
+};
+
+
+ + + + + \ No newline at end of file From ffcf57279a33a3cf75cbf5a5f8883e993d9fe613 Mon Sep 17 00:00:00 2001 From: Patrick Kettner Date: Wed, 20 Dec 2023 08:31:47 -0500 Subject: [PATCH 02/14] feedback from PR for window.browser --- specification/window.browser.bs | 57 ++ specification/window.browser.html | 1242 ++++++++++++++--------------- 2 files changed, 669 insertions(+), 630 deletions(-) create mode 100644 specification/window.browser.bs diff --git a/specification/window.browser.bs b/specification/window.browser.bs new file mode 100644 index 00000000..66f9f0af --- /dev/null +++ b/specification/window.browser.bs @@ -0,0 +1,57 @@ + + + + +
+spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/
+    type: dfn; text: valid non-empty URL; url: valid-non-empty-url-potentially-surrounded-by-spaces
+
+ +
+ ## Introduction {#introduction} + This section is non-normative. + + Modern WebExtensions are an evolution of a system originally introduced in + Chrome version 3. In that system, any API that was added was put under the + chrome namespace. When WebExtensions were adopted outside of + Chromium, other vendors used the more neutral browser namespace. + That browser is now considered to canonically correct namespace + for all WebExtension APIs. Some interactions with WebExtensions (such as + external messaging from content scripts to background processes) necessitate + the exposure of this namespace to the web. + + Given that, this document defines window.browser as reserved for + the use of APIs designed to interact with WebExtensions. The specifics of what + APIs within window.browser are at present intentionally undefined, + and are left up to User Agent implementation. +
+ + +
+

+ window.browser API +

+ + {{browser}} is UA defined attribute exposed on {{window}}. When implemented, + it MUST be used only for WebExtension related functionality. +
+ + +
+  partial interface Window {
+    readonly attribute object browser;
+  };
+
diff --git a/specification/window.browser.html b/specification/window.browser.html index c2e9801b..81bc602c 100644 --- a/specification/window.browser.html +++ b/specification/window.browser.html @@ -5,9 +5,9 @@ window.browser - + - + +