mirror of
https://github.com/webrecorder/browsertrix-crawler.git
synced 2025-10-19 14:33:17 +00:00

* support loading custom behaviors from a specified directory via --customBehaviors * call load() for each behavior incrementally, then call selectMainBehavior() (available in browsertrix-behaviors 0.5.1) * tests: add tests for multiple custom behaviors --------- Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
22 lines
326 B
JavaScript
22 lines
326 B
JavaScript
class TestBehavior
|
|
{
|
|
static init() {
|
|
return {
|
|
state: {}
|
|
};
|
|
}
|
|
|
|
static get id() {
|
|
return "TestBehavior";
|
|
}
|
|
|
|
static isMatch() {
|
|
return window.location.origin === "https://example.com";
|
|
}
|
|
|
|
|
|
async* run(ctx) {
|
|
ctx.log("In Test Behavior!");
|
|
yield ctx.Lib.getState(ctx, "test-stat");
|
|
}
|
|
}
|