For those of you who are looking for a solution to this, here's what I've done.
a)
To disable address bar and to launch a specific website (web application URL), I've used chrome's "--app=<WEB_PAGE_URL>". This will launch the URL in a panel window which doesn't have address or menu bar. Here's the "Target" value and the "start in" value that I've setup to launch
google.com in app mode.
Target: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --app=
http://google.comStart in: "C:\Program Files (x86)\Google\Chrome\Application"
Note: The "Chrome\Application" path will change based on the OS bit version. The example above refers to a 64 bit windows machine.
You just have to create a desktop or start menu shortcut, set the icon to whatever you need and setup the "Target" & "Start in" as mentioned above.
b)
To disable creation of new tabs and windows, I've created a tiny "chrome extension" that does that. The approach that I followed is as follows:
- In the chrome extension, include the "tabs" permission in the manifest.
- In the javascript associated with the extension, I've used the "chrome windows" API.
- Whenever a new window or tab tries to get created (I think oncreate event or something like that), I've issued the "remove" window function as long as the Window type is not a "panel" or "popup".
- The tricky part is to install and enable this extension automatically. This will not happen by default because the user must grant the permissions for the extension to start accessing the "tabs" information.
- To go around this problem, I've done the following steps:
- Enable developer mode in chrome's extension settings page, install the extension that you have created, that will install the extension and store the files in an exploded format (originally the way you built it where there's a manifest and a background.js).
- Now goto the "Default" chrome profile folder. On 64 bit Windows machine, it looks like "C:\Users\<USERNAME>\AppData\Local\Google\Chrome\User Data\Default". You'll find the "Preferences" file. This is where all the chrome profile specific preferences are stored.
- Find your extension ID (GUID) from the chrome extensions page, search for that extension ID in the "Preferences" file that you just opened.
- Copy and store the extension related information that you find in the "Preferences" file. Here's a sample of how the extension settings content.
"apdfllckaahabafndbhieahigkjlhalf": {
"ack_external": true,
"active_permissions": {
"api": [ "background", "clipboardRead", "clipboardWrite", "notifications", "unlimitedStorage" ]
},
"app_launcher_ordinal": "zv",
"creation_flags": 137,
"from_bookmark": false,
"from_webstore": true,
"granted_permissions": {
"api": [ "background", "clipboardRead", "clipboardWrite", "notifications", "unlimitedStorage" ]
},
"has_declarative_rules": false,
"install_time": "13023553574245171",
"lastpingday": "13025775600329930",
"location": 1,
"manifest": {
"app": {
"launch": {
"web_url": "https://drive.google.com/?usp=chrome_app"
},
"urls": [ "http://docs.google.com/", "http://drive.google.com/", "https://docs.google.com/", "https://drive.google.com/" ]
},
"background": {
"allow_js_access": false
},
"current_locale": "en_US",
"default_locale": "en_US",
"description": "Google Drive: create, share and keep all your stuff in one place.",
"icons": {
"128": "128.png"
},
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIl5KlKwL2TSkntkpY3naLLz5jsN0YwjhZyObcTOK6Nda4Ie21KRqZau9lx5SHcLh7pE2/S9OiArb+na2dn7YK5EvH+aRXS1ec3uxVlBhqLdnleVgwgwlg5fH95I52IeHcoeK6pR4hW/Nv39GNlI/Uqk6O6GBCCsAxYrdxww9BiQIDAQAB",
"manifest_version": 2,
"name": "Google Drive",
"offline_enabled": true,
"options_page": "https://drive.google.com/settings",
"permissions": [ "background", "clipboardRead", "clipboardWrite", "notifications", "unlimitedStorage" ],
"update_url": "http://clients2.google.com/service/update2/crx",
"version": "6.3"
},
"page_ordinal": "n",
"path": "apdfllckaahabafndbhieahigkjlhalf\\6.3_0",
"state": 1,
"was_installed_by_default": true
},
- This content will help you to automatically enable the extension by default on the user's machine.
- Once you install chrome on the user's machine, chrome will create a master_preferences file in the same folder as the chrome.exe.
- Only when the user first launches chrome, the "Default" profile folder gets created.
- So, once installed on the user's machine, you have to simulate chrome's first run by running it in background, so that the users do not notice that.
- You have to probably write a VB script or something similar to run a bunch of windows commands - run chrome in background, wait for atleast 5 mins, kill chrome running in background, by this time it should created the "Default" profile folder, now insert the extension settings information that you have saved earlier immediately beneath the first time '"settings": {' occurs in the "Preferences" file.
- Now the next time user launches chrome, your extension is automatically enabled without user intervention.
- Basically copying the contents of the extension settings, will insert values for "granted_permissions" which will automatically enable the extension to have permissions over "tabs" instead of user manually confirming the permissions.
I know this is a little complex procedure. But, that's what I ended up with due to various facts such as the Group policy settings for chrome which do not work the way they are supposed to. For example: When I tried to block all the URLs except for the one for my Web Application using a combination of URLBlackList and URLWhiteList policy settings, it blocked my extension as well. May be because starting with chrome v29.x, chromium dev team has changed the way the extensions are handled.
Thanks,
Sandeep Veldi