The problem I have boils down to the following. I have 2 pages with reCAPTCHA. Say, I open the first one. Then the second one, then first, then second, and so on. After all of these manipulations the window.___grecaptcha_cfg.clients variable has grown to contain references to widgets that no longer exist on the page. I'm using explicit rendering of reCAPTCHA, and call "grecaptcha.reset(widgetId)" method before the recaptcha container element is removed from DOM. Yet, for some reason, not everything is being cleaned up.
The other thing I ran into is - it looks like some of the "setTimeout" for recaptcha is not being cleaned up either. I think its about recaptcha after extensive Angular/Zone.js debugging, which finally pointed me to a function inside recaptcha__en.js. Basically, my protractor-based tests fail because of the macroTasks leftovers from recaptcha, even though recaptcha is no longer present on the page.
I would appreciate any guidance on how to fully destroy recaptcha after it's no longer needed.