Fix Chrome extension search results parsing
This commit is contained in:
parent
080fa477fd
commit
c61876c9a5
2 changed files with 4 additions and 5 deletions
|
@ -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});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue