Coder Social home page Coder Social logo

Comments (16)

stereokai avatar stereokai commented on May 22, 2024

Will have a look when I'm home. Where is the code that calls this?

from node-browser_process.

caspervonb avatar caspervonb commented on May 22, 2024

It's in type which yields the type of the browser, https://github.com/caspervonb/node-browser_process/blob/master/lib/index.js#L74

from node-browser_process.

stereokai avatar stereokai commented on May 22, 2024

Got it. Will look at it later.

from node-browser_process.

caspervonb avatar caspervonb commented on May 22, 2024

Firefox does pass the tests tho so it's not an issue as it works fine, I'm just not getting it to print to stdout in a cmd.exe for whatever reason which is a bit of a what the hell is going on here moment but i'll just write it up to my inexperience with the cmd shell.

from node-browser_process.

stereokai avatar stereokai commented on May 22, 2024

Have you tried Powershell?

from node-browser_process.

caspervonb avatar caspervonb commented on May 22, 2024

Yeah same results as above in the issue (which where from cmd.exe shell).

from node-browser_process.

stereokai avatar stereokai commented on May 22, 2024

I don't know yet. I'll have a look at home. Do you have the latest Chrome?

from node-browser_process.

caspervonb avatar caspervonb commented on May 22, 2024

Do you have the latest Chrome?

How can I test the version? 😀

But same results with both chrome and chromium, latest'ish (44 or so).

Noticing that the executable behaves differently than on unix, on mac and linux the executable is blocking, killing it will kill the tab.

On windows, it just returns immediately.

from node-browser_process.

stereokai avatar stereokai commented on May 22, 2024

You can check in Chrome -> About.

That's weird, when I terminated amok, my chrome quitted.

from node-browser_process.

caspervonb avatar caspervonb commented on May 22, 2024

You can check in Chrome -> About.

I know, just found it amusing in an issue about --version not working 😄
Based on the folder names its 45.0 46.0.

from node-browser_process.

stereokai avatar stereokai commented on May 22, 2024

Yeah :D

Alright so I'll have a look when I'm home.

from node-browser_process.

stereokai avatar stereokai commented on May 22, 2024

@caspervonb I got you covered bro.

chrome --version flag/switch is not supported on Windows: https://code.google.com/p/chromium/issues/detail?id=158372

But when there's a will, there's a way. The version number is stored in the registry in the uninstall information. So we can query it via the command line, as per the example in the above link:

reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome" /v DisplayVersion

However, this did not work for me. The reason being - the key does not exist. My immediate assumption was that in the 2 years since this idea was suggested, Google has released the 64bit version of Chrome, so, a registry scour was in order. Eventually I have found my target:

reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Google Chrome" /v DisplayVersion

Which outputs:

DisplayVersion    REG_SZ    44.0.2403.125

Which you can parse with a regex to get the version number. To strike out all possible fail points, I suggest you check the original 32bit query on a 32bit Chrome installatation - and in your code, you could try one and if it fails, try the other. They are bound to succeed, because this information must be in the registry - unless someone is using Chrome in a hackish portable way, and I don't even know if that is even possible or something you should care about.

from node-browser_process.

caspervonb avatar caspervonb commented on May 22, 2024

All right that's a shame, was hoping of using --version as an agnostic way to identify the browser name and version without resolving to platform specific things like the registry.

Think I'll revert to just using the basename of the default paths for matching the type, otherwise it'll become too complex with branching logic etc when it should just be a simple lookup.

For detect, which is yet to be implemented however this is gold 👍, need to report browser name, type, version, path, etc.

from node-browser_process.

stereokai avatar stereokai commented on May 22, 2024

Well, I'm happy I could help with something..

from node-browser_process.

caspervonb avatar caspervonb commented on May 22, 2024

Rebased a little on master, I know I know but with 0 forks and 0 current branches its fine, really.

Now if the executable name is the default one, it'll figure out the type but, there are failures which the commit was supposed to fix which is things like Google\ Chrome\ Canary which is the executable name of canary on OS X.

But, separate issue.

Thanks for the digging @stereokai 😀

from node-browser_process.

stereokai avatar stereokai commented on May 22, 2024

F***ing A man :)

from node-browser_process.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.