Skip to content

extensions

load_unpacked(path)

Installs an unpacked extension from the filesystem similar to --load-extension CLI flags. Returns extension ID once the extension has been installed.

Parameters:

Name Type Description Default
path str

Absolute file path.

required

Returns:

Type Description
Generator[T_JSON_DICT, T_JSON_DICT, str]

Extension id.

Source code in zendriver/cdp/extensions.py
def load_unpacked(path: str) -> typing.Generator[T_JSON_DICT, T_JSON_DICT, str]:
    """
    Installs an unpacked extension from the filesystem similar to
    --load-extension CLI flags. Returns extension ID once the extension
    has been installed.

    :param path: Absolute file path.
    :returns: Extension id.
    """
    params: T_JSON_DICT = dict()
    params["path"] = path
    cmd_dict: T_JSON_DICT = {
        "method": "Extensions.loadUnpacked",
        "params": params,
    }
    json = yield cmd_dict
    return str(json["id"])