Skip to content

Commit

Permalink
version 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Arwan Khoiruddin committed Jul 2, 2017
1 parent b8f4d1f commit 6860376
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ Download from https://chrome.google.com/webstore/detail/find-doi-in-sci-hub/mpon
5. Click "search DOI on Sci-Hub"
6. You will be redirected to sci-hub
7. Enjoy! <br>

For detail direction on how to use this extension, please refer to http://arwanpiyungan.blogspot.co.id/2016/06/how-to-use-find-doi-in-sci-hub-google.html

Arwan Khoiruddin

# Updates

# Version 1.3.1
* Added interaction: user can just right click on the page and click on the "Find DOI in Sci Hub" extension

# Version 1.3
* Added interaction: user can just click on the extension's button in Chrome bar without the need to select the DOI in the paper page.
11 changes: 8 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
searchSciHub = function(word){
searchSciHub = function(word, tab){
var query = word.selectionText;
chrome.tabs.update({url: "http://sci-hub.cc/" + query});
if (query == undefined) {
var tabURL = tab.url;
chrome.tabs.update({url: "http://sci-hub.cc/" + tabURL});
} else {
chrome.tabs.update({url: "http://sci-hub.cc/" + query});
}
};

chrome.browserAction.onClicked.addListener(function(tab) {
Expand All @@ -10,6 +15,6 @@ chrome.browserAction.onClicked.addListener(function(tab) {

chrome.contextMenus.create({
title: "Search DOI in sci-hub",
contexts:["selection"],
contexts:["selection", "all"],
onclick: searchSciHub
});

0 comments on commit 6860376

Please sign in to comment.