I tried using your modified script on 10.14 and found that while it did
set chrome as the default browser, it messed up a lot of my application
and dock icons to be the generic icons. I had to revert because of that
... any known solutions? @lennyvak...