@agent-scope/render 1.18.1 → 1.19.0
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.
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -144,12 +144,14 @@ var BrowserPool = class {
|
|
|
144
144
|
const viewportWidth = config.viewportWidth ?? 1440;
|
|
145
145
|
const viewportHeight = config.viewportHeight ?? 900;
|
|
146
146
|
const acquireTimeoutMs = config.acquireTimeoutMs ?? 3e4;
|
|
147
|
+
const deviceScaleFactor = config.deviceScaleFactor ?? 2;
|
|
147
148
|
const preset = config.preset ?? "local";
|
|
148
149
|
this.config = {
|
|
149
150
|
preset,
|
|
150
151
|
size: config.size ?? { browsers: 1, pagesPerBrowser: 5 },
|
|
151
152
|
viewportWidth,
|
|
152
153
|
viewportHeight,
|
|
154
|
+
deviceScaleFactor,
|
|
153
155
|
acquireTimeoutMs
|
|
154
156
|
};
|
|
155
157
|
if (config.size) {
|
|
@@ -175,7 +177,8 @@ var BrowserPool = class {
|
|
|
175
177
|
this.browsers.push(browser);
|
|
176
178
|
for (let p = 0; p < pagesPerBrowser; p++) {
|
|
177
179
|
const page = await browser.newPage({
|
|
178
|
-
viewport: { width: this.config.viewportWidth, height: this.config.viewportHeight }
|
|
180
|
+
viewport: { width: this.config.viewportWidth, height: this.config.viewportHeight },
|
|
181
|
+
deviceScaleFactor: this.config.deviceScaleFactor
|
|
179
182
|
});
|
|
180
183
|
await page.setContent(skeleton, { waitUntil: "load" });
|
|
181
184
|
const index = this.slots.length;
|