Skip to content

Commit 74302f1

Browse files
authored
Merge pull request #47 from irvinm/patch-1
Add support for optional argument openerTabId for tabs.create()
2 parents 935cfb8 + b9a779d commit 74302f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

background.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,14 @@ function reverseSearch(info, storedSettings) {
141141

142142
function openImageSearch(tabs) {
143143
const tabIndex = getTabIndex(openTabAt, tabs);
144-
144+
const thisTab = tabs.filter(t => t.active)[0];
145+
145146
for (const p of searchProviders) {
146147
chrome.tabs.create({
147148
url: p.replace('%s', encodeURIComponent(imageURL)),
148149
active: !openInBackground,
149150
index: tabIndex,
151+
openerTabId: thisTab.id,
150152
});
151153
}
152154
}

0 commit comments

Comments
 (0)