Retries when ref.executeScript fails.