commit 485430290992d12505284a1ea8c0d01cbeaf571b
parent 4ac3005e84477d6022d3fd66867fe0870a5fed24
Author: Nick Grato <ngrato@gmail.com>
Date: Wed, 3 Dec 2025 02:43:31 +0000
Bug 2003378 - Create about AI Window r=Gijs,ai-frontend-reviewers
In an effort to land the layout for AI Window we need a content process surface for LLM markdown rendering, in other words a place to render the LLM response in chat bubbles. This ticket outlines the about:ai-window and corresponding HTML page.
Differential Revision: https://phabricator.services.mozilla.com/D274671
Diffstat:
5 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp
@@ -45,6 +45,10 @@ struct RedirEntry {
browser/components/about/components.conf
*/
static const RedirEntry kRedirMap[] = {
+ {"aichatcontent", "chrome://browser/content/aiwindow/ui/aiChatContent.html",
+ nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
+ nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
+ nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},
{"asrouter", "chrome://browser/content/asrouter/asrouter-admin.html",
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |
diff --git a/browser/components/about/components.conf b/browser/components/about/components.conf
@@ -5,6 +5,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
pages = [
+ 'aichatcontent',
'asrouter',
'blocked',
'certerror',
diff --git a/browser/components/aiwindow/ui/aiChatContent.html b/browser/components/aiwindow/ui/aiChatContent.html
@@ -0,0 +1,23 @@
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+ - License, v. 2.0. If a copy of the MPL was not distributed with this file,
+ - You can obtain one at http://mozilla.org/MPL/2.0/. -->
+
+<!-- Note: This is a content process level document to interact with LLM services and render LLM output -->
+<!doctype html>
+<html xmlns="http://www.w3.org/1999/xhtml" role="document">
+ <head>
+ <meta charset="utf-8" />
+ <meta
+ http-equiv="Content-Security-Policy"
+ content="default-src resource: chrome:; object-src 'none'; img-src chrome:;"
+ />
+ <meta name="color-scheme" content="light dark" />
+ <!-- TODO : Add localization preview -->
+ <title>AI Chat Content</title>
+ <link rel="stylesheet" href="chrome://global/skin/in-content/common.css" />
+ <script src="chrome://browser/content/contentTheme.js"></script>
+ </head>
+ <body id="ai-window-wrapper">
+ Placeholder for AI Chat Content
+ </body>
+</html>
diff --git a/browser/components/aiwindow/ui/jar.mn b/browser/components/aiwindow/ui/jar.mn
@@ -0,0 +1,8 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# This file was copied from browser/components/aiwindow/ui/moz.build.
+
+browser.jar:
+ content/browser/aiwindow/ui/aiChatContent.html
diff --git a/browser/components/aiwindow/ui/moz.build b/browser/components/aiwindow/ui/moz.build
@@ -10,3 +10,5 @@ BROWSER_CHROME_MANIFESTS += ["test/browser/browser.toml"]
MOZ_SRC_FILES += [
"modules/AIWindow.sys.mjs",
]
+
+JAR_MANIFESTS += ["jar.mn"]