Chrome --load-extension doesn't work on some machines - google-chrome

I'm trying to load unpack extension using command line flag --load-extension.
I'm using one chrome profile. The syntax for query is following:
chrome --load-extension="C:\Users\someUser\Desktop\unpackExtensionFolder"
Inside unpackExtensionFolder there is manifest.JSON and all sources.
This command doesn't work on few PCs in office, but it works on the rest of them, and successfully loads the extension (Chrome version is the same on all machines - 31, extension that we are trying to load is the same).
Discovered:
Doesn't depend on chrome profiles amount
Doesn't depend on developer mode on/off
The question is why? And what could have influence on this?

The reason for this was plugin inside manifest file, seems that chrome was not able to load extension with plugin declarated in it. Works fine after removing plugin section.

Related

Chrome's map to file system resource not working after update

I can add a folder to the workspace (which doesn't seem to do anything, as far as I can tell), but the "map to file system resource" option seems to have been removed, and I can no longer live-edit css files.
Is this a bug, or has the process for mapping css files been changed?
This talk (https://developers.google.com/web/updates/2017/10/devtools-release-notes) says that the new version uses "magic" to map remote files to local ones, but I can't seem to get it to work at all.
For reference, I'm trying to map a reddit css file to one on my own computer. It worked fine on a previous version of Chrome (basically I add the folder, and map the css file inside it, which has been renamed to have the same name as the remote one) but not on the new one (Chrome 63)
I've just fiddled around with a problem, where only some files got mapped to my local workspace.
Turned out that Google Chrome also checks and compares the last modified date of your files.
If the file on the server has a more recent date than your local copy, this file won't be mapped.
I deleted the Bootstrap file on the server side and uploaded my local copy, which has an older last modified date. Google Chrome instantly mapped the file to my local workspace.
Out of curiosity I ran touch bootstrap.min.js on my server to set the last modified date to today. This broke my file mapping again.
Chrome removed manually mapping to filesystem resources because of the new Workspaces 2.0 (See: https://developers.google.com/web/updates/2017/10/devtools-release-notes).
You should be able to drag and drop your folder into the sources tab and it'll link the files automagically.
However automatic mapping doesn't work in many situations and there is a Chrome bug to re-add manual mapping
I had the same problem so I downgraded to Chrome 62 (preferences, history, extensions and so on are preserved).
Download Chrome 62 from
https://www.slimjet.com/chrome/google-chrome-old-version.php .
On OS X trash /Applications/Google Chrome.
Switch off auto-update by setting "defaults write com.google.Keystone.Agent alwaysPromptForUpdates 1". Default is 0.
May be you have to set "defaults write com.google.Keystone.Agent checkInterval 0" too. Default is 18000.
Install Chrome 62 as usual.
After starting Chrome 62 open "About Google Chrome". Chrome is checking for updates, but will prompt you to confirm.
The "Map to File System Resource..." menu item is missing. There appears to be no way to map files. It is completely broken as far as I can tell.
For me, the problem turned out to be the presence of the copyright symbol © in the file headers (which affected just about every file). With this character in the files, devtool refused to map the files but with it removed, the files map fine.
I'm also using Chrome 63.0.3239.132 (Official Build) (64-bit) and as I wanted to use the DevTools Live-edit to edit some js files I saw that the option "Map to file system resource" is missing.
After some research I have found out that the Live-edit is perfectly working in Version 63, you just have to:
go to Sources and then FileSystem
add the folder with your code to the workspace
After that, a small little green point will be displayed near your files (it means the synchronization is ready) and the changes via DevTools can be persisted locally:
Thanks to others in this thread saying chrome is checking the modified date.
Adding this to .htaccess solved it for me
IndexOptions SuppressLastModified
Of course you would not want this to get into your production code as it could stop browser caching working.
I cleared the cache and it works now.
Previously, I opened my CSS file from my FTP client, then I dragged the containing folder into the Sources tab > Filesystem tab (without caring about any folder names nor structure, I just dragged the FTP clients containing folder into it).
The persistent mapping worked straight away, edits from the Chrome Dev Tools were saving on the server. After 30 minutes of fiddling and playing around, it just stopped working and the CSS resource got greyed out. The file icon with the green dot was not appearing anymore.
It didn't matter what I'd do, it would not work, but when I cleared my cache, it started to work again.
File mapping started working reliably for me once I turned on a devtools setting -- click the upper-right gear icon and check Preferences > Network > "Disable cache (while DevTools is open)"
As of today, with Chrome Version 63.0.3239.108 (Official Build) (64-bit):
The feature appears to be still broken, not working 'automagically' nor consistently with the previous behavior.
However, adding a folder that reflects the resource's URL as seen in the Network tab, make it work again. So if for instance, in the Network Navigator tab you have:
http://mylocal.site/wp-content/themes/mytheme/assets/sass/partials/_header.scss
You will just need to add the whole wp-content/ folder to the Filesystem tab to get the feature work again as expected.
Had the same problem, but when my source maps included sourcesContent, the file mappings were automatically made and I could live edit my scss. Apparently chrome uses the content to find the right file.
node-sass --source-map-contents

What is the difference between manually opened Chrome browser and opened using chrome driver

I am using Selenium for automating the chrome browser. When I download the files using automated Chrome browser it gives me a warning,
'This type of file can harm your computer' with keep or discard options.
But when I manually open chrome and download the files from same site, I won’t get any warnings.
I know I can disable the warnings using, options.AddUserProfilePreference("safebrowsing.enabled", true);
But my question is why I am getting this warning only in automated window?
What is the difference between browser opened using Chrome driver and manually opened browser?
Please help me.
If during your manual download, in your chrome
Settings > Advance Settings
Privacy -> Protect you and your device from dangerous sites (is_checked)
The download warning wouldn't be displayed on your browser.
On the other hand, not all chrome options are set to the same value during automatic download from your code. Hence you need to specify :
options.AddUserProfilePreference("safebrowsing.enabled", true);
List of all command line arguments for chrome driver goes here.
Note : Though not all of them are certainly of use while using automation and not all of them correspond to a chrome manual setting either.

Brackets live preview not working

I am working on a local project (read: offline) and I am trying to get Brackets' live preview to work since it comes in handy quite often.
Right now I have opened my project files using Brackets' "open file" option since it supposedly maps the path to the source files. Although I am getting an error saying In order for Live Preview to connect, Chrome needs to be relaunched with remote debugging enabled.
I have read else where that Chrome, by default, does not need to be relaunched for that change and that Brackets force this flag by itself.
I have tried reinstalling Brackets, launching with another project and searched all over Chrome for this flag and did not find any thing.
Any tips?
This page shows you how to instal remote debugging! It's a Chrome dev tool. It's geared towards android apps for whatever reason, but I had that same error, and following the instructions on that page helped me launch the brackets page.
If that doesn't work, here are some troubleshooting tips that have helped me out with live preview:
1) Make sure your filename has a .html at the end
2) Use different browser (I've found chrome to be a bit finicky with brackets)
3) Make a different blank file, launch that, then launch the file
Open the folder, not the file, and then select the file.

Loading NPAPI plugin in Chrome

I have a NPAPI API based (scriptable) plugin developed using Gecko SDK 1.9.2. This plugin works fine on FF3.6 & FF4 beta, but it fails to get detected on chrome.
Also I cannot see the plugin listed - when I do a "about:Plugins" in chrome.
I've registered the plugin as described in the "Windows Installation Using the Registry".
When monitored the chrome startup using Sysinternals tool Procmon.exe, I could find that the chrome tries to do a LoadImage on my Plugin dll, whoever it quickly unloads it.
Any ideas why this plugin is not detected by chrome will help.
It would be helpful to have an example of exactly what keys you used and where you put them; FireBreath plugins (works on all npapi and activex browsers) register themselves in the registry using that method and they work fine on chrome.
Depending on your needs, might even be worth looking into building your plugin in FireBreath instead of using npapi directly -- it's a lot less work and workarounds for various browsers have already been done.
One thing to try is to make sure you have the file name correct in the registry; Many versions of firefox just use the directory specified in the registry and search for any plugin files (this isn't documented, AFAIK, it's just my observations), whereas Chrome actually uses the path and file. It's also possible you could have a permissions issue.
The issue was that the plugin dll didn't have the resource like file description, MIME type and language set. Adding the proper resource strings fixed the issue.

Automating Google Chrome extension packaging

I'm trying to automate packaging of the Chrome extension on Windows and according to the documentation, it is this command:
[path]\chrome.exe --pack-extension=c:\myext --pack-extension-key=c:\myext.pem --no-message-box
However this command results in a new browser window and no action is performed. I tried other switches like --version or --help but it seems that Chrome is ignoring all of this. Do others have the same issue? What am I doing wrong? I also tried various quoting and with no other browser window open but I haven't been able to make this work.
Update: I'm happy to learn that the new Chrome 8 has fixed this issue.
The answer is present in one of the comments. I am reposting the answer verbatim here:
You can try one of the scripts to pack
an extension at
https://developer.chrome.com/extensions/crx#scripts
– by Na7coldwater
You'll need to close all chrome windows before the command line pack extension command will work.
I raised this bug with the chrome team some time ago (http://code.google.com/p/chromium/issues/detail?id=22901) but it's not quite fixed yet. This can be somewhat frustrating because (as michaelhermannweber pointed out) "Since we're fans of Chrome, obviously Chrome is already open!"
I even tried to use a separate instance of the chrome executable to build the extension, but alas no luck on that front either :(
For now, AFAICT you have to do it manually via the pack extension button on the chrome://extensions page.
You might manage to build a script that closes all open chrome windows, builds the extension, and then re-opens chrome. But I doubt that it would be worth it given the number of tab users like to keep open.