Lazy Input for MGSV:TPP Malicious Actions Reporting

This script will save last your inquiry_id, platform, type and mode on your browser storage so you don't need to input it again next time. And set date&time to 10 minutes before now. https://www.konami.com/mgs/tpp/report/index.php?region=ac&lang=en

  1. // ==UserScript==
  2. // @name Lazy Input for MGSV:TPP Malicious Actions Reporting
  3. // @namespace https://gist.github.com/supirman/f3f313a646eaa54aec6c1d7e8fa202df#file-mgsv-report-lazy-input-userscript-js
  4. // @version 0.1.1.2
  5. // @description This script will save last your inquiry_id, platform, type and mode on your browser storage so you don't need to input it again next time. And set date&time to 10 minutes before now. https://www.konami.com/mgs/tpp/report/index.php?region=ac&lang=en
  6. // @author @suPirman
  7. // @match https://www.konami.com/mgs/tpp/report/index.php?*
  8. // @grant none
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. if(typeof(Storage) !== "undefined") {
  15. var d= new Date();
  16. d.setMinutes(d.getMinutes() - 10);
  17. $('select[name=year]').val(d.getUTCFullYear()).change();
  18. $('select[name=month]').val(d.getUTCMonth()+1).change();
  19. $('select[name=day]').val(d.getUTCDate()).change();
  20. $('select[name=hour]').val(d.getUTCHours()).change();
  21. $('select[name=minute]').val(d.getUTCMinutes()).change();
  22. $('input[name=inquiry_id]').val(localStorage.tpp_report_inquiry_id).change();
  23. $('select[name=platform]').val(localStorage.tpp_report_plaform).change();
  24. $('select[name=type]').val(localStorage.tpp_report_type).change();
  25. $('select[name=mode]').val(localStorage.tpp_report_mode).change();
  26.  
  27. $("a:contains('Send')").click(function(){
  28. localStorage.setItem("tpp_report_inquiry_id", $('input[name=inquiry_id]').val());
  29. localStorage.setItem("tpp_report_plaform", $('select[name=platform]').val());
  30. localStorage.setItem("tpp_report_type", $('select[name=type]').val());
  31. localStorage.setItem("tpp_report_mode", $('select[name=mode]').val());
  32. });
  33. } else {
  34. // Sorry! No Web Storage support..
  35. }
  36. })();