diff --git a/browser/base/content/browser.xhtml b/browser/base/content/browser.xhtml
index 7ddec2603488..a01138c7da78 100644
--- a/browser/base/content/browser.xhtml
+++ b/browser/base/content/browser.xhtml
@@ -117,7 +117,7 @@
Services.scriptloader.loadSubScript("chrome://browser/content/browser-development-helpers.js", this);
}
Services.scriptloader.loadSubScript("chrome://browser/content/browser-pageActions.js", this);
- Services.scriptloader.loadSubScript("chrome://browser/content/browser-sidebar.js", this);
+ Services.scriptloader.loadSubScript("chrome://browser/content/sidebar/browser-sidebar.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/browser-tabsintitlebar.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/browser-unified-extensions.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this);
diff --git a/browser/base/jar.mn b/browser/base/jar.mn
index e74acf396bf3..9357cf1af051 100644
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -55,7 +55,6 @@ browser.jar:
content/browser/browser-places.js (content/browser-places.js)
content/browser/browser-profiles.js (content/browser-profiles.js)
content/browser/browser-safebrowsing.js (content/browser-safebrowsing.js)
- content/browser/browser-sidebar.js (content/browser-sidebar.js)
content/browser/browser-siteIdentity.js (content/browser-siteIdentity.js)
content/browser/browser-sitePermissionPanel.js (content/browser-sitePermissionPanel.js)
content/browser/browser-siteProtections.js (content/browser-siteProtections.js)
diff --git a/browser/base/content/browser-sidebar.js b/browser/components/sidebar/browser-sidebar.js
similarity index 99%
rename from browser/base/content/browser-sidebar.js
rename to browser/components/sidebar/browser-sidebar.js
index 8a73489a5b0d..ff7f6732aa23 100644
--- a/browser/base/content/browser-sidebar.js
+++ b/browser/components/sidebar/browser-sidebar.js
@@ -203,7 +203,7 @@ var SidebarUI = {
/**
* The handler for Services.obs.addObserver.
- **/
+ */
observe(_subject, topic, _data) {
switch (topic) {
case "intl:app-locales-changed": {
@@ -260,6 +260,7 @@ var SidebarUI = {
/**
* Handles keydown on the the switcherTarget button
+ *
* @param {Event} event
*/
handleKeydown(event) {
@@ -368,8 +369,9 @@ var SidebarUI = {
/**
* Try and adopt the status of the sidebar from another window.
+ *
* @param {Window} sourceWindow - Window to use as a source for sidebar status.
- * @return true if we adopted the state, or false if the caller should
+ * @returns {boolean} true if we adopted the state, or false if the caller should
* initialize the state itself.
*/
adoptFromWindow(sourceWindow) {
@@ -512,7 +514,7 @@ var SidebarUI = {
* @param {string} commandID ID of the sidebar.
* @param {DOMNode} [triggerNode] Node, usually a button, that triggered the
* visibility toggling of the sidebar.
- * @return {Promise}
+ * @returns {Promise}
*/
toggle(commandID = this.lastOpenedId, triggerNode) {
if (
@@ -559,7 +561,7 @@ var SidebarUI = {
* @param {string} commandID ID of the sidebar to use.
* @param {DOMNode} [triggerNode] Node, usually a button, that triggered the
* showing of the sidebar.
- * @return {Promise}
+ * @returns {Promise}
*/
async show(commandID, triggerNode) {
let panelType = commandID.substring(4, commandID.length - 7);
@@ -588,7 +590,7 @@ var SidebarUI = {
* when a window opens (not triggered by user interaction).
*
* @param {string} commandID ID of the sidebar.
- * @return {Promise}
+ * @returns {Promise}
*/
async showInitially(commandID) {
let panelType = commandID.substring(4, commandID.length - 7);
@@ -610,7 +612,7 @@ var SidebarUI = {
* when a window is opened and we don't want to ping telemetry.
*
* @param {string} commandID ID of the sidebar.
- * @return {Promise}
+ * @returns {Promise}
*/
_show(commandID) {
return new Promise(resolve => {
diff --git a/browser/components/sidebar/jar.mn b/browser/components/sidebar/jar.mn
index 6f9973e650c0..8c45a40d63a6 100644
--- a/browser/components/sidebar/jar.mn
+++ b/browser/components/sidebar/jar.mn
@@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar:
+ content/browser/sidebar/browser-sidebar.js
content/browser/sidebar/sidebar-launcher.css
content/browser/sidebar/sidebar-launcher.mjs
content/browser/sidebar/sidebar-history.html
diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
index 241299e2d357..83fa01935e95 100644
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
@@ -57,6 +57,7 @@ const MAPPINGS = {
"browser/components/places/content/places-menupopup.js",
"shopping-sidebar.js":
"browser/components/shopping/content/shopping-sidebar.js",
+ "browser-sidebar.js": "browser/components/sidebar/browser-sidebar.js",
};
const globalScriptsRegExp =