Add xhrInterceptor utility
Some features would benefit from being able to listen to calls made by
the Community Console client to the API. This way, the extension
wouldn't need to make additional calls to the API, since it can directly
get all the information from the current view via the xhrInterceptor.
This change adds a script which is injected into the Community Console
and acts as the interceptor. The src/common/xhrInterceptors.json5 file
defines which calls should be intercepted, and which data (the request
body or the response body) should be retrieved, and when the
xhrInterceptor finds that an API call matches one of those definitions,
it dispatches an event with the name defined in the json5 file and the
prefix "TWPT_". Then, content scripts can listen for these events in
order to work with the data provided in the event details.
diff --git a/templates/manifest.gjson b/templates/manifest.gjson
index e3efb13..8a9fe9d 100644
@@ -66,6 +66,7 @@