Skip to content

Commit

Permalink
🐛 修复某些run-at因为GM_info注入的问题导致脚本报错
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Oct 11, 2022
1 parent fbe6e05 commit e91371d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build/scriptcat/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "ScriptCat",
"version": "0.9.3",
"version": "0.9.4",
"description": "脚本猫,一个用户脚本的框架,可编写脚本每天帮你自动处理事务.",
"background": {
"page": "background.html"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scriptcat",
"version": "0.9.3",
"version": "0.9.4",
"description": "脚本猫,一个可以执行用户脚本的浏览器扩展,万物皆可脚本化,让你的浏览器可以做更多的事情!",
"scripts": {
"lint": "eslint --ext .js,.ts,.tsx tests/ src/",
Expand Down
2 changes: 1 addition & 1 deletion src/apps/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const ExtVersion = '0.9.3';
export const ExtVersion = '0.9.4';

export const Server = process.env.NODE_ENV == 'production' ? 'https://sc.icodef.com/' : 'http://localhost:8080/';

Expand Down
2 changes: 1 addition & 1 deletion src/injected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ browserMsg.listen('scripts', (msg) => {
if (script.metadata['run-at'][0] === 'document-body') {
waitBody(() => {
if ((<{ [key: string]: () => void }><unknown>window)[script.flag]) {
(<{ [key: string]: (context: ScriptContext) => void }><unknown>window)[script.flag].apply(context, [context]);
(<{ [key: string]: (GM_Info:any,context: ScriptContext) => void }><unknown>window)[script.flag].apply(context, [GMInfo,context]);
}
Object.defineProperty(window, script.flag, {
get: () => { return undefined; },
Expand Down

0 comments on commit e91371d

Please sign in to comment.