Greasy Fork is available in English.
清除电信光猫管理网页灰色选项的disabled属性
当前为
// ==UserScript==
// @name 电信光猫灰色选项强制开启
// @author Initsnow
// @version 0.1
// @license MIT
// @match http://192.168.1.1/*
// @description 清除电信光猫管理网页灰色选项的disabled属性
// @noframes
// @namespace http://greasyfork.icu/users/982891
// ==/UserScript==
(function() {
'use strict';
var btn = document.createElement("button");
btn.style="position: absolute;right: 10px;top: 50vh;";
btn.innerHTML="解灰";
btn.addEventListener('click', function(){
var iframes = document.getElementsByTagName('iframe');
for (const iframe of iframes) {
const innerDoc = iframe.contentDocument || iframe.contentWindow.document;
var selects = innerDoc.getElementsByTagName("select");
for (const select of selects) {
select.removeAttribute('disabled');
}
var inputs = innerDoc.getElementsByTagName("input");
for (const input of inputs) {
input.removeAttribute('disabled');
}
}
});
document.body.appendChild(btn);
})();