I am looking for some event handler or hook which allows me to inspect the response from Plone to the browser just before it goes out. I am mainly interested in the "primary" responses which usually have the content type "text/html" but that's not a must.
I already know this sorcery:
from Products.CMFCore.interfaces import ISiteRoot from zope.traversing.interfaces import IBeforeTraverseEvent def hookRequest(site, event): request = event.request # Do something gsm = zope.component.getGlobalSiteManager() gsm.registerHandler(hookRequest, (ISiteRoot, IBeforeTraverseEvent))
But I did not find the possibility to hook into the response process. I wanna be able to see what the browser sees. I tried the following instead of
IBeforeTraverseEvent but it not fire a single time.
from zope.publisher.interfaces import IEndRequestEvent
Am I thinking wrong? Can someone explain what I have to do? Thanks!