mokr.browser.viewport ===================== .. py:module:: mokr.browser.viewport Classes ------- .. autoapisummary:: mokr.browser.viewport.ViewportManager Module Contents --------------- .. py:class:: ViewportManager(client: mokr.connection.connection.DevtoolsConnection) Handler for adjusting the browser viewport. Can adjust size and enable functionality such as touchmode. :param client: `mokr.network.DevtoolsConnection` object, shared from the parent `mokr.browser.Page`. :type client: DevtoolsConnection .. py:method:: emulate_viewport(viewport: dict[str, bool | int]) -> bool :async: Run viewport adjustments based off given `viewport` parameters. Not all viewport options are considered, only: "isMobile", "width", "height", "deviceScaleFactor", "isLandscape", and "hasTouch". :param viewport: The parameters to adjust the viewport to. :type viewport: dict[str, bool | int] :raises TypeError: Raised if "width" or "height" in `viewport` are not positive integers. :returns: True to indicate if a reload of the page is needed to affect the changes sent. False if not. :rtype: bool