|
阅读:3437回复:5
【已解决】如何阻止中键打开书签后关闭书签菜单
RT
在28beta之前的所有版本,安装有TU或TMP的情况下,都能够中键点击书签打开标签后,书签菜单不关闭,这样能够快速地打开多个书签 但是升级到29beta之后,虽然也安装了TMP最新版,却无法实现同样的效果了 求助有没有什么设置和此行为相关,或者其他可能的解决方案? 因为这个操作长期使用,我现在不太清楚是TMP提供的还是firefox本身发生了变化 ****************** 反复开开关关标签实在很麻烦,我没耐心找原因了,直接扒开Stay-Open Menu提取了我需要的逻辑…… 现发于此,以备有同样需求的朋友使用(下面不仅包含书签栏,也包括TMP的恢复标签列表) // ==UserScript==
// @name BookmarkMenuStayOpen
// @version 0.1.0.20140321
// @namespace BookmarkMenuStayOpen@Byzod.Bookmark
// @author custom.firefox.lady
// @modifier Byzod
// @description Stay open after click on bookmark menu
// ==/UserScript==
var BookmarkMenuStayOpen = function(){
// derives new function from the fx in-built js one, but with the menu closing removed
var origBMEH = BookmarksEventHandler.onClick.toString();
// alert(origBMEH); //uncomment to quickly view what we got
var menuClosingStr = "node.hidePopup();";
if (origBMEH.indexOf("function BEH_onClick(aEvent, aView)") !== -1 && origBMEH.indexOf(menuClosingStr) !== -1) {
origBMEH = origBMEH.replace("function BEH_onClick(aEvent, aView)", "");
origBMEH = origBMEH.replace(menuClosingStr, "if (aEvent.button === 0) {node.hidePopup();}");
BookmarksEventHandler.onClick = new Function("aEvent", "aView", origBMEH);
}
// alert(origBMEH); //uncomment to quickly view if we changed it successfully
// Clear TMP undo close tab menu's handler
if(TMP_ClosedTabs && TMP_ClosedTabs.checkForMiddleClick){
origBMEH = TMP_ClosedTabs.checkForMiddleClick.toString();
// alert(origBMEH); //uncomment to quickly view what we got
menuClosingStr = "closeMenus(aEvent.target);";
if (origBMEH.indexOf("function ct_checkForMiddleClick(aEvent)") !== -1 && origBMEH.indexOf(menuClosingStr) !== -1) {
origBMEH = origBMEH.replace("function ct_checkForMiddleClick(aEvent)", "");
origBMEH = origBMEH.replace(menuClosingStr, "{}");
TMP_ClosedTabs.checkForMiddleClick = new Function("aEvent", origBMEH);
}
// alert(origBMEH); //uncomment to quickly view if we changed it successfully
}
}
window.setTimeout( BookmarkMenuStayOpen, 100 ); |
|
|
|
1楼#
发布于:2014-03-21 23:36
专门提供此项功能的扩展:Stay-Open Menu。
没用29,不知道失效没。 |
|
|
2楼#
发布于:2014-03-22 10:33
|
|
|
|
3楼#
发布于:2014-03-22 11:29
|
|
|
4楼#
发布于:2014-03-22 12:09
|
|
|
|
5楼#
发布于:2014-10-25 21:37
36a1测试有效,多谢分享!
|
|
