广州大学第二课堂系统弹出窗口兼容

为广州大学第二课堂系统中使用的 showModalDialog 函数作兼容处理

  1. // ==UserScript==
  2. // @name 广州大学第二课堂系统弹出窗口兼容
  3. // @namespace https://gf.qytechs.cn/zh-CN/users/220174-linepro
  4. // @version 1.1
  5. // @description 为广州大学第二课堂系统中使用的 showModalDialog 函数作兼容处理
  6. // @author LinePro
  7. // @match *://172.17.1.123/*
  8. // @match *://webvpn.gzhu.edu.cn/http/*/XS/XMSB.aspx
  9. // @match *://webvpn.gzhu.edu.cn/http/*/JWC/view.aspx
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15. function getValue(str, key) {
  16. const index = str.indexOf(key);
  17. return str.slice(index + key.length + 1, str.indexOf(';', index));
  18. }
  19. window.showModalDialog = function (uri, _arguments, _options) {
  20. _options = _options.toLowerCase();
  21. let windowFeature = 'toolbar=no, menubar=no';
  22. const dialogWidth = getValue(_options, 'dialogwidth');
  23. const dialogHeight = getValue(_options, 'dialogheight');
  24. if (dialogWidth)
  25. windowFeature += ', width=' + dialogWidth;
  26. if (dialogHeight)
  27. windowFeature += ', height=' + dialogHeight;
  28. window.open(uri, "_blank", windowFeature);
  29. }
  30. })();

QingJ © 2025

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