withero
小狐狸
小狐狸
  • UID37110
  • 注册日期2011-08-29
  • 最后登录2024-03-21
  • 发帖数45
  • 经验64枚
  • 威望0点
  • 贡献值14点
  • 好评度0点
  • 社区居民
阅读:5091回复:12

升级75B后手势脚本前进后退失效了,求修复

楼主#
更多 发布于:2020-03-18 11:37
向左划出手势后不会有后退动作,并且会留下手势的线条在页面上。升级75B后出现的问题。


// ==UserScript==
// @name                 Mousegestures.uc.js
// @namespace            Mousegestures@gmail.com
// @description          自定义鼠标手势
// @author               紫云飞&黒仪大螃蟹
// @homepageURL          http://www.cnblogs.com/ziyunfei/archive/2011/12/15/2289504.html
// @include              chrome://browser/content/browser.xhtml
// @include              chrome://browser/content/browser.xul
// @include              chrome://browser/content/browser.x
// @charset              UTF-8
// ==/UserScript==
(() => {
    'use strict';
    let ucjsMouseGestures = {
        lastX: 0,
        lastY: 0,
        directionChain: '',
        isMouseDownL: false,
        isMouseDownR: false,
        hideFireContext: false,
        shouldFireContext: false,
        GESTURES: {
 
            'L': {name: '后退', cmd: () => getWebNavigation().canGoBack && getWebNavigation().goBack()},
            'R': {name: '前进', cmd: () => getWebNavigation().canGoForward && getWebNavigation().goForward()},
 
/*
            'U': {name: '向上滚动', cmd: () => goDoCommand('cmd_scrollPageUp')},
            'D': {name: '向下滚动', cmd: () => goDoCommand('cmd_scrollPageDown')},
*/             
            'U': {name: '转到页首', cmd: () => goDoCommand('cmd_scrollTop')},
            'D': {name: '转到页尾', cmd: () => goDoCommand('cmd_scrollBottom')},
 
             
             
            'W+': {name: '激活右边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(+1, true); }},
      'W-': {name: '激活左边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(-1, true); }},
      'L<R': {name: '缩放重置', cmd: function() { ucjsMouseGestures_helper.zoomReset(); }},
 
            'UD': {name: '刷新当前页面', cmd: function() { document.getElementById("Browser:Reload").doCommand();}},
            'UDU': {name: '跳过缓存刷新当前页面', cmd: function() { document.getElementById("Browser:ReloadSkipCache").doCommand();}},
            'DUDU': {name: '刷新所有页面', cmd: function() {gBrowser.visibleTabs.forEach(tab => {try {gBrowser.getBrowserForTab(tab).reload();} catch (e){}});}},
            'DU': {name: '网址向上一层', cmd:  function() { loadURI(content.location.host + content.location.pathname.replace(/\/[^\/]+\/?$/, ""));}},
 
            'RL': {name: '打开新标签', cmd:  function() { BrowserOpenTab();  }},
            'LR': {name: '添加/移除书签', cmd:  function() {document.getElementById("Browser:AddBookmarkAs").doCommand(); } },
 
        'UL': {name: '激活左边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(-1, true);}},
            'UR': {name: '激活右边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(+1, true);}},
            'ULU': {name: '激活第一个标签页', cmd:  function(event) { gBrowser.selectedTab = (gBrowser.visibleTabs || gBrowser.mTabs)[0];}},
            'URU': {name: '激活最后一个标签页', cmd: function(event) { gBrowser.selectedTab = (gBrowser.visibleTabs || gBrowser.mTabs)[(gBrowser.visibleTabs || gBrowser.mTabs).length - 1];}},
 
            'DL': {name: '恢复关闭的标签', cmd:  function() { try {                document.getElementById('History:UndoCloseTab').doCommand();            } catch (ex) {              if ('undoRemoveTab' in gBrowser) gBrowser.undoRemoveTab();              else throw "Session Restore feature is disabled."           }       }  },
            'DR': {name: '关闭当前标签', cmd: function(event) {           gBrowser.removeCurrentTab();        }},
          'LDL': {name: '关闭左侧标签页', cmd: function(event) {   for (let i = gBrowser.selectedTab._tPos - 1; i >= 0; i--) if (!gBrowser.tabs[i].pinned){ gBrowser.removeTab(gBrowser.tabs[i], {animate: true});}}},
          'RDR': {name: '关闭右侧标签页', cmd: function(event) {gBrowser.removeTabsToTheEndFrom(gBrowser.selectedTab); }},
            'LUL': {name: '关闭其他所有标签页', cmd:  function(event) {gBrowser.removeAllTabsBut(gBrowser.selectedTab); }},
            'RUR': {name: '关闭所有标签页', cmd:  function(event) { gBrowser.removeAllTabsBut(openTrustedLinkIn('about:newtab', 'current')); }},
 
            'RU': {name: '转到页首', cmd: () => goDoCommand('cmd_scrollTop')},
            'RD': {name: '转到页尾', cmd: () => goDoCommand('cmd_scrollBottom')},
 
            'LU': {name: '聚焦到地址栏', cmd: function(event) {   openLocation(); }},
            'LD': {name: '查看页面信息', cmd: function(event) {   BrowserPageInfo(); }},
 
            'RLRL': {name: '重启浏览器', cmd: function(event) {      Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);       }}, 
            'LRLR': {name: '重启浏览器', cmd: function(event) {      Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);       }}, 
            'URDLU': {name: '关闭浏览器',  cmd: function(event) {        goQuitApplication();        }},
 
            'DRU': {name: '打开附加组件',  cmd: function(event) { BrowserOpenAddonsMgr(); }},
            'URD': {name: '打开选项',  cmd: function(event) {       openPreferences(); }},
 
            'DLD': {name: '侧边栏打开当前页', cmd: function(event) { openWebPanel(document.title, gBrowser.currentURI.spec);}},
            'LDR': {name: '打开历史侧边栏',  cmd: function(event) {SidebarUI.toggle("viewHistorySidebar"); }},
            /*'RDL': {name: '打开书签工具栏',  cmd: function(event) {  var bar = document.getElementById("PersonalToolbar"); setToolbarVisibility(bar, bar.collapsed); }},*/
            'RDL': {name: '打开书签侧边栏',  cmd: function(event) {SidebarUI.toggle("viewBookmarkSidebar");    }},
 
            'RULD': {name: '添加到稍后阅读',  cmd: function(event) {document.getElementById("pageAction-urlbar-_cd7e22de-2e34-40f0-aeff-cec824cbccac_").click();}},
            'RULDR': {name: '添加到稍后阅读',  cmd: function(event) {document.getElementById("pageAction-urlbar-_cd7e22de-2e34-40f0-aeff-cec824cbccac_").click();}},
            'LDRUL': {name: '打开鼠标手势设置文件',  cmd: function(event) {FileUtils.getFile('UChrm',['SubScript', 'MouseGestures.uc.js']).launch();}},
        },
 
 
        init: function() {
            let self = this;
            ['mousedown', 'mousemove', 'mouseup', 'contextmenu', 'DOMMouseScroll'].forEach(type => {
                gBrowser.tabpanels.addEventListener(type, self, true);
            });
            gBrowser.tabpanels.addEventListener('unload', () => {
                ['mousedown', 'mousemove', 'mouseup', 'contextmenu', 'DOMMouseScroll'].forEach(type => {
                    gBrowser.tabpanels.removeEventListener(type, self, true);
                });
            }, false);
        },
        handleEvent: function(event) {
            switch (event.type) {
            case 'mousedown':
                if (event.button == 2) {
                    (gBrowser.mPanelContainer || gBrowser.tabpanels).addEventListener("mousemove", this, false);
                    this.isMouseDownR = true;
                    this.hideFireContext = false;
                    [this.lastX, this.lastY, this.directionChain] = [event.screenX, event.screenY, ''];
                }
                if (event.button == 0) {
                    this.isMouseDownR = false;
                    this.stopGesture();
                }
                break;
            case 'mousemove':
                if (this.isMouseDownR) {
                    let[subX, subY] = [event.screenX - this.lastX, event.screenY - this.lastY];
                    let[distX, distY] = [(subX > 0 ? subX : (-subX)), (subY > 0 ? subY : (-subY))];
                    let direction;
                    if (distX < 10 && distY < 10) return;
                    if (distX > distY) direction = subX < 0 ? 'L' : 'R';
                    else direction = subY < 0 ? 'U' : 'D';
                    if (!this.xdTrailArea) {
                        this.xdTrailArea = document.createXULElement('hbox');
                        let canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas');
                        canvas.setAttribute('width', window.screen.width);
                        canvas.setAttribute('height', window.screen.height);
                        this.xdTrailAreaContext = canvas.getContext('2d');
                        this.xdTrailArea.style.cssText = '-moz-user-focus: none !important;-moz-user-select: none !important;display: -moz-box !important;box-sizing: border-box !important;pointer-events: none !important;margin: 0 !important;padding: 0 !important;width: 100% !important;height: 100% !important;border: none !important;box-shadow: none !important;overflow: hidden !important;background: none !important;opacity: 0.9 !important;position: fixed !important;z-index: 2147483647 !important;display: inline !important;';
                        this.xdTrailArea.appendChild(canvas);
                        gBrowser.selectedBrowser.parentNode.insertBefore(this.xdTrailArea, gBrowser.selectedBrowser.nextSibling);
                    }
                    if (this.xdTrailAreaContext) {
                        this.hideFireContext = true;
                        this.xdTrailAreaContext.strokeStyle = '#379395';
                        this.xdTrailAreaContext.lineJoin = 'round';
                        this.xdTrailAreaContext.lineCap = 'round';
                        this.xdTrailAreaContext.lineWidth = 3;
                        this.xdTrailAreaContext.beginPath();
                        this.xdTrailAreaContext.moveTo(this.lastX - gBrowser.selectedBrowser.screenX, this.lastY - gBrowser.selectedBrowser.screenY);
                        this.xdTrailAreaContext.lineTo(event.screenX - gBrowser.selectedBrowser.screenX, event.screenY - gBrowser.selectedBrowser.screenY);
                        this.xdTrailAreaContext.closePath();
                        this.xdTrailAreaContext.stroke();
                        this.lastX = event.screenX;
                        this.lastY = event.screenY;
                    }
                    if (direction != this.directionChain.charAt(this.directionChain.length - 1)) {
                        this.directionChain += direction;
                        StatusPanel._label = this.GESTURES[this.directionChain] ? '手势: ' + this.directionChain + ' ' + this.GESTURES[this.directionChain].name : '未知手势:' + this.directionChain;
                    }
                }
                break;
            case 'mouseup':
                if (this.isMouseDownR && event.button == 2) {
                    if (this.directionChain) this.shouldFireContext = false;
                    this.isMouseDownR = false;
                    this.directionChain && this.stopGesture();
                }
                break;
            case 'contextmenu':
                if (this.isMouseDownR || this.hideFireContext) {
                    this.shouldFireContext = true;
                    this.hideFireContext = false;
                    event.preventDefault();
                    event.stopPropagation();
                }
                break;
            case 'DOMMouseScroll':
                if (this.isMouseDownR) {
                    this.shouldFireContext = false;
                    this.hideFireContext = true;
                    this.directionChain = 'W' + (event.detail > 0 ? '+' : '-');
                    this.stopGesture();
                }
                break;
            }
        },
        stopGesture: function() {
            if (this.GESTURES[this.directionChain]) this.GESTURES[this.directionChain].cmd();
            if (this.xdTrailArea) {
                this.xdTrailArea.parentNode.removeChild(this.xdTrailArea);
                this.xdTrailArea = null;
                this.xdTrailAreaContext = null;
            }
            this.directionChain = '';
            setTimeout(() => StatusPanel._label = '', 3000);
            this.hideFireContext = true;
        }
    };
    ucjsMouseGestures.init();
})();
www.helup.com
lonely_8
非常火狐
非常火狐
  • UID30273
  • 注册日期2009-09-03
  • 最后登录2022-08-09
  • 发帖数733
  • 经验469枚
  • 威望0点
  • 贡献值86点
  • 好评度147点
  • 社区居民
  • 忠实会员
1楼#
发布于:2020-03-19 13:17
getWebNavigation()
替换为
gBrowser.webNavigation
withero
小狐狸
小狐狸
  • UID37110
  • 注册日期2011-08-29
  • 最后登录2024-03-21
  • 发帖数45
  • 经验64枚
  • 威望0点
  • 贡献值14点
  • 好评度0点
  • 社区居民
2楼#
发布于:2020-03-19 14:18
lonely_8:getWebNavigation()
替换为
gBrowser.webNavigation
回到原帖
谢谢,终于又可以用了。
www.helup.com
withero
小狐狸
小狐狸
  • UID37110
  • 注册日期2011-08-29
  • 最后登录2024-03-21
  • 发帖数45
  • 经验64枚
  • 威望0点
  • 贡献值14点
  • 好评度0点
  • 社区居民
3楼#
发布于:2020-03-27 09:27
lonely_8:getWebNavigation()
替换为
gBrowser.webNavigation
回到原帖
再请教这个脚本的一个问题,通过按住右键滑动鼠标滚轮来回切换标签页,页面的滚动条就会往下移动,有办法解决吗?在卡饭有解答通过添加display: inline !important;来解决,但是不启作用了。
www.helup.com
lonely_8
非常火狐
非常火狐
  • UID30273
  • 注册日期2009-09-03
  • 最后登录2022-08-09
  • 发帖数733
  • 经验469枚
  • 威望0点
  • 贡献值86点
  • 好评度147点
  • 社区居民
  • 忠实会员
4楼#
发布于:2020-03-27 20:58
withero:再请教这个脚本的一个问题,通过按住右键滑动鼠标滚轮来回切换标签页,页面的滚动条就会往下移动,有办法解决吗?在卡饭有解答通过添加display: inline !important;来解决,但是不启作用了。回到原帖
// ==UserScript==
// @name                 Mousegestures.uc.js
// @namespace            Mousegestures@gmail.com
// @description          自定义鼠标手势
// @author               紫云飞&黒仪大螃蟹
// @homepageURL          http://www.cnblogs.com/ziyunfei/archive/2011/12/15/2289504.html
// @include              chrome://browser/content/browser.xhtml
// @include              chrome://browser/content/browser.xul
// @include              chrome://browser/content/browser.x
// @charset              UTF-8
// ==/UserScript==
(() => {
    'use strict';
    let ucjsMouseGestures = {
        lastX: 0,
        lastY: 0,
        directionChain: '',
        isMouseDownL: false,
        isMouseDownR: false,
        hideFireContext: false,
        shouldFireContext: false,
        GESTURES: {
  
            'L': {name: '后退', cmd: () => gBrowser.webNavigation.canGoBack && gBrowser.webNavigation.goBack()},
            'R': {name: '前进', cmd: () => gBrowser.webNavigation.canGoForward && gBrowser.webNavigation.goForward()},
  
/*
            'U': {name: '向上滚动', cmd: () => goDoCommand('cmd_scrollPageUp')},
            'D': {name: '向下滚动', cmd: () => goDoCommand('cmd_scrollPageDown')},
*/            
            'U': {name: '转到页首', cmd: () => goDoCommand('cmd_scrollTop')},
            'D': {name: '转到页尾', cmd: () => goDoCommand('cmd_scrollBottom')},
  
              
              
            'W+': {name: '激活右边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(+1, true); }},
      'W-': {name: '激活左边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(-1, true); }},
      'L<R': {name: '缩放重置', cmd: function() { ucjsMouseGestures_helper.zoomReset(); }},
  
            'UD': {name: '刷新当前页面', cmd: function() { document.getElementById("Browser:Reload").doCommand();}},
            'UDU': {name: '跳过缓存刷新当前页面', cmd: function() { document.getElementById("Browser:ReloadSkipCache").doCommand();}},
            'DUDU': {name: '刷新所有页面', cmd: function() {gBrowser.visibleTabs.forEach(tab => {try {gBrowser.getBrowserForTab(tab).reload();} catch (e){}});}},
            'DU': {name: '网址向上一层', cmd:  function() { loadURI(content.location.host + content.location.pathname.replace(/\/[^\/]+\/?$/, ""));}},
  
            'RL': {name: '打开新标签', cmd:  function() { BrowserOpenTab();  }},
            'LR': {name: '添加/移除书签', cmd:  function() {document.getElementById("Browser:AddBookmarkAs").doCommand(); } },
  
        'UL': {name: '激活左边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(-1, true);}},
            'UR': {name: '激活右边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(+1, true);}},
            'ULU': {name: '激活第一个标签页', cmd:  function(event) { gBrowser.selectedTab = (gBrowser.visibleTabs || gBrowser.mTabs)[0];}},
            'URU': {name: '激活最后一个标签页', cmd: function(event) { gBrowser.selectedTab = (gBrowser.visibleTabs || gBrowser.mTabs)[(gBrowser.visibleTabs || gBrowser.mTabs).length - 1];}},
  
            'DL': {name: '恢复关闭的标签', cmd:  function() { try {                document.getElementById('History:UndoCloseTab').doCommand();            } catch (ex) {              if ('undoRemoveTab' in gBrowser) gBrowser.undoRemoveTab();              else throw "Session Restore feature is disabled."           }       }  },
            'DR': {name: '关闭当前标签', cmd: function(event) {           gBrowser.removeCurrentTab();        }},
          'LDL': {name: '关闭左侧标签页', cmd: function(event) {   for (let i = gBrowser.selectedTab._tPos - 1; i >= 0; i--) if (!gBrowser.tabs[i].pinned){ gBrowser.removeTab(gBrowser.tabs[i], {animate: true});}}},
          'RDR': {name: '关闭右侧标签页', cmd: function(event) {gBrowser.removeTabsToTheEndFrom(gBrowser.selectedTab); }},
            'LUL': {name: '关闭其他所有标签页', cmd:  function(event) {gBrowser.removeAllTabsBut(gBrowser.selectedTab); }},
            'RUR': {name: '关闭所有标签页', cmd:  function(event) { gBrowser.removeAllTabsBut(openTrustedLinkIn('about:newtab', 'current')); }},
  
            'RU': {name: '转到页首', cmd: () => goDoCommand('cmd_scrollTop')},
            'RD': {name: '转到页尾', cmd: () => goDoCommand('cmd_scrollBottom')},
  
            'LU': {name: '聚焦到地址栏', cmd: function(event) {   openLocation(); }},
            'LD': {name: '查看页面信息', cmd: function(event) {   BrowserPageInfo(); }},
  
            'RLRL': {name: '重启浏览器', cmd: function(event) {      Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);       }},
            'LRLR': {name: '重启浏览器', cmd: function(event) {      Services.startup.quit(Services.startup.eAttemptQuit | Services.startup.eRestart);       }},
            'URDLU': {name: '关闭浏览器',  cmd: function(event) {        goQuitApplication();        }},
  
            'DRU': {name: '打开附加组件',  cmd: function(event) { BrowserOpenAddonsMgr(); }},
            'URD': {name: '打开选项',  cmd: function(event) {       openPreferences(); }},
  
            'DLD': {name: '侧边栏打开当前页', cmd: function(event) { openWebPanel(document.title, gBrowser.currentURI.spec);}},
            'LDR': {name: '打开历史侧边栏',  cmd: function(event) {SidebarUI.toggle("viewHistorySidebar"); }},
            /*'RDL': {name: '打开书签工具栏',  cmd: function(event) {  var bar = document.getElementById("PersonalToolbar"); setToolbarVisibility(bar, bar.collapsed); }},*/
            'RDL': {name: '打开书签侧边栏',  cmd: function(event) {SidebarUI.toggle("viewBookmarkSidebar");    }},
  
            'RULD': {name: '添加到稍后阅读',  cmd: function(event) {document.getElementById("pageAction-urlbar-_cd7e22de-2e34-40f0-aeff-cec824cbccac_").click();}},
            'RULDR': {name: '添加到稍后阅读',  cmd: function(event) {document.getElementById("pageAction-urlbar-_cd7e22de-2e34-40f0-aeff-cec824cbccac_").click();}},
            'LDRUL': {name: '打开鼠标手势设置文件',  cmd: function(event) {FileUtils.getFile('UChrm',['SubScript', 'MouseGestures.uc.js']).launch();}},
        },
  
  
        init: function() {
            let self = this;
            ['mousedown', 'mousemove', 'mouseup', 'contextmenu', 'DOMMouseScroll'].forEach(type => {
                addEventListener(type, self, { passive: false , capture: true });
            });
            addEventListener('unload', () => {
                ['mousedown', 'mousemove', 'mouseup', 'contextmenu', 'DOMMouseScroll'].forEach(type => {
                    removeEventListener(type, self, { passive: false , capture: true });
                });
            }, false);
        },
        handleEvent: function(event) {
            switch (event.type) {
            case 'mousedown':
                if (event.button == 2) {
                    this.isMouseDownR = true;
                    this.hideFireContext = false;
                    [this.lastX, this.lastY, this.directionChain] = [event.screenX, event.screenY, ''];
                }
                if (event.button == 0) {
                    this.isMouseDownR = false;
                    this.stopGesture();
                }
                break;
            case 'mousemove':
                if (this.isMouseDownR) {
                    let[subX, subY] = [event.screenX - this.lastX, event.screenY - this.lastY];
                    let[distX, distY] = [(subX > 0 ? subX : (-subX)), (subY > 0 ? subY : (-subY))];
                    let direction;
                    if (distX < 10 && distY < 10) return;
                    if (distX > distY) direction = subX < 0 ? 'L' : 'R';
                    else direction = subY < 0 ? 'U' : 'D';
                    if (!this.xdTrailArea) {
                        this.xdTrailArea = document.createXULElement('hbox');
                        let canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas');
                        canvas.setAttribute('width', window.screen.width);
                        canvas.setAttribute('height', window.screen.height);
                        this.xdTrailAreaContext = canvas.getContext('2d');
                        this.xdTrailArea.style.cssText = '-moz-user-focus: none !important;-moz-user-select: none !important;display: -moz-box !important;box-sizing: border-box !important;pointer-events: none !important;margin: 0 !important;padding: 0 !important;width: 100% !important;height: 100% !important;border: none !important;box-shadow: none !important;overflow: hidden !important;background: none !important;opacity: 0.9 !important;position: fixed !important;z-index: 2147483647 !important;display: inline !important;';
                        this.xdTrailArea.appendChild(canvas);
                        gBrowser.selectedBrowser.parentNode.insertBefore(this.xdTrailArea, gBrowser.selectedBrowser.nextSibling);
                    }
                    if (this.xdTrailAreaContext) {
                        this.hideFireContext = true;
                        this.xdTrailAreaContext.strokeStyle = '#379395';
                        this.xdTrailAreaContext.lineJoin = 'round';
                        this.xdTrailAreaContext.lineCap = 'round';
                        this.xdTrailAreaContext.lineWidth = 3;
                        this.xdTrailAreaContext.beginPath();
                        this.xdTrailAreaContext.moveTo(this.lastX - gBrowser.selectedBrowser.screenX, this.lastY - gBrowser.selectedBrowser.screenY);
                        this.xdTrailAreaContext.lineTo(event.screenX - gBrowser.selectedBrowser.screenX, event.screenY - gBrowser.selectedBrowser.screenY);
                        this.xdTrailAreaContext.closePath();
                        this.xdTrailAreaContext.stroke();
                        this.lastX = event.screenX;
                        this.lastY = event.screenY;
                    }
                    if (direction != this.directionChain.charAt(this.directionChain.length - 1)) {
                        this.directionChain += direction;
                        StatusPanel._label = this.GESTURES[this.directionChain] ? '手势: ' + this.directionChain + ' ' + this.GESTURES[this.directionChain].name : '未知手势:' + this.directionChain;
                    }
                }
                break;
            case 'mouseup':
                if (this.isMouseDownR && event.button == 2) {
                    if (this.directionChain) this.shouldFireContext = false;
                    this.isMouseDownR = false;
                    this.directionChain && this.stopGesture();
                }
                break;
            case 'contextmenu':
                if (this.isMouseDownR || this.hideFireContext) {
                    this.shouldFireContext = true;
                    this.hideFireContext = false;
                    event.preventDefault();
                    event.stopPropagation();
                }
                break;
            case 'DOMMouseScroll':
                if (this.isMouseDownR) {
                    event.preventDefault();
                    event.stopPropagation();
                    this.shouldFireContext = false;
                    this.hideFireContext = true;
                    this.directionChain = 'W' + (event.detail > 0 ? '+' : '-');
                    this.stopGesture();
                }
                break;
            }
        },
        stopGesture: function() {
            if (this.GESTURES[this.directionChain]) this.GESTURES[this.directionChain].cmd();
            if (this.xdTrailArea) {
                this.xdTrailArea.parentNode.removeChild(this.xdTrailArea);
                this.xdTrailArea = null;
                this.xdTrailAreaContext = null;
            }
            this.directionChain = '';
            setTimeout(() => StatusPanel._label = '', 3000);
            this.hideFireContext = true;
        }
    };
    ucjsMouseGestures.init();
})();
zds111
小狐狸
小狐狸
  • UID34704
  • 注册日期2010-11-27
  • 最后登录2020-04-07
  • 发帖数25
  • 经验20枚
  • 威望0点
  • 贡献值10点
  • 好评度0点
  • 社区居民
  • 忠实会员
5楼#
发布于:2020-03-28 19:08
'W+': {name: '激活右边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(+1, true); }},
'W-': {name: '激活左边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(-1, true); }},
'L&lt;R': {name: '缩放重置', cmd: function() { ucjsMouseGestures_helper.zoomReset(); }},


'W+'
'W-'
'L<R'
这三个分别是什么手势?
withero
小狐狸
小狐狸
  • UID37110
  • 注册日期2011-08-29
  • 最后登录2024-03-21
  • 发帖数45
  • 经验64枚
  • 威望0点
  • 贡献值14点
  • 好评度0点
  • 社区居民
6楼#
发布于:2020-03-28 21:09
lonely_8:// ==UserScript==
// @name                 Mousegestures.uc.js
// @namespace            Mousegestures@gmail.com
// @d...
回到原帖
非常感谢,脚本的手势还是有优势的。谢~~~
www.helup.com
withero
小狐狸
小狐狸
  • UID37110
  • 注册日期2011-08-29
  • 最后登录2024-03-21
  • 发帖数45
  • 经验64枚
  • 威望0点
  • 贡献值14点
  • 好评度0点
  • 社区居民
7楼#
发布于:2020-03-28 21:12
zds111:'W+': {name: '激活右边的标签页', cmd: function(event) { gBrowser.tabContainer.advanceSelectedTab(+1, true); }},
'W-': {name: '激...
回到原帖
'W+'  = 按住右键向下滚动
'W-'   = 按住右键向上滚动
'L<R'  = 按住右键再按左键,或者是反过来,不记得了,这个不能用。
www.helup.com
zds111
小狐狸
小狐狸
  • UID34704
  • 注册日期2010-11-27
  • 最后登录2020-04-07
  • 发帖数25
  • 经验20枚
  • 威望0点
  • 贡献值10点
  • 好评度0点
  • 社区居民
  • 忠实会员
8楼#
发布于:2020-03-29 13:51
withero:'W+'  = 按住右键向下滚动
'W-'   = 按住右键向上滚动
'L<R'  = 按住右键再按左键,或者是反过来,不记得了,这个不能用。
回到原帖
'L<R'
旧版Firefox我一直用,  哪位能修复下吗, 这个摇杆手势很有用, 我用在快速到网页尾和到网页顶
withero
小狐狸
小狐狸
  • UID37110
  • 注册日期2011-08-29
  • 最后登录2024-03-21
  • 发帖数45
  • 经验64枚
  • 威望0点
  • 贡献值14点
  • 好评度0点
  • 社区居民
9楼#
发布于:2020-03-31 19:05
zds111:'L<R'
旧版Firefox我一直用,  哪位能修复下吗, 这个摇杆手势很有用, 我用在快速到网页尾和到网页顶
回到原帖
摇杆手势 是啥?
www.helup.com
zds111
小狐狸
小狐狸
  • UID34704
  • 注册日期2010-11-27
  • 最后登录2020-04-07
  • 发帖数25
  • 经验20枚
  • 威望0点
  • 贡献值10点
  • 好评度0点
  • 社区居民
  • 忠实会员
10楼#
发布于:2020-03-31 20:39
withero:摇杆手势 是啥?回到原帖
就你说的" 按住右键再按左键,或者是反过来", FireGuestures里有写
nofoghu
小狐狸
小狐狸
  • UID10984
  • 注册日期2006-01-06
  • 最后登录2022-03-02
  • 发帖数11
  • 经验12枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
11楼#
发布于:2020-04-16 21:18
哇,非常感谢。
终于解决了
点球射飞
火狐狸
火狐狸
  • UID24757
  • 注册日期2008-06-18
  • 最后登录2024-04-04
  • 发帖数168
  • 经验45枚
  • 威望0点
  • 贡献值24点
  • 好评度0点
  • 社区居民
  • 忠实会员
12楼#
发布于:2020-04-22 12:49
感谢 很好
我的Firefox
游客

返回顶部