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
What information was incorrect, unhelpful, or incomplete?
First off: my extension uses activeTab.
When clicking on a context menu item while the Safari extension toolbar icon is greyed out (not activated on this page), the tab data returned inside the onClicked callback is missing crucial information like the tab url.
I assume this is due to the extension getting access to the tab after the click handler has run.
So if you need tab data, you essentially need to query({ tabId }) to find the tab. Thankfully, the tab ID is returned.
What browsers does this problem apply to, if applicable?
Safari
What did you expect to see?
This would be helpful to mention for future developers running into this issue.
Did you test this? If so, how?
Ran the extension in Safari 16.6, followed steps as described above.
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
No response
Do you have anything more you want to share?
This page may not be the right/only place to mention this specific issue.
https://webkit.org/b/268639
rdar://problem/122194046
Reviewed by Brian Weinstein.
Add a new test that verifies that activeTab does grant visibility into the tab's URL and title
when invoking an action's menu item. We already had a test like this for context menu items.
This was mentioned in: mdn/browser-compat-data#20592
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebExtensionAPIMenus.mm:
(TestWebKitAPI::TEST):
Canonical link: https://commits.webkit.org/274019@main
What type of issue is this?
Missing compatibility data
What information was incorrect, unhelpful, or incomplete?
First off: my extension uses activeTab.
When clicking on a context menu item while the Safari extension toolbar icon is greyed out (not activated on this page), the tab data returned inside the onClicked callback is missing crucial information like the tab url.
I assume this is due to the extension getting access to the tab after the click handler has run.
So if you need tab data, you essentially need to
query({ tabId })
to find the tab. Thankfully, the tab ID is returned.What browsers does this problem apply to, if applicable?
Safari
What did you expect to see?
This would be helpful to mention for future developers running into this issue.
Did you test this? If so, how?
Ran the extension in Safari 16.6, followed steps as described above.
Can you link to any release notes, bugs, pull requests, or MDN pages related to this?
No response
Do you have anything more you want to share?
This page may not be the right/only place to mention this specific issue.
MDN URL
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/onClicked
MDN metadata
MDN page report details
webextensions.api.menus.onClicked
The text was updated successfully, but these errors were encountered: