summaryrefslogtreecommitdiffstats
path: root/toolkit/components/extensions/ExtensionActions.sys.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/extensions/ExtensionActions.sys.mjs')
-rw-r--r--toolkit/components/extensions/ExtensionActions.sys.mjs46
1 files changed, 27 insertions, 19 deletions
diff --git a/toolkit/components/extensions/ExtensionActions.sys.mjs b/toolkit/components/extensions/ExtensionActions.sys.mjs
index 29a286442e..92ea9865e3 100644
--- a/toolkit/components/extensions/ExtensionActions.sys.mjs
+++ b/toolkit/components/extensions/ExtensionActions.sys.mjs
@@ -79,8 +79,8 @@ class PanelActionBase {
/**
* Set a global, window specific or tab specific property.
*
- * @param {XULElement|ChromeWindow|null} target
- * A XULElement tab, a ChromeWindow, or null for the global data.
+ * @param {NativeTab|ChromeWindow|null} target
+ * A NativeTab tab, a ChromeWindow, or null for the global data.
* @param {string} prop
* String property to set. Should should be one of "icon", "title", "badgeText",
* "popup", "badgeBackgroundColor", "badgeTextColor" or "enabled".
@@ -104,8 +104,8 @@ class PanelActionBase {
/**
* Gets the data associated with a tab, window, or the global one.
*
- * @param {XULElement|ChromeWindow|null} target
- * A XULElement tab, a ChromeWindow, or null for the global data.
+ * @param {NativeTab|ChromeWindow|null} target
+ * A NativeTab tab, a ChromeWindow, or null for the global data.
* @returns {object}
* The icon, title, badge, etc. associated with the target.
*/
@@ -119,8 +119,8 @@ class PanelActionBase {
/**
* Retrieve the value of a global, window specific or tab specific property.
*
- * @param {XULElement|ChromeWindow|null} target
- * A XULElement tab, a ChromeWindow, or null for the global data.
+ * @param {NativeTab|ChromeWindow|null} target
+ * A NativeTab tab, a ChromeWindow, or null for the global data.
* @param {string} prop
* Name of property to retrieve. Should should be one of "icon",
* "title", "badgeText", "popup", "badgeBackgroundColor" or "enabled".
@@ -161,7 +161,7 @@ class PanelActionBase {
*
* @param {string} eventType
* The type of the event, should be "location-change".
- * @param {XULElement} tab
+ * @param {NativeTab} tab
* The tab whose location changed, or which has become selected.
* @param {boolean} [fromBrowse]
* - `true` if navigation occurred in `tab`.
@@ -178,7 +178,7 @@ class PanelActionBase {
/**
* Gets the popup url for a given tab.
*
- * @param {XULElement} tab
+ * @param {NativeTab} tab
* The tab the popup refers to.
* @param {boolean} strict
* If errors should be thrown if a URL is not available.
@@ -208,7 +208,7 @@ class PanelActionBase {
* Will clear any existing activeTab permissions previously granted for any
* other tab.
*
- * @param {XULElement} tab
+ * @param {NativeTab} tab
* The tab that should be granted activeTab permission for. Set to
* null to clear previously granted activeTab permission.
*/
@@ -229,7 +229,7 @@ class PanelActionBase {
/**
* Triggers this action and sends the appropriate event if needed.
*
- * @param {XULElement} tab
+ * @param {NativeTab} tab
* The tab on which the action was fired.
* @param {object} clickInfo
* Extra data passed to the second parameter to the action API's
@@ -322,7 +322,7 @@ class PanelActionBase {
* If it only changes a parameter for a single window, `target` will be that window.
* Otherwise `target` will be null.
*
- * @param {XULElement|ChromeWindow|null} _target
+ * @param {NativeTab|ChromeWindow} [_target]
* Browser tab or browser chrome window, may be null.
*/
updateOnChange(_target) {}
@@ -332,16 +332,22 @@ class PanelActionBase {
*
* @param {string} _tabId
* Internal id of the tab to get.
+ * @returns {NativeTab}
*/
- getTab(_tabId) {}
+ getTab(_tabId) {
+ throw new Error("Not implemented.");
+ }
/**
* Get window object from windowId
*
* @param {string} _windowId
* Internal id of the window to get.
+ * @returns {ChromeWindow}
*/
- getWindow(_windowId) {}
+ getWindow(_windowId) {
+ throw new Error("Not implemented.");
+ }
/**
* Gets the target object corresponding to the `details` parameter of the various
@@ -352,19 +358,19 @@ class PanelActionBase {
* @param {number} [_details.tabId]
* @param {number} [_details.windowId]
* @throws if both `tabId` and `windowId` are specified, or if they are invalid.
- * @returns {XULElement|ChromeWindow|null}
- * If a `tabId` was specified, the corresponding XULElement tab.
+ * @returns {NativeTab|ChromeWindow|null}
+ * If a `tabId` was specified, the corresponding NativeTab tab.
* If a `windowId` was specified, the corresponding ChromeWindow.
* Otherwise, `null`.
*/
getTargetFromDetails(_details) {
- return null;
+ throw new Error("Not Implemented");
}
/**
* Triggers a click event.
*
- * @param {XULElement} _tab
+ * @param {NativeTab} _tab
* The tab where this event should be fired.
* @param {object} _clickInfo
* Extra data passed to the second parameter to the action API's
@@ -375,7 +381,7 @@ class PanelActionBase {
/**
* Checks whether this action is shown.
*
- * @param {XULElement} _tab
+ * @param {NativeTab} _tab
* The tab to be checked
* @returns {boolean}
*/
@@ -442,7 +448,7 @@ export class PageActionBase extends PanelActionBase {
// Checks whether the tab action is shown when the specified tab becomes active.
// Does pattern matching if necessary, and caches the result as a tab-specific value.
- // @param {XULElement} tab
+ // @param {NativeTab} tab
// The tab to be checked
// @return boolean
isShownForTab(tab) {
@@ -571,6 +577,8 @@ export class BrowserActionBase extends PanelActionBase {
/**
* Determines the text badge color to be used in a tab, window, or globally.
*
+ * @typedef {number[]} ColorArray from schemas/browser_action.json.
+ *
* @param {object} values
* The values associated with the tab or window, or global values.
* @returns {ColorArray}