Skip to content

Commit 4854302

Browse files
committed
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
1 parent 4ac3005 commit 4854302

File tree

5 files changed

+38
-0
lines changed

5 files changed

+38
-0
lines changed

browser/components/about/AboutRedirector.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ struct RedirEntry {
4545
browser/components/about/components.conf
4646
*/
4747
static const RedirEntry kRedirMap[] = {
48+
{"aichatcontent", "chrome://browser/content/aiwindow/ui/aiChatContent.html",
49+
nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
50+
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
51+
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT},
4852
{"asrouter", "chrome://browser/content/asrouter/asrouter-admin.html",
4953
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
5054
nsIAboutModule::URI_CAN_LOAD_IN_PRIVILEGEDABOUT_PROCESS |

browser/components/about/components.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
66

77
pages = [
8+
'aichatcontent',
89
'asrouter',
910
'blocked',
1011
'certerror',
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!-- This Source Code Form is subject to the terms of the Mozilla Public
2+
- License, v. 2.0. If a copy of the MPL was not distributed with this file,
3+
- You can obtain one at http://mozilla.org/MPL/2.0/. -->
4+
5+
<!-- Note: This is a content process level document to interact with LLM services and render LLM output -->
6+
<!doctype html>
7+
<html xmlns="http://www.w3.org/1999/xhtml" role="document">
8+
<head>
9+
<meta charset="utf-8" />
10+
<meta
11+
http-equiv="Content-Security-Policy"
12+
content="default-src resource: chrome:; object-src 'none'; img-src chrome:;"
13+
/>
14+
<meta name="color-scheme" content="light dark" />
15+
<!-- TODO : Add localization preview -->
16+
<title>AI Chat Content</title>
17+
<link rel="stylesheet" href="chrome://global/skin/in-content/common.css" />
18+
<script src="chrome://browser/content/contentTheme.js"></script>
19+
</head>
20+
<body id="ai-window-wrapper">
21+
Placeholder for AI Chat Content
22+
</body>
23+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This Source Code Form is subject to the terms of the Mozilla Public
2+
# License, v. 2.0. If a copy of the MPL was not distributed with this
3+
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
4+
5+
# This file was copied from browser/components/aiwindow/ui/moz.build.
6+
7+
browser.jar:
8+
content/browser/aiwindow/ui/aiChatContent.html

browser/components/aiwindow/ui/moz.build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ BROWSER_CHROME_MANIFESTS += ["test/browser/browser.toml"]
1010
MOZ_SRC_FILES += [
1111
"modules/AIWindow.sys.mjs",
1212
]
13+
14+
JAR_MANIFESTS += ["jar.mn"]

0 commit comments

Comments
 (0)