Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do something similar with chrome (have to use sometimes it for testing compatibility), but just create a fresh profile every time with:

  chrome_dir=$(mktemp -d)
  
  echo "Using temp dir: $chrome_dir"
  
  /usr/bin/google-chrome \
      --incognito \
      --user-data-dir="$chrome_dir" \
      --window-size=1280,1280 \
      --no-referrers \
      --no-pings \
      --no-experiments \
      --disable-translate \
      --dns-prefetch-disable \
      --disable-background-mode \
      --no-first-run \
      --no-default-browser-check
  
  wait $!
  
  rm -rf "$chrome_dir"


And on the day that “mktemp” fails for some reason, that script will then delete your entire home directory.


And on the day that “mktemp” fails for some reason, that script will then delete your entire home directory.

That's a good point but an incredibly lazy comment. I think the possible failure of 'mktemp' could be protected against by using 'set -e' at the start of the script.


Nice.

I think --incognito makes no difference if you throw away the data dir anyhow.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: