hoothin / SearchJumper

Yet another awesome web extension for switching search engines, search everything (selection text / image / link / find in page) on any engine with a simple right click or a variety of menus and shortcuts. Build with React & Material-UI. (WIP).
https://hoothin.github.io/SearchJumper
GNU General Public License v3.0
705 stars 39 forks source link

寻找功能 #128

Open HONE13 opened 2 months ago

HONE13 commented 2 months ago

你好,大佬 请问一下,有无像 网页高亮关键字 https://greasyfork.org/zh-CN/scripts/465200-%E7%BD%91%E9%A1%B5%E9%AB%98%E4%BA%AE%E5%85%B3%E9%94%AE%E5%AD%97 小鱼标签 (UTags) - 为链接添加用户标签 https://greasyfork.org/zh-CN/scripts/460718-utags-add-usertags-to-links 希望能够给词汇高亮并添加备注(别名/标签),或者悬浮备注(别名/标签)

hoothin commented 2 months ago

image 这样吗?

hoothin commented 2 months ago

这是链接注释。 image

HONE13 commented 2 months ago

感谢大佬的回复,能不能像网页高亮关键字那样, 第一栏为网页 第二栏为注释 第三栏为关键字 网页高亮关键字缺点是空格隔开,变成单词

hoothin commented 2 months ago

不好意思我没用过你提到的脚本,但是搜索酱可以在设置页通过通配符来设定高亮规则生效的网页范围

HONE13 commented 2 months ago

[有没有这样的浏览器插件——自动给自定义列表中的词汇加悬浮触发的备注?] https://meta.appinn.net/t/topic/34564/14 找到大佬以前写的代码,我看了一下,差不多,就是没有网页限定以及多个关键词同一个注释 不是”text = "c|AA,BB:收藏“ 而是text = "c|AA:收藏 |BB:收藏“

hoothin commented 2 months ago

有的,在设置页,如下 image 预置分组就是多个关键词打包,然后在规则里调用分组名

hoothin commented 2 months ago

当你点击保存按钮的时候,会自动生成规则,此时你再微调就行了。其中网址可以用通配符,*代表多个字符,?代表一个字符 image 你希望的话,也可以通过搜索词样式来美化高亮样式。

