Replacer

replace words

当前为 2024-12-16 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
Shuraken007
评分
0 0 0
版本
1.8
创建于
2024-12-13
更新于
2024-12-16
大小
45.0 KB
许可证
MIT
适用于
所有网站

Idea

Here is small js script for word replacements.
Json config with replacements should be store at any web source.
[https://github.com/], [https://www.npoint.io/], select any sutable

config json_url:

insert your own url at config.json_url

config traditional_to_simple_chinese

I'm reading chinese book with double translate.
I see as chinese, as translated text.
So - I added the ability to convert barely readable traditional
hieroglyphs into simplified ones.
config values: true / false

config format

config looks this way:

{
   "https://some_novel_site/my_novel/chapter_*": [
      "效果", "属性",
      "歐皇狀態", "运气状态"
   ],
   "url2": [
      "a.s.s.", "ass",
      "/(\\d+)~(\\d+)/", "($1~$2)",
      "/(?:\\s|^)(.{1,5})~(?:\\s|$)/", "⟦ $1 ⟧",
      "國足三人", ["Troitsa Of Hooligans ", "Troitsa Of Idiots ","Trinity of Jesters "],
      "космически", "пространственны",
      "космическ", "пространственн",
   ]
}

url

well, you reading some book and want to make book-specific replaces
current chapter is
https://tw.wa01.com/novel/pagea/lunhuileyuan-nayizhiwenzi_852.html

easy way *

use *, it solves 99% cases
https://tw.wa01.com/novel/pagea/lunhuileyuan-nayizhiwenzi_*
if you really have * in your url (some extreme cases) - then escape it \\*
https://tw.wa01.com/novel/\\*/lunhuileyuan-nayizhiwenzi_*

hard way full regex

  • easy way - use unique part from url, no mess with / /lunhuileyuan-nayizhiwenzi_.*/
  • full way - escape []^&$.()?/\+{}|* with \\
    https:\\/\\/tw\\.wa01\\.com\\/novel\\/pagea\\/lunhuileyuan-nayizhiwenzi_
  • add bounds /url/
    /https:\\/\\/tw\\.wa01\\.com\\/novel\\/pagea\\/lunhuileyuan-nayizhiwenzi_/
  • add your regex part /https:\\/\\/tw\\.wa01\\.com\\/novel\\/pagea\\/lunhuileyuan-nayizhiwenzi_.+/
  • example for specific chapters [1][0-9] - chapters 10 - 19
    /https:\\/\\/tw\\.wa01\\.com\\/novel\\/pagea\\/lunhuileyuan-nayizhiwenzi_[1][0-9]/

replacements

they also supports regexp
"/(?:blue|green) shadow king/i", "Цин Ган Инь"
google javascript regex if want more examples
script use function string.replaceAll(pattern, replacement)
modifier global g auto inserted

array of replacements allowed, random would be choosed
: "老三", ["Third Bro", "Younger Bro"],