手机via支持油猴脚本,但手机上不能直接调试网页,没有开发者工具,但又想看更多网页的详细信息,所以写了这个脚本,可以直接在每个网页上添加一个悬浮开发者工具按钮,脚本名:Eruda Debugger Injector
// ==UserScript==
// @name Eruda Debugger Injector
// @namespace https://viayoo.com/
// @version 0.2
// @description 为所有网页注入Eruda调试工具
// @author YourName
// @run-at document-end
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// 创建第一个script标签加载eruda库
const script1 = document.createElement('script');
script1.src = 'https://cdnjs.webstatic.cn/ajax/libs/eruda/3.2.1/eruda.min.js';
// 库加载完成后初始化eruda
script1.onload = function() {
const script2 = document.createElement('script');
script2.textContent = 'eruda.init();';
document.body.appendChild(script2);
};
// 将脚本添加到页面
document.body.appendChild(script1);
})();
复制粘贴到脚本里面就可以了,其实就是给每个页面都注入Eruda的js代码,实现了简单的网页调试,理论上不仅via可以用,支持油猴插件的都可以吧