From 19a1e5378acbc49c02984f9dac71bec72e550911 Mon Sep 17 00:00:00 2001 From: likeablob <46628917+likeablob@users.noreply.github.com> Date: Fri, 27 Jan 2023 00:37:03 +0900 Subject: [PATCH] Open new tab for clip.html in background - This makes the current active tab unchanged upon activating the extension. --- src/background.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/background.js b/src/background.js index 942103e..40aa580 100644 --- a/src/background.js +++ b/src/background.js @@ -44,11 +44,11 @@ chrome.runtime.onMessage.addListener(async function listener(result) { // Open a new tab for clipping through the protocol, since we cannot go from the extension to this.. if (result.testing) { - chrome.tabs.create({ url: redirectUrl , active: true},function(obsidianTab){ + chrome.tabs.create({ url: redirectUrl , active: false},function(obsidianTab){ // Since we're testing, we are not closing the tag... }); } else { - chrome.tabs.create({ url: redirectUrl , active: true},function(obsidianTab){ + chrome.tabs.create({ url: redirectUrl , active: false},function(obsidianTab){ setTimeout(function() { chrome.tabs.remove(obsidianTab.id) }, 500); }); }