FuckTheWorld / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Loading of unpacked extensions is disabled by the administrator #639

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
See http://goo.gl/ll2FvQ for common issues.

Issue Description:
Launching chrome driver gives error "Could not load extension from 
C:\Windows\Temp\scoped_dir23880_1457\internal. Loading of unpacked extensions 
is disabled by the administrator." I have advised our customer to whitelist the 
extension with ID aapnijgdinlhnhlmodcfapnahmbfebeb as suggested in 
https://code.google.com/p/chromedriver/issues/detail?id=480 . However they say 
that for the whitelisting to work, Chrome needs to see the extension as 
installed, but when they launch Chrome to check if the extension is installed, 
it's not listed as being installed. 

Using ChromeDriver 2.4 with Chrome 31.0.1650.57

Steps to reproduce (if relevant, you MUST provide a simplified html page or
link to public site):
Launch ChromeDriver

-----Other helpful tips:
Attach your chromedriver log with verbose logging enabled (see
http://goo.gl/5Sx8mC for how to do this).

Original issue reported on code.google.com by dstanisl...@yahoo.com.au on 25 Nov 2013 at 10:47

GoogleCodeExporter commented 9 years ago
Issue 480 has been merged into this issue.

Original comment by kkania@chromium.org on 3 Dec 2013 at 9:04

GoogleCodeExporter commented 9 years ago
One way to solve this might be to add the extension to the Preferences file and 
if necessary put the extension dir under the user data dir folder.

Original comment by kkania@chromium.org on 3 Dec 2013 at 9:07

GoogleCodeExporter commented 9 years ago
Hi Ken

I had a look at adding the extensions to the preferences file as per the 
section PreInstalling via Master_Extensions at 
https://support.google.com/chrome/a/answer/188453?hl=en . The documentation 
says "This method only works if the user has access to the public extension 
gallery or another URL where the CRX file is kept" - as far as I'm aware there 
is no URL where the CRX file is kept. It also says "This method generally only 
works on new installs" - we need something that will work for existing 
installs. Further down, the documentation says to use an "Update_url" value 
from the extension's Manifest.json file - but I don't say any url value in this 
file. 

Original comment by dstanisl...@yahoo.com.au on 3 Dec 2013 at 11:07

GoogleCodeExporter commented 9 years ago
Ken you asked for the exact error I am getting after attempting to whitelist 
the extension - the error is "Could not load extension from 
C:\Windows\Temp\scoped_dir23880_1457\internal. Loading of unpacked extensions 
is disabled by the administrator."

Original comment by dstanisl...@yahoo.com.au on 3 Dec 2013 at 11:10

GoogleCodeExporter commented 9 years ago
Hi Ken, even this way of whitelisting didnot help. We tried to load extension 
manually and whitelisted id and even added to the preference file as below:
"settings": {
         "aapnijgdinlhnhlmodcfapnahmbfebeb": {
            "active_permissions": {
               "api": [ "tabs" ],

We have updated our driver to 2.7 and tried but it still didnot work. can you 
please advice.

Thank you!

Original comment by sirisha....@gmail.com on 9 Dec 2013 at 5:24

GoogleCodeExporter commented 9 years ago
I am also seeing the same issues with ChromeDriver 2.4 and 2.7. At runtime, 
ChromeDriver automatically places a .json and .js file at 
'C:\Users\xxxx\AppData\Local\Temp\scope_dirxxx\internal', which I assume are 
used to pack and add the extension 'Chrome Automation Extension 1' to the 
browser at runtime. 

Since these files are manifested from ChromeDriver.exe at runtime, we have no 
way to manipulate the .json or .js files to get the extension key that we want 
to use for Whitelisting. 

If I manually try to pack the .json and .js files through Google Chromes 
Extensions, the generated key is different every single time, which leads me to 
believe it will also be random from the Automated approach using 
ChromeDriver.exe, which would make WhiteListing this extension impossible. 

Sample code that I am using is provided in this other post related to this 
topic: https://groups.google.com/forum/#!topic/chromedriver-users/dyhaFSoY7xw. 

My organization does not allow blacklisting. Please confirm if the extension ID 
is in fact random for each execution, and if there are any solutions to 
Whitelisting the extension ID.

Original comment by wieczore...@gmail.com on 12 Dec 2013 at 4:45

GoogleCodeExporter commented 9 years ago
Verified with Chrome 32.0.1700.55 on Ubuntu 12.04.2 and Windows 7. Steps to 
reproduce on Linux:

1. cp extension_blacklist.json extension_whitelist.json 
/etc/opt/chrome/policies/managed
2. launch chrome through chromedriver, or run chrome directly:
google-chrome 
--load-extension=/path/to/chromium/src/chrome/test/chromedriver/extension

Extension loading will fail with:

Could not load extension from 
'/usr/local/google/home/samuong/src/chrome/test/chromedriver/extension'. 
Loading of unpacked extensions is disabled by the administrator.

The whitelist policy can be verified by browsing to chrome://policy 
(ExtensionInstallWhitelist should contain "aapnijgdinlhnhlmodcfapnahmbfebeb").

Jason, I've checked and the extension id is always 
"aapnijgdinlhnhlmodcfapnahmbfebeb" but it looks like the blacklist disables 
loading of all unpacked extensions.

Original comment by samu...@chromium.org on 16 Dec 2013 at 6:19

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 16 Dec 2013 at 6:21

GoogleCodeExporter commented 9 years ago
Attaching files refereneced in #7.

Original comment by samu...@chromium.org on 16 Dec 2013 at 6:27

Attachments:

GoogleCodeExporter commented 9 years ago
Where are you getting the extension_blacklist.json and extension_whitelist.json 
files from? 

I'm not sure if its related, but I assume that your .json files are somehow 
fetching the values from your registry keys? On my system the black and 
whitelist variables live here: 
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\(ExtensionInstallBlackList / 
ExtensionInstallWhiteList)

Variable values on my system:
Blacklist = "*"
WhiteList = "aapnijgdinlhnhlmodcfapnahmbfebeb"

While the above configuration throws the "could not load extension" error, I 
noticed that when I manually pack the extensions (which generate a random ID), 
I am able to whitelist and add the extension successfully even with the * still 
in blacklist, which leads me to believe that the * variable in the .json file 
is not the root cause. 

Please let me know your thoughts, 

Jason 

Original comment by wieczore...@gmail.com on 16 Dec 2013 at 7:13

GoogleCodeExporter commented 9 years ago
The *.json files are only used on Linux, since there is no registry on Linux. I 
wrote these files by hand to reproduce the error.

If you're able to whitelist the re-packaged .crx file, it sounds like the 
problem is in whitelisting of unpacked extensions only.

Original comment by samu...@chromium.org on 26 Dec 2013 at 6:08

GoogleCodeExporter commented 9 years ago
Any roadmaps on when this issue gets resolved?

Original comment by ajopjovi...@gmail.com on 7 May 2014 at 5:24

GoogleCodeExporter commented 9 years ago
Any updates? We really need this for enterprisey environments.

Original comment by baljeet....@gmail.com on 4 Oct 2014 at 1:08

GoogleCodeExporter commented 9 years ago
I'm getting same issue with chrome driver 2.12. Is there any plan to fix it?

Original comment by haopeng....@gmail.com on 20 Nov 2014 at 6:18

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:19

GoogleCodeExporter commented 9 years ago
Issue 568 has been merged into this issue.

Original comment by gmanikp...@chromium.org on 18 Mar 2015 at 6:53