InstallTrigger.install Equivalent in Chrome? - javascript

In firefox InstallTrigger.install is used to download xpi file. What is used to download the crx file in chrome browser. The download should start without the user click.

Simply change the location of your window, use window.location.href = "http://.../extension.crx";.
Edit: The answer above is outdated, Chrome no longer requires installing extensions from any website other than Chrome WebStore.
There is a supported inline installation flow that allows you to trigger installation for your extension from your website. This requires your website to be verified and associated with the extension in the Chrome Web Store. Then you can add a <link rel="chrome-webstore-item"> tag to the page pointing to your extension in Chrome Web Store and a call to chrome.webstore.install() will start installation.

Related

Click a button in Google Chrome not using Selenium

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.

Possible to open link in Chrome Application from javascript?

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

How to install extension directly without visiting chrome store

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

Chrome Extension installation

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.

Is it possible to open Internet Explorer window from Firefox? [duplicate]

Our Web application is based on IE9, which means only IE9 can open the pages in our site. We'll prevent user to browse our site when their browser is not IE9.
But sometimes we had to send a link to user's email box to complete some actions and they will open the link directly with their default browser, the problem is here, if the default browser is not IE9 then they can't open the link, they have to copy the link to IE9. Our user don't want do this manually, they want open the link in IE9 directly no matter what the default browser is.
I have tried using ActiveXObject, but it only works in IE. I want have a script which can open IE browser in Firefox/Chrome page.
It sounds like you want to have a link in an email that activates a specific program on the user's computer rather than the program that they've identified should be used (e.g., their default browser). I don't believe you can do that.
You can install "protocol handlers" in both Chrome and Safari (I suspect Firefox as well), which would let you send a link like ie://example.com/path/to/app. Your protocol handler would launch IE and take you to the relevant site. (Apple does this with iTunes.) But your users would have to install the handler (and, of course, you'd have to write it).
An easier answer might be to have the users install any of the ubiquitous "open in IE" add-ons/extensions that exist for Chrome, Firefox, etc. They follow the link, then choose "open in IE" from some kind of menu. (If they're using webmail, they may even be able to right-click the link and choose that line item, depending on the extension.)
Side note: Obviously, though, barring it being impossible I'd recommend making your application compatible with Chrome and Firefox.
No you can't do it..
but there is some alternatives:
Install your users IE tab:
FireFox - http://lifehacker.com/135297/internet-explorer-in-a-firefox-tab?tag=softwarewebpublishing,
Chrome - https://chrome.google.com/webstore/detail/hehijbfgiekmjfkfjpbkbammjbdenadd
Use a batch file that will launch your link in explorer.
use this Firefox plugin makes it possible to use (host) ActiveX controls in Firefox - http://code.google.com/p/ff-activex-host/
instead of ActiveX try using Netscape Plugin Application Programming Interface (NPAPI) - a cross-platform plugin architecture used by many web browsers.
Similar as with a batch file, you may create a link file to the page you need using the ".website" file extension with IE, which is configured in windows by default to open with ie. Put it in your webserver public folder and then add a link to that file in your website
You don't have to write code to create a custom protocol handler in Windows. See this page for how to define one in the registry.
You can use User agent switcher for chrome or firefox
For Chrome :
https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg
For Firefox :
https://addons.mozilla.org/en-US/firefox/addon/uaswitcher/

Categories