Skip to content
Permalink
Browse files

Google Scholar: Don't try to save snapshot if same as full text URL

For results that were just PDF pages, this would cause an open/save
dialog to pop up, since Zotero tried to open what it was told was
text/html and get a PDF instead.

Also change "Fulltext" attachment title to "Full Text"
  • Loading branch information...
dstillman committed Nov 16, 2018
1 parent cf1f2a4 commit 217d9dae691472bd27ab42138375c94de7e88335
Showing with 11 additions and 10 deletions.
  1. +11 −10 Google Scholar.js
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2018-10-08 07:50:18"
"lastUpdated": "2018-11-16 05:56:18"
}

// attr()/text() v2
@@ -229,21 +229,13 @@ function scrapeIds(doc, ids) {
true);
}

//attach linked page as snapshot if available
if (titleLink) {
item.attachments.push({
url: titleLink,
title: "Snapshot",
mimeType: "text/html"
});
}
//attach linked document as attachment if available
var documentLinkTarget = attr(context, '.gs_or_ggsm a, #gsc_vcd_title_gg a', 'href');
var documentLinkTitle = text(context, '.gs_or_ggsm a, #gsc_vcd_title_gg a');
if (documentLinkTarget) {
//Z.debug(documentLinkTarget);
attachment = {
title: "Fulltext",
title: "Full Text",
url: documentLinkTarget
};
var m = documentLinkTitle.match(/^\[(\w+)\]/);
@@ -259,6 +251,15 @@ function scrapeIds(doc, ids) {
}
item.attachments.push(attachment);
}

// Attach linked page as snapshot if available
if (titleLink && titleLink != documentLinkTarget) {
item.attachments.push({
url: titleLink,
title: "Snapshot",
mimeType: "text/html"
});
}

item.complete();
});

0 comments on commit 217d9da

Please sign in to comment.
You can’t perform that action at this time.