How to access browser javascript APIs from another browser - javascript

I want to access one browser javascript APIs from another browser.
For example, if I am writing chrome extensions, is there any way to access javascript API for Firefox browser (let us say, History API for Firefox) installed on the same machine?
I looked at the Native Messaging in mdn, but it doesn't seem to satisfy my requirement.
Is it possible that extensions written for one browser communicate with extension for another browser?
For example, if I write a chrome extensions, can I communicate with Firefox add-on from it?
If it is not possible to have communication between extensions/browsers, how come Chrome/Firefox able to pull our
settings,bookmarks etc,. from another browser when we first install
it?
Any help?

Related

Manipulating the browser chrome in a web extension

I want to develop a small extension to hide the browser chrome for a use case. It seems that the new way to develop addons is to use the web extension api. With the old api it seems to be possible to manipulate the chrome. E.g. in the webdeveloper console (with some config flags) I was able to run this code:
document.getElementById('toolbar-menubar').style.display = 'none';
However it seems to be impossible with the web extension api. Is there any way to do that?

Communicate between remote Chrome extensions

I need to develop a Chrome extension that will be able to send messages between instances of the extension (i.e. active Chrome browsers with the extension installed around the world) very quickly (like push notifications).
I understand that the regular Chrome messaging (even the external type) only works with extensions installed on the same browser, not remote ones.
I'm looking for the best, simplest solution, that will provide quick communication between the clients. The only way I thought about is to get some server running (I don't have one, so I need to find an online service), and run a script that will continuously receive/forward data. Is that the best way? Is there a simpler solution to set up for very simple communication between the remote extension instances?

How to open an EXE file from a Client Machine through a Web Application using Chrome

How to open an EXE file from a Client Machine through a Web Application using Chrome?
I am able to open the EXE through Internet Explorer since I am using ActiveX Objects to open the Exe file through client side scripting. But since chrome does not support ActiveX I am unable to open the EXE from chrome. Can somebody provide an alternate way to open the exe from chrome?
I know it works if IETab addon is added to the browser for supporting ActiveX. But the client policy will not accept adding add-ons.
I am trying for a solution as such in WebEx websites where a temporary application is run once and each time it is accessed it opens in the temporary app without each time installing it.
Thanks in Advance..
Short and simple answer, NO! it's not possible just by using plain HTML5/JavaScript API, and thank god it's not possible or else the consequences would be devastating! Imagine any random website executing a file on your computer! That would be the worst security nightmare!
But, there are workarounds!
1. You can, for example, use Flash (but you shouldn't) or Silverlight but as mentioned the OP doesn't want any plugin-based solution so I guess they are not as useful.
2. Another solution would be to deploy a Desktop agent, if possible, and then communicate with it using a local Rest API and handle all the native access in that Desktop agent.
Still, the most preferred way would be to just ask your user to scan (or whatever) the document and upload it to your site.
More references can be found here

Open a link in another browser: Javascript

Is it possible to open a link in another browser using Javascript?
I basically want to open Firefox from Google Chrome. I'm (attempting to) write an extension for chrome, but I can't find anything pointing to be able to do this.
I think I could use NPAPI plugins for Chrome, but they are being deprecated and are very insecure, so are there any alternate options?
You did not provide enough info so I can't asses the utility of what I'm about to offer, but here's an option:
Basically, use URL schemes to launch your application of choice from the browser. Start reading this SO question - How do I register a custom URL protocol in Windows?. You'll need to register some prefix - like "firefox://" for it to work. Should also be possible on other platforms.
Of course, this assumes that your user has firefox installed and that you can register on their machine. If this application is meant for a the general public, you'll need to perform those by some other means (installer?)
Yet another way to go is (as mentioned above) to run some native code via the extension. Not a simple choice: once again you need to somehow install the native code on the host machine (and you cannot do that via Chrome extensions, for security reasons).
You can use Native Messaging, paired with a native program which will launch the browser. I would write the native application in something like Python.

Any Javascript functions to get homepage ,search provider ,favourites etc from browsers like Firefox and google chrome

my application is setting browserhome page ,search provider ,favourites etc to all supported browsers like googlechrome,firefox,internet explorer.My purpose is to automate my application using selenium .In case of IE these informationa are stored in registry . so it is easy for me to validate the above details .But for firefox and google chrome its bit problem .So i just want know whether there is any functions available in javascript to check browser homepage ,search provider,favourites etc in firefox and google chrome ?
The simple answer is no. It would be a security and privacy issue if client side js code could access that information. Instead you would need to use a browser extension, or in your case you can just use an external program with administrative rights. I am pretty sure that selenium does not have this functionality built in, however it is all available if you know where the browser stores it. IE uses the registry, but chrome and Firefox use proprietary files in their profile directories. There may be an library that does this, otherwise it is possible

Categories

Resources