JavaScript URL 解析 パラメータ取得

let url = new URL(this.templateInfo.adSrcUrl);
if(this.templateInfo.adSrcUrl.includes('xxx.com')) {
    let params = url.searchParams;
    if(params.get('ids')) {
        this.templateInfo.adSrcUrl = this.previewBaseUrl + params.get('ids');
    }
}