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

added isActive parameter to tabOpenLink #2113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/content_scripts/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ function constructSearchURL(se, word) {
* Open links in new tabs.
*
* @param {string} str links to be opened, the links should be split by `\n` if there are more than one.
* @param {boolean} [isActive=true] whether tab should open on top your current tab or in a background tab
* @param {number} [simultaneousness=5] how many tabs will be opened simultaneously, the rest will be queued and opened later whenever a tab is closed.
*
* @example
Expand All @@ -613,7 +614,7 @@ function constructSearchURL(se, word) {
* btn.click();
* }, {domain: /youtube.com/i});
*/
function tabOpenLink(str, simultaneousness) {
function tabOpenLink(str, isActive, simultaneousness) {
simultaneousness = simultaneousness || 5;

var urls;
Expand All @@ -636,7 +637,8 @@ function tabOpenLink(str, simultaneousness) {
urls.slice(0, simultaneousness).forEach(function(url) {
RUNTIME("openLink", {
tab: {
tabbed: true
tabbed: true,
active: isActive
},
url: url
});
Expand Down