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

searchSelectedWith do not work after upgrade to 1.0 #1597

Closed
dapanghu opened this issue Dec 31, 2021 · 7 comments
Closed

searchSelectedWith do not work after upgrade to 1.0 #1597

dapanghu opened this issue Dec 31, 2021 · 7 comments

Comments

@dapanghu
Copy link

dapanghu commented Dec 31, 2021

Prelude

Error details

SurfingKeys: 1.0.0

Browser: Chrome Mac OS

URL: Any website

Context

I have the code below in Surfing key settings to create a short cut to search in chinese. It worked before I upgrade to 1.0.0. But after I upgrade to 1.0.0. it never works. When I input 's' I can see the 'search in chinese' in prompt in the bottom right corner but nothing happened when I click 'c'

api.unmap('sc');
api.mapkey('sc', 'search in chinese', function() {
    searchSelectedWith("https://www.google.com/search?lr=lang_zh-CN&q=");
});

I have verifed, other mapkey in my settings still work, like below mapkey using tabOpenLink works, only those using searchSelectedWith do not work

api.mapkey('gt','Open ticktock', function() {
    tabOpenLink("https://www.dida365.com/#q/all/tasks");
});
ncaq added a commit to ncaq/surfingkeys-config that referenced this issue Jan 3, 2022
[Migrate your settings from 0.9.74 to 1.0 · brookhong/Surfingkeys Wiki](https://github.com/brookhong/Surfingkeys/wiki/Migrate-your-settings-from-0.9.74-to-1.0)
を参考に非互換変更に対応しました。

[searchSelectedWith do not work after upgrade to 1.0 · Issue #1597 · brookhong/Surfingkeys](brookhong/Surfingkeys#1597)
は対応されてないですが、
即座にエラーになるわけではないので対応を待ちます。
ncaq added a commit to ncaq/surfingkeys-config that referenced this issue Jan 3, 2022
[Migrate your settings from 0.9.74 to 1.0 · brookhong/Surfingkeys Wiki](https://github.com/brookhong/Surfingkeys/wiki/Migrate-your-settings-from-0.9.74-to-1.0)
を参考に非互換変更に対応しました。

charactersの設定はマッピング全体が終わってからでないと、
Hints状態でスクロールするキーだと思われて設定を拒否されるので注意。

[searchSelectedWith do not work after upgrade to 1.0 · Issue #1597 · brookhong/Surfingkeys](brookhong/Surfingkeys#1597)
は対応されてないですが、
即座にエラーになるわけではないので対応を待ちます。
@brookhong
Copy link
Owner

searchSelectedWith has been published in 1.0.3

@Caelestrasz
Copy link

你的恢复了吗,我的这行设置
mapkey(';t', '用谷歌翻译选中文本', function() {searchSelectedWith("https://translate.google.com/?hl=zn#auto/zn/");});
还是没用

@LawlietNot
Copy link

你的恢复了吗,我的这行设置 mapkey(';t', '用谷歌翻译选中文本', function() {searchSelectedWith("https://translate.google.com/?hl=zn#auto/zn/");};%7D)); 还是没用

打开控制台看下有没有报错

@Caelestrasz
Copy link

Caelestrasz commented Jan 17, 2022

歌翻译选中文本,我懂了,const里添加一下就行

VM69:31 Uncaught ReferenceError: searchSelectedWith is not defined
at eval (eval at (content.js:3:121026), :31:39)
at J.handleMapKey (content.js:3:55681)
at content.js:3:56831
at te (content.js:3:52597)
at keydown (content.js:3:52767)

@dapanghu
Copy link
Author

你的恢复了吗,我的这行设置 mapkey(';t', '用谷歌翻译选中文本', function() {searchSelectedWith("https://translate.google.com/?hl=zn#auto/zn/");};%7D)); 还是没用

我一开始即使是升级到了1.03 还是不行,最后我把surfingkey卸载然后重装了之后就可以了(记得卸载前复制你的设定)

@dapanghu
Copy link
Author

抱歉我刚刚又研究了下,好像不是卸载重装修复的,是要把searchSelectedWith 改成api.searchSelectedWith 才行, 比如我的现在是这样的

api.mapkey('sc', 'search in chinese', function() {
api.searchSelectedWith("https://www.google.com/search?lr=lang_zh-CN&q=");
});

@ncaq
Copy link
Contributor

ncaq commented Jan 29, 2022

I use Firefox 96.0.3 and Surfingkeys 1.0.3.
I exec,

searchSelectedWith("https://www.google.com/search?q=", false, false, "");

and I get error message.

 Error: Please use $(ref:runtime.getURL).

ncaq added a commit to ncaq/surfingkeys-config that referenced this issue Mar 2, 2022
[searchSelectedWith do not work after upgrade to 1.0 · Issue #1597 · brookhong/Surfingkeys](brookhong/Surfingkeys#1597)
が修正されないので設定側で回避。
ncaq added a commit to ncaq/surfingkeys-config that referenced this issue Mar 2, 2022
[searchSelectedWith do not work after upgrade to 1.0 · Issue #1597 · brookhong/Surfingkeys](brookhong/Surfingkeys#1597)
が修正されないので設定側で回避。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants