Fix Chrome extension search results parsing

This commit is contained in:
Jonathan Cremin 2015-01-11 16:42:12 +00:00
parent 080fa477fd
commit c61876c9a5
2 changed files with 4 additions and 5 deletions

View file

@ -41,10 +41,9 @@ chrome.pageAction.onClicked.addListener(function(tab) {
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
var parser = document.createElement('a');
parser.href = xhr.responseURL;
if (!parser.pathname.match(/^(\/search|\/)$/)) {
chrome.tabs.create({ url: xhr.responseURL});
var match = JSON.parse(xhr.response);
if (match.id) {
chrome.tabs.create({ url: "https://match.audio/" + match.service + "/" + match.type + "/" + match.id});
}
}
}

View file

@ -1,6 +1,6 @@
{
"name" : "Match Audio",
"version" : "0.2.0",
"version" : "0.2.1",
"description" : "Match Audio makes sharing from music services better.",
"background" : {
"persistent": false,