take over changes from PR 67 from garetjax/phpbrowscap