我最近通过 KBX 在TomatoFlix中发现了一个错误。当用户登录 Netflix(与未登录界面不同)时,评分横幅会添加两次:
我在规则中添加了一些发射,以显示规则何时被触发。代码现在如下所示:
rule netflix_loggedin {
select when pageview "movies.netflix.com/.*?Movie/(.*)/" setting (movieTitle)
pre {
title = movieTitle.replace(re/[-_]/g, " ");
div = getRatings(title, "", "lycoflix");
}
emit <|
console.log("TomatoFlix fired!");
|>;
before("p.synopsis", div);
}
rule netflix_two {
select when pageview "movies.netflix.com/.*?Movie/(.*)/" setting (movieTitle)
emit <|
console.log("TomatoFlix second rule fired!");
|>;
}
JavaScript 控制台显示以下四行:
TomatoFlix fired!
TomatoFlix second rule fired!
TomatoFlix fired!
TomatoFlix second rule fired!
小书签或独立浏览器扩展不会发生这种情况。仅在 KBX 中。
该dispatch
块中有两个域:www.netflix.com
和movies.netflix.com
想法?