feat(cc-slowness-fix): remove unused large data from some requests

The ViewForum and ViewThread requests may contain the
User.ProfileAbuse.account_reported_abuse field in their responses which
for some users contains megabytes of data and is seemingly unused by the
Community Console.

Thus, this CL removes this data from the responses when the feature
which fixes the CC slowness and high memory usage is enabled.

Change-Id: Idef49285c29d256c5413971c80581ba4ad65cb98
diff --git a/src/xhrInterceptor/responseModifiers/index.js b/src/xhrInterceptor/responseModifiers/index.js
index 057960f..e736593 100644
--- a/src/xhrInterceptor/responseModifiers/index.js
+++ b/src/xhrInterceptor/responseModifiers/index.js
@@ -4,11 +4,15 @@
 import createMessageRemoveParentRef from './createMessageRemoveParentRef.js';
 import flattenThread from './flattenThread.js';
 import loadMoreThread from './loadMoreThread.js';
+import removeUserAbuseEventsInViewForum from './removeUserAbuseEventsInViewForum.js';
+import removeUserAbuseEventsInViewThread from './removeUserAbuseEventsInViewThread.js';
 
 export const responseModifiers = [
   loadMoreThread,
   flattenThread,
   createMessageRemoveParentRef,
+  removeUserAbuseEventsInViewForum,
+  removeUserAbuseEventsInViewThread,
 ];
 
 // Content script target
diff --git a/src/xhrInterceptor/responseModifiers/removeUserAbuseEventsInViewForum.js b/src/xhrInterceptor/responseModifiers/removeUserAbuseEventsInViewForum.js
new file mode 100644
index 0000000..eb40e8e
--- /dev/null
+++ b/src/xhrInterceptor/responseModifiers/removeUserAbuseEventsInViewForum.js
@@ -0,0 +1,16 @@
+const removeUserAbuseEventsInViewForum = {
+  urlRegex: /api\/ViewForum/i,
+  featureGated: true,
+  features: ['fixpekb269560789'],
+  isEnabled(options) {
+    return options['fixpekb269560789'];
+  },
+  async interceptor(_, response) {
+    if (response?.[1]?.[6]?.[8]?.[7]) {
+      delete response[1][6][8][7];
+    }
+    return response;
+  },
+};
+
+export default removeUserAbuseEventsInViewForum;
diff --git a/src/xhrInterceptor/responseModifiers/removeUserAbuseEventsInViewThread.js b/src/xhrInterceptor/responseModifiers/removeUserAbuseEventsInViewThread.js
new file mode 100644
index 0000000..ccaeb95
--- /dev/null
+++ b/src/xhrInterceptor/responseModifiers/removeUserAbuseEventsInViewThread.js
@@ -0,0 +1,16 @@
+const removeUserAbuseEventsInViewThread = {
+  urlRegex: /api\/ViewThread/i,
+  featureGated: true,
+  features: ['fixpekb269560789'],
+  isEnabled(options) {
+    return options['fixpekb269560789'];
+  },
+  async interceptor(_, response) {
+    if (response?.[1]?.[13]?.[8]?.[7]) {
+      delete response[1][13][8][7];
+    }
+    return response;
+  },
+};
+
+export default removeUserAbuseEventsInViewThread;