browsertrix-crawler/tests/custom-behaviors/custom.js

23 lines
326 B
JavaScript
Raw Normal View History

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");
}
}