@robotical/martyblocksjr 3.5.32 → 3.5.33

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robotical/martyblocksjr",
3
- "version": "3.5.32",
3
+ "version": "3.5.33",
4
4
  "description": "ScratchJr",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -62,9 +62,16 @@ async function getTutorialFrame(page) {
62
62
  await page.waitForFunction(() => {
63
63
  const iframe = document.getElementById("htmlcontents");
64
64
  return iframe && iframe.tagName === "IFRAME" && iframe.src.includes("inapp/tutorials.html");
65
- });
65
+ }, { timeout: 30_000 });
66
+
67
+ await page.waitForFunction(() => {
68
+ const iframe = document.getElementById("htmlcontents");
69
+ const frameLocation = iframe?.contentWindow?.location?.href;
70
+ return typeof frameLocation === "string" && frameLocation.includes("/inapp/tutorials.html");
71
+ }, { timeout: 30_000 });
66
72
 
67
- const frame = page.frames().find((entry) => entry.url().includes("/inapp/tutorials.html"));
73
+ const iframeHandle = await page.$("#htmlcontents");
74
+ const frame = iframeHandle ? await iframeHandle.contentFrame() : null;
68
75
  if (!frame) {
69
76
  throw new Error("Tutorial frame not found");
70
77
  }