From b17bb37c386bb5dff39ee17827b6c03fe5b8302b Mon Sep 17 00:00:00 2001 From: MengYX Date: Mon, 8 Feb 2021 04:50:00 +0800 Subject: [PATCH] Fix: [Extension] Use extension API make sure page open successfully --- src/extension/popup.html | 12 ++++++++++++ src/extension/popup.js | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/extension/popup.html b/src/extension/popup.html index b28b4e7..b57bb19 100644 --- a/src/extension/popup.html +++ b/src/extension/popup.html @@ -1 +1,13 @@ + + + + + + + + + + + + diff --git a/src/extension/popup.js b/src/extension/popup.js index cfb7565..4d138c0 100644 --- a/src/extension/popup.js +++ b/src/extension/popup.js @@ -1,2 +1,5 @@ const bs = chrome || browser -window.open(bs.runtime.getURL('./index.html')) +bs.tabs.create({ + url: bs.runtime.getURL('./index.html') +}, tab => console.log(tab)) +