diff --git a/chrome/background.js b/chrome/background.js index 88d5f8f..c95a76c 100644 --- a/chrome/background.js +++ b/chrome/background.js @@ -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}); } } } diff --git a/chrome/manifest.json b/chrome/manifest.json index 7d5148c..374122a 100644 --- a/chrome/manifest.json +++ b/chrome/manifest.json @@ -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,