yd582
火狐狸
火狐狸
  • UID37521
  • 注册日期2011-10-07
  • 最后登录2013-03-31
  • 发帖数227
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
阅读:1542回复:6

有没有办法不重复点击书签钮

楼主#
更多 发布于:2011-12-15 13:51
我是通过书签按钮点开书签的,一般情况下我每次都要点开二到三个书签,但是,每点一个书签,书签钮的下拉菜单就会关闭,需要再重新点击书签按钮,来来回回一直这样。
有没有办法,点击书签时,书签下拉不自动关闭?等我不需要了,点击空白处,再自动关闭!
能实现吗?
alanfly
千年狐狸
千年狐狸
  • UID31035
  • 注册日期2009-11-10
  • 最后登录2024-05-19
  • 发帖数2769
  • 经验580枚
  • 威望1点
  • 贡献值128点
  • 好评度102点
  • 社区居民
  • 最爱沙发
  • 忠实会员
1楼#
发布于:2011-12-15 13:51
Stay-Open Menu :: Add-ons for Firefox
中键或者ctrl+左键点击。
bobnemo
小狐狸
小狐狸
  • UID29702
  • 注册日期2009-07-17
  • 最后登录2012-04-14
  • 发帖数39
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
2楼#
发布于:2011-12-15 13:51
自动弹出菜单,很方便的。

自动弹出菜单.uc.rar

// ==UserScript==
// @name           AutoPopup.uc.js
// @description    Auto popup menulist/menupopup
// @compatibility  Firefox 2.0+
// @author         GOLF-AT
// @version        1.8.0.20101230

(function() {
    var PopElt = null;    var DropElt = null;
    var PopTimer = null;  var HideTimer = null;
    var AlwaysPop = false;  var nDelay = 200;

    function AutoPopup()
    {
        PopTimer = null;
        if (DropElt) {
            if (DropElt.localName!='dropmarker') {
                var v = null;
                try {
                    v = DropElt.ownerDocument.
                        getAnonymousNodes(DropElt);
                }catch(ex) {}
                if (v!=null && v.length!=0 && v[0].
                    localName=='menupopup')
                    PopElt = v[0];
                else
                    PopElt = DropElt.childNodes[0];
            }
            else
                PopElt = DropElt;
            try {
                PopElt.showPopup(PopElt.parentNode,
                    -1, -1, 'popup', 'bottomleft',
		            'topleft'); 
            }catch(e) { PopElt = null; }
        }
    }

    function HidePopup()
    {
        try {
            if (PopElt.localName=='dropmarker')
                PopElt.parentNode.closePopup();
            else
                PopElt.hidePopup();
        }catch(e) {}
        HideTimer = null; DropElt = null;
        PopElt = null;
    }

    function MouseOver(e)
    {
        if (!AlwaysPop && !document.hasFocus())
            return;

        if (IsButton(e.target)) {
            type = e.target.getAttribute('type');
            if (type == 'menu-button') {
                if (e.originalTarget!=e.target)
                    return;
            }
            else {
                if (type != 'menu') return;
            }
        }

        if (HideTimer) {
            window.clearTimeout(HideTimer);
            HideTimer = null;
        }
        try {
            if ('PopupAutoComplete'==e.target.id.
                substr(0,17))
                return;
            for(var elt=e.target; elt!=null; elt=
                elt.parentNode) {
                if (elt.localName=='popup' || elt.
                    localName=='menupopup')
                    return;
            }
        }catch(ex) {}

        if (PopElt) {
            if (DropElt!=null && e.target==DropElt)
                return;
            try { 
                if (PopElt.localName != 'dropmarker'
                    ) {
                    for(var elt=e.target; elt!=null;
                        elt=elt.parentNode) {
                        if (elt == PopElt) return;
                    }
                }
            }catch(ex) {}
            HidePopup();
        }
        DropElt = e.target;
        PopTimer = setTimeout(AutoPopup, nDelay);
    }

    function MouseOut(e)
    {
        if (PopTimer) {
            window.clearTimeout(PopTimer);
            PopTimer = null;
        }
        if (!HideTimer && PopElt!=null)
            HideTimer = window.setTimeout(HidePopup,
                500);
    }

    function IsButton(elt) {
        try {
            return elt.localName=='toolbarbutton' || elt
                .localName=='button';
        }catch(e) { return false; }
    }

    function IsMenuButton(elt) {
        if (!IsButton(elt)) return false;
        for(var i=0; i<2; i++) {
            try {
                var nodes = i==0x01 ? elt.childNodes : elt.
                    ownerDocument.getAnonymousNodes(elt);
                if (nodes!=null && nodes.length && nodes[0]
                    .localName=='menupopup')
                    return true;
            }catch(e) {}
        }
        return false;
    }

    function EnumElement(elt) {
        try {
            if (elt.localName == 'prefpane') {
                elt.addEventListener('paneload', function(e) {
                    setTimeout(function() { EnumElement(e.
                        target); }, 100); 
                    }, false);
            }
            else if(elt.id=='sidebar' && !elt.hasAttribute(
                'AutoPopup')) {
                elt.setAttribute('AutoPopup', true)
                elt.addEventListener('SidebarFocused', 
                    function(e) { EnumElement(elt); }, false);
            }
            else if(elt.id == 'editBookmarkPanel')
                return;
        }catch(e) {}

        for(var i=0; i<2; i++) {
            var nodes = null;
            try {
                if (elt.localName == 'browser') {
                    i = 1;
                    nodes = elt.contentDocument.childNodes;
                }
                else
                    nodes = i==0x01 ? elt.childNodes : elt.
                        ownerDocument.getAnonymousNodes(elt);
            }catch(e) { nodes = null; }
            if (nodes == null) continue;

            for(var n=0; n<nodes.length; n++) {
                try {
                    var node = nodes[n];
                    if ('PopupAutoComplete'==node.getAttribute(
                        'id').substr(0,17) || 'menupopup'==node
                        .localName || node.localName=='popup')
                        ;
                    else if (node.localName != 'dropmarker') {
                        if (node.localName=='menu' && 'menubar'
                            ==node.parentNode.localName)
                            ;
                        else if(!IsMenuButton(node))
                            node = null;
                    }
                    else if(node.getAttribute('type')=='menu') {
                        node = node.parentNode;
                        if (!node.firstChild || node.firstChild.
                            localName!='menupopup')
                            continue;
                    }
                    if (node == null) {
                        EnumElement(nodes[n]); continue;
                    }
                    if (node.hasAttribute('command')) continue;

                    node.addEventListener('mouseout', MouseOut,
                        false);
                    node.addEventListener('mouseover',MouseOver,
                        false);
                }catch(e) {}
            }
        }
    }

    setTimeout(function() { EnumElement(document); }, 100);
})();
璀璨星空001
小狐狸
小狐狸
  • UID37856
  • 注册日期2011-11-25
  • 最后登录2011-12-17
  • 发帖数80
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
3楼#
发布于:2011-12-15 13:51
alanflyStay-Open Menu :: Add-ons for Firefox
中键或者ctrl+左键点击。
回到原帖

安装了stay-open-menu还是要点中键才能”stay-open-menu“,直接点击左键就不行了。
另外有没有类似的UC或油猴,省一个扩展。
alanfly
千年狐狸
千年狐狸
  • UID31035
  • 注册日期2009-11-10
  • 最后登录2024-05-19
  • 发帖数2769
  • 经验580枚
  • 威望1点
  • 贡献值128点
  • 好评度102点
  • 社区居民
  • 最爱沙发
  • 忠实会员
4楼#
发布于:2011-12-15 13:51
璀璨星空001
安装了stay-open-menu还是要点中键才能”stay-open-menu“,直接点击左键就不行了。
另外有没有类似的UC或油猴,省一个扩展。
回到原帖

直接左键你可以向作者提意见加个选项;
脚本这里有个:http://www.cnblogs.com/ziyunfei/
页面内搜索doNotCloseMenu就是了。
璀璨星空001
小狐狸
小狐狸
  • UID37856
  • 注册日期2011-11-25
  • 最后登录2011-12-17
  • 发帖数80
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
5楼#
发布于:2011-12-15 13:51

直接左键你可以向作者提意见加个选项;
脚本这里有个:http://www.cnblogs.com/ziyunfei/
页面内搜索doNotCloseMenu就是了。

我把扩展禁用,把doNotCloseMenu.uc.js放进profile\chrome文件夹。重启后发现doNotCloseMenu没有用。
脚本失效还是脚本比不上扩展?
alanfly
千年狐狸
千年狐狸
  • UID31035
  • 注册日期2009-11-10
  • 最后登录2024-05-19
  • 发帖数2769
  • 经验580枚
  • 威望1点
  • 贡献值128点
  • 好评度102点
  • 社区居民
  • 最爱沙发
  • 忠实会员
6楼#
发布于:2011-12-15 13:51

我把扩展禁用,把doNotCloseMenu.uc.js放进profile\chrome文件夹。重启后发现doNotCloseMenu没有用。
脚本失效还是脚本比不上扩展?

没用过这个脚本,可以问作者。
游客

返回顶部