ReferenceError: Can't find variable: __gCrWeb ReferenceError: Can't find variable: __gCrWeb ios ios

ReferenceError: Can't find variable: __gCrWeb


__gcrweb is a reference by gcrweb.js, which is a local (on device) js getting injected by the iOS version of Chrome.

Google needs to do this for some extended functionality (mostly inserting/retrieving login credentials and other form information you stored via another synced Chrome browser) which isn't provided by the native webview it's built on and can't be added to it otherwise.

This should not affect any parts of your code and i'd get rid of it by ignoring it in your error logging (the error should always be the same string), for example:

https://docs.sentry.io/clients/javascript/config/

https://rollbar.com/docs/notifier/rollbar.js/#ignoring-specific-exception-messages

Another solution could be to make sure that the reference always exists by declaring it yourself at the beginning of your js init

if (!window.__gCrWeb) window['__gCrWeb'] = {};

just like Google does it.