@intuned/runtime-dev 1.6.0-dev-52-2 → 1.6.0-dev-52-4
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,11 +75,13 @@ async function getProductionPlaywrightConstructs({
|
|
|
75
75
|
session: storageState
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
-
const assetsFile = _path.default.join(__dirname, "
|
|
78
|
+
const assetsFile = _path.default.join(__dirname, "");
|
|
79
|
+
await context.addInitScript({
|
|
80
|
+
path: assetsFile
|
|
81
|
+
});
|
|
79
82
|
let page = context.pages().at(0);
|
|
80
83
|
if (page) {
|
|
81
84
|
const scriptString = await (0, _fsExtra.readFile)(assetsFile, "utf8");
|
|
82
|
-
await page.evaluate(scriptString);
|
|
83
85
|
} else {
|
|
84
86
|
page = await context.newPage();
|
|
85
87
|
}
|
|
@@ -101,12 +103,14 @@ async function getPlaywrightConstructsForMode(mode, cdpAddress, authSession) {
|
|
|
101
103
|
throw new Error("no context found");
|
|
102
104
|
}
|
|
103
105
|
const assetsFile = _path.default.join(__dirname, "./assets/browser_scripts.js");
|
|
106
|
+
await context.addInitScript({
|
|
107
|
+
path: assetsFile
|
|
108
|
+
});
|
|
104
109
|
const pages = await context.pages();
|
|
105
110
|
let page = null;
|
|
106
111
|
if (pages.length > 0) {
|
|
107
112
|
page = pages[0];
|
|
108
113
|
const scriptString = await fs.readFile(assetsFile, "utf8");
|
|
109
|
-
await page.evaluate(scriptString);
|
|
110
114
|
} else {
|
|
111
115
|
page = await context.newPage();
|
|
112
116
|
}
|