Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/ext/background.js

Issue 4726788198498304: Issue 2537 - Don't assume "Chrome/" to be given in the user agent string (Closed)
Patch Set: Created May 18, 2015, 1:42 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/ext/background.js
===================================================================
--- a/chrome/ext/background.js
+++ b/chrome/ext/background.js
@@ -360,7 +360,8 @@
// Since Chrome 38 requests of type 'object' (e.g. requests
// initiated by Flash) are mistakenly reported with the type 'other'.
// https://code.google.com/p/chromium/issues/detail?id=410382
- if (parseInt(navigator.userAgent.match(/\bChrome\/(\d+)/)[1], 10) >= 38)
+ var match = navigator.userAgent.match(/\bChrome\/(\d+)/);
+ if (match && parseInt(match[1], 10) >= 38)
{
ext.webRequest.indistinguishableTypes = [
["OTHER", "OBJECT", "OBJECT_SUBREQUEST"]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld