Skip to content

Commit

Permalink
fix: resolve issues with content representation (mdn#33889)
Browse files Browse the repository at this point in the history
* fix: resolve issues with content representation

* Update files/en-us/mozilla/add-ons/webextensions/api/browseraction/onclicked/index.md

Co-authored-by: rebloor <git@sherpa.co.nz>

---------

Co-authored-by: rebloor <git@sherpa.co.nz>
  • Loading branch information
tianyeeT and rebloor authored Jun 4, 2024
1 parent b22d69d commit 5e1ef83
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ Events have three functions:

## Examples

When the user clicks the icon, disable it for the active tab, and log the tab's URL:
When the user clicks the browser action icon this code turns it off for the active tab and logs the tab's URL:

```js
browser.browserAction.onClicked.addListener((tab) => {
// disable the active tab
// disable the browser action for the tab
browser.browserAction.disable(tab.id);
// requires the "tabs" or "activeTab" permission, or host permissions for the URL
console.log(tab.url);
Expand Down

0 comments on commit 5e1ef83

Please sign in to comment.