xkeyC 2024-01-30 21:53:49 +08:00
parent 27dbf46324
commit 7ab69ab30a
2 changed files with 40 additions and 30 deletions

View File

@ -1,7 +1,8 @@
let dataVersion = null let dataVersion = null
chrome.runtime.onInstalled.addListener(function () { chrome.runtime.onInstalled.addListener(function () {
_checkVersion().then(_ => { }); _checkVersion().then(_ => {
});
console.log("SWTT init"); console.log("SWTT init");
}); });
@ -56,6 +57,10 @@ async function _initLocalization(url) {
const referral = "https://robertsspaceindustries.com/account/referral-program"; const referral = "https://robertsspaceindustries.com/account/referral-program";
const address = "https://robertsspaceindustries.com/account/addresses"; const address = "https://robertsspaceindustries.com/account/addresses";
const hangar = "https://robertsspaceindustries.com/account/pledges"; const hangar = "https://robertsspaceindustries.com/account/pledges";
const spectrum = "https://robertsspaceindustries.com/spectrum/community/";
if (url.startsWith(spectrum)) {
return;
}
addLocalizationResource("zh-CN"); addLocalizationResource("zh-CN");
if (url.startsWith(org) || url.startsWith(citizens) || url.startsWith(organization)) { if (url.startsWith(org) || url.startsWith(citizens) || url.startsWith(organization)) {
replaceWords.push({"word": 'members', "replacement": '名成员'}); replaceWords.push({"word": 'members', "replacement": '名成员'});

View File

@ -1,7 +1,8 @@
let dataVersion = null let dataVersion = null
chrome.runtime.onInstalled.addListener(function () { chrome.runtime.onInstalled.addListener(function () {
_checkVersion().then(_ => { }); _checkVersion().then(_ => {
});
console.log("SWTT init"); console.log("SWTT init");
}); });
@ -56,6 +57,10 @@ async function _initLocalization(url) {
const referral = "https://robertsspaceindustries.com/account/referral-program"; const referral = "https://robertsspaceindustries.com/account/referral-program";
const address = "https://robertsspaceindustries.com/account/addresses"; const address = "https://robertsspaceindustries.com/account/addresses";
const hangar = "https://robertsspaceindustries.com/account/pledges"; const hangar = "https://robertsspaceindustries.com/account/pledges";
const spectrum = "https://robertsspaceindustries.com/spectrum/community/";
if (url.startsWith(spectrum)) {
return;
}
addLocalizationResource("zh-CN"); addLocalizationResource("zh-CN");
if (url.startsWith(org) || url.startsWith(citizens) || url.startsWith(organization)) { if (url.startsWith(org) || url.startsWith(citizens) || url.startsWith(organization)) {
replaceWords.push({"word": 'members', "replacement": '名成员'}); replaceWords.push({"word": 'members', "replacement": '名成员'});