Automatic "Attach Snapshot of Current Page"

I'm looking at modifying a translator, and want it to automatically attach a snapshot of the html page. The translator is for the Canadian Legal Information Institute, canlii.org. Right now it will automatically download the linked PDF file using the following:

var pdfRe = /^(.+)\.html$/;
var pdfMatch = pdfRe.exec(doc.location.href);
if (pdfMatch) {
var pdfUrl = pdfMatch[1]+".pdf";
newItem.attachments = [{url:pdfUrl, title:"PDF version", mimeType:"application/pdf"}];

but it would be much more useful (for my purposes, in any case) to get a snapshot of the HTML page instead of the PDF.
I looked through the various documentation on translators, but couldn't figure out how to do this. Any suggestions on what would do this?

Thanks
  • 1) It's generally better to post questions like this to zotero-dev.

    2) Rather than looking through documentation, just look at existing translators. In this case, searching for "snapshot" would yield many examples. See, e.g., the NYT translator.
  • Thanks, will do that (though a quick glance at the NYTimes.com.js translator mostly reminds me that I know almost nothing about javascript and what does what)
Sign In or Register to comment.