Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pross committed Oct 20, 2017
1 parent c8d3983 commit 10da0f8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion content.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,24 @@ chrome.runtime.onMessage.addListener(
version = ParseResult( result )
if( version ) {
bboutput = 'Beaver Builder version ' + version + ' detected!\n'
} else {
bboutput = 'Beaver Builder not found.\n'
}

result = GetResult( bbtheme )
version = ParseResult( result )
if( version ) {
bboutput += 'Beaver Theme version ' + version + ' detected!\n'
} else {
bboutput += 'Beaver Theme not found.\n'
}

result = GetResult( themer )
version = ParseResult( result )
if( version ) {
bboutput += 'Beaver Themer version ' + version + ' detected!\n'
} else {
bboutput += 'Beaver Themer not found.\n'
}

if( bboutput ) {
Expand All @@ -35,9 +41,13 @@ chrome.runtime.onMessage.addListener(
);

function ParseResult( data ) {

if( data.length < 1 ) {
return false;
}
if( ! data ) {
return false;
}
var lines = data.split("\n");
line = lines[0]
versions = line.match(/<h4>([a-z0-9\.-]+)/)
Expand All @@ -48,7 +58,7 @@ function ParseResult( data ) {
}

function GetResult( url ) {
var result = null;
var result = false;
$.ajax({
url: url,
type: 'get',
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "BB Detector",
"description": "Detects Beaver Builder version string.",
"version": "0.2",
"version": "0.3",
"background": {
"scripts": ["background.js"]
},
Expand Down

0 comments on commit 10da0f8

Please sign in to comment.