@hyperframes/producer 0.4.3 → 0.4.4

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.
@@ -103853,12 +103853,20 @@ async function createCaptureSession(serverUrl, outputDir, options, onBeforeCaptu
103853
103853
  config: config2
103854
103854
  };
103855
103855
  }
103856
+ function isFontResourceError(type, text, locationUrl) {
103857
+ if (type !== "error") return false;
103858
+ if (!text.startsWith("Failed to load resource")) return false;
103859
+ return /fonts\.googleapis|fonts\.gstatic|\.(woff2?|ttf|otf)(\b|$)/i.test(
103860
+ `${locationUrl} ${text}`
103861
+ );
103862
+ }
103856
103863
  async function initializeSession(session) {
103857
103864
  const { page, serverUrl } = session;
103858
103865
  page.on("console", (msg) => {
103859
103866
  const type = msg.type();
103860
103867
  const text = msg.text();
103861
- const isFontLoadError = type === "error" && text.startsWith("Failed to load resource") && /fonts\.googleapis|fonts\.gstatic|\.woff2?(\b|$)/i.test(text);
103868
+ const locationUrl = msg.location()?.url ?? "";
103869
+ const isFontLoadError = isFontResourceError(type, text, locationUrl);
103862
103870
  const isResourceLoadError = type === "error" && text.startsWith("Failed to load resource") && !isFontLoadError;
103863
103871
  const prefix = isResourceLoadError ? "[non-blocking]" : type === "error" ? "[Browser:ERROR]" : type === "warn" ? "[Browser:WARN]" : "[Browser]";
103864
103872
  if (!isFontLoadError) {