kyuucr / open-link-in-other-window

Firefox extension for opening links in other window.
MIT License
9 stars 1 forks source link

New tab not focused, even if opened in foreground #1

Closed jscher2000 closed 6 years ago

jscher2000 commented 6 years ago

I see this in the Browser Console --

"Open https://github.com/kyuucr at window-161 in foreground"

-- but focus does not shift to the new tab. Is this by design?

kyuucr commented 6 years ago

Can you give me steps to reproduce?

jscher2000 commented 6 years ago

The new tab opens as the active tab in the background window, but Firefox doesn't bring the background window forward. I tested with the default settings in a new profile.

To focus the new tab, active:true is not enough ( https://developer.mozilla.org/Add-ons/WebExtensions/API/tabs/create ). I think you would need to add something like this after your switch structure:

if (active) {
  browser.windows.update(windowId, {
    focused: true 
  });
}

That's "air code" -- I haven't tested it.

kyuucr commented 6 years ago

OK, I understand what you meant by that. The open tab in fore/background option is limited only to the tab, it won't mess with the window. I will implement a separate option that control whether the window of the new tab will be brought to foreground or not.

On Fri, Apr 13, 2018, 9:46 PM Jefferson Scher notifications@github.com wrote:

The new tab opens as the active tab in the background window, but Firefox doesn't bring the background window forward. I tested with the default settings in a new profile.

To focus the new tab, active:true is not enough ( https://developer.mozilla.org/Add-ons/WebExtensions/API/tabs/create ). I think you would need to add something like this after your switch structure:

if (active) { browser.windows.update(windowId, { focused: true }); }

That's "air code" -- I haven't tested it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kyuucr/open-link-in-other-window/issues/1#issuecomment-381158776, or mute the thread https://github.com/notifications/unsubscribe-auth/AAtuKr1FJuWeMCv53v8Vk7LgbhovYIEWks5toLpFgaJpZM4TSaNs .