How to setup policies and master preferences on Mac OS X?

4,856 views
Skip to first unread message

Afonso

unread,
Oct 12, 2011, 7:10:27 AM10/12/11
to Chromium-discuss
Hi,

I've been trying to customize a chromium build in order to limit what
the user can do. Basically atm I'm focusing on not allowing the URL
field to be editable (which was easy, just open the xib in Interface
Builder and make it disabled) and I want to "force some settings".

I saw in the documentation that there are 2 ways:

1. Master Preferences
According to the docs, you have a predefined set of preferences which
will make sure that a new user will have specific preferences (eg a
pre-defined home page). In the docs it says:
"A file named "master_preferences" located next to chrome.exe or
chromium executable, is used as a template for what becomes users'
Preferences file."

Well I tried this, both inside the bundle (ie Chromium.app/Contents/
MacOS/) and next to the .app, neither approach worked. The preferences
were always created with the same default settings, the master
preferences file was always ignored.

So is this a Mac issue? Am I doing something wrong?

2. Policy
Then I read about the policies, which would be perfect for what I
need, since they seem to be preferences that the user cannot change.

However, I also wasn't able to get these to work! I grabbed de file
inside the bundle (org.chromium.Chromium.manifest) and did lots of
tries:
- tried changing it and leaving it there
- tried changing the file name to org.chromium.Chromium, and
org.chromium.Chromium.plist
- tried to even put it on the preferences folder (~/Library/
Preferences/org.chromium.Chromium.plist) before running Chromium, but
when it is run it will create the default .plist file and override
this one.

So what am I doing wrong? The information about how to setup stuff in
Mac is lacking a lot in my opinion. There's no example files (there's
the .manifest, but not even is explained how it has to be changed in
order to work, nor where it should be put and if it should be renamed)

The "administrator quick start guide" for mac is a blank page:
http://www.chromium.org/administrators/mac-quick-start

Can somebody please share some insight into the process of setting up
default policies and preferences for Mac?

Regards,
Nuno Afonso

Joao da Silva

unread,
Oct 12, 2011, 10:07:18 AM10/12/11
to naf...@gmail.com, Chromium-discuss
Hey Afonso,

I've just written a few notes on the mac-quick-start page. Please try
it out and let us know if it works for you.

Best,
Joao

http://www.chromium.org/administrators/mac-quick-start

> --
> Chromium Discussion mailing list: chromium...@chromium.org
> View archives, change email options, or unsubscribe:
>    http://groups.google.com/a/chromium.org/group/chromium-discuss
>

Nuno Afonso

unread,
Oct 12, 2011, 11:19:30 AM10/12/11
to Joao da Silva, Chromium-discuss
Hi João,

I've looked at them and it seems that it requires a "managed mac network".
Isn't there a way to pass the policy as an argument (according to the
parameters listed here http://peter.sh/experiments/chromium-command-line-switches/
it only references a --device-management-url, which doesn't sound like it
is the same thing), or to have it in the user library (ie ~/Library/Preferences/ although the user can
still mess with it, but at least for most it would just work)?

Let me try to explain what's my use case. I'm trying to re-launch a game
on steam, we already have it running but it uses a custom prism build
( http://prism.mozillalabs.com/ ), which is horrible in terms of performance.

So what I'm trying to do is "recreate prism" using Chromium. So it
has to be a solution that will fit for "regular users" (ie no administrator
rights needed) and work with systems which aren't in a network
managed area (ie anyone who would use steam could just install
and play it).

It seems to me that the only option viable atm, would be to
create a "launcher app" which would copy the default preferences
that I want the user to have to its library before launching
chromium, and then maybe disable the access to the preferences
from within chromium.

Any ideas?

Regards,
Nuno Afonso

Joao da Silva

unread,
Oct 12, 2011, 2:56:37 PM10/12/11
to Nuno Afonso, Chromium-discuss
Hey Nuno,

> I've looked at them and it seems that it requires a "managed mac network".

I haven't tested the steps outside a managed network. I'll try it and
update the notes later.

> Isn't there a way to pass the policy as an argument (according to the
> parameters listed here http://peter.sh/experiments/chromium-command-line-switches/
> it only references a --device-management-url, which doesn't sound like it
> is the same thing), or to have it in the user library (ie ~/Library/Preferences/ although the user can
> still mess with it, but at least for most it would just work)?

