@intuned/runtime-dev 1.8.0-dev-52 → 1.9.0-dev-52
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.
|
@@ -30,23 +30,7 @@ async function setStorageState(context, state) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
if ("sessionStorage" in state && state.sessionStorage) {
|
|
34
|
-
await context.addInitScript(storage => {
|
|
35
|
-
for (const {
|
|
36
|
-
origin,
|
|
37
|
-
sessionStorage
|
|
38
|
-
} of storage) {
|
|
39
|
-
if (window.location.origin === origin) {
|
|
40
|
-
for (const item of sessionStorage) {
|
|
41
|
-
const value = window.sessionStorage.getItem(item.name);
|
|
42
|
-
if (!value) {
|
|
43
|
-
window.sessionStorage.setItem(item.name, item.value);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}, state.sessionStorage);
|
|
49
|
-
}
|
|
33
|
+
if ("sessionStorage" in state && state.sessionStorage) {}
|
|
50
34
|
await page.close();
|
|
51
35
|
}
|
|
52
36
|
async function getStorageState(context) {
|
|
@@ -76,9 +76,13 @@ async function getProductionPlaywrightConstructs({
|
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
const assetsFile = _path.default.join(__dirname, "./assets/browser_scripts.js");
|
|
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");
|
|
85
|
+
await page.evaluate(scriptString);
|
|
82
86
|
} else {
|
|
83
87
|
page = await context.newPage();
|
|
84
88
|
}
|
|
@@ -100,11 +104,15 @@ async function getPlaywrightConstructsForMode(mode, cdpAddress, authSession) {
|
|
|
100
104
|
throw new Error("no context found");
|
|
101
105
|
}
|
|
102
106
|
const assetsFile = _path.default.join(__dirname, "./assets/browser_scripts.js");
|
|
107
|
+
await context.addInitScript({
|
|
108
|
+
path: assetsFile
|
|
109
|
+
});
|
|
103
110
|
const pages = await context.pages();
|
|
104
111
|
let page = null;
|
|
105
112
|
if (pages.length > 0) {
|
|
106
113
|
page = pages[0];
|
|
107
114
|
const scriptString = await fs.readFile(assetsFile, "utf8");
|
|
115
|
+
await page.evaluate(scriptString);
|
|
108
116
|
} else {
|
|
109
117
|
page = await context.newPage();
|
|
110
118
|
}
|