Here is the approach:
Create a pluggable MIME filter (refer to IInternetProtocol) to monitor HTML document (mime type text/html) before it is rendered by TWebBrowser.
Here is a code example. And I highly suggest you read these documents first.
I removed the previous answer of using IDocHostUIHandler.TranslateURL, because I think it might mislead other readers, if they are in a similar situation.