How to set xdg-settings (or some other setting) to launch different web browsers based on launching application - browser

I would like to have default launching of a browser to be different when launching from different programs.
For instance:
when I open a link from Discord I'd like it to be launched in
Firefox.
When I run npm run dev, I want my development app to
launch in Brave.
As for the second example, the issue I run into is that the browser window gets hi-jacked every time the code is updated. So I'd like the default launch from the npm application to launch a different browser than the one I'm using for research.

Related

Stop node-debug from opening a new browser window

The command:
node-debug sls offline
opens a new browser window every time it is run.
How do we stop it from opening a new window every time? I want to reuse the existing window!
This is a known issue with node inspector. Take a look here.
Since 0.9.0 we use https://github.com/benderjs/browser-launcher2 to
start the browser, and make sure it's Chrome/Chromium/Opera (i.e. the
browsers that can properly render node inspector; we detect installed
browsers in the system and choose the most appropriate one; earlier we
used opener module which just delegated opening the browser to the OS,
which would open the defaul browser, which could have been e.g.
Firefox) and this could be the reason why the behavior has changed.
browser-launcher2 actually does a bit more than just launching a
browser, for instance it creates a new profile for Chrome in a
subfolder of ~/ - this is probably the issue that #CalvinScott
reported (i.e. Chrome that was opened was the new profile created by
browser-launcher, not your original profile; you should be able to
open your original profile of Chrome normally)
Also, you may consider this:
Since version 6.3, Node.js provides a buit-in DevTools-based debugger
which mostly deprecates Node Inspector, see e.g. this blog post to get
started. The built-in debugger is developed directly by the
V8/Chromium team and provides certain advanced features (e.g.
long/async stack traces) that are too difficult to implement in Node
Inspector.

Browsers not visible when running Selenium2/Webdriver tests with Hudson

I am using Hudson CI to run an ant script which compiles and executes Selenium2/Webdriver tests (written as TestNG tests). These tests are set to run in a Firefox browser, not with headless HTMLUnit. During the Hudson build, I don't see any errors in the console output or the TestNG report, and my custom report seems to indicate that my tests do run normally, but I noticed that no actual Firefox browser is ever launched during the build.
In contrast, whenever I run my Selenium2/WebDriver tests via Eclipse or the command line either as a TestNG test or an Ant build, the tests always launch a browser on which I can see the tests being run. I just can't figure out why the browser does not appear. All of the aforementioned details suggest that the tests are in fact run properly, but the Hudson server is run on my local machine and no additional resources are apparently used to run the tests in their own Firefox instance.
I am not using Selenium Grid at the moment. Also, regardless if I run the tests sequentially or in parallel across multiple threads through Hudson, I am still not able to see any active browsers. I do vaguely remember at one point seeing Hudson launch an actual browser yesterday when I began this work, but I have yet to see once since. This makes me wonder if I possibly configured something incorrectly in my Hudson job.
Any help is greatly appreciated!
Login to test node
Open the window services and locate Jenkins Slave services
Right click and select properties
Go to “Log On” tab
Make sure option “Local System Account” is selected and tick the option “Allow service to interact with desktop”
Click OK to save the setting
Restart the services.

How can I control in which of my desktops the browser called by selenium remote server will pop up?

I am running tests from phpunit using selenium. Since the tests take a couple of minutes proceed, I would like to switch to another desktop and do some tasks while the tests are running in the background.
However, since every test calls a new browser via selenium remote server, and a new test management window and a application window are started, these new windows do not appear in the desktop which I started the php tests from, but in my current desktop taking the focus away from the window I am working in.
How can I control that the browsers are always opens in the desktop that is in the background (where I start phpunit)? I am using Kubuntu i.e. the KDE Desktop.
Thanks for any suggestions!
This is probably a bit late, but for anyone reading this: When you launch your selenium RC server, you could try exporting to a specific display using the command:
export DISPLAY="somedisplay" && java -jar /path/to/selenium-server.jar
Using this, you could also export it to for instance an X virtual frame buffer (Xvfb), effectively running it in the background.

Selenium not opening virtual browser window on Linux

I am using Selenium to conduct user interface tests with JUnit, in a Maven project. The project is located on a Linux box running IEs4Linux and Wine to allow us to run the tests in IE.
Right now I'm using Xming along with Putty to view the virtual browser windows, and I am able to open an IE window with the command "ie6", and I can see it functioning correctly in Xming.
When setting up the Selenium RC using the *iexplore browser mode, I get the following in the RC server window:
INFO - Command request: getNewBrowserSession[*iexplore, http://asdfasdfasdf.com:7011/, ] on session null
INFO - creating new remote session
INFO - Allocated session asdfasdfasdfasdfasdfasdfadsf for http://asdfasdfasdf.com:7011/, launching...
INFO - Launching Embedded Internet Explorer...
INFO - Launching Internet Explorer HTA...
Which is normal, except the browser never opens and the tests never run. Using *iexploreproxy or *piiexplore, I get the following error from the RC:
13:46:06.957 INFO - Got result: Failed to start new browser session: org.openqa.selenium.server.browserlaunchers.WindowsUtils$WindowsRegistryException: Problem while managing the registry, OS Version '2.6.18-164.11.1.el5', regVersion1 = null on session null
Is there any reason Selenium would fail to launch the IE window using *iexplore? I would use *firefox or *chrome but the application I am testing is only compatible with IE. Also note that these test cases run perfectly fine on my local Windows machine.
Please let me know if you need more details.
Got it working...in case anybody else attempts to use a similar configuration to mine...for whatever reason it seems you cannot start up the server with the Http.proxyName and Http.proxyPort settings when using IEs4Linux to open IE6...it will just ignore them. You have to manually open the IE6 browser and enter the proxy settings yourself (most likely localhost and 4444).
I think I'll start looking into IE7 for Linux...apparently IE6 doesn't like Selenium's use of XPaths.

Launching a web page in a different process

I want to launch the browser in a different process when a particular link is clicked on the page. When I checked the net I found the following tip: http://www.dslreports.com/faq/3849 . But there we have to change the registry. Is there any simple way of doing this without touching the registry?
If you use the Google Chrome browser, each new window or tab runs in a separate process. Internet Explorer version 8 will do the same (it's currently in the second beta round).
Earlier versions of IE will run a new window in a separate process if it is launched from, say, the Start menu or the command line, or a link in an email (but not by clicking a link within IE). I imagine you could create a proxy that the client would run through, which would intercept the links you care about and launch them by running a command line request. That seems like more trouble than mucking with the registry though (assuming that registry change still works -- looks like your link is from 2002).
I don't believe this is possible unless you change the client computer setup or software it's running.
Why do you want to do this?

Resources