Skip to content

Commit

Permalink
👔 只有中版本更新时才打开更新日志页面
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Dec 17, 2021
1 parent 8ae251a commit 74981dc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 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.7.6",
"version": "0.7.7",
"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.7.6",
"version": "0.7.7",
"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.7.6";
export const ExtVersion = "0.7.7";

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

Expand Down
10 changes: 7 additions & 3 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { migrate } from "./model/migrate";
import { SCRIPT_STATUS_ENABLE, Script, SCRIPT_TYPE_NORMAL, SCRIPT_STATUS_DISABLE } from "./model/do/script";
import { MapCache } from "./pkg/storage/cache/cache";
import { get } from "./pkg/utils/utils";
import { Server } from "./apps/config";
import { ExtVersion, Server } from "./apps/config";
import { Subscribe, SUBSCRIBE_STATUS_ENABLE } from "./model/do/subscribe";
import { UserManager } from "./apps/user/manager";
import { ToolsManager } from "./apps/tools/manager";
import { config } from "vue/types/umd";

migrate();

Expand Down Expand Up @@ -146,10 +147,13 @@ setInterval(() => {
}
}, 1800000);

process.env.NODE_ENV === "production" && chrome.runtime.onInstalled.addListener((details) => {
chrome.runtime.onInstalled.addListener((details) => {
if (details.reason == "install") {
chrome.tabs.create({ url: "https://docs.scriptcat.org/" });
} else if (details.reason == "update") {
chrome.tabs.create({ url: "https://docs.scriptcat.org/change/" });
// 中版本的更新才打开新窗口
if (details.previousVersion?.substring(0, details.previousVersion.lastIndexOf('.')) != ExtVersion.substring(0, ExtVersion.lastIndexOf('.'))) {
chrome.tabs.create({ url: "https://docs.scriptcat.org/change/" });
}
}
});

0 comments on commit 74981dc

Please sign in to comment.