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

Pentadactyl always opens new child tabs in Tree Style Tab since updating to Fx44 #140

Closed
symmetryrtemmys opened this issue Feb 15, 2016 · 10 comments

Comments

@symmetryrtemmys
Copy link

Hello,

With the latest versions of both TST and Pentadactyl installed, every new tab is opened as a child tab of the current one. The only situation in which this is not the case is when opening several tabs with the same command, e.g. :tabopen google.com | duckduckgo.com

It also opens child tabs when using QuickMarks, and when using hints.

There is an identical bug for Vimperator, and there is an open issue on TST's Github here. Google Translate was somewhat helpful, but I am not sure if a solution has been found

@piroor
Copy link

piroor commented Feb 15, 2016

Self translation.

By recent changes of TST, now the strategy was changed. Old TST opened new tabs as independent by default, and only intentionally attached tabs became children of the current tab. However, now new tabs with relatedToCurrent or referrerURI option are opened as children of the current tab, and only intentionally rejected tabs become independent tabs.

If Vimperator (and Pentadactly) opens a new tab via BrowserOpenTab() or something, they are tracked by TST and new tabs will be opened as independent at bottom of the tab bar. However, because Vimperator calls a lower API gBrowser.loadOneTab() with relatedToCurrent option, TST opens those tabs as children of the current tab.

So, there are some choices:

  1. I make TST's condition more harder to open new tabs as children.
  2. TST injects some codes into Vimperator's internal function to open new independent tabs.
  3. Vimperator calls TST's API to open new independent tabs.

Currently I have no better idea about the 1st choice. The 3rd choice depends on Vimperator's author's will. The 2nd choice seems most realistic solution, but it is risky because such injection will be broken by future changes in Vimperator itself.

I need a cool idea for the 1st choice, because many other addons can have same compatibility issues like this.

@oddRaven
Copy link

I have this problem as well. What is the reason for this change in strategy?

@piroor
Copy link

piroor commented Feb 15, 2016

I have this problem as well. What is the reason for this change in strategy?

Because I got many requests to open child tabs from other addons like this and I had to write special codes to inject API call for each addon again and again. Such injection is troublesome, because redefined functions can be broken easily from variables defined with const - they can't be accessed from other namespaces anymore, so I hoped that I reduce such dangerous codes from TST as possible as I can. I don't want to inject my custom codes into Vimperator's function.

piroor added a commit to piroor/treestyletab that referenced this issue Feb 16, 2016
…th relatedToCurrent=true

There are two keys: tab.owner and gBrowser._lastRelatedTab.
tab.owner can appear even if the tab is opened without relatedToCurrent=true, for example, about:addons.
On the other hand, gBrowser._lastRelatedTab is updated only when relatedToCurrent=true.
So it seems more better trigger to attach a new tab to the parent automatically.
This should fix #1065 (5digits/dactyl#140)
@piroor
Copy link

piroor commented Feb 16, 2016

After the commit piroor/treestyletab@0bfedf7 TST detects new "possibly child" tabs more strictly. It is the 1st solution I told at #140 (comment) and I hope that it solves this problem.

@symmetryrtemmys
Copy link
Author

Problem solved! This also opens up new potential Pentadactyl/Vimperator commands for hooking into TST and opening child tabs with a keyboard shortcut - say, ^t, perhaps.

Thank you piroor!

@oddRaven
Copy link

Working again for me too now.

@FLHerne
Copy link

FLHerne commented Feb 18, 2016

And for me. Thanks!
@symmetryrtemmys 'ntnn' already wrote that, plugins/contrib/treestyletabs.js has a :tabchildopen along with many other useful commands. :-)

@polyzen
Copy link

polyzen commented May 1, 2016

@symmetryrtemmys, issue resolved? Please close :)

@symmetryrtemmys
Copy link
Author

@polyzen apologies! :)

@phanimahesh
Copy link

@symmetryrtemmys None needed. :)

@polyzen seems to have gone on a spree and requested all possibly outdated issues to be closed.

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

No branches or pull requests

6 participants