Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

On windows, getting chrome version opens browser and does not work. #6

Open
cderv opened this issue Nov 11, 2018 · 4 comments · May be fixed by #7
Open

On windows, getting chrome version opens browser and does not work. #6

cderv opened this issue Nov 11, 2018 · 4 comments · May be fixed by #7

Comments

@cderv
Copy link

cderv commented Nov 11, 2018

I am on windows 10 and decapitated::chrome_version() is not working properly. This affects others functions that calls it, like decapitated::chrome_dump_pdf().

This is a related to a known bug I think
https://bugs.chromium.org/p/chromium/issues/detail?id=158372
--version does not work on windows.

Looking at the code, I am not sure to see why the need to get the version. In chrome_dump_pdf for example, vers is not used after being assigned. Should we get rid of chrome_version calls in functions that do not need it ?

If version is needed, it needs a workaround on windows.

To share, in case you don't know, there is another approach with chrome headless in pagedown to propose a function like chrome_dump_pdf

@cderv cderv changed the title On windows, getting chrome version opends browser On windows, getting chrome version opens browser and does not work. Nov 11, 2018
@cderv
Copy link
Author

cderv commented Nov 11, 2018

For getting the version on windows, I did not manage to make the workaround proposed in chromium bug report with wmic datafile

However, using powershell it worked.

args <- c(
  "-NoLogo", 
  "-NoProfile",
  "-Command",
  glue::glue("(Get-Item -Path {glue::single_quote(Sys.getenv('HEADLESS_CHROME'))}).VersionInfo.ProductVersion")
)

res <- processx::run("powershell", args)
trimws(res$stdout)
#> [1] "70.0.3508.0"

Is this something that we could do when on windows OS ?

@hrbrmstr
Copy link
Owner

oh i rly like that approach! do you want me to change the code or would you like to PR?

@cderv
Copy link
Author

cderv commented Nov 11, 2018

I could do a PR for chrome_version to this specific case on windows.

About the call to chrome_version,

vers <- chrome_version(quiet=TRUE)

Object vers does not seem to be used after. am I missing something ?

@hrbrmstr
Copy link
Owner

I'm not sure why I put that in (I think I had plans to potentially enable functions by new features they might add if folks need to keep using older versions.

@cderv cderv linked a pull request Nov 11, 2018 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants