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

- on first page, attempt to evaluate the behavior class to ensure it compiles - if fails to compile, log exception with fatal and exit - update behavior gathering code to keep track of behavior filename - tests: add test for invalid behavior which causes crawl to exit with fatal exit code (17)
20 lines
333 B
JavaScript
20 lines
333 B
JavaScript
export 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");
|
|
}
|
|
}
|