public static <T> T executeScript(String script, Object... args) {
        JavascriptExecutor executor = (JavascriptExecutor) getWebDriver();
        T t = (T) executor.executeScript(script, args);
        if (isSafari()) {
            /*
             * Safari has sometimes weird timing issues. (At least on Github Actions.) So wait a bit.
             */
            wait(50);
        }
        return t;
    }
Executes JavaScript in the browser.

@param script the script to execute
@param args any arguments to the script
@param <T> the return type
@return the result of running the JavaScript
primefaces-selenium/primefaces-selenium-core/src/main/java/org/primefaces/selenium/PrimeSelenium.java