{"size": 627, "ext": "js", "max_stars_repo_path": "src/js/background.js", "max_stars_repo_name": "syndbg/chrome-django-docs-searcher", "max_stars_repo_stars_event_min_datetime": "2019-04-14T20:27:34.000Z", "max_stars_repo_stars_event_max_datetime": "2019-04-14T20:27:34.000Z", "max_issues_repo_path": "src/js/background.js", "max_issues_repo_name": "syndbg/chrome-django-docs-searcher", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/js/background.js", "max_forks_repo_name": "syndbg/chrome-django-docs-searcher", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.3928571429, "max_line_length": 73, "alphanum_fraction": 0.696969697}
function getResults(query) {
    return ['https://docs.djangoproject.com/search/?q=', query].join('');
}


chrome.contextMenus.create({
    title: 'Search Django docs',
    contexts: ['selection']
});


chrome.contextMenus.onClicked.addListener(function(info, tab) {
    var query = info.selectionText;
    var newUrl = getResults(query);
    chrome.tabs.create({url: newUrl});
});


chrome.omnibox.setDefaultSuggestion({
    description: 'Press ENTER to search latest Django docs'
});


chrome.omnibox.onInputEntered.addListener(function(query) {
    var newUrl = getResults(query);
    chrome.tabs.update({url: newUrl});
});
