erosman / support

Support Location for all my extensions
Mozilla Public License 2.0
174 stars 12 forks source link

FoxyTabs Not Recognizing Sideberry Tabs #589

Open Stoaac opened 1 year ago

Stoaac commented 1 year ago

Is there a way to allow FoxyTabs to recognize my Sideberry tabs as actual tabs yet?

I customized the Firefox browser CSS file to get rid of the horizontal tabs toolbar, so that I can only use the vertical Sideberry sidebar, which is the coolest most efficient and productive solution I have found for tab management.

For this reason I do not wish to bring back the original tabs format, so I am willing to do anything to keep using Sideberry, and not willing to do anything that will stop me from using Sideberry.

Any help is greatly appreciated!

erosman commented 1 year ago

FoxyTab menu is handled by Firefox based on menus.ContextType being "tab". FoxyTab has no control over it.

It appears wherever ContextType "tab" is present. Does standard Tab context-menu appear on Sideberry Tabs?

Stoaac commented 1 year ago

It does not. Is there a workaround to this? What is the ContextType of the Sideberry tabs? Can I switch what ContextType FoxyTabs works with?

erosman commented 1 year ago

Those are not tabs. They are actually a list with the details copied from the tabs. Firefox doesn't recognize them as tabs.

However, I have seen some other extensions do it.

See also: #575

Stoaac commented 1 year ago

Yes, I used to use TST, and I read the issue prior to opening this new one, but I'm not interested in going back since Sideberry is so much more potent.

Let me ask another way. First let me make a glossary for the terms I'm about to make up for the sake of the question: Glossary

Questions

I know very VERY little about coding, but I imagine the code says something along these lines: <FoxyTabs: If right-click on ContextType "Tabs," then dropdown DefaultBrowserContextMenu>

I'm sure this is FAR from accurate, but my logic tells me that this is essentially what's happening in the code. So my question is: Can we make it say something like this instead: <FoxyTabs: If "Combination-Click" on "Sideberry Links," then dropdown DefaultBrowserContextMenu>

Also, I would like to mention that SingleFile does interpret the Sideberry "Links" as tabs, as you can see in the video I attached. If SingleFile can do it, why not FoxyTabs? https://github.com/erosman/support/assets/126362441/307c6f97-b436-4c6e-9ab8-ef734c64e77c

erosman commented 1 year ago

What ContextType do these Sideberry "links" fall under?

In browsers, menus.ContextType affects not only where a context-menu appears but also the data that is passed when clicked i.e. menus.OnClickData.

Data provided when a link is clicked, or an image is clicked or text clicked etc differs from when a tab-strip is clicked.

Is it possible to edit something within the FoxyTabs code to make the extension interact with the Sideberry "links" instead of the Firefox tabs?

Unfortunately, it is not possible.

Stoaac commented 1 year ago

What ContextType do these Sideberry "links" fall under?

In browsers, menus.ContextType affects not only where a context-menu appears but also the data that is passed when clicked i.e. menus.OnClickData.

Data provided when a link is clicked, or an image is clicked or text clicked etc differs from when a tab-strip is clicked.

Sorry, I don't see how that answers my question. I understand that different context menus appear for different content types. I want to know what a Sideberry "tab" is if it's not a tab or a link. What is the damn thing? XD XD

Is there anything to say about different context menus popping up when you right-click while holding down the SHIFT key?

Is it possible to edit something within the FoxyTabs code to make the extension interact with the Sideberry "links" instead of the Firefox tabs?

Unfortunately, it is not possible.

If it's not possible, then what exactly is to blame? Is it the fact that the FoxyTabs code is not accessible, or is it the Firefox browser code that's not accessible? Is it something else entirely?

Wouldn't the solution be something as simple as adding the following instructions to the FoxyTabs Code

erosman commented 1 year ago

FoxyTab adds a menu to the standard tab-context-menu and then Firefox shows it. You can ask the Sideberry etc why the standard Firefox context-menu doesn't appear on their tabs/links/whatever. If it did, FoxyTab would have also appeared there. There is nothing that FoxyTab can do to make another extension show the tab-context-menu.

To finalise, the issue is "Firefox Not Recognizing Sideberry Tabs" and that is something for Sideberry Tabs to sort out.

Stoaac commented 1 year ago

Goooot it! Thank you very much for your help!

Stoaac commented 1 year ago

If you follow the link https://github.com/mbnuqw posted in his reply, you'll see that Sidebery does, in fact, use the ContextType tab (browser.menus.overrideContext({ context: 'tab', tabId: tab.id }))

https://github.com/mbnuqw/sidebery/issues/1195#issuecomment-1701278691

Above is a link to the entire conversation, which is a short one in which I realized that all my add-ons work with Sidebery, except FoxyTabs.

erosman commented 1 year ago

So, what is the issue? After enabling "Use native context menu" in Sideberry, FoxyTab menu appears..

Stoaac commented 1 year ago

So, what is the issue? After enabling "Use native context menu" in Sideberry, FoxyTab menu appears..

I've configured everything on my Sidebery to be a certain way, including the context menu. I switched it, but I prefer Sidebery's context menu so I switched it back. The problem is that I want to be able to access the FoxyTabs options using Shift+Right-Click, but I'm not able to. I understand the workaround, but why does the specific problem in question exist, and why are other add-ons showing their menu options when I Shift+Right-Click?

erosman commented 1 year ago

why are other add-ons showing their menu options when I Shift+Right-Click?

  • Other extensions' context-menu show on different context (e.g. image, not context: 'tab')
  • Adding context: 'tab' to Shift+Right-Click should be discussed with Sideberry

Sideberry

Sideberry show 2 types of context-menu:

  1. Use native context menu = off

    • Right-Click shows Sideberry's own context-menu image

    • Shift+Right-Click shows default image context-menu image

  2. Use native context menu = on (context: 'tab')

    • Right-Click shows Tab context-menu image

FoxyTab

Standard Tab context-menu

image

Stoaac commented 1 year ago

@erosman Understood. Thank you for your patience, it is very much appreciated!

What I still don't understand is how the "Multi-Account Containers" is able to show up in that Shift+Right-Click menu when it's an add-on which functions based on tabs. By the way, the Shift+Right-Click menu is not solely for contextType image, but also for pages.

https://github.com/mbnuqw/sidebery/issues/1195#issuecomment-1703785488 - Ok, now I understand the issue. It's impossible for addon to handle and configure context-menu event fired with Shift+Right-Click, which is a direct purpose of Shift+Right-Click - forcefully show context menu for the page. So, when you Shift+Right-Click on sidebery (doesn't matter what area) browser think you right-clicked on the page and shows you a context menu with options of addons that work on normal web-pages.

Maybe Firefox's "Multi-Account Containers" doesn't base it's function on tabs, but if that's the case then it's confusing how it could open tabs in containers and have all sorts of rules for contextType tab. I'm assuming its functionality is based on tabs, so I'm wondering why an add-on that interacts with contextType tab is able to show its menu options in the forced context menu, but FoxyTabs isn't.

Again, I appreciate your patience and knowledge on the matter!

erosman commented 1 year ago

Actually, I tested it now.

It is not a problem to make FoxyTab context-menu show on page in Sideberry sidebar (Shift+Right-Click), however the necessary data is missing.

Data received from FoxyTab context-menu when clicked in Sideberry

Use native context menu = on (context: 'tab')

Use native context menu = off (context: 'page')

Stoaac commented 1 year ago
* **tab**
null

This means that the necessary data needs to be added by Sideberry, then?

erosman commented 1 year ago

This means that the necessary data needs to be added by Sideberry, then?

No, Firefox doesn't add the data when a click is generated from an extension's internal page (the sidebar). Firefox does provide it from a normal web page (like this GitHub page) though.

Incidentally, as part of another issue (https://github.com/w3c/webextensions/issues/431#issuecomment-1717898144), we have been discussing the provision of tab data and it will relate to this issue as well, if implemented.