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.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState == 4) {
|
if (xhr.readyState == 4) {
|
||||||
var parser = document.createElement('a');
|
var match = JSON.parse(xhr.response);
|
||||||
parser.href = xhr.responseURL;
|
if (match.id) {
|
||||||
if (!parser.pathname.match(/^(\/search|\/)$/)) {
|
chrome.tabs.create({ url: "https://match.audio/" + match.service + "/" + match.type + "/" + match.id});
|
||||||
chrome.tabs.create({ url: xhr.responseURL});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name" : "Match Audio",
|
"name" : "Match Audio",
|
||||||
"version" : "0.2.0",
|
"version" : "0.2.1",
|
||||||
"description" : "Match Audio makes sharing from music services better.",
|
"description" : "Match Audio makes sharing from music services better.",
|
||||||
"background" : {
|
"background" : {
|
||||||
"persistent": false,
|
"persistent": false,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue