本帖最后由 kidzgy 于 2023-8-8 01:57 编辑
【extensions.json】内容- "rootURI":"jar:file:///D:/Firefox115/Profiles/extensions/uBlock0@raymondhill.net.xpi!/","location":"app-profile"
- "path":"D:\\Firefox115\\Profiles\\extensions\\s3google@translator.xpi","skinnable":false,
复制代码 【sed.bat】内容- @ECHO OFF&(PUSHD "%~DP0")
- set "firefox=%~dp0"
- sed.exe -i -r "s#(jar:file:\/\/\/)[^^,]+(profiles\/extensions|browser\/features)\/#\1%firefox:\=/%\2#gi" "extensions.json"
- sed.exe -i -r "s#(\"path\":\")[^^,]+(profiles\\\\extensions^|browser\\\\features)#\1%firefox:\=\\\\%\2#gi" "extensions.json"
- exit
复制代码
有个问题不明白,sed第一个替换语句,竖线【|】前是不用加【^】的,加了反而没有效果,第二个语句却是要加【^】,删除了反而没有效果。这两者为什么一个要加,一个不用加,百思不得其解。 |