Browse Source

Fix: [Extension] Use extension API make sure page open successfully

20230320
MengYX 4 years ago
parent
commit
b17bb37c38
No known key found for this signature in database GPG Key ID: E63F9C7303E8F604
  1. 12
      src/extension/popup.html
  2. 5
      src/extension/popup.js

12
src/extension/popup.html

@ -1 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<script src="./popup.js"></script>
<a href="./index.html" target="_blank">
<button>立即使用</button>
</a>
</body>
</html>

5
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))

Loading…
Cancel
Save