I'm trying to install a google chrome extension on a large amount of my desktop computers using python. I've gotten Selenium to open a simulated browser with the extension, but that doesn't actually download it to the computer, so that doesn't necessarily help. My current code is
import webbrowser
webbrowser.open_new_tab(
"https://panelresearch.google.com/browser/extension/download")
This just opens the page where I can find the extension, can anyone show me a library where I can click buttons that are on this page?
Additionally, I'll need to identify the extension popup and I realized that I cannot inspect any elements in that popup.
As far as I know, there is no way of operating the extension popup using any API other than simulating the clicking on OS level.
When you're testing an extension using Selenium, you have to specify a custom profile as an argument during the start of the process connected to the WebDriver. More info here or use a special ChromeDriver API.
If you just want to force install an extension in an enterprise/educational environment, you can follow this guide.
You can also edit already existing profiles (to some extend and in my experience unreliably) by editing the Preferences file in the profile directory. Just make sure you have backups and an instance of Chrome is not running with that profile.
Good luck.
Related
From the command line, I can open a url as a chrome application by running e.g.
chromium --app=https://www.stackoverflow.com
Is it possible to do open a url in this mode from javascript in an existing page? To be clear, the url should ideally be opened in a new window, which has the properties implied by the --app flag (e.g. no address bar), whether or not the current page is running in that mode.
My reason for asking is that I'd like to integrate this into vimium.
There is no way to do what you need directly from Javascript. I think you'll need to create an Chrome extension to do that.
You still can find an extension called "Open with external application" which do that, but its use NPAPI and NPAPI is not supported anymore by latest Chrome version. The source is hosted on BitBucket.
The new way to do the same thing is using the native messaging API. In this case the external application would have to register a native messaging host in order to exchange messages with your application. You can see more at http://developer.chrome.com/extensions/messaging.html#native-messaging
I have an extension
https://chrome.google.com/webstore/detail/myextenstion/lkdklkkflkfedlbfpl
like this.
i created a menu item on my website like
Click here to Download Extesnion
which is working fine'
Now i want user just click and extension popup appear directly .
Any idea ?
Thanks
Before Chrome 33 on windows, you could self-host your crx file and serve it with a given content-type to trigger the installation popup.
See https://developer.chrome.com/extensions/hosting
Since them, to avoid malware, users can only install extensions hosted on the chrome web store (if they don't use the "developer mode" settings in chrome).
To install from a third party website directly, chrome provides a javascript API (called inline installation).
Here is the documentation
https://developer.chrome.com/webstore/inline_installation
I have my first brand new google chrome extension, which I'd like to upload to the chrome web store. The thing is that my extension is using native messaging via stdio to a c++ exe. The extension also required a registry key to be installed.
Is it possible to upload the required files to the chrome web store (including exe and dll dependency)? Is there a way to automate the installation of the registry key (required to send messages from chrome extension js to exe), and register dll?
The idea behind chrome-extensions (and native messaging) is to limit the giant security hole that is NPAPI: to create a divide between the browser and the desktop that runs it. For this reason, you'll need to perform two separate installations: one for the extension and another for the native code.
To the best of my knowledge, you can't bundle the binary with the extension. But you might be able to (partially) do it the other way around: have the native code also install the extension:
There is a way to partially automate the process of installing the extension: you can pre-load the extension via the registry. This only applies to extensions on the chrome web-store (CWS). I believe this requires to reboot chrome. And of course the user is notified that an extension was installed. see here - https://developer.chrome.com/extensions/external_extensions
There's also something called "inline installation" - not quite "automatic", but this should make it easier for your users to install the extension from "within" your site (as opposed to the CWS). The extension still needs to be hosted on the CWS, but the user needs not navigate there.
see here - https://developer.chrome.com/webstore/inline_installation (and especially the line section - about verified site - which requires that you register your site with Google - and thus may render this technique useless to you)
I have chrome extension which get installed with using installer which install some process and browser extensions. As per chrome security changes stand alone installation will be blocked.Google to block local Chrome extensions
If we host extension on chrome store what are the ways we can redirect chrome from installer to install extension.
According to the Chromium Blog:
If your extensions are currently hosted outside the Chrome Web Store you should migrate them as soon as possible. There will be no impact to your users, who will still be able to use your extension as if nothing changed. You could keep the extensions hidden from the Web Store listings if you like. And if you have a dedicated installation flow from your own website, you can make use of the existing inline installs feature.
So, basically, what you need to do is:
Host your extension on the Chrome Web Store (optionaly keeping it hidden from the listings).
Have your installer open a Chrome browser window pointing to a webpage on your site.
On that page have all necessary info and data for the user to initiate the extention's installation process. (The key concept here is that the user has to initiate the installation process, e.g. by clicking a button.
How does inline installation work:
The HTML page on your site from which you want inline installation to occur must contain one or more tags in the section referencing the items that the user can install. Each tag must have the following format:
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/itemID">
To actually begin inline installation, the chrome.webstore.install(url, successCallback, failureCallback) function must be called. This function can only be called in response to a user gesture, for example within a click event handler; an exception will be thrown if it is not.
(emphasis mine)
More info on the inline installs feature.
For enterprise intranet web application, is there any way to create a desktop shortcut of web application on user's desktop? I'm looking for functionality similar to Google Gears, but without installing Google Gears. I'm looking to give user's a link on web application that says "Click here to install desktop shortcut", when they click on it, a desktop shortcut is installed with the custom icon for our application. Is there a way to do it using javascript or any other client side technologies? I don't want to run any exe on user's machines. Even though it's intranet, I have to jump through lot of corporate hoops, compliance approvals, etc to run exe on their machine. We are trying to avoid that, due to time constraints. User machines are windows XP with IE6 installed. They may all upgrade within next year's time to Windows 7 with IE8. Intranet web application in question is developed using asp.net 3.5, c#.
If this is really a corporate environment then just go talk to the network operations team.
It should be trivial for them to add something to the login script to push this link to the people's desktops.
More Info:
http://www.petri.co.il/forums/showthread.php?t=6154
http://social.technet.microsoft.com/Forums/en/winserverGP/thread/02a7bfbb-180f-40eb-82e3-2343b2bf31eb
Alright, at first I thought that this was an impossible task, until I realized that it's not.
A shortcut is just a file, and we all know you can download files from links.
I'm not sure how well windows shortcuts can be transferred from computer to computer, but I would assume that a shortcut with a location like http://www.google.com/ is not tied to any specific windows machine.
You could zip the shortcut, and point the link to the location of the zip file. Tell the users to unzip the file and place the shortcut. You may be able to just serve the shortcut, but you'd have to give the right headers, and probably specify application/octet-stream or something like it.
Alternatively you can tell them to right click, go to new -> shortcut, and copy-pasta the url into the location box.
Alternatively you could write a batch file for the users to download that opens a url in the default browser.
I know it's not quite as direct as click-button -> receive bacon but it will work.
Try looking at SaveAs
document.execCommand("SaveAs", false, "url to desktop");
The user will still have to click save and it only saves a HTML page. You would have to open a hidden IFrame containing a web application and call .execCommand on the iframe's document.`
You can create a shortcut (.lnk) file in a directory in your site and put it as the Url for a hyperlink so the users right click and save as they download the .lnk file. Your server will need the mime-type .lnk application/x-ms-shortcut adding.
The icon can be done by putting it on a network location and using the "Change icon" function to refer to this network location. This works on Windows. I suppose it could be adapted for each OS required?