Skip to content

Instantly share code, notes, and snippets.

@ssaavedra
Last active December 27, 2015 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssaavedra/7373213 to your computer and use it in GitHub Desktop.
Save ssaavedra/7373213 to your computer and use it in GitHub Desktop.
EXT.get_keywords = function (tab) {
var keywords = [];
if(tab) {
chrome.tabs.executeScript(tab.id, {file:"js/keywords.js"},
(function(keywords) {
return function (res) {
var kw_str = res && res[0];
if (kw_str) {
keywords.push.apply(keywords, kw_str.split(","));
}
}
})(keywords));
}
return keywords;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment