This may only be needed if the network tools are not being captured properly, or at all. Otherwise, you can safely ignore this page.

This issue is sometimes observed when using PlayerZero with other third party scripts like Apollo’s GraphQL, Sentry, or DataDog.

PlayerZero wraps window.fetch and XMLHttpRequest calls during the regular course of it monitoring in order to capture performance & network errors and build better devtools.

Sometimes, when using other libraries such as Sentry, Apollo GraphQL, and DataDog RUM these other libraries wrap the window fetch object first and don’t release it back to other third party scripts like ours.

To fix this, embed this snippet in addition to your regular setup as the first tag in your <head/> of the index.html file. This helps PlayerZero get access to the fetch object first before the page loads.

<script>
  const originalFetch = window.fetch;
  if (!window["playerzero"]) window["playerzero"] = {};

  window["playerzero"]["monkey_patch_ts"] = performance.now();
  window.fetch = function (url, options) {
    // preserve arity
    if (
      window["playerzero"] &&
      window["playerzero"]["before_fetch_apply"] &&
      window["playerzero"]["after_fetch_apply"]
    ) {
      const beforeFetchApplyResult = window["playerzero"]["before_fetch_apply"](
        url,
        options
      );
      const args = arguments;
      return new Promise((resolve) => {
        originalFetch.apply(this, args).then((response) => {
          return window["playerzero"]
            ["after_fetch_apply"](response, beforeFetchApplyResult)
            .finally(() => resolve(response));
        });
      });
    } else return originalFetch.apply(this, arguments);
  };
</script>