browsertrix-crawler/tests/custom-behaviors/custom.js
Ilya Kreymer af1e0860e4
TypeScript Conversion (#425)
Follows #424. Converts the upcoming 1.0.0 branch based on native browser-based traffic capture and recording to TypeScript. Fixes #426

---------
Co-authored-by: Tessa Walsh <tessa@bitarchivist.net>
Co-authored-by: emma <hi@emma.cafe>
2023-11-09 11:27:11 -08:00

23 lines
381 B
JavaScript

/* eslint-disable @typescript-eslint/no-unused-vars */
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");
}
}