Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用F点击链接未在后台打开 #2

Closed
iliuyuyang opened this issue Feb 15, 2017 · 13 comments
Closed

使用F点击链接未在后台打开 #2

iliuyuyang opened this issue Feb 15, 2017 · 13 comments
Labels

Comments

@iliuyuyang
Copy link

默认状态下vimium的f和F逻辑是"在当前标签页打开链接"和"新建标签并在后台打开链接",但在使用vimium++的时候感觉存在bug,使用F不是新建标签并在后台打开,而是新建标签后跳转到新建的标签。

重新绑定LinkHints.activateModeToOpenInNewTab后未解决问题,感觉是函数有错误。

@gdh1995
Copy link
Owner

gdh1995 commented Feb 16, 2017

能说下你用的Vimium++的版本、是哪个url上的哪个超链接,和Chrome版本吗?

@iliuyuyang
Copy link
Author

基本上是所有超链接哦。使用的是 58.0.3014.0(正式版本)canary (64 位)

@gdh1995
Copy link
Owner

gdh1995 commented Feb 16, 2017

使用的是Vimium++的master版还是应用商店版?版本号显示的是1.58beta吗?

@iliuyuyang
Copy link
Author

应用商店版 1.58beta

@gdh1995
Copy link
Owner

gdh1995 commented Feb 16, 2017

我刚在Chrome 58.0.3013.0 x64上测试了master 和 应用商店版,在空配置时F正常,在推荐配置的下Fg正常。测试页面是https://m.baidu.com/?pu=sz%401328_100

Chrome下载自https://api.shuax.com/tools/getchrome
商店版是我从https://github.com/gdh1995/vimium-plus/releases/download/v1.57.6/vimium_plus_1.57.6.crx
解压出来的,貌似我自己制作的crx还是有点问题(确认了,其实没问题)

@iliuyuyang
Copy link
Author

发了一段视频到你邮箱里面,你看下吧。我这边用的mac,难道是这的原因吗?

@iliuyuyang
Copy link
Author

经测试这问题在window下的chrome不存在,应该是系统差异。

@gdh1995
Copy link
Owner

gdh1995 commented Feb 16, 2017

我没收到邮件,mac我没法测试,你可以用developer tools来debug下content/link_hints.js里的DEFAULT.activator,看看this.mode和onMac是多少。

Vimium判断了Mac系统,如果是mac则会使用metaKey,windows下用ctrlKey,来模拟单击链接。你试试你的Mac下“metaKey+鼠标左键单击”能不能触发”后台创建新标签页打开网址“吧。

@iliuyuyang
Copy link
Author

确实是你说的原因,我fork一个来改改,谢谢了。

@gdh1995
Copy link
Owner

gdh1995 commented Feb 16, 2017

这个地方不太好轻易改,你能测试下Chrome55/56下的情况吗?需要确定这个问题是一直有还是某些个Chrome版本后才有。而且金丝雀/dev版改动很频繁,有可能过几天这个问题就被Chrome给抹平成不存在了,最好在stable版本上确认下。

@gdh1995
Copy link
Owner

gdh1995 commented Feb 16, 2017

另外这个项目现在用了typescript,如果你不方便安装,可以把1.57.6这个tag给checkout出来,那个版本应该还是全javascript的,然后再修改。

另一种方式是,把github上release的1.57.6的crx文件解压了,然后改js文件,改好之后再去改git仓库里对应的位置并提交。

或者就安装typescript吧,不过官方的typescript在编译的时候会报一些error,不用管。

@iliuyuyang
Copy link
Author

稳定版中测试问题依然存在,应该是win和osx的键位设置不同所致。

gdh1995 added a commit that referenced this issue Mar 4, 2017
This is better than PR #5

The bug in #2 is because `onMac` is computed before `Settings.CONST.Platform` gets loaded.
@gdh1995
Copy link
Owner

gdh1995 commented Mar 4, 2017

这个问题其实是我写的代码里存在竞态条件,实际启动中先判断了平台是否是Mac,才用getPlatformInfo获取了平台信息,很明显这是个大问题。新commit里修复了。

PR #5 里用userAgent来判断是否是Mac,这个方法不能百分百保证正确,因为可以强行在开发者工具里修改Network conditions里的user agent。

这也是为什么不能在content scripts里直接用userAgent判断是不是mac,毕竟Chrome里后台环境隔离得好,更安全些。

Close #5

gdh1995 added a commit that referenced this issue Jul 26, 2019
so a same key may be used to "disable" Vimium C and then re-enable it.
* here the action "disable" will set passKeys to the "only-hooked" mode

as said in point #2 of
#55 (comment)
@gdh1995 gdh1995 added the bug label Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants