Page 1 of 1

关于sidki的sUserJS

Posted: Jul 23 2008, 14:31
by ddbb
刚才研究sidki加JS
看到了IncludeExclude-U.ptxt里 有这么一段.....
## insert user script $SET(sUserJS=JS_CODE)
##
## JS_CODE can be any valid JS code, like:
## var foo = "bar", check = true; function test() {}
## ----------------------------------------------------------------------------
看上去应该是自己加JS用的......
可是我试了一下 怎么都试不出来
我试过了

Code: Select all

www.google.com    var foo = "bar", check = true; function test() {}   $SET(sUserJS=JS_CODE)
var foo = "bar", check = true; function test() {}   $SET(sUserJS=JS_CODE)
www.google.com    var foo = "bar", check = true; function test() {}
去网页里直接看src......都没找到 var foo = "bar", check = true; function test()
是我理解错了么???

Re: 关于sidki的sUserJS

Posted: Jul 23 2008, 14:36
by phoenix
试试:

Code: Select all

www.google.com/		$SET(sUserJS=var foo = "bar", check = true; function test() {})

Re: 关于sidki的sUserJS

Posted: Jul 23 2008, 14:39
by ddbb
:cry:

这么快.........

好用了.........原来是这样..........

:oops:

为什么我就没想到...........-_-

Re: 关于sidki的sUserJS

Posted: Jul 23 2008, 14:52
by ddbb
顺便说一下......
发现了sidki的一个小BUG
我在IncludeExclude-U.ptxt里加了一句 用来显示baidu贴吧的发言框

Code: Select all

tieba.baidu.com       $SET(0=a_adcont_i.)
然后又加了一个

Code: Select all

tieba.baidu.com       $SET(sUserJS=var foo = "bar", check = true; function test() {})
JS能正常出来 但是第一句那个a_adcont_i就没有效果了.....发言框被过滤掉
把JS那句删掉 发言框就出来了

Re: 关于sidki的sUserJS

Posted: Jul 23 2008, 15:08
by phoenix
不是bug。Proxomitron在扫描blockfile的时候,遇到第一个匹配项后即停止扫描了。IncludeExclude-U.ptxt文件开头的注释中也有解释,你看下。

另外,在URL后面加“/”会是个好习惯,详情参考 帮助文件 中的Blocklist Indexing (hashes)部分。

所以,正确的写法应该是:

Code: Select all

tieba.baidu.com/       $SET(0=a_adcont_i.) $SET(sUserJS=var foo = "bar", check = true; function test() {})

Re: 关于sidki的sUserJS

Posted: Jul 23 2008, 15:45
by ddbb
差不多明白了........
现在终于两个效果都有了.......
麻烦你了.....

Re: 关于sidki的sUserJS

Posted: Mar 13 2010, 21:41
by red
抱歉,不想新开一贴。看到ph提及Blocklist Indexing (hashes),当初看help的时候就有不明白
URL style hashes...It works by looking in the expression for the end of the hostname (marked by a ":" or "/") and indexes back from there. For it to work there must be no other wildcards between the hostname's end and the leading wildcard. Valid wildcards include "*", "\w", "[...]+", "[...]++", and "(...|)".
help里给出几个例子,其余的蛮好懂,这2个不太明白
*somehost.com/(anything|after|here|is|fine)/\w.html
(http://www.|)somehost.com:[0-9]+/
1、URL style hashes难道不是都以":" 或者"/"结尾的吗,比如上面的第1个例子
2、第2个例子开头与结尾不是还有个[0-9]+,[0-9]不算wildcard?

Re: 关于sidki的sUserJS

Posted: Mar 14 2010, 01:18
by Bonnie
应该是只要一部分符合就会索引全部
比如第一个例子的*somehost.com/满足索引要求,第二个的(http://www.|)somehost.com:满足索引要求,
另外就是要足够长,两种索引好像都必须要超过10个可索引字符才会被索引。

Re: 关于sidki的sUserJS

Posted: Mar 14 2010, 09:21
by red
"fixed prefix"在help中是有如下说明
The longer the prefix is before any wildcard, the more indexable it becomes.
看来"URL style hashes" 与"fixed prefix" 一样,只是没有写明
多谢讲解