HONE13 commented 2 months ago
"https://github.com/*": {
    "words": [
        "谢谢,希望$t{你好}"
    ]

是这样吗?谢谢,希望是关键词,{你好}是注释 多个关键词同个注释

hoothin commented 2 months ago

首先添加预置分组,添加完之后形如"@groupName": "jack|rose|谢谢|你好" 然后把关键词改为

    "words": [
        "@groupName$t{你好}",
        "@groupName1$t{你吼不吼}"
    ]
HONE13 commented 2 months ago

"https://github.com/*": { "words": [ "@groupName":谢谢|希望$t{你好}" ] 长这样的吗?

hoothin commented 2 months ago

不,你得先点击下面的添加预置分组按钮,添加分组内容。 然后把 谢谢,希望 替换为分组名 image

HONE13 commented 2 months ago

屏幕截图_29-5-2024_8558_search hoothin com

HONE13 commented 2 months ago

这样对吗?

hoothin commented 2 months ago

@github": "/关键词|注释/"这样。 内容其实是个正则

HONE13 commented 2 months ago

屏幕截图_29-5-2024_85827_search hoothin com 这把好了

HONE13 commented 2 months ago

多个关键词同个注释弄好了 那网址这一行怎么弄两个 https://sleazyfork.org/和https://greasyfork.org/

HONE13 commented 2 months ago

{ "[https://sleazyfork.org/*,https://greasyfork.org/*": { "words": [ "@github$t{你好}" ] },

这样弄的吗

hoothin commented 2 months ago

可以换用正则/https://sleazyfork\\.org/|https://greasyfork\\.org//i

hoothin commented 2 months ago

或者这样/https://(sleazyfork|greasyfork)\\.org//i

HONE13 commented 2 months ago

哦,十分感谢 已经没问题了

HONE13 commented 2 months ago

大佬请问一下,关键词里面有空格也有_ 例:app_la和app la 怎么弄

HONE13 commented 2 months ago

有万能字符来代替空格和_吗?十分感谢

hoothin commented 2 months ago

也是用正则,/app.la/ 或者 /app[ _]la/

HONE13 commented 2 months ago

然后就是如果关键词是LO(就是一个词,那么怎么只在一些LOH,LOVE,LO上使LO高光LO,而LOH,LOVE上不高光LO呢

hoothin commented 2 months ago

/LO\b/

HONE13 commented 2 months ago

赞赞赞

HONE13 commented 2 months ago
     "words": [
        "@irri$s{red}$t{权}"
    ]
},

"@irri": "/nemu\b|nemui neru\b/ 为什么设置成这样就不高光了

HONE13 commented 2 months ago

不能弄成/LOH\b|LOVE\b|LO\b/吗?

hoothin commented 2 months ago

因为你在json里直接写的话,\要替换为\\。在配置页的json里得这样写: "@irri": "/nemu\\b|nemui neru\\b/"

HONE13 commented 2 months ago

原来如此,十分感谢你的回复 我就不关闭议题了,有问题可以问你 话说不弄什么教程吗?谢谢

hoothin commented 2 months ago

不会推广,没人用啊。用户人数这么少,教程写了也没人看🥹🥹

HONE13 commented 2 months ago

话说如果有一个词是nemu| koko(本身是一个词,会发生被|隔开的情况吗?

hoothin commented 2 months ago

可以用转义符nemu\\| koko

HONE13 commented 2 months ago

ExResurrect https://sleazyfork.org/zh-CN/scripts/411277-exresurrect 大佬你看看能不能添加到该脚本,感觉挺厉害的

HONE13 commented 2 months ago

"@irri": "/nemu\b/" 有一个问题,网站里面有memu和memu memu和memu memu R 我只高光memu,但是也把memu memu和memu memu R高光了(没有添加到规则里,显示的是memu(高光) memu(高光)和memu(高光) memu(高光) R,每个memu都是分别高光的

HONE13 commented 2 months ago

不知道回复后怎么变成\b了

hoothin commented 2 months ago

用零宽断言就行了 (?<! )\\bmemu\\b(?! )

HONE13 commented 2 months ago

OK

HONE13 commented 2 months ago

用零宽断言就行了 (?<! )\\bmemu\\b(?! ) 我高光K和Ten,然后K-Ten被分别高光K和Ten 怎么才能避免被高光

hoothin commented 2 months ago

也是用零宽断言,但具体情况得具体分析,例如如果单词前后都有空格的话,那么可以用正预测断言。你可以系统学习一下正则,或者问 AI

HONE13 commented 2 months ago

好的

HONE13 commented 2 months ago

请问一下,我试着生效范围弄了,然后生效范围只能在一个网站设置吗?那网址这一行弄两个,共用一个关键字库 怎么在两个网站分别设置两个生效范围,比如在A站设置范围,B站设置范围,两个网址里有相同的关键字,那能在两个范围内高亮吗

hoothin commented 2 months ago

分开两条规则就行了,或者如果你能确保范围的选择器不重合,那么也可以在 words 数组里添加一条不同范围的

HONE13 commented 2 months ago

怎么写,这两个范围都是在不同网站弄得 $in{#artistname} $in{#favform > table.itg.glte}

hoothin commented 2 months ago

比如说,原本这样的

{
    "/https://sleazyfork.org/|https://greasyfork.org//": {
        "words": [
            "@github$t{你好}"
        ]
    }
}

改成这样

{
    "https://sleazyfork.org": {
        "words": [
            "@github$t{你好}"
        ]
    },
    "https://greasyfork.org/": {
        "words": [
            "@github$t{你好}"
        ]
    }
}
HONE13 commented 2 months ago
"https://sleazyfork.org": {
    "words": [
        "@github$t{你好}$in{#artistname}"
    ]
},
"https://greasyfork.org/": {
    "words": [
        "@github$t{你好}$in{#favform > table.itg.glte}"
    ]
}
"@github": "//"

} 是这样的吗?

hoothin commented 2 months ago

是的,另外预置分组是可以在页面中划词添加内容的,如这篇教程写的