@codepress/design-kit 0.2.0 → 0.2.1
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/package.json +1 -1
- package/src/capture-pages.mjs +5 -2
package/package.json
CHANGED
package/src/capture-pages.mjs
CHANGED
|
@@ -330,9 +330,12 @@ async function capturePage(context, page, viewport, run) {
|
|
|
330
330
|
requestAnimationFrame(() => requestAnimationFrame(resolve)),
|
|
331
331
|
);
|
|
332
332
|
});
|
|
333
|
+
// A page's path may carry a query (`?tab=settings`), which the app may
|
|
334
|
+
// rewrite; only a different pathname is a redirect.
|
|
333
335
|
const finalPath = new URL(tab.url()).pathname;
|
|
334
|
-
|
|
335
|
-
|
|
336
|
+
const wantPath = new URL(page.path, baseUrl).pathname;
|
|
337
|
+
if (finalPath !== wantPath)
|
|
338
|
+
throw new Error(`redirected from ${wantPath} to ${finalPath}`);
|
|
336
339
|
|
|
337
340
|
// The serialized DOM keeps no scroll, so neither does the screenshot.
|
|
338
341
|
await tab.evaluate(() => {
|