@intuned/runtime-dev 1.2.5-dev-peer → 1.2.6-dev-peer-script
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -75,13 +75,18 @@ async function getProductionPlaywrightConstructs({
|
|
|
75
75
|
session: storageState
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
const assetsFile = _path.default.join(__dirname, "./assets/
|
|
79
|
-
await context.addInitScript({
|
|
80
|
-
|
|
78
|
+
const assetsFile = _path.default.join(__dirname, "./assets/browser_scripdfdts.js");
|
|
79
|
+
await context.addInitScript(() => {
|
|
80
|
+
console.log("Initialization script executed in the browser context");
|
|
81
|
+
window.addEventListener("DOMContentLoaded", () => {
|
|
82
|
+
console.log("Page loaded - initialization script was executed successfully");
|
|
83
|
+
});
|
|
84
|
+
window.__CUSTOM_INIT_SCRIPT_LOADED__ = true;
|
|
81
85
|
});
|
|
82
86
|
let page = context.pages().at(0);
|
|
83
87
|
if (page) {
|
|
84
88
|
const scriptString = await (0, _fsExtra.readFile)(assetsFile, "utf8");
|
|
89
|
+
await page.evaluate(scriptString);
|
|
85
90
|
} else {
|
|
86
91
|
page = await context.newPage();
|
|
87
92
|
}
|