Made a app to start browser sync , anyone interested?

Hi there,
I loved the new update with the option to use browser sync but i found it a bit awkward to have to open the cmd each time and paste the line in to run the start the browser sync.

So i made a small c# .net core app for those of us using windows so we don’t need to paste anything just click the app and the browser sync will start automatically.

A even better option is if the app is placed in the pinegrow folder and maybe the pinegrow team add a link in pinegrow menu under user browser sync to trigger my app to start the browser sync.
It would be nice to be able to do everything from pinegrow without having to click my app but i guess placing my app in the start menu will also work better then having to open cmd and paste the line to run browser sync.

If anyone are interested ill finish up the app and share it or if the pinegrow team want to use it ill give it to them.

1 Like

Pretty neat @beatngu - I’m guessing that with your app the default hostname/port, or…?

I added a small settings file so the user can get their port from pinegrow and just copy paste it to the settings file since it may vary from user to user what ports they use.

Here is the download link if anyone want to use it : https://www.dropbox.com/s/1zmlu6azh56goeo/StartBrowserSync.zip?dl=0

1.Download the file and unpack it anywhere on your pc.
2.Open pinegrow and click --> Support --> Show API url
3.Copy the url marked in red
4.Go to the folder of StartBrowserSync
5.Open the text file called api_url.txt and replace the url with the one you copied from pinegrow and save.
6.Click the icon of StartBrowserSync and you should be ready to use browser sync.

You may have to download .net core 3.1 if you don’t have it installed on your pc here is the link : Download .NET Core 3.1 (Linux, macOS, and Windows) (microsoft.com)

1 Like

This looks good, I too dislike fiddling around to start browser sync. But after installing this, plus the 3.1 .net update, reconfiguring the txt file as instructed (and restarting windows), I get localhost refused to connect. if I use the app and then from Pinegrow ‘Open the file browser’. However browser opens OK if browser sync is turned off. Any ideas what I need to do?

Not sure what’s going on , what happens if you do everything manual as described in the pinegrow documentation do you get a error then as well?

@beatngu No love for me either. Mind sending me the project?

What error do you get?
Is it the command window?
Nothing wrong with the code so it must be something missing on the pc.
I am using it myself and i have debugged it just to make sure everything is working and it’s working fine.Tested on latest version of windows 10 x64 with net core 3.1 x64.

It is refusing the connection - error in the browser, no place else. Works fine if I start using browser-sync using the CLI.

That’s weird.
I use edge as default browser.
I just cleaned the solution and rebuilt it , you can check if this works for you.
Or else if you have the dev tools i can send the solution but not much to debug since it’s just sending the string to cmd.

Here is the link to the rebuilt version https://www.dropbox.com/s/6k86ryh6s8abth9/netcoreapp3.1.zip?dl=0

Did some testing again yesterday and installed this on a fresh surface pro and installed pinegrow to test.
This laptop has not visual studio and all the microsoft dev tools installed and it worked perfect.

One thing i must mention is , you want the latest net core SDK 3.1.404 and not just the runtime.
So on the download page do not just install the runtime on the right side but install the latest stable release of the SDK 3.1.404.

There may be something iffy with the latest runtime and most of the time i don’t use the latest because of bugs and stuff like that but i thought with a small app like this it would not mather.

If this does not solves you problems i will convert it down to normal netframework 4.6 and that is very stable and i use that often in other apps i make.

PS: I would also like to mention in the pinegrow documentation of the browser sync it may be easier for people to use this link https://nodejs.org/en/download/ instead of the link provided in the documentation that is going to the folder https://nodejs.org/download/ to install nodejs. It may be a bit confusing and i think its easier to just use the installers.

Works as expected if I open node.js from command prompt and enter

browser-sync start --proxy “http://127.0.0.1:40000

But if I close that and run the app, again get ‘localhost refused to connect’.

The rebuilt version works for me, though it leaves the command window open which the first version did not.

That apart, most useful, many thanks.

Awesome that it works for you , but weird that the first one does not work since i did not change the code on the second one.

The window is supposed to stay open , i find it easy to use to see what’s running on my pc.
However i do understand some want to have the window disabled since it saves one click so i will make a second version with hidden command window that only runs in the background.