That switch is unrelated to this. I suggest placing the plist file
directly in /Library/Managed Preferences/<username>. See the attached
file for an example; you'll have to add the policies manually. An
almost complete list of policies is available at

http://www.chromium.org/administrators/policy-list-3

Notice that the file name matters; to control Chrome it should be
named "com.google.Chrome.plist". For Chromium it's
"org.chromium.Chromium.plist".

> Let me try to explain what's my use case. I'm trying to re-launch a game
> on steam, we already have it running but it uses a custom prism build
> ( http://prism.mozillalabs.com/ ), which is horrible in terms of performance.
>
> So what I'm trying to do is "recreate prism" using Chromium. So it
> has to be a solution that will fit for "regular users" (ie no administrator
> rights needed) and work with systems which aren't in a network
> managed area (ie anyone who would use steam could just install
> and play it).
>
> It seems to me that the only option viable atm, would be to
> create a "launcher app" which would copy the default preferences
> that I want the user to have to its library before launching
> chromium, and then maybe disable the access to the preferences
> from within chromium.

Interesting. You might find app mode useful; see

http://superuser.com/questions/33548/how-to-start-chrome-in-application-mode

Unfortunately it isn't implemented on Mac yet:

http://code.google.com/p/chromium/issues/detail?id=13148

Feel free to star the issue to receive updates.

Hope this helps!

Best,
Joao

org.chromium.Chromium.plist

Nuno Afonso

unread,
Oct 12, 2011, 4:03:50 PM10/12/11
to Joao da Silva, Chromium-discuss

> Interesting. You might find app mode useful; see
>
> http://superuser.com/questions/33548/how-to-start-chrome-in-application-mode

Nice! Exactly what I wanted! When I read those parameters, I thought it was a way
to launch chrome installed apps, but this is exactly what I want!

Just tried it on windows. The only problem I see from it so far is that the icon on
the task bar is the favicon, which looks really pixilated. Is there a way to use
another icon? It would be nice if we could pass it as an argument or
if by default chrome would try to download a specific file name (ie like
browsers do with favicon).

> Unfortunately it isn't implemented on Mac yet:
>
> http://code.google.com/p/chromium/issues/detail?id=13148
>
> Feel free to star the issue to receive updates.

Like it always happens, Mac users get the short end of the stick when
it comes to open source! ;-]

Anyway, as long as it comes "soon" it would be great. At the moment
the game is also released for windows, which is 93% of the user base,
so we'd at least solve the problem for 93% of the user base and
eventually the other 7% will be resolved.

So basically my plan is to do chromium builds and launch chromium
from a bat file passing the --app argument. I think it is best
to go with a separate chromium build to prevent conflicts if
the user has a chrome installed (and probably we cannot legally
install chrome like that anyway, so it is better off to just go with chromium).

Better to do this kind of solution than start doing custom builds,
getting into chromium's base code is _very_ hard.

Thanks a lot for your help João. I'll keep my eye on that ticket.

Regards,
Nuno Afonso


Joao da Silva

unread,
Oct 12, 2011, 4:10:02 PM10/12/11
to Nuno Afonso, Chromium-discuss
> Just tried it on windows. The only problem I see from it so far is that the icon on
> the task bar is the favicon, which looks really pixilated. Is there a way to use
> another icon? It would be nice if we could pass it as an argument or
> if by default chrome would try to download a specific file name (ie like
> browsers do with favicon).

Try packaging your stuff as a packaged app/extension. An extension is
mostly like a web page but has access to a couple more APIs, and can
have larger icons set in its manifest. Have a look around

http://code.google.com/chrome/extensions/overview.html

> Like it always happens, Mac users get the short end of the stick when
> it comes to open source! ;-]

Patches are welcome, I guess :-)

Good luck & have fun!
-Joao

Reply all
Reply to author
Forward
0 new messages