Chrome扩展程序:操纵数据URI内容的权限 [英] Chrome Extension: Permissions to manipulate content of data URIs

查看:456
本文介绍了Chrome扩展程序:操纵数据URI内容的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我试图执行javascript时,我得到一个异常:

p>

  tabs.executeScript中的错误:无法访问url的内容data:text / html; charset = utf-8,...。扩展清单必须请求访问此主机的权限。 

但是哪种权限适用于我?我试过 data:* < all_urls> *:// * / * - 这些都不起作用。此外, activeTab 权限并没有成功。任何想法?

解决方案

目前铬错误,扩展名无法在数据URI上工作。一个解决方案是在这将纠正这一问题,希望在Chrome 66登陆。


I am working on a Chrome extension that needs to inject scripts into data:-URI pages.

When trying to execute the javascript I get an exception:

Error during tabs.executeScript: Cannot access contents of url "data:text/html;charset=utf-8, … ". Extension manifest must request permission to access this host.

But which permission would work for me? I tried data:*, <all_urls>, *://*/* - none of these worked. Also the activeTab permission did not do the trick. Any ideas?

解决方案

It's currently a chromium bug that extensions cannot work on data URIs. A fix is going in that will rectify this, hopefully landing in Chrome 66.

这篇关于Chrome扩展程序:操纵数据URI内容的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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