3

First of all, I haven't started the implementation of the system I'm about to describe, as I didn't want to commit on implementing something I did not know if was possible.

So, what I'm trying to achieve is to build a chrome-app to download the audio from certain websites (e.g. youtube and soundcloud) using youtube-dl, post process it using ffmpeg and then upload it to a cloud service via some api. The reason I want to do it via a chrome-app is because I could do all the work on the client side (no need for servers) and I'd have the ability to insert javascript into the pages using content scripts, which would make the app pretty simple to use (I could create buttons such as 'download song' and stuff like that).

Although I have already read the documentation explaining the NaCl Technical Overview and some of the Application Structure, I still am not sure as to whether I would be able to make these calls via some C/C++ module or if I would get denied due to security reasons.

To summarize: considering that the user has the needed dependencies in his system (youtube-dl, python, ffmpeg and etc.), is it possible to make calls to third party APIs such as the ones described before via a chrome-app using NaCl ?

Thank you all in advance,

4

1 回答 1

3

Chrome 应用程序通常是沙盒的。

不如扩展——它们可以通过应用程序 API 访问更多的系统资源。

但是,您提到的是在浏览器之外执行库/实用程序,通常不允许这样做。

(P)NaCl 在这方面被严格沙盒化。看到这个老问题,它仍然适用:您只能使用与您的应用程序一起编译成 NaCl 的第 3 方代码,而不仅仅是链接到库。NaCl 有一些库端口,但它不是自动的。

通常,几年前您会使用像 NPAPI 这样的机制来联系并使用浏览器之外的库。它已被弃用,并且不再起作用。取而代之的是,Chrome 提供了与名为Native Messaging的外部程序的管道式(通过 stdio)连接。您可以使用它来执行系统级库和工具的操作,但缺点是您不能将本机主机与您的应用程序捆绑在一起,您需要一个单独的安装程序。

于 2015-01-08T15:32:55.107 回答