Skip to content

Commit a6cd36f

Browse files
committed
v0.5.1
1 parent 8f0af15 commit a6cd36f

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

build/scriptcat/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.5.0",
4+
"version": "0.5.1",
55
"description": "脚本猫,一个用户脚本的框架,可编写脚本每天帮你自动处理事务.",
66
"background": {
77
"page": "background.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.5.0",
3+
"version": "0.5.1",
44
"description": "脚本猫,一个可以执行用户脚本的浏览器扩展,万物皆可脚本化,让你的浏览器可以做更多的事情!",
55
"scripts": {
66
"test": "jest",

src/apps/config.ts

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

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

src/apps/script/manager.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,6 @@ export class ScriptManager {
3030

3131
protected resource = new ResourceManager();
3232

33-
constructor() {
34-
chrome.contextMenus.create({
35-
id: 'script-cat',
36-
title: "ScriptCat",
37-
contexts: ['all'],
38-
onclick: () => {
39-
console.log('exec script');
40-
},
41-
});
42-
}
43-
4433
protected changePort = new Map<any, chrome.runtime.Port>();
4534
public listenEvent() {
4635
// 监听值修改事件,并发送给全局

src/background.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ InitApp({
1919
Cache: new MapCache(),
2020
});
2121

22+
chrome.contextMenus.create({
23+
id: 'script-cat',
24+
title: "ScriptCat",
25+
contexts: ['all'],
26+
onclick: () => {
27+
console.log('exec script');
28+
},
29+
});
30+
2231
let scripts = new ScriptManager();
2332
let grant = BackgroundGrant.SingleInstance(
2433
scripts,

src/pkg/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function isFirefox() {
5454
}
5555

5656
export function SendLogger(level: LOGGER_LEVEL, origin: string, msg: string, title: string = "", scriptId?: number) {
57-
top.postMessage(
57+
top!.postMessage(
5858
{
5959
action: Logger,
6060
data: {

0 commit comments

Comments
 (0)