简体   繁体   English

从Firefox扩展读取Blob URI的内容

[英]Reading content of Blob URI from Firefox extension

I am developing a Firefox extension in Javascript and have the need to read the contents of a Blob URI (eg URI of the form blob:488ab243-e325-49f7-b981-b904bd829c48). 我正在使用Javascript开发Firefox扩展,并且需要读取Blob URI的内容(例如,形式为blob:488ab243-e325-49f7-b981-b904bd829c48的URI)。

My extension works on simple test page, but when I run my Firefox extension on Google Drive, I get the error 'Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)"' 我的扩展程序可以在简单的测试页面上运行,但是当我在Google Drive上运行Firefox扩展程序时,出现错误“异常...“拒绝访问受限制的URI”代码:“ 1012” nsresult:“ 0x805303f4(NS_ERROR_DOM_BAD_URI)”

I assumed that the Firefox extension has all the privileges, so why the error 'Access to restricted URI denied'? 我假设Firefox扩展具有所有特权,那么为什么出现错误“拒绝访问受限制的URI”? Does anyone have any clues? 有人有任何线索吗? Is there a way I elevate my privilege even higher? 有什么办法可以使我的特权更高?

Never mind, the reason for the error was the Blob URI was getting 'revoked' before the extension got a chance to read it's contents. 没关系,该错误的原因是Blob URI在扩展程序有机会读取其内容之前被“吊销”了。 If it doesn't get revoked, the extension is able to read it. 如果它没有被撤消,则扩展程序可以读取它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM