"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
async function setPageDomOverrides(domOverrides, data, page) {
    const script = domOverrides.build('page');
    const promises = [];
    for (const { name, fn } of script.callbacks) {
        promises.push(page.addPageCallback(name, fn, false));
    }
    // overrides happen in main frame
    promises.push(page.addNewDocumentScript(script.script, false));
    await Promise.all(promises);
}
exports.default = setPageDomOverrides;
//# sourceMappingURL=setPageDomOverrides.js.map