Box3allSkin

获取所有皮肤

  1. // ==UserScript==
  2. // @name Box3allSkin
  3. // @namespace https://box3.codemao.cn/
  4. // @version 2.0
  5. // @description 获取所有皮肤
  6. // @author 普洱
  7. // @license MIT
  8. // @run-at document-end
  9. // @match https://box3.codemao.cn/*
  10. // @grant unsafeWindow
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. try{
  16. setTimeout(function () {
  17. const box3CoreElement = document.querySelector("#react-container");
  18. const reactNodeName=Object.keys(box3CoreElement).filter((v) =>v.includes('reactContain'))[0];
  19. const core=box3CoreElement[reactNodeName].updateQueue.baseState.element.props.children.props.children.props;
  20. window.core=core;
  21. core.state.brpc.skin.api.getAll().then((a)=>(core.state.box3.state.secret.availableSkin = a.map((o) => o.name)));
  22. },1000);
  23. }catch(e){
  24. alert(e.message);
  25. }
  26. })();