Skip to content
This repository has been archived by the owner on Jul 16, 2019. It is now read-only.

open tab on next available window #16

Open
robsonsobral opened this issue Jul 11, 2015 · 1 comment
Open

open tab on next available window #16

robsonsobral opened this issue Jul 11, 2015 · 1 comment

Comments

@robsonsobral
Copy link

Hi!

Thanks for the last update.


Sometimes, when we have more than one window open, firefox uses the last one focused to open links.

Is it possible to open the link on the other window, if this one is full?

Thanks!

@robsonsobral
Copy link
Author

Ok! I gave up!

I tried, but, first, I couldn't find the URL being requested to send it to another window. Because of that, I had to wait for the ready event. Then, I couldn't find how to loop through windows and open the tab.

if (windows.browserWindows.length > 1){
    tab.on('ready', function(tab){
        for (var i = 0, w = windows.browserWindows.length; i < w; i++){
            if (browserWindows.activeWindow !== window[i] && window[i].tabs.length <= max){
                window[i].tabs.open(tab.url);
                break;
            }
        }
        tab.close();
        notifications.notify({
            title: title,
            text: _('not_open_max_tabs', max)
        });
    });
} else {

So, #15 is also beyond my capabilities.

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

No branches or pull requests

2 participants