Jira 工具

2021/2/9下午3:12:17

  1. // ==UserScript==
  2. // @name Jira 工具
  3. // @namespace Violentmonkey Scripts
  4. // @match https://jira.zhenguanyu.com/secure/*
  5. // @match https://jira.zhenguanyu.com/browse/*
  6. // @grant none
  7. // @version 1.1.3
  8. // @author -
  9. // @description 2021/2/9下午3:12:17
  10. // ==/UserScript==
  11.  
  12. ;(async function () {
  13. window.addEventListener('load', async () => {
  14. const loadScript = (url) => {
  15. const script = document.createElement('script')
  16. script.src = url;
  17. document.head.appendChild(script)
  18.  
  19. return new Promise((resolve, reject) => {
  20. script.onload = resolve;
  21. script.onerror = reject;
  22. })
  23. }
  24. const loadStyle = (url) => {
  25. const link = document.createElement('link')
  26. link.href = url;
  27. link.rel = 'stylesheet';
  28. document.head.appendChild(link)
  29.  
  30. return new Promise((resolve, reject) => {
  31. link.onload = resolve;
  32. link.onerror = reject;
  33. })
  34. }
  35. const isDebug = location.search.indexOf('jira-extension-script-debug=true') >= 0;
  36.  
  37. const jsUrl = isDebug ? 'http://localhost:8080/index.js' : 'https://unpkg.com/jira-extension-script@latest';
  38. const cssUrl = isDebug ? 'http://localhost:8080/index.css' : 'https://unpkg.com/jira-extension-script@latest/dist/index.css';
  39. await Promise.all([
  40. loadScript(jsUrl),
  41. loadStyle(cssUrl)
  42. ]);
  43. const div = document.createElement('div');
  44. div.id = 'jira-ext';
  45. document.body.appendChild(div);
  46. JiraExtensionScript.render(div);
  47.  
  48. JiraExtensionScript.polyfillRender && JiraExtensionScript.polyfillRender();
  49. })
  50. })()

QingJ © 2025

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