Angular 使用Chrome ad块在角度块中渲染PDF

Angular 使用Chrome ad块在角度块中渲染PDF,angular,typescript,adblock,Angular,Typescript,Adblock,我的设置如下所示: getDocumentPdf(name: string) { this.pdfService.getPdfFile(name).subscribe((data) => { const file = new Blob([data], {type:'application/pdf'}); const fileUrl = URL.createObjectURL(file); window.open(fileUrl); }); } PDF服务是: getPdfFi

我的设置如下所示:

getDocumentPdf(name: string) {
this.pdfService.getPdfFile(name).subscribe((data) => {
  const file = new Blob([data], {type:'application/pdf'});
  const fileUrl = URL.createObjectURL(file);
  window.open(fileUrl);
});
}

PDF服务是:

getPdfFile(name: string) {
    const url = environment.apiUrl + '/files/';
    const httpOpt = {
        'responseType': 'arraybuffer' as 'json'
    };

    return this.http.get<any>(url + name, httpOpt);
}
getPdfFile(名称:string){
const url=environment.apirl+'/files/';
常数httpOpt={
'responseType':'arraybuffer'作为'json'
};
返回this.http.get(url+name,httpOpt);
}
使用chrome时,弹出窗口被阻止。使用incognito解决了这个问题,但我希望用户使用标准浏览器访问它

亲切问候,