GF enhance new version upload

Select Syntax highlight (enhanced editor) and resize the code box by default when uploading a script

  1. // ==UserScript==
  2. // @name GF enhance new version upload
  3. // @author wOxxOm
  4. // @license MIT License
  5. // @description Select Syntax highlight (enhanced editor) and resize the code box by default when uploading a script
  6. // @namespace wOxxOm.scripts
  7. // @version 1.0.1
  8. // @include https://gf.qytechs.cn/*scripts/*/versions/new*
  9. // @include https://gf.qytechs.cn/*script_versions/new*
  10. // @run-at document-start
  11. // @require https://gf.qytechs.cn/scripts/12228/code/setMutationHandler.js
  12. // ==/UserScript==
  13.  
  14. setMutationHandler(document, '#script_version_code', function(nodes) {
  15. this.disconnect();
  16.  
  17. var area = nodes[0];
  18. var bounds = area.getBoundingClientRect();
  19. area.style.height = Math.max(200, innerHeight - bounds.top - 100) + 'px';
  20. area.style.marginBottom = innerHeight + 'px';
  21.  
  22. var scriptInfo = document.getElementById('script-info') || document.querySelector('header').nextElementSibling;
  23. if (scriptInfo)
  24. scrollBy(0, scriptInfo.getBoundingClientRect().top);
  25.  
  26. document.getElementById('enable-source-editor-code').click();
  27. });

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址