VS Code, open in default browser not working? - visual-studio-code

I'm having problems launching an html file into the chrome browser, usually I do this in VS Code by tapping Cmd+1 key, or by clicking the "go live" button, or also right-click on the html.index file then click "open in default browser".
I've rechecked my settings in VS Code, my default browser is set to Chrome. Have relaunched VS Code and even restarted my computer but still can't figure out what the issue is since no error messages are being displayed.
Then I tried downloading a plug-in "open in browser" and it also doesn't launch to chrome, however if I select to launch it with Firefox it works.
Not sure if this helps, but I just upgraded my macOS to Big Sur a couple days ago.
Has anyone encountered the same issue?
Thanks in advance!

Related

Open Link in VSCode Will Create a New Web Browser Under Same Icon as VSCode

I am using VScode version 1.45 with Firefox version 76.0.1 as a default browser (with Ubuntu 18.04.4 LTS). Whenever I tried to open a link in the VSCode, it will open the Firefox browser under same icon as VSCode, and I cannot merge these tabs into existing Firefox web browser.
Same thing also happens when I try to run a program using live server extension. But when I use npm to start the development server, it will create a new window or tab under the Firefox icon.
How could I fix this so whenever I open a browser from VSCode, it will create a new browser or tab under the appropriate (Firefox) icon? Thank you.
There is already an issue on VSCode's GitHub repository and as it is mentioned in the issue, origin of the issue is in snapd.
To fix the issue, as mentioned on aforementioned github issue:
Open some URL from the VSCode snap.
In the new window, navigate to about:profiles.
Ensure that the profile marked as "Default Profile" matches Firefox when opened normally. If not, use the "Set as default profile" button under the correct profile to change the default.
Try making firefox your default browser thorugh firefox and also do check that firefox is your default browser from vscode
I found this solution the best solution
You might have installed VSCode as a snap package, which causes
$XDG_CACHE_HOME to be set to ~/snap/code/common/.cache, which could
cause some cli tools to mistake that for your cache directory, and
install/launch binaries from there.
If you install VSCode from the .deb download, it should fix your issue
I removed vscode from Ubuntu software and download the .deb file from vscode site and install it ... problem solved

Eclipse doesn't run my project

In Eclipse I tried to run my project with Ctrl + F11 (Button Run in menu I also checked). Then coming Android Device Chooser, I choose my phone and wait my app running. But nothing happens. I checked with another project, and it works good, application was running in my phone. Why does it happen?
Thanks.
In Eclipse look at the out put from Console and LogCat.

When launching google apps from command line , don't want to open google chrome browser

When I launch google apps[which is developed by myself] from command line, for example:
chrome.exe --load-and-launch-app="C:\Users\KyawKhaing\Desktop\chrome\Chrome App\Example2"
After I run this, I see Google Chrome Browser open first follow by my google chrome apps launch. I don't want to open google chrome browser when I launch a chrome app. Any one know the solution. Is it possible?
Use the --silent-launch argument.
chrome.exe --silent-launch --load-and-launch-app="C:\Users\KyawKhaing\Desktop\chrome\Chrome App\Example2"
As I was running automation scripts in java, i did notice that chrome did not open using command prompt.
Runtime.getRuntime().exec("C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe \"http:\\www.google.com\"");
From Windows 7, I fixed the problem with the following steps:
Go to the folder C:\Program Files (x86)\Google\Chrome\Application
Right-click on chrome.exe
Select Properties
Select the Compatibility TAB
Click on the "Change settings for all users" button
Make sure to put a Check Mark on "Run this program in compatibility mode for:" and
Select "Windows 7" from the drop down list.
Enjoy!
I don't think you can do it currently. It is a reasonable feature request! You can make feature requests at http://crbug.com/new
There is a bug already logged for this, see http://crbug.com/175381.
We are working on making app background pages keep the browser process alive; once this is done we can fix this bug. The problem currently is due to the way the process is kept alive - if we don't show the browser window the process exits between loading the app and the app opening a window.
I don't think you can do that. The browser is the environment of the app. Its like trying to run a windows app, without running windows. The app depends on the browser. You can't open the app without opening the browser first. Sorry. Hope this helps.

How can I set Chrome as default external browser in Eclipse for Mac?

I think that question is self-explained :-)
When I browse to Application eclipse send me an error.
The simplest way to get Eclipse to recognize Chrome as the default system browser is :
Open Safari.
Go to menu Safari > Preferences > General.
Change 'Default web browser' to Safari.
Close the Preferences dialog.
Re-open the Preferences dialog.
Change 'Default web browser' to Chrome.
Close the Preferences dialog.
This solution is more general as it applies to any application which chooses the incorrect system browser. (thanks to Kelvin Lawrence at IBM)
I am using Eclipse 4.2.0 on an iMac with OSX Mountain Lion. This also works for Eclipse Kepler on Mountain Lion.
I posted the answer on another question like this on stackoverflow, so here it goes:
I found the solution in a blog's post that doesn't exist anymore, it involves configuring the Location to be '/usr/bin/open' and the parameter is '%URL%'.
You need to make sure that google chrome is your default browser and it will work properly. This is the only method that worked for me on OSX Lion.
I solved this by calling /usr/bin/open -a "/Applications/Google Chrome.app" <url>
rubdottocom almost got it. The problem is, that the path contains spaces. If you write a new shell script with the following content:
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' $1
Eclipse can launch a new Chrome instance with it. Sadly, this way it is not possible to open a new tab in an already running instance, as the script exits with the following error message:
[21043:2307:292361872340725:ERROR:process_singleton_mac.cc(102)]
Unable to obtain profile lock.
Ooops! I find the answer here: Is there a way to add Google Chrome as an external web browser in Flash Builder Standalone for Mac?
The exact location is:
/Applications/Google Chrome.app/Contents/MacOS/Google Chrome
It's annoying that you can't enter inside to an "Application folder" (AppName.app) through Finder :-S
Oh Wait! It's not working >_< Safari is opened
you can also try to fix that from eclipse at the menu bar: windows->preferences->general->web browser-> select the radio, Use external web browser and choose your default browser from there. that simple.
Here's a helpful visual showing the /usr/bin/open techinque:
In Finder, right click on Google Chrome.app, select Show Package Contents and browse down to Contents/Mac OS and drag Google Chrome to the Location in Eclipse's Edit External Web Browser dialog box. Enter -url %URL% in the field Parameters. This worked for me on Eclipse Indigo on MacOS 10.7, at least when Chrome was not started before...
My method to set Chrome as a default browser in eclipse is:
Go to Window >> Web browser and then select Chrome.

Mac eclipse xdebug firefox issue

I have worked with eclipse, firefox, and xdebug for months now on a linux-ubuntu machine. recently i moved to a mac 10.6 and set up all these programs and they all work fine until I try to run xdebug using firefox as the default browser in eclipse.
It will work, but the browser must be close other wise it will prompt a message saying
Close Firefox:
A copy of Firefox is already open. Only one copy of Firefox can be open at a time.
and when this happens I can not debug, I have to close the browser and start the debugger again. This becomes very annoying after a few tries.
If I use safari I do not have this issue, it just opens a new tab and I can debug with no problems. I can live with this set up, but I prefer to use FF. any idea why this is happening?
make sure firefox is set as your default browser on your mac and then in eclipse go to preferences->general->web browser and select use external browser and in the window below select default system browser.
This should launch stuff as a new tab in firefox.