Load chrome extension using java programming - java

I have create a download manager like IDM and I want to install chrome extension.
As you see when you install IDM it automatically add chrome extension in it.
I want to do it like that whenever mine Downloader install it will automatically add chrome extension same as IDM.
I'm new in software development so, how to do that I'm using java programming.
I checked IDM folder and found .crx file which mean this is chrome extension.
And I think IDM load extension from this folder to chrome.
But according to my search Google disable to install chrome extension out of Chrome web store then how IDM do it.
Any suggestion which things I need to do that ?
UPDATE:
I try to install it using preference JSON but its not working.
I followed a method which is described here.
please check out this link.

After facing a same problem, I found this Google article which will help you to Load Chrome extension from outside.
An extension that is not installed from the Chrome Web Store is known as an external extension. For developers who want to distribute an extension as part of the installation process for other software, or for network admins that want to distribute an extension throughout their organization, Google Chrome supports the following extension installation methods:
Using a preferences JSON file (for Mac OS X and Linux only) Using the
Windows registry (for Windows only) Both ways support installing an
extension hosted at an update_URL. On Windows and Mac, the update_URL
must point to the Chrome Web Store where the extension must be hosted.

Related

Upload and Download File over Remote Node without Input Tag as File type

I am Automating a Scenario for Web Application Over Windows which includes the File And Images to be Uploaded to a website, and on my local it is working fine through robot class **
but when i execute my tests over Jenkins my jobs get failed. I need to Upload my file to a web site executing over Remote machine.
**
For File Upload :-
I cannot simply upload the file using send keys method since The Input tag doesn't have File Type i.e. input[type!='file'].
Are there any other solutions to achieve this without using Robot Classes and Auto-It.
**
For File Download:-
**
And I also need to download the File from a web Application over remote and verify that it has been downloaded successfully provided there is no API for this.
When the file gets downloaded over the remote, I am not able to verify that whether it has been downloaded or not since Remote Machine execution is not visible.
Is there any way to achieve this, kindly please suggest.
As you are using remote desktop for execution of scripts which would fail robot class action calls as it needs screen to be unlocked.
For the better results try using AutoIt is a free ware tools used for such purposes.
AutoIt will identify browse file objects and perform actions on it as Selenium does on Web applications.
Identify the Windows control, through AutoItV3 Windows Info tool.
More detailed steps to use AutoIt is present in the below link:
https://www.softwaretestinghelp.com/autoit-tutorial-to-download-write-autoit-script/
Thanks and regards,
Sandeep Jaju

Using Steam Web API from an Android app

I am trying to add some information from Steam into my Android app.
I see that Steam has Steamworks, but that is only built for Windows, OSX and Linux.
Furthermore, I saw that they also have a Web API that could also be accessed from a mobile application. But all the methods in the API require a 64 bit SteamID, which they say can be retrieved using OpenID. I downloaded the Google Oauth Client Library for JAVA but I reading through the documentation, I don't understand how I can get a SteamID for a user using this library.
Has anyone used this lib or another open source lib to get a SteamID?
UPDATE
To get direct SteamID64.
Login to Steam using a web broswer.
Once logged click on your profile and add ?xml=1 to browser url address
http://steamcommunity.com/id/yourusername/?xml=1 or
http://steamcommunity.com/profiles/yourprofilenumber/?xml=1 (if you have not set a public username yet)
I think this is number in profile link or steamID64 example: http://steamcommunity.com/profiles/76561198113616635
Steamid will be: 76561198113616635
To check it online you can go to https://steamid.io/lookup
In Android app, I think after authorize, steam will give you that number and key.

Launch an Application from a Browser

I would like to have a link or button on my web site that launches
vim (an editor) on a specific file (e.g., myfile.txt) on my local machine.
I want to launch C:\Vim\Vim74\gvim.exe on C:\Users\paulco\myfile.txt form any browser.
I want this to work on all (realistically most) browsers.
I actively use Chrome, Opera, FireFox and IE (in that order of preference).
In order for it to work across all of these browsers,
I think the script has to Java-based.
Does anyone know how to do this?
Does anyone have a Java-based script that does this?
Here are some resources I found on the topic.
But either they are IE specific or don't work.
Launch application from a browser
http://msdn.microsoft.com/en-us/library/aa767914%28VS.85%29.aspx
I have tested the following on Internet Explorer, Chrome, Opera and Firefox.
The browser has to run on a Windows operating system, Linux and Mac require different aproaches.
Solution is to define a protocol handler for a custom protocol.
1) Take this HTML example, it should open the specified text file using notepad.exe:
Open Textfile
2) You need to define the protocol handler in the windows registry, save the following to a file named testing.reg and execute it (double click on it), or enter the values manually using regedit:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\test]
#="URL:Editor test"
"URL Protocol"=hex(2):00,00
[HKEY_CLASSES_ROOT\test\DefaultIcon]
#="\"C:\\Windows\\system32\\notepad.exe\""
[HKEY_CLASSES_ROOT\test\shell]
[HKEY_CLASSES_ROOT\test\shell\open]
[HKEY_CLASSES_ROOT\test\shell\open\command]
#="\"C:\\temp\\editor.bat\" %1"
3) As you can see, I am not calling notepad.exe directly, but a c:\temp\editor.bat batch file. This is because the file-parameter has to be modified. using the %1 as a parameter will pass the complete URL including the test: custom protocol name to the shell. In the script, I use a simple substring pattern to extract the specified file name and call the editor:
REM editor.bat
set param=%1
notepad %param:~5%
That's all!

System-level Proxy switcher using Java

Can we use Java (included JNA) to change Windows proxy settings (System level, not just for JVM) on the fly. I found some code snippets for C# where they are using InternetSetOption() API provided by wininte.dll. I've tried but it does not work also. All I want is to change IE and Chrome proxy settings by running a JAR file (desktop app) without restarting the browser.
Thank you so much!

How we can open browser through j2me code in ubuntu os?

How we can open browser through Java ME code in ubuntu os ?
I am using the below given code
String URL1="any url";
midlet.platformRequest(URL1);
The above line does not open the browser in the UBUNTU 10.10 but its working fine on windows os.
Please help me if any body else have faced the same problem.
if you use emulator (which one?), check if it is properly configured (emulators tend to have stuff like that in User Guide y'know)
eg this article provides a recipe for WTK / ME SDK:
...The J2ME Wireless Toolkit supports the platformRequest() method, but
before using the method you must tell the toolkit what to do when it's
invoked. You can associate only one platform service with
platformRequest(). For instance, if for testing purposes you associate
the method with your browser, the browser will be launched every time
you call platformRequest(). If you need more flexibility, you can
associate platformRequest() with a script that will use the URL
scheme to route the request to the right handler.
To associate a particular platform service with platformRequest(),
simply add a com.sun.midp.midlet.platformRequestCommand attribute to
the system.config file in the toolkit's lib directory. For example, to
invoke the Mozilla browser whenever platformRequest() is called, add
the following to system.config:
# Associate the Mozilla browser with platformRequest() - Windows
com.sun.midp.midlet.platformRequestCommand: "C:\Program Files\mozilla.org\Mozilla\mozilla.exe"
Given this setting, the call
platformRequest("http://developers.sun.com/mobility") will launch
Mozilla, and the browser will navigate to Sun's developer mobility
portal...

Categories