HPX Flutter Trigger

给 HPX 增加一个 Flutter 版本号变更入口

目前為 2022-04-27 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name HPX Flutter Trigger
  3. // @namespace https://mtflutter.sankuai.com
  4. // @version 1.1
  5. // @description 给 HPX 增加一个 Flutter 版本号变更入口
  6. // @author iyeatse@gmail.com
  7. // @match hpx.sankuai.com/application/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=flutter.dev
  9. // @grant none
  10. // @run-at document-start
  11. // @license Commercial
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. document.onreadystatechange = function () {
  17. if (document.readyState === "interactive") {
  18. const script = document.createElement('script')
  19. script.src = '//unpkg.sankuai.com/package/xhook@latest/dist/xhook.min.js'
  20. document.getElementsByTagName('head')[0].appendChild(script)
  21. } else if (document.readyState === 'complete') {
  22. xhook.after(function (request, response) {
  23. if (request.url.match(/api\/buildType\/detail/)) {
  24. const resp = JSON.parse(response.text)
  25. if (resp.status == 1) {
  26. for (const buildTypeParam of resp.data.buildType.buildTypeParams) {
  27. const { buildParams } = buildTypeParam
  28. for (let i = 0; i < buildParams.length; i++) {
  29. if (buildParams[i].paramKey === 'integrationList') {
  30. const { elementRules } = buildParams[i]
  31. const newParam = {
  32. paramKey: "mtflutterIntegrationList",
  33. paramName: "Flutter 模块变更列表",
  34. paramValue: [],
  35. paramDesc: "iOS填waimai_e_flutter,Android填com.sankuai.wme:waimai_e_flutter",
  36. valueDesc: "Flutter 模块变更列表",
  37. couldEdit: true,
  38. require: false,
  39. elementRules,
  40. }
  41. buildParams.splice(i + 1, 0, newParam)
  42. break
  43. }
  44. }
  45. }
  46. response.text = JSON.stringify(resp)
  47. }
  48. }
  49. });
  50. }
  51. }
  52. })();

QingJ © 2025

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