Save to Zotero

Make Zotero's boorkmarklet a user script (click the button 'Zotero!' on bottom right)

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Save to Zotero
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Make Zotero's boorkmarklet a user script (click the button 'Zotero!' on bottom right)
// @author       SLAPaper
// @match        *://*/*
// @grant        none
// ==/UserScript==

function loader() {
    // content of https://www.zotero.org/bookmarklet/loader.js
    var a = document.getElementById('zotero-iframe');
    if (a) {
        return void a.contentWindow.postMessage(['progressWindow.reopen', null], '*');
    }
    a = document.createElement('iframe');
    a.id = 'zotero-iframe';
    a.style.display = 'none';
    a.style.borderStyle = 'none';
    a.setAttribute('frameborder', '0');
    a.src = (
        'javascript:(function(){document.open();try{window.parent.document;}catch(e){document.domain="' +
        document.domain.replace(/[\\\"]/g, '\\$0') +
        '";}document.write(\'<!DOCTYPE html><html><head><script src="' +
        'https://www.zotero.org/bookmarklet/common.js' +
        '"></script><script src="' +
        'https://www.zotero.org/bookmarklet/inject.js' +
        '"></script></head><body></body></html>\');document.close();})()'
    );

    var tag = document.body || document.documentElement;
    tag.appendChild(a);
}

(function () {
    'use strict';
    var d = document;
    var div = d.createElement('div');
    div.id = 'div-save-to-zotero';
    div.style.position = 'fixed';
    div.style.bottom = '-0.1rem';
    div.style.right = '-0.2rem';
    div.style.zIndex = '999';

    var btn = d.createElement('button');
    btn.id = 'btn-save-to-zotero';
    btn.innerText = 'Zotero!';
    btn.onclick = loader;
    div.appendChild(btn);

    (d.body ? d.body : d.documentElement).appendChild(div);
})();