 });

    stack = stack.parent || stack.asyncParent;
  }

  return frames;
}

/**
 * Check if a frame is from chrome scope.
 *
 * @param {object} frame
 *     The frame to check
 *
 * @returns {boolean}
 *     True, if frame is from chrome scope
 */
export function isChromeFrame(frame) {
  return (
    frame.filename.startsWith("chrome://") ||
    frame.filename.startsWith("resource://")
  );
}
PK