错误:拒绝访问属性'addEventListener'的权限 [英] Error: Permission denied to access property 'addEventListener'

查看:398
本文介绍了错误:拒绝访问属性'addEventListener'的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试打开一个窗口,其中包含已下载pdf的url。但它抛出错误错误:权限被拒绝访问属性'addEventListener'。错误出现在firefox中,在chrome中工作正常。

I am trying to open a window with url passed of a pdf downloaded. but it throws error "Error: Permission denied to access property 'addEventListener'". The error show up in firefox, in chrome it is working fine.

我用Google搜索并发现它是由于跨域策略。以下是我的代码

I googled and figured out it is due to the cross domain policy.Given below is my code

var printWindow = window.open(fileUrl, 'Print', 'left=0, top=0, width=' + pdfResolution.w + ', height=' + pdfResolution.h + ', toolbar=0, resizable=0');

                printWindow.addEventListener('load', function () {
                    printWindow.print();
                }, true);

此外,生成的fileUrl类似于blob:https%3A // domain.com / e597b770-8d11 -48ab-b458-782af519be27

Also, the fileUrl generated is like blob:https%3A//domain.com/e597b770-8d11-48ab-b458-782af519be27

建议我如何超越此限制,以便打开下载pdf的打印预览。

Suggest how can i surpass this restriction so that i open the print preview for the downloaded pdf.

推荐答案

一周之后,我禁用牵强木偶为FF(java):

After a week I disable marionette for FF (java):

功能。 setCapability(marionette,false);

维修一切

这篇关于错误:拒绝访问属性'addEventListener'的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