a, s, e shortcut in dcinside

a키를 누르면 다음 개념글, s 키를 누르면 이전 념글, e 키를 누르면 개념글로 이동하고, 또 e키를 누르면 첫 번째 개념글을 선택합니다.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         a, s, e shortcut in dcinside
// @namespace    http://tampermonkey.net/
// @version      2024
// @description  a키를 누르면 다음 개념글, s 키를 누르면 이전 념글, e 키를 누르면 개념글로 이동하고, 또 e키를 누르면 첫 번째 개념글을 선택합니다.
// @author       You
// @match        https://gall.dcinside.com/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// ==/UserScript==

document.addEventListener('keydown', function (keyInput) {
    if (keyInput.key === 'a') {
        let elementNodeListOf = document.querySelectorAll('.gall_tit.ub-word');
        for (let a = 0; a < elementNodeListOf.length; a++) {
            if (document.URL === elementNodeListOf[a].querySelector('a').href) {
                elementNodeListOf[a + 1].querySelector('a').click();
            }
        }
    }
    if (keyInput.key === 's') {
        let elementNodeListOf = document.querySelectorAll('.gall_tit.ub-word');
        for (let a = 0; a < elementNodeListOf.length; a++) {
            if (document.URL === elementNodeListOf[a].querySelector('a').href) {
                elementNodeListOf[a - 1].querySelector('a').click();
            }
        }
    }

    if (keyInput.key === 'e') {
        let main = document.querySelector('.array_tab.left_box').querySelectorAll('button')[1];
        if (main.textContent === '개념글' && main.getAttribute('class') !== 'on') {
            document.querySelector('.array_tab.left_box').querySelectorAll('button')[1].onclick();
        } else {
            document.querySelector('tr[data-type="icon_recomimg"]').querySelector('.gall_tit.ub-word').querySelector('a').click();

        }
    }
});

// css title
document.querySelector('.title.ub-word').style.fontSize = 'xxx-large';