Files
bcm-tool/dist/inject.js
T
2026-01-20 11:24:40 +08:00

33 lines
1.5 KiB
JavaScript

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
(function () {
return __awaiter(this, void 0, void 0, function* () {
const scriptUrl = 'https://dev.deadend.work/lingdar77/bcm-tool/raw/branch/main/dist/bcm_tool.js';
try {
const response = yield fetch(scriptUrl);
const code = yield response.text();
const blob = new Blob([code], { type: 'application/javascript' });
const blobUrl = URL.createObjectURL(blob);
const script = document.createElement('script');
script.src = blobUrl;
script.type = 'module';
script.onload = () => {
URL.revokeObjectURL(blobUrl);
console.log("插件加载成功");
};
document.head.appendChild(script);
}
catch (e) {
console.error("插件加载失败", e);
}
});
})();