pic替换通用脚本自行添加网站
当前为
// ==UserScript== // @name pic替换通用脚本 // @description pic替换通用脚本自行添加网站 // @namespace [email protected] // @include http://apk.hiapk.com/appinfo/* // @include http://www.baidu.com/* // @include http://www.baidu.com/* // @version 1.0 // @grant none // ==/UserScript== //----定义函数----//函数(定位 img元素,原始名,目标名) var $ = function(s,o,r){ var imgs = document.querySelectorAll(s) for (i=0; i < imgs.length; i++) {imgs[i].src = imgs[i].src.replace(o,r)} } //----定义函数----// //----匹配网站----// var main = { hiapk:{ regexp: /hiapk\.com/, proc : $(".left img",".png",".png1") }, baidu:{ regexp: /baidu\.com/, proc : $(".s-p-top img",".png",".png1") }, xxxx:{ regexp: /xxxx\.com/, proc : $(".s-p-top img",".png",".png1") }, };