Surfingkeys icon indicating copy to clipboard operation
Surfingkeys copied to clipboard

希望增加 OZ 知乎快捷搜索框和暗黑模式

Open xj179 opened this issue 2 years ago • 6 comments

以前是手动添加可以正常运行,但经常有时候更新版本后,老是提示 按键未映射啥 的。最后我又只能恢复默认的了(不然一打开网页就弹那个按键未映射)。希望能系统默认增加oz 弹出知乎搜索框。最后能增加傻瓜式的黑暗模式吗?那样不用自己手动配置了。现在各种软件都基本上有暗黑模式选项了

xj179 avatar Mar 09 '22 03:03 xj179

我在edge中添加了如下,就可以使用了 // click Save button to make above settings to take effect. api.addSearchAlias('z', '知乎搜索', 'https://www.zhihu.com/search?type=question&q=','s'); api.mapkey('oz', '#8打开知乎搜索栏', function() { api.Front.openOmnibar({type: "SearchEngine", extra: "z"}); }); 但是在chrome中添加会报错如下,有知道怎么解决的吗 [SurfingKeys] Error found in settings: ReferenceError: mapkey is not defined

tiaotiaonianhua avatar Mar 12 '22 16:03 tiaotiaonianhua

我在 edge 中添加了如下,就可以使用了 // click Save button to make above settings to take effect. api.addSearchAlias ('z', ' 知乎搜索 ', 'https://www.zhihu.com/search?type=question&q=','s'); api.mapkey ('oz', '#8 打开知乎搜索栏 ', function () { api.Front.openOmnibar({type: "SearchEngine", extra: "z"}); }); 但是在 chrome 中添加会报错如下,有知道怎么解决的吗 [SurfingKeys] Error found in settings: ReferenceError: mapkey is not defined

我这以前在chrome和edge上面添加了都行呢,就是有时候 插件自动更新后,有时候就会弹出这个按键未定义。

xj179 avatar Mar 16 '22 09:03 xj179

就是chrome上的插件自动更新后弹出的,重装surfingkey后就解决啦。

tiaotiaonianhua avatar Mar 16 '22 09:03 tiaotiaonianhua

surfingkey 但这不是一个完美的解决方案,每次更新后要重装插件挺麻烦的。希望作者还是能修复这个bug吧。

xj179 avatar Mar 21 '22 00:03 xj179

@xj179 @tiaotiaonianhua 可以使用下面的设置方式:

api.addSearchAlias('z', '知乎', 'https://www.zhihu.com/search?type=content&q=', 's', null, function(response) {
    var res = JSON.parse(response.text);
    return res.map(function(r){
        return r.phrase;
    });
});

gengdz avatar May 03 '22 05:05 gengdz

@xj179 @tiaotiaonianhua @gengdz About the display of search suggestions, here is my solution✌️:

api.addSearchAlias("z",  "zhihu",  "https://www.zhihu.com/search?q=",  "s",  "https://www.zhihu.com/api/v4/search/suggest?q=",  (response) => {
    const res = JSON.parse(response.text);
    const suggest = res.suggest;
    return suggest.map((r) => r.query);
  }
);

At least it is working well at the moment. May be able to use chrome devtools to get other website`s suggestions-return api by watching network connection.

dorian-li avatar Aug 05 '22 13:08 dorian-li