tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 3e3f53d319c4adfb113d9bd1adbefc6a0c0dfd07
parent 1a3fabb47096daa440ff459664552c18b3384f53
Author: Nick Grato <ngrato@gmail.com>
Date:   Tue,  9 Dec 2025 23:16:29 +0000

Bug 2004782 - Add AI Window html and css boilerplate files - r=Mardak,ai-frontend-reviewers

Updating folder struct and also adding aiwindow root html file

Differential Revision: https://phabricator.services.mozilla.com/D275666

Diffstat:
Mbrowser/components/about/AboutRedirector.cpp | 2+-
Dbrowser/components/aiwindow/ui/aiChatContent.html | 26--------------------------
Mbrowser/components/aiwindow/ui/components/input-cta/input-cta.mjs | 4++--
Mbrowser/components/aiwindow/ui/components/input-cta/input-cta.stories.mjs | 2+-
Abrowser/components/aiwindow/ui/content/aiChatContent.html | 25+++++++++++++++++++++++++
Abrowser/components/aiwindow/ui/content/aiWindow.html | 23+++++++++++++++++++++++
Mbrowser/components/aiwindow/ui/jar.mn | 9+++++----
Mbrowser/components/aiwindow/ui/modules/AIWindow.sys.mjs | 2+-
Mbrowser/components/storybook/component-status/components.json | 2+-
9 files changed, 59 insertions(+), 36 deletions(-)

diff --git a/browser/components/about/AboutRedirector.cpp b/browser/components/about/AboutRedirector.cpp @@ -45,7 +45,7 @@ struct RedirEntry { browser/components/about/components.conf */ static const RedirEntry kRedirMap[] = { - {"aichatcontent", "chrome://browser/content/aiwindow/ui/aiChatContent.html", + {"aichatcontent", "chrome://browser/content/aiwindow/aiChatContent.html", nsIAboutModule::URI_MUST_LOAD_IN_CHILD | nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::HIDE_FROM_ABOUTABOUT}, diff --git a/browser/components/aiwindow/ui/aiChatContent.html b/browser/components/aiwindow/ui/aiChatContent.html @@ -1,26 +0,0 @@ -<!-- 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> - <!-- TODO: load appropriate component modules - "chrome://browser/content/aiwindow/ui/components/input-cta.mjs" - --> - </head> - <body id="ai-window-wrapper"> - Placeholder for AI Chat Content - </body> -</html> diff --git a/browser/components/aiwindow/ui/components/input-cta/input-cta.mjs b/browser/components/aiwindow/ui/components/input-cta/input-cta.mjs @@ -82,7 +82,7 @@ export class InputCta extends MozLitElement { return html` <link rel="stylesheet" - href="chrome://browser/content/aiwindow/ui/components/input-cta.css" + href="chrome://browser/content/aiwindow/components/input-cta.css" /> <moz-button type=${this.action ? "split" : "default"} @@ -90,7 +90,7 @@ export class InputCta extends MozLitElement { menuId=${ifDefined(this.action ? this._menuId : undefined)} .iconSrc=${this.action ? undefined - : "chrome://browser/content/aiwindow/ui/assets/input-cta-arrow-icon.svg"} + : "chrome://browser/content/aiwindow/assets/input-cta-arrow-icon.svg"} ?disabled=${!this.action} > <slot> diff --git a/browser/components/aiwindow/ui/components/input-cta/input-cta.stories.mjs b/browser/components/aiwindow/ui/components/input-cta/input-cta.stories.mjs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { html } from "chrome://global/content/vendor/lit.all.mjs"; -import "chrome://browser/content/aiwindow/ui/components/input-cta.mjs"; +import "chrome://browser/content/aiwindow/components/input-cta.mjs"; export default { title: "Domain-specific UI Widgets/AI Window/Input CTA", diff --git a/browser/components/aiwindow/ui/content/aiChatContent.html b/browser/components/aiwindow/ui/content/aiChatContent.html @@ -0,0 +1,25 @@ +<!-- 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> + <!-- TODO: load appropriate component modules + --> + </head> + <body id="ai-window-wrapper"> + Placeholder for AI Chat Content + </body> +</html> diff --git a/browser/components/aiwindow/ui/content/aiWindow.html b/browser/components/aiwindow/ui/content/aiWindow.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 https://mozilla.org/MPL/2.0/. --> + +<!doctype html> +<html class="ai-window"> + <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 Window</title> + <!-- TODO: load appropriate component modules + "chrome://browser/content/aiwindow/components/input-cta.mjs" + --> + </head> + <body> + Placeholder for AI Window + </body> +</html> diff --git a/browser/components/aiwindow/ui/jar.mn b/browser/components/aiwindow/ui/jar.mn @@ -3,7 +3,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. browser.jar: - content/browser/aiwindow/ui/aiChatContent.html - content/browser/aiwindow/ui/assets/input-cta-arrow-icon.svg (assets/input-cta-arrow-icon.svg) - content/browser/aiwindow/ui/components/input-cta.css (components/input-cta/input-cta.css) - content/browser/aiwindow/ui/components/input-cta.mjs (components/input-cta/input-cta.mjs) + content/browser/aiwindow/aiChatContent.html (content/aiChatContent.html) + content/browser/aiwindow/aiWindow.html (content/aiWindow.html) + content/browser/aiwindow/assets/input-cta-arrow-icon.svg (assets/input-cta-arrow-icon.svg) + content/browser/aiwindow/components/input-cta.css (components/input-cta/input-cta.css) + content/browser/aiwindow/components/input-cta.mjs (components/input-cta/input-cta.mjs) diff --git a/browser/components/aiwindow/ui/modules/AIWindow.sys.mjs b/browser/components/aiwindow/ui/modules/AIWindow.sys.mjs @@ -64,7 +64,7 @@ export const AIWindow = { const aiWindowURI = Cc["@mozilla.org/supports-string;1"].createInstance( Ci.nsISupportsString ); - aiWindowURI.data = "chrome://browser/content/genai/smartAssist.html"; + aiWindowURI.data = "chrome://browser/content/aiwindow/aiWindow.html"; options.args.appendElement(aiWindowURI); const aiOption = Cc["@mozilla.org/hash-property-bag;1"].createInstance( diff --git a/browser/components/storybook/component-status/components.json b/browser/components/storybook/component-status/components.json @@ -1,5 +1,5 @@ { - "generatedAt": "2025-12-05T16:54:08.681Z", + "generatedAt": "2025-12-09T20:57:06.503Z", "count": 29, "items": [ {