PubMed Research

Adds a "Research" button that searches the current query on PubMed

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        PubMed Research
// @namespace   http://tampermonkey.net/
// @version     1.0
// @description Adds a "Research" button that searches the current query on PubMed
// @author      UnitedPenguin
// @git         https://github.com/UnitedPenguin/PubMed-Automatic-Research
// @include     http://*
// @include     https://*
// @license     MIT
// @grant       none
// ==/UserScript==

(function() {
    'use strict';

    // create the "Research" button and style it
    let btn = document.createElement("button");
    btn.innerHTML = "Research";
    btn.style.position = "fixed";
    btn.style.bottom = "10px";
    btn.style.right = "10px";
    btn.style.zIndex = 9999;

    // add the button to the page
    document.body.appendChild(btn);

    // when clicked, search the current query on PubMed
    btn.onclick = function() {
        // get the current search query from the search bar
        let input = document.querySelector('input[name=q]');

        if (input && input.value) {
            // redirect to PubMed with the search query
            window.location.href = `https://pubmed.ncbi.nlm.nih.gov/?term=${encodeURIComponent(input.value)}`;
        }
    };

})();