prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  BrowserExtensionsFilter: _gCrWeb autofill error in iOS Chrome not ignored
  This seems to be a relatively well-known issue on Chrome for iOS. It seems this could be ignored safely by the filter as well.
  
  Source: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/7VU0_VvC7mE
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `src/sentry/filters/browser_extensions.py`
  Content:
  ```
  1 from __future__ import absolute_import
  2 
  3 from .base import Filter
  4 
  5 import re
  6 
  7 EXTENSION_EXC_VALUES = re.compile('|'.join((re.escape(x) for x in (
  8     # Random plugins/extensions
  9     'top.GLOBALS',
  10     # See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error. html
  11     'originalCreateNotification',
  12     'canvas.contentDocument',
  13     'MyApp_RemoveAllHighlights',
  14     'http://tt.epicplay.com',
  15     'Can\'t find variable: ZiteReader',
  16     'jigsaw is not defined',
  17     'ComboSearch is not defined',
  18     'http://loading.retry.widdit.com/',
  19     'atomicFindClose',
  20     # Facebook borked
  21     'fb_xd_fragment',
  22     # ISP "optimizing" proxy - `Cache-Control: no-transform` seems to
  23     # reduce this. (thanks @acdha)
  24     # See http://stackoverflow.com/questions/4113268
  25     'bmi_SafeAddOnload',
  26     'EBCallBackMessageReceived',
  27     # See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
  28     'conduitPage'
  29 ))), re.I)
  30 
  31 EXTENSION_EXC_SOURCES = re.compile('|'.join((
  32     # Facebook flakiness
  33     r'graph\.facebook\.com'
  34     # Facebook blocked
  35     r'connect\.facebook\.net\/en_US\/all\.js',
  36     # Woopra flakiness
  37     r'eatdifferent\.com\.woopra-ns\.com',
  38     r'static\.woopra\.com\/js\/woopra\.js',
  39     # Chrome extensions
  40     r'^chrome(?:-extension)?:\/\/',
  41     # Cacaoweb
  42     r'127\.0\.0\.1:4001\/isrunning',
  43     # Other
  44     r'webappstoolbarba\.texthelp\.com\/',
  45     r'metrics\.itunes\.apple\.com\.edgesuite\.net\/',
  46 )), re.I)
  47 
  48 
  49 class BrowserExtensionsFilter(Filter):
  50     id = 'browser-extensions'
  51     name = 'Filter out errors known to be caused by browser extensions'
  52     description = 'Certain browser extensions will inject inline scripts and are known to cause errors.'
  53 
  54     def get_exception_value(self, data):
  55         try:
  56             return data['sentry.interfaces.Exception']['values'][0]['value']
  57         except (LookupError, TypeError):
  58             return ''
  59 
  60     def get_exception_source(self, data):
  61         try:
  62             return data['sentry.interfaces.Exception']['values'][0]['stacktrace']['frames'][-1]['abs_path']
  63         except (LookupError, TypeError):
  64             return ''
  65 
  66     def test(self, data):
  67         """
  68         Test the exception value to determine if it looks like the error is
  69         caused by a common browser extension.
  70         """
  71         if data.get('platform') != 'javascript':
  72             return False
  73 
  74         exc_value = self.get_exception_value(data)
  75         if exc_value:
  76             if EXTENSION_EXC_VALUES.search(exc_value):
  77                 return True
  78 
  79         exc_source = self.get_exception_source(data)
  80         if exc_source:
  81             if EXTENSION_EXC_SOURCES.match(exc_source):
  82                 return True
  83 
  84         return False
  85
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/src/sentry/filters/browser_extensions.py b/src/sentry/filters/browser_extensions.py
  --- a/src/sentry/filters/browser_extensions.py
  +++ b/src/sentry/filters/browser_extensions.py
  @@ -24,6 +24,8 @@
       # See http://stackoverflow.com/questions/4113268
       'bmi_SafeAddOnload',
       'EBCallBackMessageReceived',
  +    # See https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/7VU0_VvC7mE
  +    '_gCrWeb',
       # See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
       'conduitPage'
   ))), re.I)
  
verification_info: {"golden_diff": "diff --git a/src/sentry/filters/browser_extensions.py b/src/sentry/filters/browser_extensions.py\n--- a/src/sentry/filters/browser_extensions.py\n+++ b/src/sentry/filters/browser_extensions.py\n@@ -24,6 +24,8 @@\n     # See http://stackoverflow.com/questions/4113268\n     'bmi_SafeAddOnload',\n     'EBCallBackMessageReceived',\n+    # See https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/7VU0_VvC7mE\n+    '_gCrWeb',\n     # See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx\n     'conduitPage'\n ))), re.I)\n", "issue": "BrowserExtensionsFilter: _gCrWeb autofill error in iOS Chrome not ignored\nThis seems to be a relatively well-known issue on Chrome for iOS. It seems this could be ignored safely by the filter as well.\r\n\r\nSource: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/7VU0_VvC7mE\n", "before_files": [{"content": "from __future__ import absolute_import\n\nfrom .base import Filter\n\nimport re\n\nEXTENSION_EXC_VALUES = re.compile('|'.join((re.escape(x) for x in (\n    # Random plugins/extensions\n    'top.GLOBALS',\n    # See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error. html\n    'originalCreateNotification',\n    'canvas.contentDocument',\n    'MyApp_RemoveAllHighlights',\n    'http://tt.epicplay.com',\n    'Can\\'t find variable: ZiteReader',\n    'jigsaw is not defined',\n    'ComboSearch is not defined',\n    'http://loading.retry.widdit.com/',\n    'atomicFindClose',\n    # Facebook borked\n    'fb_xd_fragment',\n    # ISP \"optimizing\" proxy - `Cache-Control: no-transform` seems to\n    # reduce this. (thanks @acdha)\n    # See http://stackoverflow.com/questions/4113268\n    'bmi_SafeAddOnload',\n    'EBCallBackMessageReceived',\n    # See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx\n    'conduitPage'\n))), re.I)\n\nEXTENSION_EXC_SOURCES = re.compile('|'.join((\n    # Facebook flakiness\n    r'graph\\.facebook\\.com'\n    # Facebook blocked\n    r'connect\\.facebook\\.net\\/en_US\\/all\\.js',\n    # Woopra flakiness\n    r'eatdifferent\\.com\\.woopra-ns\\.com',\n    r'static\\.woopra\\.com\\/js\\/woopra\\.js',\n    # Chrome extensions\n    r'^chrome(?:-extension)?:\\/\\/',\n    # Cacaoweb\n    r'127\\.0\\.0\\.1:4001\\/isrunning',\n    # Other\n    r'webappstoolbarba\\.texthelp\\.com\\/',\n    r'metrics\\.itunes\\.apple\\.com\\.edgesuite\\.net\\/',\n)), re.I)\n\n\nclass BrowserExtensionsFilter(Filter):\n    id = 'browser-extensions'\n    name = 'Filter out errors known to be caused by browser extensions'\n    description = 'Certain browser extensions will inject inline scripts and are known to cause errors.'\n\n    def get_exception_value(self, data):\n        try:\n            return data['sentry.interfaces.Exception']['values'][0]['value']\n        except (LookupError, TypeError):\n            return ''\n\n    def get_exception_source(self, data):\n        try:\n            return data['sentry.interfaces.Exception']['values'][0]['stacktrace']['frames'][-1]['abs_path']\n        except (LookupError, TypeError):\n            return ''\n\n    def test(self, data):\n        \"\"\"\n        Test the exception value to determine if it looks like the error is\n        caused by a common browser extension.\n        \"\"\"\n        if data.get('platform') != 'javascript':\n            return False\n\n        exc_value = self.get_exception_value(data)\n        if exc_value:\n            if EXTENSION_EXC_VALUES.search(exc_value):\n                return True\n\n        exc_source = self.get_exception_source(data)\n        if exc_source:\n            if EXTENSION_EXC_SOURCES.match(exc_source):\n                return True\n\n        return False\n", "path": "src/sentry/filters/browser_extensions.py"}], "after_files": [{"content": "from __future__ import absolute_import\n\nfrom .base import Filter\n\nimport re\n\nEXTENSION_EXC_VALUES = re.compile('|'.join((re.escape(x) for x in (\n    # Random plugins/extensions\n    'top.GLOBALS',\n    # See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error. html\n    'originalCreateNotification',\n    'canvas.contentDocument',\n    'MyApp_RemoveAllHighlights',\n    'http://tt.epicplay.com',\n    'Can\\'t find variable: ZiteReader',\n    'jigsaw is not defined',\n    'ComboSearch is not defined',\n    'http://loading.retry.widdit.com/',\n    'atomicFindClose',\n    # Facebook borked\n    'fb_xd_fragment',\n    # ISP \"optimizing\" proxy - `Cache-Control: no-transform` seems to\n    # reduce this. (thanks @acdha)\n    # See http://stackoverflow.com/questions/4113268\n    'bmi_SafeAddOnload',\n    'EBCallBackMessageReceived',\n    # See https://groups.google.com/a/chromium.org/forum/#!topic/chromium-discuss/7VU0_VvC7mE\n    '_gCrWeb',\n    # See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx\n    'conduitPage'\n))), re.I)\n\nEXTENSION_EXC_SOURCES = re.compile('|'.join((\n    # Facebook flakiness\n    r'graph\\.facebook\\.com'\n    # Facebook blocked\n    r'connect\\.facebook\\.net\\/en_US\\/all\\.js',\n    # Woopra flakiness\n    r'eatdifferent\\.com\\.woopra-ns\\.com',\n    r'static\\.woopra\\.com\\/js\\/woopra\\.js',\n    # Chrome extensions\n    r'^chrome(?:-extension)?:\\/\\/',\n    # Cacaoweb\n    r'127\\.0\\.0\\.1:4001\\/isrunning',\n    # Other\n    r'webappstoolbarba\\.texthelp\\.com\\/',\n    r'metrics\\.itunes\\.apple\\.com\\.edgesuite\\.net\\/',\n)), re.I)\n\n\nclass BrowserExtensionsFilter(Filter):\n    id = 'browser-extensions'\n    name = 'Filter out errors known to be caused by browser extensions'\n    description = 'Certain browser extensions will inject inline scripts and are known to cause errors.'\n\n    def get_exception_value(self, data):\n        try:\n            return data['sentry.interfaces.Exception']['values'][0]['value']\n        except (LookupError, TypeError):\n            return ''\n\n    def get_exception_source(self, data):\n        try:\n            return data['sentry.interfaces.Exception']['values'][0]['stacktrace']['frames'][-1]['abs_path']\n        except (LookupError, TypeError):\n            return ''\n\n    def test(self, data):\n        \"\"\"\n        Test the exception value to determine if it looks like the error is\n        caused by a common browser extension.\n        \"\"\"\n        if data.get('platform') != 'javascript':\n            return False\n\n        exc_value = self.get_exception_value(data)\n        if exc_value:\n            if EXTENSION_EXC_VALUES.search(exc_value):\n                return True\n\n        exc_source = self.get_exception_source(data)\n        if exc_source:\n            if EXTENSION_EXC_SOURCES.match(exc_source):\n                return True\n\n        return False\n", "path": "src/sentry/filters/browser_extensions.py"}]}