Skip to content

Commit

Permalink
Fixed type error in chrome content_script mitro-co#124
Browse files Browse the repository at this point in the history
  • Loading branch information
uno_tasuku committed Jul 2, 2015
1 parent ae43f83 commit 1fbd9f5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions browser-ext/login/chrome/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
* *****************************************************************************
*/

var _CHROME_VERSION = parseInt(navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)[2], 10);
var _CHROME_VERSION = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
_CHROME_VERSION = _CHROME_VERSION && parseInt(_CHROME_VERSION[2], 10);

var LAST_AUTOCOMPLETE_COMPLIANT_CHROME_VERSION = 33;

Expand Down Expand Up @@ -99,7 +100,7 @@ function ContentHelper() {

this.preventAutoFill = function($passwordField, $form) {
$form.attr('autocomplete', 'off');
if (_CHROME_VERSION > LAST_AUTOCOMPLETE_COMPLIANT_CHROME_VERSION) {
if (_CHROME_VERSION && _CHROME_VERSION > LAST_AUTOCOMPLETE_COMPLIANT_CHROME_VERSION) {
console.log('using extreme measures to prevent browser form saving');
var newInput = document.createElement('input');
newInput.setAttribute('type', 'password');
Expand Down

0 comments on commit 1fbd9f5

Please sign in to comment.