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
GM 3.0: GM_openInTab opens tabs relative to active tab, instead of the source tab #2105
Comments
Confirmed. Ad "inBackground": !!null == false; i.e., works incorrectly: if ('undefined' == typeof aLoadInBackground) aLoadInBackground = null;
[...]
return aScriptRunner.openInTab(uri.spec, !!aLoadInBackground); The suggestion (for example): if ('undefined' == typeof aLoadInBackground) aLoadInBackground = null;
if (aLoadInBackground != null) aLoadInBackground = !!aLoadInBackground;
[...]
return aScriptRunner.openInTab(uri.spec, aLoadInBackground); Also #2106 Ad "relatedToCurrent": But it does not work well... In doing so... relatedToCurrent: true |
Where is If it is supposed to be set elsewhere, then: Personally, I dislike double negative |
I don't know why it's like that. So I changed it this way and works the way I need it. It is an example of issues to be resolved. Note that there are lots of ways to solve these problems. |
I changed mine to the following which fixes the background issue... If I knew where it was picking up the tab index (it is picking the active tab index, not the one that initialled the script) ... I would fix that too. function GM_openInTab(aScriptRunner, aUrl, aLoadInBackground) {
aLoadInBackground = typeof aLoadInBackground !== 'undefined' ? aLoadInBackground : null;
// Resolve URL relative to the location of the content window.
var baseUri = Services.io.newURI(aScriptRunner.window.location.href, null, null);
var uri = Services.io.newURI(aUrl, null, baseUri);
return aScriptRunner.openInTab(uri.spec, aLoadInBackground);
} |
Does that mean it will not be fixed for another 2 versions??!! |
The tab focus is a big issue for us as well. We have a number of scripts with operations that open from 1 to 10 tabs in the background, perform tasks, then close themselves. Having the tab focus jump around is a huge workflow interruption, and rather confusing. The best possible outcome, as I see it, is for the default mode to be opening in the background, with an optional parameter after the URL, to have the tab grab focus. There have been a few instances where the ability to have the new tab get focus would be preferable, so having the option to do that would make the API for useful. |
@ArtCarnage: See #1936. |
I havent noticed any activity on the main GM page here... is anyone working on these issues?! |
There is a problem with version 3.0+ and GM_openInTab() function. Tabs are opened in foreground and not background. Currently staying with 2.3 version that does not have such problems. |
More info:
|
Until a fix is issued, you can force GM_openInTab to open tabs in the background
|
As in the title, I have scripts that open tabs automatically.
In previous versions, the new tab was opened relative to the source tab but now it opens relative to the active tab which results in tabs opening all over the place (for someone like me who always have multiple tabs open)
I just noticed another (rather annoying) development.
GM_openInTab is also setting the new tab as active tab. That happened now when I was typing this and suddenly, I ended up on another page (new tab that was opened)
(browser.tabs.loadInBackground is true)
(PS. I reviewed GM 3.0. Please fix these and I will review it quickly.)
The text was updated successfully, but these errors were encountered: