用油猴划词搜索脚本,划词会弹出图标栏,试了下使用 mouseIn 、mouseOver 函数,把鼠标移到图标栏的时候,都不能不自动消失,一定是哪里弄错了,感谢大佬指导
完整代码
浏览器搜索扩展工具
原先是使用的 mouseIn,添加代码最前面,请问这一块要如何写呢
mouseIn: 0;
var TimeOutHide = function () {
if (mouseIn === 0) {
return fadeOut(icon);
}
};
原脚本前面的图标栏的内容:
var iconArray = [
{
name: '打开',
image: 'https://i.ibb.co/PQ5xM2R/2-1.png',
host: [''],
popup: function (text) {
if(text.indexOf("http://")==0||text.indexOf("https://")==0)
window.open(text, "_blank");
else window.open("http://"+text, "_blank");
}
},
然后在划词弹窗这样使用
timer = window.setTimeout(TimeOutHide, 6000);