From cb224f5b6529e43230df01fec1513e7df99d79a0 Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Tue, 26 May 2026 12:14:03 +1000 Subject: [PATCH 1/3] FF152 Relnote: with { type: "text" } supported --- .../firefox/experimental_features/index.md | 16 ++++++++++++++++ .../en-us/mozilla/firefox/releases/152/index.md | 6 ++++++ 2 files changed, 22 insertions(+) diff --git a/files/en-us/mozilla/firefox/experimental_features/index.md b/files/en-us/mozilla/firefox/experimental_features/index.md index 59ac57e4509b1c3..7be311f25a83f1b 100644 --- a/files/en-us/mozilla/firefox/experimental_features/index.md +++ b/files/en-us/mozilla/firefox/experimental_features/index.md @@ -445,6 +445,22 @@ This includes all the instance methods on `Intl.Locale` that are prefixed with " - `javascript.options.experimental.intl_locale_info` - : Set to `true` to enable on Nightly. +### Text module import + +The `with` clause [`{ type: "text" }`](/en-US/docs/Web/JavaScript/Reference/Statements/import/with#text_modules_type_text) allows importing a module's source as a string value. +The media type of the response is ignored, and the content is parsed as text even if the source contains scripts or other executable code. +([Firefox bug 2024854](https://bugzil.la/2024854)). + +| Release channel | Version added | Enabled by default? | +| ----------------- | ------------- | ------------------- | +| Nightly | 152 | No | +| Developer Edition | 152 | No | +| Beta | 152 | No | +| Release | 152 | No | + +- `javascript.options.experimental.import_text` + - : Set to `true` to enable. + ### Multiple import maps Support for [multiple import maps](/en-US/docs/Web/HTML/Reference/Elements/script/type/importmap#merging_multiple_import_maps). diff --git a/files/en-us/mozilla/firefox/releases/152/index.md b/files/en-us/mozilla/firefox/releases/152/index.md index 3dbb48490e0549b..04c98f4fcefbb17 100644 --- a/files/en-us/mozilla/firefox/releases/152/index.md +++ b/files/en-us/mozilla/firefox/releases/152/index.md @@ -127,3 +127,9 @@ You can find more such features on the [Experimental features](/en-US/docs/Mozil The [TC39 Intl.Locale info proposal](https://github.com/tc39/proposal-intl-locale-info) is now supported on nightly builds if the preference is enabled. This includes all the [`Intl.Locale` instance methods prefixed with "get"](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale#instance_methods). ([Firefox bug 1693576](https://bugzil.la/1693576)). + +- **Text module import**: `javascript.options.experimental.import_text` + + The `with` clause [`{ type: "text" }`](/en-US/docs/Web/JavaScript/Reference/Statements/import/with#text_modules_type_text) is now supported for importing a text module into a string value. + This can be used to ensure that a module served with the media type of `text/plain` is imported as text, even if it contains JavaScript or some other format. + ([Firefox bug 2024854](https://bugzil.la/2024854)). From 79bcd1ffc165d728a7f064b1b139ca722efff9a3 Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Fri, 29 May 2026 10:33:48 +1000 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Hamish Willee --- files/en-us/mozilla/firefox/experimental_features/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/en-us/mozilla/firefox/experimental_features/index.md b/files/en-us/mozilla/firefox/experimental_features/index.md index 7be311f25a83f1b..eed9d4c7e93e8a3 100644 --- a/files/en-us/mozilla/firefox/experimental_features/index.md +++ b/files/en-us/mozilla/firefox/experimental_features/index.md @@ -448,7 +448,7 @@ This includes all the instance methods on `Intl.Locale` that are prefixed with " ### Text module import The `with` clause [`{ type: "text" }`](/en-US/docs/Web/JavaScript/Reference/Statements/import/with#text_modules_type_text) allows importing a module's source as a string value. -The media type of the response is ignored, and the content is parsed as text even if the source contains scripts or other executable code. +The import ignores the media type of the response: the content is parsed as text even if the source contains scripts or other executable code. ([Firefox bug 2024854](https://bugzil.la/2024854)). | Release channel | Version added | Enabled by default? | From 7cc40c4edc3ad9db8e3ee5f0216e77ae16ed644b Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Fri, 29 May 2026 10:37:54 +1000 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Hamish Willee --- files/en-us/mozilla/firefox/experimental_features/index.md | 2 +- files/en-us/mozilla/firefox/releases/152/index.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/files/en-us/mozilla/firefox/experimental_features/index.md b/files/en-us/mozilla/firefox/experimental_features/index.md index eed9d4c7e93e8a3..7be311f25a83f1b 100644 --- a/files/en-us/mozilla/firefox/experimental_features/index.md +++ b/files/en-us/mozilla/firefox/experimental_features/index.md @@ -448,7 +448,7 @@ This includes all the instance methods on `Intl.Locale` that are prefixed with " ### Text module import The `with` clause [`{ type: "text" }`](/en-US/docs/Web/JavaScript/Reference/Statements/import/with#text_modules_type_text) allows importing a module's source as a string value. -The import ignores the media type of the response: the content is parsed as text even if the source contains scripts or other executable code. +The media type of the response is ignored, and the content is parsed as text even if the source contains scripts or other executable code. ([Firefox bug 2024854](https://bugzil.la/2024854)). | Release channel | Version added | Enabled by default? | diff --git a/files/en-us/mozilla/firefox/releases/152/index.md b/files/en-us/mozilla/firefox/releases/152/index.md index 04c98f4fcefbb17..445d11b82ea214b 100644 --- a/files/en-us/mozilla/firefox/releases/152/index.md +++ b/files/en-us/mozilla/firefox/releases/152/index.md @@ -130,6 +130,6 @@ You can find more such features on the [Experimental features](/en-US/docs/Mozil - **Text module import**: `javascript.options.experimental.import_text` - The `with` clause [`{ type: "text" }`](/en-US/docs/Web/JavaScript/Reference/Statements/import/with#text_modules_type_text) is now supported for importing a text module into a string value. - This can be used to ensure that a module served with the media type of `text/plain` is imported as text, even if it contains JavaScript or some other format. + The `with` clause [`{ type: "text" }`](/en-US/docs/Web/JavaScript/Reference/Statements/import/with#text_modules_type_text) allows importing a module's source as a string value. + The media type of the response is ignored, and the content is parsed as text even if the source contains scripts or other executable code. ([Firefox bug 2024854](https://bugzil.la/2024854)).