Browse Source

提高sanbon控制台直接运行代码的支持

pull/1/head
枫谷剑仙 1 year ago
parent
commit
50ea7af319
2 changed files with 11 additions and 4 deletions
  1. +10
    -3
      script.js
  2. +1
    -1
      service-worker.js

+ 10
- 3
script.js View File

@@ -1382,9 +1382,16 @@ Formation.prototype.getSanbonV2Script = function()
const [members,assists,badge] = this.teams[0];
const scriptLines = [`(async ()=>{
"use strict";
const __NEXT_DATA__ = document.getElementById("__NEXT_DATA__");
const __NEXT_DATA__JSON = JSON.parse(__NEXT_DATA__.innerHTML);
const buildId = __NEXT_DATA__JSON.buildId;
let buildId;
if (typeof __NEXT_DATA__ !== 'undefined') {
buildId = __NEXT_DATA__?.buildId;
} else {
const Zstr = window.__next_f.find(o=>o?.[1]?.startsWith("0:"))[1];
const regRes = /"buildId":"([\\w\\-]+)"/ig.exec(Zstr);
buildId = regRes[1];
}
if (!buildId) throw Error("buildId not found.");
const region = "${region}";
async function fetchFlattened(id) {


+ 1
- 1
service-worker.js View File

@@ -29191,7 +29191,7 @@ const cachesMap = new Map([
],
[
"script.js",
"5ccf991a960d65a22dafaecdb56ffdce"
"e404ffcfe61737efab3476ec7da3ceef"
],
[
"solo.html",


Loading…
Cancel
Save