How to allow Chromium to open local file and access system resources?

827 views
Skip to first unread message

宇超

unread,
Jan 13, 2017, 1:19:00 AM1/13/17
to Chromium-dev
I have defined a new interface by adding an IDL and c++ file. but when I tries to open a file on my computer, or get my own MAC address in my codes, an error of "5: Access is denied." will be reported. How can I resolve it?

PhistucK

unread,
Jan 13, 2017, 6:30:57 AM1/13/17
to myc.sn...@gmail.com, Chromium-dev
Renderers are operating within a sandbox, which basically blocks their access to anything in the system that is not explicitly allowed.
If you only intend to use this modified browser in a controlled environment, without any access to the open web, you can use --no-sandbox (you might also need --user-data-dir) which disables that sandbox and probably lets you access whatever you want from a renderer.
Beware that using this flag while accessing the open web can have severe consequences - your computer can get hacked completely (especially if you do not update your version whenever a new Chrome version is released).

Otherwise, the way to access system APIs and such (including file system access) is by using IPC to send a message from the renderer process to the browser process, letting the browser process access whatever you want and returning the data back to the renderer via IPC.

Note - "IPC" is either really IPC (the old way) or Mojo (the new and recommended way).


PhistucK

On Fri, Jan 13, 2017 at 8:19 AM, 宇超 <myc.sn...@gmail.com> wrote:
I have defined a new interface by adding an IDL and c++ file. but when I tries to open a file on my computer, or get my own MAC address in my codes, an error of "5: Access is denied." will be reported. How can I resolve it?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.

Reply all
Reply to author
Forward
0 new messages