QTI document downloader

QTI createpoint.qti.qualcomm.com document download to file "DocNumber_version_title" old style small letter file name.

  1. // ==UserScript==
  2. // @license MIT
  3. // @name QTI document downloader
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.2
  6. // @description QTI createpoint.qti.qualcomm.com document download to file "DocNumber_version_title" old style small letter file name.
  7. // @author hk3f
  8. // @match https://createpoint.qti.qualcomm.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=qualcomm.com
  10. // @grant GM_xmlhttpRequest
  11. // @grant GM_openInTab
  12. // @grant GM_registerMenuCommand
  13. // @grant GM_unregisterMenuCommand
  14. // @run-at context-menu
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. 'use strict';
  19. //load context-menu URL
  20. let el = document.activeElement;
  21. if (el.tagName !== "A") el = el.closest("a");
  22. if (el) {
  23. let url = el.href;
  24. console.log(url);
  25. //parse URL title ID
  26. let idx = url.slice(url.lastIndexOf("/")+1 , url.length);
  27. console.log('TitleID=' , idx);
  28. //get title info json data
  29. let infoUrl = "https://createpoint.qti.qualcomm.com/chipcenter/title/" + idx;
  30. console.log('Url Of Title detailed info = ' , infoUrl);
  31. GM_xmlhttpRequest({
  32. method: 'GET',
  33. url: infoUrl,
  34. headers: {
  35. 'User-agent': 'Mozilla/4.0 (compatible) Greasemonkey',
  36. 'Accept': 'application/atom+xml,application/xml,text/xml',
  37. },
  38. onload: function(response) {
  39. var obj = JSON.parse(response.responseText);
  40. console.log("Target Document ID = ", obj.documents[0].id);
  41. //download target document with old style file name
  42. let urlTarget = "https://createpoint.qti.qualcomm.com/chipcenter/download/title/" + obj.documents[0].id;
  43. console.log("Target Document URL = ", urlTarget);
  44. GM_openInTab(urlTarget);
  45. }
  46.  
  47. });
  48.  
  49. } else console.log('not actually a link');
  50.  
  51.  
  52. })();

QingJ © 2025

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