Skip to main content

American Heart Association Courses | BLS- ACLS – PALS

PALS Classes in Queens, NY | AHA Certification | GoACLS body{margin:0;font-family:Poppins,sans-serif;background:#fff}.top{background:#3d48b3;color:#fff;font-size:14px;padding:8px 20px;text-align:center} header{display:flex;justify-content:space-between;align-items:center;padding:14px 24px;border-bottom:1px solid #e3e6f2;gap:12px;flex-wrap:wrap}header img{height:48px}header a.reg{background:#f8111c;color:#fff;padding:10px 20px;border-radius:6px;text-decoration:none;font-weight:600;font-size:15px} .hero{max-width:900px;margin:28px auto 8px;padding:0 20px}.hero img{width:100%;max-width:768px;display:block;border-radius:8px}.hero figcaption{font-size:13px;color:#666;margin-top:6px}main{padding:8px 20px 40px} footer{background:#1f2566;color:#dfe3ff;padding:28px 20px;font-size:14px;text-align:center;line-height:1.7}footer a{color:#fff}.note{background:#fff7e0;border-bottom:1px solid #f7b342;font-size:13px;padding:6px 20px;text-align:center;color:#5b4300}.gp .gp-reg{display:inline-block;background:#f8111c;color:#fff;text-decoration:none;font-weight:600;font-size:14px;padding:5px 14px;border-radius:5px;white-space:nowrap} .gp .gp-reg:hover{background:#3d48b3;color:#fff} .gp td a{font-weight:500}
Preview of the proposed goacls.com/pals-queens/ page — header and footer approximate your site theme; only the center content gets pasted into WordPress.
81-28A Margaret Place Queens, NY · 718-441-0656
GoACLSCLASS Registration
Group of medical professionals practicing CPR techniques on a training dummy in a classroom setting.
Medical professionals engaged in CPR training with a dummy.
.gp{font-family:"Poppins",sans-serif;color:#333;font-size:16px;line-height:1.7;max-width:900px;margin:0 auto} .gp h1{font-size:clamp(28px,4vw,40px);line-height:1.2;color:#3d48b3;font-weight:600;margin:0 0 16px} .gp h2{font-size:clamp(21px,2.6vw,26px);line-height:1.3;color:#3d48b3;font-weight:600;margin:40px 0 12px} .gp p{margin:0 0 14px} .gp ul,.gp ol{margin:0 0 16px;padding-left:22px} .gp li{margin:4px 0} .gp a{color:#3d48b3;text-decoration:underline;text-underline-offset:2px} .gp a:hover{color:#f8111c} .gp .gp-cta{display:inline-block;background:#f8111c;color:#fff;text-decoration:none;font-weight:600;padding:12px 26px;border-radius:6px;margin:6px 0 10px} .gp .gp-cta:hover{background:#3d48b3;color:#fff} .gp .gp-key{background:#f3f5fd;border-left:4px solid #3d48b3;border-radius:6px;padding:18px 22px 6px;margin:18px 0} .gp .gp-table{width:100%;overflow-x:auto;margin:6px 0 16px} .gp table{width:100%;border-collapse:collapse;font-size:15px} @media(max-width:480px){.gp table{font-size:14px}.gp th,.gp td{padding:8px}} .gp th{background:#3d48b3;color:#fff;text-align:left;font-weight:600;padding:10px 12px} .gp td{border-bottom:1px solid #e3e6f2;padding:10px 12px;vertical-align:top} .gp tr:nth-child(even) td{background:#f8f9fd} .gp blockquote{margin:12px 0;padding:12px 18px;border-left:4px solid #4bcff8;background:#f8f9fd;border-radius:6px} .gp .gp-faq h3{font-size:17px;font-weight:600;color:#222;margin:20px 0 6px} .gp .gp-address{background:#f8f9fd;border-radius:6px;padding:16px 20px;margin:10px 0 16px} .gp .gp-links{font-size:15px}

PALS Classes in Queens, NY

GoACLS Training Center is an official American Heart Association training site (#TS17189) in Glendale, Queens. We run PALS initial and renewal courses for physicians, nurses, paramedics, and other healthcare professionals who manage emergencies involving infants and children and need an AHA eCard accepted by NYC hospitals.

Register on Enrollware or call 718-441-0656.

  • AHA PALS aligned to the 2025 Guidelines for CPR and ECC
  • Initial and renewal, in-person or hybrid
  • Same-day AHA eCard after you complete the course
  • Small classes, six days a week (every day except Wednesday), 1:00 PM–4:00 PM
  • Add BLS renewal to PALS when you register

Who this class is for

Take initial PALS if you have never held an AHA PALS card, or if your card has been expired for more than 90 days.

Take renewal if you hold a current AHA PALS card, or one that has not been expired for more than 90 days, and need a two-year update. All cards expire on the last day of the month: a card dated 03/05/2026 expires 03/31/2026. A hybrid renewal is available if you prefer to finish the online work at home.

PALS is a very specialized course, usually used in emergency departments, pediatric departments, and pediatric intensive care. It is designed for healthcare providers who direct or participate in the management of respiratory and cardiovascular emergencies and cardiopulmonary arrest in pediatric patients, including personnel in emergency response, emergency medicine, intensive care, and critical care units. Many new grads also get PALS to strengthen their resume.

What you get

The 2025 AHA PALS course is designed to improve outcomes for pediatric patients by preparing providers to recognize and intervene in respiratory emergencies, shock, and cardiopulmonary arrest, using high-performance team dynamics and high-quality individual skills. You watch the course videos at home, which allows more hands-on time in class. Classroom time covers:

  • Child and infant CPR
  • Oxygen delivery and airway management equipment
  • Intraosseous (IO) access and rapid fluid boluses
  • ECG monitoring, defibrillation, and cardioversion
  • The systematic approach to pediatric assessment
  • Management of respiratory problems, shock, bradycardia, and tachycardia, plus the cardiac arrest algorithm
  • Team communication and high-performance team dynamics, including the CPR Coach role

Pass the course and you receive an AHA PALS Provider eCard, valid two years and traceable to the Association. NYC facilities currently accept AHA cards for ACLS, BLS, and PALS.

PALS renewal in Queens

Renewal runs in the same 1:00 PM–4:00 PM classroom window as initial on the live calendar; register for the renewal product so you are not placed in an original seat. Bring proof of a current AHA PALS card, or one that has not been expired for more than 90 days. If your card has been expired for more than 90 days, use the "Expired Beyond 90 Days" option when registering, or call first.

Hybrid PALS renewal: complete the pre-assessment on the American Heart Association website (we send you the link after you register; it takes about an hour). If your skills are up to date, we will waive the classroom attendance. On the registration page, look for the Indirect / Hybrid class; there are no dates or times listed. Complete the online work, email us the results, and we will issue your new eCard.

You can add HeartCode BLS at checkout if you also need BLS on the same visit.

Glendale training center

GoACLS Training Center
81-28A Margaret Place
Glendale, Queens, NY 11385
Phone: 718-441-0656

The classroom sits in Glendale, convenient to Ridgewood, Middle Village, Maspeth, Forest Hills, and the rest of Queens. Register before you arrive. Walk-ins are not seated once class has started; registration stays open until start time.

Schedule and formats

PALS runs six days a week: Monday, Tuesday, Thursday, Friday, Saturday, and Sunday (no Wednesday classes; check Enrollware for holiday dates). Typical window: 1:00 PM–4:00 PM, usually done by 3:00 PM.

FormatBest ifNotes
In-person PALS originalFirst card, or card expired more than 90 days1:00 PM–4:00 PM
In-person PALS renewalCurrent card, or expired 90 days or less1:00 PM–4:00 PM
Hybrid PALS renewal (Indirect)You want to do the online work at homeNo class date; email us your results
ACLS + PALS comboBoth cards this cycle10:00 AM–4:00 PM; original $390, renewal $290

Complete the AHA precourse work before class: the video lessons (about 3 hours) and the Pre-course Self-Assessment covering ECG rhythms, pharmacology, and practical application (about 1 hour). A score of 70% or higher on the self-assessment is required. Bring a printed score sheet, or take a photo with your phone and text or email it to us.

Price

List prices on goacls.com (confirm at checkout; alumni, students, and facility staff use Affiliate pricing):

Returning students: choose Affiliate pricing in Enrollware. Hospital and union group employees (including 1199SEIU, Montefiore, Mt Sinai, Northwell, NYP, NYSNA, NYU, and others listed on Enrollware) can choose their group's PALS hybrid renewal at $150.

How to register

  1. Open goacls.enrollware.com.
  2. Choose PALS original or PALS renewal (or a combo).
  3. Pick date and time, then add BLS if needed.
  4. Pay online. If the date you need is not listed, register and call 718-441-0656.

Please do not use your hospital email when registering. Corporate and office groups: call the same number. Dental and medical practices can use blended online + onsite skills.

Register for PALS in Queens

What students say

GoACLS is rated 5.0 from 626 reviews on the site. Students repeatedly mention same-day cards, low-stress renewals, and instructors who stay on point.

"I renewed my ACLS, PALS, and BLS through the hybrid option… I also received my cards the very same day." — Kathleen B.
"I had an amazing experience at GoACLS in Queens… professional, welcoming, and well-organized." — Kalman L.
"I've been coming to Mr. Esposito for many years for my BLS/ACLS, he doesn't waste your time, he goes straight to the point." — Roberto R.

FAQ

Is this an AHA PALS class?

Yes. GoACLS is AHA training site #TS17189. You get an official AHA eCard, not a substitute card.

How long is PALS in Queens?

Plan on 1:00 PM–4:00 PM for the in-person initial or renewal class; it is usually done by 3:00 PM. Hybrid renewal moves the work home, and the classroom can be waived if your skills are up to date.

What if my PALS card is expired?

If it has not been expired for more than 90 days, you can take the renewal. Beyond 90 days, use the "Expired Beyond 90 Days" option when registering, or call 718-441-0656 with your expiration date.

What score do I need on the precourse self-assessment?

70% or higher. Bring the printed score sheet or a phone photo of it to class.

Do I get the eCard the same day?

After you complete all course requirements, GoACLS issues the AHA eCard the same day.

Can I do BLS the same day as PALS?

Yes. Add HeartCode BLS (or the BLS add-on) when you register for PALS or ACLS.

Can I take ACLS and PALS together?

Yes. The ACLS + PALS combo runs 10:00 AM–4:00 PM and saves $100 on original courses or $50 on renewals. You can do both courses in one day or on separate days.

Do you take walk-ins?

No. Register online before class. Registration remains open until the class start time.

Where do I park / how do I get there?

The address is 81-28A Margaret Place, Glendale, NY 11385. Call if you need parking or transit notes for your shift.

Is the course updated to 2025 AHA Guidelines?

Yes. Current PALS listings are 2025 AHA PALS Provider courses.

Map and contact

GoACLS Training Center
81-28A Margaret Place, Glendale, Queens, NY 11385
718-441-0656

{ "@context": "https://schema.org", "@graph": [ { "@type": "Course", "name": "PALS Provider Course (AHA) — Queens, NY", "description": "American Heart Association PALS initial and renewal courses aligned to the 2025 Guidelines for CPR and ECC, taught at GoACLS Training Center in Glendale, Queens.", "provider": { "@id": "https://goacls.com/#organization" }, "offers": [ { "@type": "Offer", "name": "PALS original", "price": "245", "priceCurrency": "USD", "url": "https://goacls.enrollware.com/schedule" }, { "@type": "Offer", "name": "PALS renewal", "price": "170", "priceCurrency": "USD", "url": "https://goacls.enrollware.com/schedule" } ], "hasCourseInstance": { "@type": "CourseInstance", "courseMode": "Onsite", "location": { "@type": "Place", "name": "GoACLS Training Center", "address": { "@type": "PostalAddress", "streetAddress": "81-28A Margaret Place", "addressLocality": "Glendale", "addressRegion": "NY", "postalCode": "11385", "addressCountry": "US" } } } }, { "@type": "FAQPage", "mainEntity": [ { "@type": "Question", "name": "Is this an AHA PALS class?", "acceptedAnswer": { "@type": "Answer", "text": "Yes. GoACLS is AHA training site #TS17189. You get an official AHA eCard, not a substitute card." } }, { "@type": "Question", "name": "How long is PALS in Queens?", "acceptedAnswer": { "@type": "Answer", "text": "Plan on 1:00 PM–4:00 PM for the in-person initial or renewal class; it is usually done by 3:00 PM. Hybrid renewal moves the work home, and the classroom can be waived if your skills are up to date." } }, { "@type": "Question", "name": "What if my PALS card is expired?", "acceptedAnswer": { "@type": "Answer", "text": "If it has not been expired for more than 90 days, you can take the renewal. Beyond 90 days, use the \"Expired Beyond 90 Days\" option when registering, or call 718-441-0656 with your expiration date." } }, { "@type": "Question", "name": "What score do I need on the precourse self-assessment?", "acceptedAnswer": { "@type": "Answer", "text": "70% or higher. Bring the printed score sheet or a phone photo of it to class." } }, { "@type": "Question", "name": "Do I get the eCard the same day?", "acceptedAnswer": { "@type": "Answer", "text": "After you complete all course requirements, GoACLS issues the AHA eCard the same day." } }, { "@type": "Question", "name": "Can I do BLS the same day as PALS?", "acceptedAnswer": { "@type": "Answer", "text": "Yes. Add HeartCode BLS (or the BLS add-on) when you register for PALS or ACLS." } }, { "@type": "Question", "name": "Can I take ACLS and PALS together?", "acceptedAnswer": { "@type": "Answer", "text": "Yes. The ACLS + PALS combo runs 10:00 AM–4:00 PM and saves $100 on original courses or $50 on renewals. You can do both courses in one day or on separate days." } }, { "@type": "Question", "name": "Do you take walk-ins?", "acceptedAnswer": { "@type": "Answer", "text": "No. Register online before class. Registration remains open until the class start time." } }, { "@type": "Question", "name": "Where do I park / how do I get there?", "acceptedAnswer": { "@type": "Answer", "text": "The address is 81-28A Margaret Place, Glendale, NY 11385. Call if you need parking or transit notes for your shift." } }, { "@type": "Question", "name": "Is the course updated to 2025 AHA Guidelines?", "acceptedAnswer": { "@type": "Answer", "text": "Yes. Current PALS listings are 2025 AHA PALS Provider courses." } } ] } ] }
Let's Connect — If you have a question, please call us: 718-441-0656
81-28A Margaret Place Queens, NY
About GoACLS – We are an official American Heart Association training site. All certifications are issued as eCards, which are directly traceable to the American Heart Association.
(function () { if (window === window.top) return; const allowedParentOrigins = ["https://www.perplexity.ai","https://perplexity.ai","https://testing.perplexity.ai","https://staging.perplexity.ai","https://*.preview.i.perplexity.ai","http://perplexity.localhost","http://localhost:1420","http://127.0.0.1:1420","http://localhost:3000","http://127.0.0.1:3000","http://localhost:5173","http://127.0.0.1:5173"]; const MAX_FONT_BYTES = 500 * 1024; const MAX_TOTAL_FONT_BYTES = 2 * 1024 * 1024; const DEFAULT_LINE_HEIGHT = 16; let scrollForwarding = false; let scrollRaf = 0; let trustedTopOrigin = null; // Allow entries like "https://*.preview.i.perplexity.ai" — the wildcard // matches a single DNS label (no dots), so "https://*.foo" cannot stretch // across multiple labels. function matchesAllowedOrigin(origin) { if (!origin) return false; for (const entry of allowedParentOrigins) { if (!entry.includes("*")) { if (entry === origin) return true; continue; } const pattern = new RegExp( "^" + entry.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^.]+") + "$", ); if (pattern.test(origin)) return true; } return false; } // Trust decision: when the sender is same-origin-visible (event.origin is a // real origin like https://www.perplexity.ai) we trust event.origin directly. // When event.origin is "null" (opaque broker srcdoc), we fall back to the // broker's stamped `parentOrigin` to identify the top window. The fallback // is claim-only — we rely on the browser's native `targetOrigin` enforcement // on the response path (see postToTrustedTop) to ensure replies can't be // delivered to anyone but the actual top window of that claimed origin. function getTrustedParentOrigin(event) { const forwardedParentOrigin = typeof event.data.parentOrigin === "string" ? event.data.parentOrigin : null; const parentOrigin = event.origin === "null" ? forwardedParentOrigin : event.origin; return matchesAllowedOrigin(parentOrigin) ? parentOrigin : null; } // All responses go to window.top with targetOrigin = the allowlisted origin. // An attacker that iframes us inside their own null-origin broker can claim // any parentOrigin they like, but the browser will drop the reply whenever // the real top's origin doesn't match — so the screenshot never leaves. function postToTrustedTop(message) { if (!trustedTopOrigin) return; try { window.top.postMessage(message, trustedTopOrigin); } catch (_error) {} } const PICK_CAPABILITIES = ["pick"]; const PICK_CHAIN_LENGTH = 4; const PICK_MAX_TEXT_CHARS = 120; const PICK_MAX_HTML_CHARS = 300; function truncate(value, maxChars) { return value.length > maxChars ? value.slice(0, maxChars - 1) + "…" : value; } function isPickableElement(element) { return ( element instanceof Element && element !== document.documentElement && element !== document.body ); } function resolvePickTarget(x, y) { if (!Number.isFinite(x) || !Number.isFinite(y)) return null; const element = document.elementFromPoint(x, y); return isPickableElement(element) ? element.closest("svg") || element : null; } function pickLabel(element) { if (element.id) return element.localName + "#" + element.id; return [element.localName].concat(Array.from(element.classList).slice(0, 2)).join("."); } // Only attributes that help find the element in source. data-* values and URL // query strings or fragments can carry tokens. const PICK_ATTRIBUTES = new Set([ "id", "class", "name", "type", "role", "alt", "aria-label", "href", "src", ]); function pickAttributeValue(attribute) { return attribute.name === "href" || attribute.name === "src" ? attribute.value.split(/[?#]/)[0] : attribute.value; } function describePickElement(element) { const chain = []; for ( let current = element; isPickableElement(current) && chain.length PICK_ATTRIBUTES.has(attribute.name)) .map((attribute) => ` ${attribute.name}="${pickAttributeValue(attribute).replace(/"/g, """)}"`) .join(""); const text = (element.innerText || element.textContent || "").replace(/\s+/g, " ").trim(); return { chain: chain.map(pickLabel), html: truncate(``, PICK_MAX_HTML_CHARS), text: text ? truncate(text, PICK_MAX_TEXT_CHARS) : undefined, }; } // Hover asks once per frame, and innerText on a large section forces layout, // so only the rect is re-read while the pointer stays on the same element. // Clicks ask for fresh details since the page may have changed the element. let lastPick = null; function describePickTarget(element, fresh) { if (fresh || lastPick?.element !== element) { lastPick = { element, details: describePickElement(element) }; } const rect = element.getBoundingClientRect(); return { rect: { x: rect.left, y: rect.top, width: rect.width, height: rect.height }, ...lastPick.details, }; } function inlineAll(original, clone) { if (original.nodeType !== 1 || clone.nodeType !== 1) return; try { const computedStyle = getComputedStyle(original); // cssText on a computed style is the serialized declaration in modern // Chromium/Safari — a single read beats enumerating ~400 longhand // properties. Firefox returns "" here, so we fall back on empty. const serialized = computedStyle.cssText; if (serialized) { clone.style.cssText = serialized; } else { const parts = new Array(computedStyle.length); for (let index = 0; index < computedStyle.length; index += 1) { const property = computedStyle[index]; parts[index] = `${property}:${computedStyle.getPropertyValue(property)};`; } clone.style.cssText = parts.join(""); } } catch (_error) {} const originalChildren = original.children; const clonedChildren = clone.children; for ( let index = 0; index < originalChildren.length && index m[2] && m[2].toLowerCase().includes("woff2")); if (woff2) return woff2[1]; const woff = matches.find((m) => m[2] && m[2].toLowerCase().includes("woff")); if (woff) return woff[1]; return matches[0][1]; } // Cache resolved font URL -> data URI across captures. Fonts on a page // essentially never change, and a batch run emits multiple captures back to // back — without this we'd refetch + re-base64 every time. const fontDataUriCache = new Map(); const SRC_DECLARATION_RE = /src\s*:\s*[^;}]+/i; async function fetchAsDataUri(url) { if (fontDataUriCache.has(url)) return fontDataUriCache.get(url); let dataUri = null; try { const response = await fetch(url, { mode: "cors", credentials: "omit" }); if (response.ok) { const blob = await response.blob(); if (blob.size { const reader = new FileReader(); reader.onloadend = () => resolve(typeof reader.result === "string" ? reader.result : null); reader.onerror = () => resolve(null); reader.readAsDataURL(blob); }); } } } catch (_error) { dataUri = null; } fontDataUriCache.set(url, dataUri); return dataUri; } function collectFontFaceRuleTexts() { const rules = []; for (const sheet of document.styleSheets) { let cssRules; try { cssRules = sheet.cssRules; } catch (_error) { continue; } if (!cssRules) continue; for (const rule of cssRules) { const cssText = rule.cssText || ""; if (cssText.startsWith("@font-face")) rules.push(cssText); } } return rules; } async function buildInlinedFontCss() { const ruleTexts = collectFontFaceRuleTexts(); if (ruleTexts.length === 0) return null; const resolved = ruleTexts.map((cssText) => { if (!SRC_DECLARATION_RE.test(cssText)) return null; const srcMatch = cssText.match(/src\s*:\s*([^;}]+)[;}]/i); if (!srcMatch) return null; const url = extractFontUrl(srcMatch[1]); if (!url) return null; try { return { cssText, url: new URL(url, document.baseURI).href }; } catch (_error) { return null; } }); const dataUris = await Promise.all( resolved.map((entry) => (entry ? fetchAsDataUri(entry.url) : Promise.resolve(null))), ); const inlined = []; let totalBytes = 0; for (let index = 0; index MAX_TOTAL_FONT_BYTES) break; totalBytes += approxBytes; inlined.push(entry.cssText.replace(SRC_DECLARATION_RE, `src: url("${dataUri}")`)); } return inlined.length > 0 ? inlined.join("\n") : null; } function stripExternal(clone) { const images = clone.querySelectorAll("img"); for (let index = 0; index < images.length; index += 1) { const src = images[index].getAttribute("src"); if (src && !src.startsWith("data:")) images[index].removeAttribute("src"); } const elements = clone.querySelectorAll("*"); for (let index = 0; index < elements.length; index += 1) { const style = elements[index].style.cssText; if (style && style.includes("url(")) { elements[index].style.cssText = style.replace( /url\(["']?(?!data:)[^)"']*["']?\)/gi, "none", ); } } } function emitScroll() { scrollRaf = 0; if (!scrollForwarding) return; postToTrustedTop({ type: "INLINE_EDIT_SCROLL", scrollX: window.scrollX, scrollY: window.scrollY, capabilities: PICK_CAPABILITIES, }); } window.addEventListener( "scroll", function () { if (!scrollForwarding || scrollRaf) return; scrollRaf = requestAnimationFrame(emitScroll); }, { passive: true, capture: true }, ); async function handleCaptureRequest(event) { const requestId = event.data.requestId; const scrollX = window.scrollX; const scrollY = window.scrollY; const width = window.innerWidth; const height = window.innerHeight; function postResult(dataUrl) { postToTrustedTop({ type: "INLINE_EDIT_SCREENSHOT_RESULT", requestId, dataUrl, scrollX, scrollY, }); } try { // Wait for any pending web fonts to resolve so both inline metrics and // the @font-face inlining below see the same loaded faces. if (document.fonts && document.fonts.ready) { try { await document.fonts.ready; } catch (_error) {} } const clone = document.documentElement.cloneNode(true); inlineAll(document.documentElement, clone); const removedNodes = clone.querySelectorAll("script,link[rel=\"stylesheet\"],style"); for (let index = 0; index < removedNodes.length; index += 1) { removedNodes[index].remove(); } stripExternal(clone); // Re-embed web fonts as data-URI @font-face rules so the SVG rasterizer // can resolve them — external font URLs aren't fetched during // foreignObject rendering, which would otherwise force a fallback face // and change text metrics. const inlinedFontCss = await buildInlinedFontCss(); if (inlinedFontCss) { const styleEl = document.createElement("style"); styleEl.textContent = inlinedFontCss; const head = clone.querySelector("head"); if (head) head.appendChild(styleEl); else clone.insertBefore(styleEl, clone.firstChild); } const html = new XMLSerializer().serializeToString(clone); const svg = `` + '' + `
` + `
` + html + "
"; const svgUrl = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`; const image = new Image(); image.onload = function () { const canvas = document.createElement("canvas"); canvas.width = width; canvas.height = height; canvas.getContext("2d").drawImage(image, 0, 0); postResult(canvas.toDataURL("image/png")); }; image.onerror = function () { postResult(null); }; image.src = svgUrl; } catch (_error) { postResult(null); } } window.addEventListener("message", function (event) { if (!event.data) return; // Only accept messages from the direct parent frame. Blocks sibling / // unrelated-window postMessage senders that could otherwise reach us. if (event.source !== window.parent) return; const trustedParentOrigin = getTrustedParentOrigin(event); if (!trustedParentOrigin) return; trustedTopOrigin = trustedParentOrigin; if (event.data.type === "INLINE_EDIT_PICK") { const element = resolvePickTarget(event.data.x, event.data.y); postToTrustedTop({ type: "INLINE_EDIT_PICK_RESULT", seq: event.data.seq, target: element ? describePickTarget(element, event.data.fresh === true) : null, }); return; } if (event.data.type === "INLINE_EDIT_SCROLL_START") { scrollForwarding = true; emitScroll(); return; } if (event.data.type === "INLINE_EDIT_SCROLL_STOP") { scrollForwarding = false; if (scrollRaf) cancelAnimationFrame(scrollRaf); scrollRaf = 0; return; } if (event.data.type === "INLINE_EDIT_SCROLL_BY") { const { deltaX, deltaY, deltaMode } = event.data; if (!scrollForwarding || !Number.isFinite(deltaX) || !Number.isFinite(deltaY)) return; if (deltaMode !== 0 && deltaMode !== 1 && deltaMode !== 2) return; const lineHeight = parseFloat(getComputedStyle(document.documentElement).lineHeight) || DEFAULT_LINE_HEIGHT; const scaleX = deltaMode === 1 ? lineHeight : deltaMode === 2 ? window.innerWidth : 1; const scaleY = deltaMode === 1 ? lineHeight : deltaMode === 2 ? window.innerHeight : 1; // The selection overlay receives the wheel event instead of this iframe. // Instant scrolling preserves trackpad deltas even on smooth-scroll sites. window.scrollBy({ left: deltaX * scaleX, top: deltaY * scaleY, behavior: "instant" }); emitScroll(); return; } if (event.data.type !== "INLINE_EDIT_CAPTURE_REQUEST") return; handleCaptureRequest(event); }); })();