During download of executable of chrome extension getting Failed-Network error - google-chrome-extension

I am creating a chrome extension. And as soon as user adds extension to chrome, new html page is opened and executable file downloaded to user machine. All needed files including exe takes part during packing process. But when I try to add extension, there is a problem with downloading exe: "Failed-Network error". Chrome acts my exe as a malicious software. How can I make my exe trustful?

This is part of Google's security measures as I found a blog post with regard to Chrome blocking exe files.

Related

Uploading Chrome Extension - Error: Failed to process your item

When uploading my zip file using the Developer Dashboard, I'm getting the following error:
An error occurred: Failed to process your item.
Can not process the manifest file.,Can not process the message.json file.,Can not process the key.pem file.,Chrome Web Store system error, please try again later.
I've followed 3 different tutorials (2 on extensions, and 1 on uploading to the Developer Dashboard) that I found on creating an extension on Googles' site. None of them say to create a message.json so I didn't create one (not sure why its telling me it can't process it). There is also no key.pem file, as they said do not generate this file and don't include it - as it will be generated when you upload it.
It says try again later, but I've tried several weeks now with no luck.
Currently, I'm exploring if my zip file is generated "funny" from 7-zip. I'd use the built in windows zip once I get that working again - however it seems corrupted.
My manifest file is in the root folder, and and the extension works in developer mode on my chrome. I've quadruple checked that the JSON is valid as well.
The extension works great for me, but fails the upload process.
How do I get past this step of the process?
Make sure manifest.json is in the root of the zip archive (not inside any directory)
Use the standard deflate zipping method in 7-zip, not anything fancy like deflate64
The answer to this was:
In the 7-Zip settings, I was using the compression method Deflate64, I changed it to Deflate and it the zip file was accepted. Thanks to #wOxxOm
I probably wouldn't have had this problem but my windows built in zip is currently corrupted and used 7zip to make a zip file.

Update some chrome extension files from own server

I am writing a chrome extension in which some script and an XML file in which I data is to be read by the script are changed almost twice per day. If I include a link to it on every page load, my hosting server load will probably suffer. Isn't it possible to get a copy of my script and XML Files each time that the browser is launched in order to update them in my extension ?
PS : I resorted to this solution since it is not possible to get the Update of the extension directly from my server since chrome's last upgrades.
- Any other way to update my extension is welcomed .

Run Chrome Extensions using command prompt

Is it possible to run a chrome extension from command line?
I need to automate the process for my software, and my software will need to run that extension with a particular parameter.
I am using a Chrome Extension 'APK Downloader' by Yogi. The Extension works like this:-
"If a page contains any .apk file link, then when I click on the extension's icon on the address bar, it starts direct download of that .apk file"
Now, I have my software that needs some .apk file to download [The software will have the package name of the .apk file to be downloaded, which is used by the extension to generate a download link]. It will be an automatic process. So, I need to know if it is possible to pass a parameter to the extension automatically, and make the extension to work without clicking on it.
Is it possible to do so??
Unpacked extension can be loaded using the --load-extension= flag.
What I usually do is chromium --user-data-dir=/tmp/someuniquedirname --load-extension=path/to/extension --no-first-run.
The --user-data-dir= flag is used to specify a non-default user data directory, to minimize conflicts between your existing browser profile and the test directory. You can omit this flag if you want to use your default user profile.
The --no-first-runflag prevents the first run UI from showing up (e.g. the bubble that explains how to use the omnibox, and a "Getting Started" page that opens in a new tab).
You can load multiple extensions by separating the paths by commas, e.g. chromium --load-extension=path/to/one/extension,path/to/another/extension.
I have published some shell scripts and a convenience extension to speed up (manual) testing of Chrome extensions. Take a look at https://github.com/Rob--W/extension-dev-tools/tree/master/chrome.
it helps to open extension normally and after that hit F12 (dev tools) to see actual url...
having that i can, for example load "Selenium IDE" chrome extension as
(run from command prompt)
"C:\Program Files (x86)\Google\Chrome\Application\new_chrome.exe" chrome-extension://mooikfkahbdckldjjndioackbalphokd/index.html
on a mac:
osascript <<EOD
set theURL to "chrome://extensions/"
tell application "Google Chrome"
if windows = {} then
make new window
set URL of (active tab of window 1) to theURL
else
make new tab at the end of window 1 with properties {URL:theURL}
end if
activate
end tell
EOD
Question answered here:
https://superuser.com/a/979678

Is there a way to use a downloaded (xml-esque) file in an extension?

I'm attempting to write an emusic download manager extension for Chrome. This would essentially involve parsing the .emx file (xml-esque) downloaded from the site to get the temporary music file URL.
I've gone through everything I can find online about extensions working with downloads, but the problem comes in that the .emx file isn't directly accessible from the web. The link to download it seems to pass through a counter for your account so that it can deduct the cost, and then it pushes a file 0.emx to be downloaded. It doesn't seem to work with any hotlinking, even copying and pasting the button's destination URL into the same browser tab.
I think the only way to get the file is to wait for the 0.emx file to be pushed. Is there any way I can use an extension to intercept that file before it goes to the downloads folder or use it after it's already downloaded?
Thanks!

Making a Windows Installer communicate with a Chrome extension without NPAPI

I have a windows application which installs a Chrome extension via the windows registry. I wish for this application to generate some one-time information for Chrome to read based on information typed in by the user during the installation process.
Assuming I am not using NPAPI in the Chrome extension, is there anywhere the installer can place information such that the extension will see it?
Edit: I also wish to launching chrome at the end of the installation.
Another way you can pass information to an installed extension from outside of Chrome is to have a page with your extension that you then open Chrome too and pass the info in the hash...such as....
chrome.exe "chrome-extension://emcggffhhapbbkcodabdliakappfibcf/showHash.html#info"
Problem with this method is your installing the extension using the simple registry method (Im guessing) and not using the Policy method. With the Policy method you can force an install and it will happen even if Chrome is allready open (where as according to the docs the simple method happens the next time Chrome is opened). Downside to this is you will have to make an uninstaller yourself as you cant uninstall an extension from Chrome that is installed with this method. Im also not sure how quick/often it will be before the extension is installed (couldnt find it in the docs and too lazy to try it ;)) and youd need to make your installer wait a bit for it to be installed....
http://www.chromium.org/developers/how-tos/adding-new-policies
http://dev.chromium.org/administrators/policy-list-3#ExtensionInstallForcelist
http://dev.chromium.org/administrators/policy-templates (says where in the registry to add them)
Another possible method could be to pack the extension at install time and add a file with the info that the extension could read. Problem with this method is that the extensions ID would change (might not be a problem for you?) or youll have to include the PEM in your installer which you probably dont want to do....
chrome.exe --pack-extension="C:\simple-example" --no-message-box
Many people wish there were an event firing on extension installing.
There's a workaround, not elegant way to send info to the browser from outside: launch chrome asking to open an url.
I use it with a local html file. My application execute a command line like:
"pathToChrome\Chrome.exe" "file://pathToHtmlFile/myFile.html?param1=value1&param2=value2"
The info I pass are the page's parameters.
The catch is that this page is read by the extensions in one of many ways:
You can write a content script this page will fire
You can put some javascript on this page to write down the parameters as cookies, for the extension to read in the future (without calling the extension at this time)
It hasn't to be a local page. If your page is on a server, it can save the parameters in the server, ir it worthy.
It hasn't to be even your page. You can call any page on Internet, but beeing sure it will fire your content script extension, and it will read your "customized" parameters.
Instead of communicating through the windows registry, you can create a WebSQL from the installer and from the extension read the data from there.
You will need to a bit of research about how to this, but this is possible. the steps should be:
The installer will create the database and register to chrome (maybe with the Databases.db)
The extension will use openDatabase to create a connection to the database
The extension will do a transaction and read the needed file.
Another option is to add file to the crx for example "installer_info.json" and do an AJAX request from the extension to the "installer_info.json" file.
There is no formal way for doing this things, little research and you will have a way.

Resources