MCPcopy
hub / github.com/webpack/webpack-dev-server / ensureOverlayExists

Function ensureOverlayExists

client-src/overlay.js:550–569  ·  view source on GitHub ↗

* @param {(element: HTMLDivElement) => void} callback callback * @param {string | false | undefined} trustedTypesPolicyName trusted types policy name

(callback, trustedTypesPolicyName)

Source from the content-addressed store, hash-verified

548 * @param {string | false | undefined} trustedTypesPolicyName trusted types policy name
549 */
550 function ensureOverlayExists(callback, trustedTypesPolicyName) {
551 if (containerElement) {
552 // @ts-expect-error https://github.com/microsoft/TypeScript/issues/30024
553 containerElement.innerHTML = overlayTrustedTypesPolicy
554 ? overlayTrustedTypesPolicy.createHTML("")
555 : "";
556 // Everything is ready, call the callback right away.
557 callback(containerElement);
558
559 return;
560 }
561
562 onLoadQueue.push(callback);
563
564 if (iframeContainerElement) {
565 return;
566 }
567
568 createContainer(trustedTypesPolicyName);
569 }
570
571 // Successful compilation.
572 /**

Callers 1

showFunction · 0.85

Calls 1

createContainerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…