You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the user navigates to a new URL in a tab, this will typically generate several `onUpdated` events as various properties of the {{WebExtAPIRef("tabs.Tab")}} object are updated. This includes the `url`, but also potentially the `title` and `favIconUrl` properties. The `status` property will cycle through `"loading"` and `"complete"`.
19
+
When the user navigates to a new URL in a tab, this typically generates several `onUpdated` events as various properties of the {{WebExtAPIRef("tabs.Tab")}} object are updated. This includes the `url`, but also potentially the `title` and `favIconUrl` properties. The `status` property will cycle through `"loading"` and `"complete"`.
20
20
21
-
This event will also be fired for changes to a tab's properties that don't involve navigation, like pinning and unpinning (which updates the `pinned` property) and muting or unmuting (which updates the `audible` and `mutedInfo` properties).
21
+
This event also fires for changes to a tab's properties that don't involve navigation, such as pinning and unpinning (which updates the `pinned` property) and muting or unmuting (which updates the `audible` and `mutedInfo` properties).
22
22
23
-
You can filter this event, making it only fire for tabs whose URLs match specific [patterns](/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns), or for changes to specific properties, or for changes to a specific tab or window, or any combinations of these restrictions.
23
+
You can filter this event, making it only fire for tabs whose URLs match specific [patterns](/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns), changes to particular properties, changes to a tab or window, or any combinations of these restrictions.
24
24
25
25
## Syntax
26
26
@@ -45,24 +45,24 @@ Events have three functions:
45
45
46
46
-`callback`
47
47
48
-
- : Function that will be called when this event occurs. The function will be passed the following arguments:
48
+
- : The function called when this event occurs. The function is passed these arguments:
49
49
50
50
-`tabId`
51
-
- : `integer`. ID of the tab that was updated.
51
+
- : `integer`. The ID of the updated tab.
52
52
-`changeInfo`
53
-
- : [`object`](#changeinfo). Contains properties for the tab properties that have changed. See [`changeInfo`](#changeinfo_2) below.
53
+
- : [`object`](#changeinfo). Properties of the tab that changed. See [`changeInfo`](#changeinfo_2) below.
54
54
-`tab`
55
55
- : {{WebExtAPIRef('tabs.Tab')}}. The new state of the tab.
56
56
57
57
-`extraParameters` {{optional_inline}}
58
58
59
-
- : `object`. A set of filters that restricts the events that will be sent to this listener. This is an object which may have one or more of the following properties. Events will only be sent if they satisfy all the filters given.
59
+
- : `object`. A set of filters that restrict the events sent to this listener. This object can have one or more of these properties. Events are only sent if they satisfy all the filters provided.
60
60
61
61
-`urls`
62
-
- : `Array`. An array of [match patterns](/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns). Fire the event only for tabs whose current `url` property matches any one of the patterns.
62
+
- : `Array`. An array of [match patterns](/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns). Fires the event only for tabs whose current `url` property matches any one of the patterns.
63
63
-`properties`
64
64
65
-
- : `Array`. An array of strings, which are the names of properties of the {{WebExtAPIRef("tabs.Tab")}} object. Fire this event only for changes to one of the properties named in this array. The following properties may be listed here:
65
+
- : `Array`. An array of strings consisting of supported {{WebExtAPIRef("tabs.Tab")}} object property names. Fires the event only for changes to one of the properties named in the array. These properties can be used:
66
66
67
67
- "attention"
68
68
- "audible"
@@ -72,32 +72,31 @@ Events have three functions:
72
72
- "isArticle"
73
73
- "mutedInfo"
74
74
- "pinned"
75
-
- "sharingState"
76
75
- "status"
77
76
- "title"
78
77
- "url"
79
78
80
-
> **Note:** The "url" value is supported since Firefox 88. In Firefox 87 and earlier, "url" changes can be observed by filtering by "status".
79
+
> **Note:** The "url" value has been supported since Firefox 88. In Firefox 87 and earlier, "url" changes can be observed by filtering by "status".
81
80
82
81
-`tabId`
83
-
- : `Integer`. Fire this event only for the tab identified by this ID.
82
+
- : `Integer`. Fires this event only for the tab identified by this ID.
84
83
-`windowId`
85
-
- : `Integer`. Fire this event only for tabs which are currently in the window identified by this ID.
84
+
- : `Integer`. Fires this event only for tabs in the window identified by this ID.
86
85
87
86
## Additional objects
88
87
89
88
### changeInfo
90
89
91
-
Lists the changes to the state of the tab that was updated. To learn more about these properties, see the {{WebExtAPIRef("tabs.Tab")}} documentation.
90
+
Lists the changes to the state of the tab that is updated. To learn more about these properties, see the {{WebExtAPIRef("tabs.Tab")}} documentation. Note that not all {{WebExtAPIRef("tabs.Tab")}} properties are supported.
92
91
93
92
-`attention` {{optional_inline}}
94
-
- : `boolean`. Indicates whether the tab is drawing attention. For example, when the tab displays a modal dialog, `attention` will be `true`.
93
+
- : `boolean`. Indicates whether the tab is drawing attention. For example, `attention` is `true`when the tab displays a modal dialog.
95
94
-`audible` {{optional_inline}}
96
95
- : `boolean`. The tab's new audible state.
97
96
-`discarded` {{optional_inline}}
98
-
- : `boolean`. Whether the tab is discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content gets reloaded the next time it's activated.
97
+
- : `boolean`. Whether the tab is discarded. A discarded tab is one whose content has been unloaded from memory but is visible in the tab strip. Its content gets reloaded the next time it's activated.
99
98
-`favIconUrl` {{optional_inline}}
100
-
- : `string`. The tab's new favicon URL. Not included when a tab loses its favicon (navigating from a page with a favicon to a page that without one), please check`favIconUrl` in [tab](#tab) instead.
99
+
- : `string`. The tab's new favicon URL. Not included when a tab loses its favicon (navigating from a page with a favicon to a page without one). Check`favIconUrl` in [tab](#tab) instead.
101
100
-`hidden` {{optional_inline}}
102
101
- : `boolean`. True if the tab is {{WebExtAPIRef("tabs.hide()", "hidden")}}.
103
102
-`isArticle` {{optional_inline}}
@@ -111,7 +110,7 @@ Lists the changes to the state of the tab that was updated. To learn more about
111
110
-`title` {{optional_inline}}
112
111
- : `string`. The tab's new title.
113
112
-`url` {{optional_inline}}
114
-
- : `string`. The tab's URL if it has changed.
113
+
- : `string`. The tab's URL, if it has changed.
115
114
116
115
## Examples
117
116
@@ -160,7 +159,7 @@ function handleUpdated(tabId, changeInfo, tabInfo) {
Combine both the previous filters: log changes only:
180
-
181
-
- to the `pinned` property of tabs
182
-
- whose `url` property is [matched](/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) by `https://developer.mozilla.org/*` or `https://twitter.com/mozdevnet`:
178
+
Combine both the previous filters, log only when the `pinned` property of tabs changes for tabs whose `url` property is [matched](/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) by `https://developer.mozilla.org/*` or `https://twitter.com/mozdevnet`:
- whose `url` property is [matched](/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) by `https://developer.mozilla.org/*` or `https://twitter.com/mozdevnet`
208
-
- and which are part of the current browser window at the time the update event is fired:
200
+
Log changes only when the `pinned` property of tabs changes for tabs whose `url` property is [matched](/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns) by `https://developer.mozilla.org/*` or `https://twitter.com/mozdevnet` where the tab was part of the current browser window when the update event fired:
0 commit comments