Replacer

replace words

目前為 2024-12-13 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

作者
Shuraken007
評價
0 0 0
版本
1.4
建立日期
2024-12-13
更新日期
2024-12-13
尺寸
4.4 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/], find your source

config format:

config must be loaded on script start
load_config("https://some_source/my_config.json")

config looks this way:

{
   "https://some_novel_site/my_novel/chapter_*": [
      "效果", "属性",
      "歐皇狀態", "运气状态"
   ],
   "url2": [
      "a.s.s.", "ass",
      "/(\w)\.(\w)\.(\w)\./", "$1$2$3"
   ]
}

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