def get_extension_dirurl(ctx, extid):
    """Get extension directory url from the extension id."""
    pip_name = '/singletons/com.sun.star.deployment.PackageInformationProvider'
    if ctx.hasByName(pip_name):
        pip = ctx.getByName(pip_name)
        return pip.getPackageLocation(extid)
    return ''