为广州大学第二课堂系统中使用的showModalDialog函数作兼容处理
当前为
// ==UserScript==
// @name 广州大学第二课堂系统弹出窗口兼容
// @namespace https://gf.qytechs.cn/zh-CN/users/220174-linepro
// @version 0.2
// @description 为广州大学第二课堂系统中使用的showModalDialog函数作兼容处理
// @author LinePro
// @match *://172.17.1.123/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
function getValue(str, key) {
const index = str.indexOf(key);
return str.slice(index + key.length + 1, str.indexOf(';', index));
}
const doc = document;
window.showModalDialog = function (uri, _arguments, _options) {
_options = _options.toLowerCase();
let window_feature = 'toolbar=no, menubar=no';
window_feature += getValue(_options, 'dialogwidth') ? ',width=' + getValue(_options, 'dialogwidth') : '';
window_feature += getValue(_options, 'dialogheight') ? ',height=' + getValue(_options, 'dialogheight') : '';
window.open(uri, _arguments, window_feature);
}
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址