BrowserAutomationStudio allow to execute custom javascript code in thread context. “Custom” action can help you with that: