On 07/07/2023 03:47, Robbi wrote:
> Ok, so I can read the tab url, but i cannot access that page unless I
> add "activeTab" permission to the manifest file.
> On Thu, Jul 6, 2023 at 6:03 AM Robbi wrote:
>
> The extension below, creates a context menu on all pages.
> It appears on the pages of other extensions and also in
> chrome://extensions/
From another post I see you are trying to limit context menu to your
own extension, so the following may be unrelated.
Be prepared to get "
tab.id: -1" in an event listener (or even undefined
instead of Tab in other browsers) and no access to the top level page of
the browser tab as it may be perceived by users despite the activeTab
permission. For example, PDF files have their own internal tab (I guess,
as content of <object> elements). Extension options is a similar beast
when opened inside the chrome://extensions/ manager, not in a separate
tab. Obviously browser internal pages are inaccessible for extensions,
but frames with PDF files may appear on any site.
You may find more not so obvious cases like "action" popups.
The "page" menu context for inaccessible documents may be useful in a
limited number of cases, however the "link" context provides URL
suitable for notes. So context menu appearing almost everywhere,
including other extensions, may be reasonable.