Skip to content

Commit

Permalink
Start work on #16
Browse files Browse the repository at this point in the history
  • Loading branch information
Shakeel Mohamed committed Mar 2, 2016
1 parent a73c214 commit 7b19fea
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions search-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ chrome.omnibox.onInputChanged.addListener(function(text, suggest) {
});

function navigate(url) {
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.update(tabs[0].id, {url: url});
});
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
chrome.tabs.update(tabs[0].id, {url: url});
});
}

chrome.omnibox.onInputEntered.addListener(function(text) {
navigate("https://zenplayer.audio?v=" + encodeURIComponent(text) )
// TODO: lame hack, assume we're doing real search if we find a space
var param = text.indexOf(" ") ? "q=" : "v=";
navigate("https://zenplayer.audio?" + param + encodeURIComponent(text));
});

0 comments on commit 7b19fea

Please sign in to comment.