移除 ccu game 汉化 (官方已内置)

This commit is contained in:
xkeyC 2023-11-16 21:05:39 +08:00
parent 154fc2515b
commit 79635be514
8 changed files with 91 additions and 113 deletions

View File

@ -104,7 +104,6 @@ function getLocalizationResource(localizationResource, key) {
async function _getJsonData(fileName, { cacheKey = "", version = null } = {}) { async function _getJsonData(fileName, { cacheKey = "", version = null } = {}) {
url = "https://ch.citizenwiki.cn/json-files/locales/" + fileName; url = "https://ch.citizenwiki.cn/json-files/locales/" + fileName;
const box = await getLocalStorage();
if (cacheKey && cacheKey !== "") { if (cacheKey && cacheKey !== "") {
const localVersion = await getLocalData(`${cacheKey}_version`); const localVersion = await getLocalData(`${cacheKey}_version`);
const data = await getLocalData(cacheKey); const data = await getLocalData(cacheKey);
@ -124,14 +123,6 @@ async function _getJsonData(fileName, { cacheKey = "", version = null } = {}) {
return data; return data;
} }
function getLocalStorage() {
return new Promise((resolve) => {
chrome.storage.local;
resolve();
});
}
function getLocalData(key) { function getLocalData(key) {
return new Promise((resolve) => { return new Promise((resolve) => {
chrome.storage.local.get([key], (result) => { chrome.storage.local.get([key], (result) => {

View File

@ -29,7 +29,7 @@ function LocalizationWatchUpdate() {
SCLocalizationEnableSplitMode = true; SCLocalizationEnableSplitMode = true;
} }
if (window.location.hostname.includes("www.erkul.games") || window.location.hostname.includes("ccugame.app")) { if (window.location.hostname.includes("www.erkul.games")) {
document.body.addEventListener("click", function (event) { document.body.addEventListener("click", function (event) {
setTimeout(function () { setTimeout(function () {
allTranslate().then(_ => { allTranslate().then(_ => {

View File

@ -25,8 +25,7 @@
"https://robertsspaceindustries.com/*", "https://robertsspaceindustries.com/*",
"https://*.robertsspaceindustries.com/*", "https://*.robertsspaceindustries.com/*",
"https://www.erkul.games/*", "https://www.erkul.games/*",
"https://uexcorp.space/*", "https://uexcorp.space/*"
"https://ccugame.app/*"
], ],
"js": [ "js": [
"core.js", "core.js",
@ -35,8 +34,7 @@
}, },
{ {
"matches": [ "matches": [
"https://www.erkul.games/*", "https://www.erkul.games/*"
"https://ccugame.app/*"
], ],
"js": [ "js": [
"thirdparty/jquery.min.js" "thirdparty/jquery.min.js"

View File

@ -48,15 +48,15 @@
<body> <body>
<div class="card" style="padding-top: 0; padding-bottom: 0; border-radius: 0;"> <div class="card" style="padding-top: 0; padding-bottom: 0; border-radius: 0;">
<a href="https://github.com/xkeyC/StarCitizenBoxBrowserEx" target="_blank"> <a href="https://github.com/xkeyC/StarCitizenBoxBrowserEx" target="_blank">
<div> <div>
<h2>星际公民盒子浏览器拓展</h2> <h2>星际公民盒子浏览器拓展</h2>
</div> </div>
</a> </a>
</div> </div>
<div class="card"> <div class="card">
<a href="https://robertsspaceindustries.com/" target="_blank"> <a href="https://robertsspaceindustries.com/" target="_blank">
<svg viewBox="0 0 56 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg viewBox="0 0 56 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" <path fill-rule="evenodd" clip-rule="evenodd"
@ -69,31 +69,31 @@
<h3>星际公民官网</h3> <h3>星际公民官网</h3>
<p>罗伯茨航天工业公司,万物的起源</p> <p>罗伯茨航天工业公司,万物的起源</p>
</a> </a>
</div> </div>
<div class="card"> <div class="card">
<a href="https://uexcorp.space" target="_blank"> <a href="https://uexcorp.space" target="_blank">
<img src="https://uexcorp.space/img/uex-logo-v1.svg" alt=""> <img src="https://uexcorp.space/img/uex-logo-v1.svg" alt="">
<h3>UEX</h3> <h3>UEX</h3>
<p>采矿、精炼、贸易计算器、价格、船信息</p> <p>采矿、精炼、贸易计算器、价格、船信息</p>
</a> </a>
</div> </div>
<div class="card"> <div class="card">
<a href="https://www.erkul.games/live/calculator" target="_blank"> <a href="https://www.erkul.games/live/calculator" target="_blank">
<img src="https://www.erkul.games/assets/icons/icon-512x512.png"> <img src="https://www.erkul.games/assets/icons/icon-512x512.png">
<h3>DPS 计算器</h3> <h3>DPS 计算器</h3>
<p>在线改船,查询伤害数值和配件购买地点</p> <p>在线改船,查询伤害数值和配件购买地点</p>
</a> </a>
</div> </div>
<div class="card"> <div class="card">
<a href="https://ccugame.app" target="_blank"> <a href="https://ccugame.app" target="_blank">
<img src="https://ccugame.app/assets/images/logo/logo.png"> <img src="https://ccugame.app/assets/images/logo/logo.png">
<h3>CCUGame</h3> <h3>CCUGame(官方汉化)</h3>
<p>资产管理和舰队规划,一定要理性消费.jpg</p> <p>资产管理和舰队规划,一定要理性消费.jpg</p>
</a> </a>
</div> </div>
</body> </body>

View File

@ -104,7 +104,6 @@ function getLocalizationResource(localizationResource, key) {
async function _getJsonData(fileName, { cacheKey = "", version = null } = {}) { async function _getJsonData(fileName, { cacheKey = "", version = null } = {}) {
url = "https://ch.citizenwiki.cn/json-files/locales/" + fileName; url = "https://ch.citizenwiki.cn/json-files/locales/" + fileName;
const box = await getLocalStorage();
if (cacheKey && cacheKey !== "") { if (cacheKey && cacheKey !== "") {
const localVersion = await getLocalData(`${cacheKey}_version`); const localVersion = await getLocalData(`${cacheKey}_version`);
const data = await getLocalData(cacheKey); const data = await getLocalData(cacheKey);
@ -124,14 +123,6 @@ async function _getJsonData(fileName, { cacheKey = "", version = null } = {}) {
return data; return data;
} }
function getLocalStorage() {
return new Promise((resolve) => {
chrome.storage.local;
resolve();
});
}
function getLocalData(key) { function getLocalData(key) {
return new Promise((resolve) => { return new Promise((resolve) => {
chrome.storage.local.get([key], (result) => { chrome.storage.local.get([key], (result) => {

View File

@ -29,7 +29,7 @@ function LocalizationWatchUpdate() {
SCLocalizationEnableSplitMode = true; SCLocalizationEnableSplitMode = true;
} }
if (window.location.hostname.includes("www.erkul.games") || window.location.hostname.includes("ccugame.app")) { if (window.location.hostname.includes("www.erkul.games")) {
document.body.addEventListener("click", function (event) { document.body.addEventListener("click", function (event) {
setTimeout(function () { setTimeout(function () {
allTranslate().then(_ => { allTranslate().then(_ => {

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "星际公民盒子浏览器拓展", "name": "星际公民盒子浏览器拓展",
"version": "0.0.5", "version": "0.0.6",
"description": "为星际公民网站及工具站提供汉化", "description": "为星际公民网站及工具站提供汉化",
"author": "xkeyC", "author": "xkeyC",
"icons": { "icons": {
@ -26,8 +26,7 @@
"https://robertsspaceindustries.com/*", "https://robertsspaceindustries.com/*",
"https://*.robertsspaceindustries.com/*", "https://*.robertsspaceindustries.com/*",
"https://www.erkul.games/*", "https://www.erkul.games/*",
"https://uexcorp.space/*", "https://uexcorp.space/*"
"https://ccugame.app/*"
], ],
"js": [ "js": [
"core.js", "core.js",
@ -36,8 +35,7 @@
}, },
{ {
"matches": [ "matches": [
"https://www.erkul.games/*", "https://www.erkul.games/*"
"https://ccugame.app/*"
], ],
"js": [ "js": [
"thirdparty/jquery.min.js" "thirdparty/jquery.min.js"

View File

@ -48,15 +48,15 @@
<body> <body>
<div class="card" style="padding-top: 0; padding-bottom: 0; border-radius: 0;"> <div class="card" style="padding-top: 0; padding-bottom: 0; border-radius: 0;">
<a href="https://github.com/xkeyC/StarCitizenBoxBrowserEx" target="_blank"> <a href="https://github.com/xkeyC/StarCitizenBoxBrowserEx" target="_blank">
<div> <div>
<h2>星际公民盒子浏览器拓展</h2> <h2>星际公民盒子浏览器拓展</h2>
</div> </div>
</a> </a>
</div> </div>
<div class="card"> <div class="card">
<a href="https://robertsspaceindustries.com/" target="_blank"> <a href="https://robertsspaceindustries.com/" target="_blank">
<svg viewBox="0 0 56 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg viewBox="0 0 56 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" <path fill-rule="evenodd" clip-rule="evenodd"
@ -69,31 +69,31 @@
<h3>星际公民官网</h3> <h3>星际公民官网</h3>
<p>罗伯茨航天工业公司,万物的起源</p> <p>罗伯茨航天工业公司,万物的起源</p>
</a> </a>
</div> </div>
<div class="card"> <div class="card">
<a href="https://uexcorp.space" target="_blank"> <a href="https://uexcorp.space" target="_blank">
<img src="https://uexcorp.space/img/uex-logo-v1.svg" alt=""> <img src="https://uexcorp.space/img/uex-logo-v1.svg" alt="">
<h3>UEX</h3> <h3>UEX</h3>
<p>采矿、精炼、贸易计算器、价格、船信息</p> <p>采矿、精炼、贸易计算器、价格、船信息</p>
</a> </a>
</div> </div>
<div class="card"> <div class="card">
<a href="https://www.erkul.games/live/calculator" target="_blank"> <a href="https://www.erkul.games/live/calculator" target="_blank">
<img src="https://www.erkul.games/assets/icons/icon-512x512.png"> <img src="https://www.erkul.games/assets/icons/icon-512x512.png">
<h3>DPS 计算器</h3> <h3>DPS 计算器</h3>
<p>在线改船,查询伤害数值和配件购买地点</p> <p>在线改船,查询伤害数值和配件购买地点</p>
</a> </a>
</div> </div>
<div class="card"> <div class="card">
<a href="https://ccugame.app" target="_blank"> <a href="https://ccugame.app" target="_blank">
<img src="https://ccugame.app/assets/images/logo/logo.png"> <img src="https://ccugame.app/assets/images/logo/logo.png">
<h3>CCUGame</h3> <h3>CCUGame(官方汉化)</h3>
<p>资产管理和舰队规划,一定要理性消费.jpg</p> <p>资产管理和舰队规划,一定要理性消费.jpg</p>
</a> </a>
</div> </div>
</body> </body>