2018-05-15 09:21:03 +00:00
|
|
|
// ==UserScript==
|
|
|
|
// @name WebIDE增强脚本
|
|
|
|
// @namespace http://ide.yumc.pw/
|
2018-05-15 09:49:59 +00:00
|
|
|
// @version 0.4
|
2018-05-15 09:21:03 +00:00
|
|
|
// @description Coding WebIDE 增强脚本
|
|
|
|
// @author MiaoWoo
|
|
|
|
// @match http*://ide.yumc.pw/ws/*
|
2018-05-15 09:24:03 +00:00
|
|
|
// @match http*://ide.coding.net/ws/*
|
2018-05-15 09:21:03 +00:00
|
|
|
// @grant none
|
|
|
|
// ==/UserScript==
|
|
|
|
|
|
|
|
(function() {
|
|
|
|
'use strict';
|
2018-05-15 09:34:39 +00:00
|
|
|
var id = setInterval(function (){
|
|
|
|
if (document.getElementsByClassName('ide-container')[0]) {
|
2018-05-15 09:49:59 +00:00
|
|
|
document.onbeforeunload = function () { return false; }
|
2018-05-15 09:34:39 +00:00
|
|
|
console.log('已阻止 Ctrl + W 关闭页面...')
|
|
|
|
clearInterval(id);
|
|
|
|
}
|
|
|
|
}, 300)
|
2018-05-15 09:52:24 +00:00
|
|
|
document.onkeydown = function() {
|
2018-05-15 09:49:59 +00:00
|
|
|
var e = window.event;
|
|
|
|
if (e.keyCode == 87 && e.altKey) {
|
2018-05-15 09:47:33 +00:00
|
|
|
var activeTab = document.getElementsByClassName('tab-label active')[0];
|
|
|
|
if (activeTab) {
|
|
|
|
activeTab.childNodes[2].childNodes[0].click();
|
2018-05-15 09:21:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})();
|