Vimium: 我已经创建了一个分支 [here](https://github.com/mrmr1993/vimium/tree/right-click-linkhint),它应该使用 `LinkHints.activateModeToTriggerRightClickAction` 命令来解决这个问题。

创建于 2018-09-24  ·  3评论  ·  资料来源: philc/vimium

这似乎是一个需求量很低的功能,所以我不希望很快在发布的版本中看到它。

_最初由@ mrmr1993 发布在https://github.com/philc/vimium/issues/874#issuecomment -63235870_

最有用的评论

我已经将近一年没有在 Vimium 上工作了,但我认为这是针对我的……

如果您想显示 Chrome 自己的上下文菜单,我很确定这仍然无法使用任何方法。 但是,该分支触发一个 javascript 事件处理程序,设置为拦截click / mousedown / mouseup鼠标右键单击事件或contextmenu事件。

如果这是您想要的,基于快速浏览 ae829c8cf8d2bc507653451d9ad940dc5e47d96f(该分支中的提交)和当前主控,您应该能够:

  • 直接应用background_scripts/commands.coffee的更改
  • 复制simulateContextMenuEvent了加lib/dom_utils.coffee
  • 将按钮参数添加到simulateClick (如在该提交中)并将其传递给simulateMouseEvent ,它应该将最终的0参数替换为mouseEvent.initMouseEvent
  • 此条件中的某处添加button == 0的支票
  • 将以下内容添加到content_scripts/link_hints.coffee ,靠近其他类似的行:
RIGHT_CLICK = 
  name: "right-click"
  indicator: "Right click"
  linkActivator: (link) ->
    DomUtils.simulateClick(link, {
      altKey: false,
      ctrlKey: false,
      metaKey: false }, 2)
    DomUtils.simulateContextMenuEvent link
  • RIGHT_CLICK中将available_modes content_scripts/link_hints.coffee
  • activateModeToTriggerRightClickAction (count) -> <strong i="37">@activateMode</strong> count, mode: RIGHT_CLICK其他类似行附近添加content_scripts/link_hints.coffee

我对参与这个不感兴趣,所以我可能不会再回复了,但祝你好运!

所有3条评论

嗨,您能向我解释一下如何实现上述命令吗? 我希望能够右键单击 vimium 中的链接。 谢谢!

我已经将近一年没有在 Vimium 上工作了,但我认为这是针对我的……

如果您想显示 Chrome 自己的上下文菜单,我很确定这仍然无法使用任何方法。 但是,该分支触发一个 javascript 事件处理程序,设置为拦截click / mousedown / mouseup鼠标右键单击事件或contextmenu事件。

如果这是您想要的,基于快速浏览 ae829c8cf8d2bc507653451d9ad940dc5e47d96f(该分支中的提交)和当前主控,您应该能够:

  • 直接应用background_scripts/commands.coffee的更改
  • 复制simulateContextMenuEvent了加lib/dom_utils.coffee
  • 将按钮参数添加到simulateClick (如在该提交中)并将其传递给simulateMouseEvent ,它应该将最终的0参数替换为mouseEvent.initMouseEvent
  • 此条件中的某处添加button == 0的支票
  • 将以下内容添加到content_scripts/link_hints.coffee ,靠近其他类似的行:
RIGHT_CLICK = 
  name: "right-click"
  indicator: "Right click"
  linkActivator: (link) ->
    DomUtils.simulateClick(link, {
      altKey: false,
      ctrlKey: false,
      metaKey: false }, 2)
    DomUtils.simulateContextMenuEvent link
  • RIGHT_CLICK中将available_modes content_scripts/link_hints.coffee
  • activateModeToTriggerRightClickAction (count) -> <strong i="37">@activateMode</strong> count, mode: RIGHT_CLICK其他类似行附近添加content_scripts/link_hints.coffee

我对参与这个不感兴趣,所以我可能不会再回复了,但祝你好运!

+1 我很想看到这种变化。 我专门使用大量应用程序的网络版本,因此我可以使用 vimium 进行导航。 可悲的是,其中一些需要右键单击才能完全正常运行(看着您的 Spotify)。

此页面是否有帮助?
0 / 5 - 0 等级