Skip to content

Commit c4d4de4

Browse files
committed
🐛 修复在sandbox页执行BroadcastChannel某些浏览器会报错 #107
1 parent 62c2f47 commit c4d4de4

File tree

4 files changed

+20
-13
lines changed

4 files changed

+20
-13
lines changed

build/assets/template/sandbox.html

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>Document</title>
8-
</head>
9-
<body>
10-
11-
</body>
12-
</html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<script>
8+
// 某些版本浏览器会因为sandbox中引用了dexie执行此方法导致报错,这里mock一个假的
9+
window.BroadcastChannel = function () {
10+
return {
11+
postMessage: function () {},
12+
close: function () {},
13+
};
14+
};
15+
</script>
16+
<title>Document</title>
17+
</head>
18+
<body></body>
19+
</html>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scriptcat",
3-
"version": "0.10.0-beta.1",
3+
"version": "0.10.0-beta.2",
44
"description": "脚本猫,一个可以执行用户脚本的浏览器扩展,万物皆可脚本化,让你的浏览器可以做更多的事情!",
55
"author": "CodFrm",
66
"license": "GPLv3",

src/app/const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const ExtVersion = "0.10.0-beta.1";
1+
export const ExtVersion = "0.10.0-beta.2";
22

33
export const Server = "https://sc.icodef.com/";
44

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 2,
33
"name": "ScriptCat",
4-
"version": "0.10.0.1020",
4+
"version": "0.10.0.1030",
55
"author": "CodFrm",
66
"description": "脚本猫,一个用户脚本管理器,支持后台脚本、定时脚本、页面脚本,可编写脚本每天帮你自动处理事务.",
77
"options_ui": {

0 commit comments

Comments
 (0)