def flush(self):
        """
        Wait until history is read but no more than 10 cycles
        in case a browser session is closed.
        """
        i = 0
        while self._frame_data.is_dirty and i < 10:
            i += 1
            time.sleep(0.1)