They now have an IJavaScriptExecutor interface that can be used to replace custom extensions.
This is the C # / NUnit version.
IJavaScriptExecutor js = driver as IJavaScriptExecutor; long tableRowCount = (long)js.ExecuteScript("return $('#tableid tr').length);
Here is the Java / JUnit version:
JavascriptExecutor js = (JavascriptExecutor) driver; Object o = js.executeScript("return '123'");
source share