piroor / copy-selected-tabs-to-clipboard

Provides ability to copy title and URL of selected tabs to the clipboard for Firefox 63 and later.
Other
78 stars 15 forks source link

On some tabs, it's not possible to copy all tabs to clipboard #55

Open migozz opened 1 month ago

migozz commented 1 month ago

Short description

On some tabs, it's not possible to copy all tabs to clipboard

Steps to reproduce

  1. Start Firefox.
  2. Install Copy Selected Tabs.
  3. Set to All Tabs or Choose always
  4. Open any url, e.g. google.com
  5. Follow any link in a new tab
  6. Return to previous tab
  7. Press right-click on a tab header

Expected result

"Copy (all tabs) to clipboard" should be displayed

Actual result

"Copy this tree to clipboard" is displayed

Environment

piroor commented 1 month ago

I couldn't reproduce this problem with these steps:

  1. Start Firefox ESR115.
  2. Install Copy Selected Tabs to Clipboard.
  3. Go to the options page of this addon.
  4. Configure it as:
    • Behavior on no multiselection
      • On an individual Tab
      • Regular Operation: Copy All Tabs
      • Middle Click: Copy All Tabs
      • On the Parent Tab of a Tree
      • Regular Operation: Copy All Tabs
      • Middle Click: Copy All Tabs
  5. Open new Firefox window. Here is only one tab, assume that it is the tab A.
  6. Load https://www.google.com/ into the tab A.
  7. Search the term "Firefox".
  8. Middle-click on a search result link to open it in a new tab. A new tab B is opened next to the tab A.
  9. Click the tab B.
  10. Click the tab A.
  11. Right-click on the tab A.
  12. I've seen the menu item "Copy This Tree to Clipboard" successfully.

Could you provide more information for debugging?

piroor commented 1 month ago

And, could you point differences with yours in the steps I did?

migozz commented 1 month ago

I have not selected "Parent Tab of a Tree (require tab management addon like Tree Style Tab)" because I don't have a Tree Style Tab.

  1. It should display "copy All tabs" and not "copy this tree".
  2. Probably all except "choose from menu always" (on parent tab) working incorrectly. Ok, I satisfied with "choose from menu always".
piroor commented 1 month ago

Sorry I totally misunderstood the problem you pointed. I've realized that the context menu command is not updated for a tree parent tab having descendant tabs. This addon guesses the tree structure based on openerTabId information of tabs without TST. There are two unexpected on your case: 1) the search result tab is internally detected as a tree parent because there is child tabs referring it with their openerTabId, and 2) this addon has a bug that the context menu item is always labeled as "Copy Tree..." regardless your configs. The commit 7c1b6f2 should fix the second problem, so the context menu command should behave as "Copy All Tabs" if you choose "Copy All Tabs" for the reaction for tree parent tab without multiselection.