Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FoxyTabs Not Recognizing Sideberry Tabs #589

Open
Stoaac opened this issue Aug 22, 2023 · 16 comments
Open

FoxyTabs Not Recognizing Sideberry Tabs #589

Stoaac opened this issue Aug 22, 2023 · 16 comments
Labels

Comments

@Stoaac
Copy link

Stoaac commented Aug 22, 2023

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
Copy link
Owner

erosman commented Aug 22, 2023

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
Copy link
Author

Stoaac commented Aug 22, 2023

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
Copy link
Owner

erosman commented Aug 22, 2023

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
Copy link
Author

Stoaac commented Aug 23, 2023

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

  • Instead of calling them Sideberry "tabs," let's call them Sideberry "links"
  • DefaultBrowserContextMenu = The context menu that pops up when you right-click the DEFAULT browser tabs
  • Combination-Click = When you right-click while holding down another key, or a combination of other keys. (i.e.: Shift + Right-Click; CTRL + Shift + Right-Click)

Questions

  • What ContextType do these Sideberry "links" fall under?
  • Is it possible to edit something within the FoxyTabs code to make the extension interact with the Sideberry "links" instead of the Firefox tabs?

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
Copy link
Owner

erosman commented Aug 23, 2023

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
Copy link
Author

Stoaac commented Aug 24, 2023

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

  • If "Combination-Click" on "Sideberry (WHATEVER THE HELL THE "NOT-A-TAB" THING IS),"
  • Then dropdown "DefaultBrowserContextMenu"

@erosman
Copy link
Owner

erosman commented Aug 24, 2023

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
Copy link
Author

Stoaac commented Aug 24, 2023

Goooot it! Thank you very much for your help!

@Stoaac
Copy link
Author

Stoaac commented Aug 31, 2023

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 }))

mbnuqw/sidebery#1195 (comment)

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.

@Stoaac Stoaac reopened this Aug 31, 2023
@erosman
Copy link
Owner

erosman commented Aug 31, 2023

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

@Stoaac
Copy link
Author

Stoaac commented Sep 1, 2023

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
Copy link
Owner

erosman commented Sep 2, 2023

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

  1. Use native context menu = on (context: 'tab')
  • Right-Click shows Tab context-menu
    image

FoxyTab

  • FoxyTab only shows when context: 'tab'
  • FoxyTab needs the data that is generated by Firefox in context: 'tab' (those data are not available in other context)

Standard Tab context-menu

image

@Stoaac
Copy link
Author

Stoaac commented Sep 2, 2023

@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.

mbnuqw/sidebery#1195 (comment) - 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 erosman added the feature request 💡 New feature or request label Sep 2, 2023
@erosman
Copy link
Owner

erosman commented Sep 2, 2023

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.

  • In page context, pageUrl shows the Sidberry internal page, and tab data is missing.

Data received from FoxyTab context-menu when clicked in Sideberry

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

  • info
{
  "menuItemId": "copyTitle",
  "parentMenuItemId": "copy",
  "viewType": "sidebar",
  "editable": false,
  "pageUrl": "https://github.com/erosman/support/issues/589",
  "frameUrl": "moz-extension://4d3...77442cef04/sidebar/index.html",
  "modifiers": [],
  "button": 0
}
  • tab
{
  "id": 35,
  "index": 8,
  "windowId": 1,
  "highlighted": true,
  "active": true,
  "attention": false,
  "pinned": false,
  "status": "complete",
  "hidden": false,
  "discarded": false,
  "incognito": false,
  "width": 1386,
  "height": 965,
  "lastAccessed": 1693678417893,
  "audible": false,
  "autoDiscardable": true,
  "mutedInfo": {
    "muted": false
  },
  "isArticle": false,
  "isInReaderMode": false,
  "sharingState": {
    "camera": false,
    "microphone": false
  },
  "successorTabId": 36,
  "cookieStoreId": "firefox-default",
  "url": "https://github.com/erosman/support/issues/589",
  "title": "FoxyTabs Not Recognizing Sideberry Tabs · Issue #589 · erosman/support",
  "favIconUrl": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9Ij...."
}

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

  • info
{
  "menuItemId": "copyTitle",
  "parentMenuItemId": "copy",
  "viewType": "sidebar",
  "frameId": 0,
  "editable": false,
  "targetElementId": 102516,
  "pageUrl": "moz-extension://4d3...77442cef04/sidebar/index.html",
  "modifiers": [],
  "button": 0
}
  • tab
null

@Stoaac
Copy link
Author

Stoaac commented Sep 14, 2023

* **tab**
null

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

@erosman
Copy link
Owner

erosman commented Sep 14, 2023

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 (w3c/webextensions#431 (comment)), we have been discussing the provision of tab data and it will relate to this issue as well, if implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants