您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Make the right/left keys go to the next/previous image in a multi-image post, then on to the adjacent post. While holding shift, right/left will jump directly between posts
当前为
// ==UserScript== // @name Instagram: Arrow Key Navigation for Multi-Image Posts // @description Make the right/left keys go to the next/previous image in a multi-image post, then on to the adjacent post. While holding shift, right/left will jump directly between posts // @match https://www.instagram.com/* // @version 0.3 // @namespace greasyfork.org/users/12559 // @license MIT // ==/UserScript== let nextBtns; let backBtns; document.addEventListener('keydown', (event) => { event.stopPropagation(); if (event.shiftKey && event.key === 'ArrowRight') { document.querySelector('svg[aria-label="Next"]').closest('button').click(); } else if (event.key === 'ArrowRight') { if (document.querySelectorAll('button[aria-label="Next"]').length === 1 && nextBtns === 2) { document.querySelector('svg[aria-label="Next"]').closest('button').click(); } else if (document.querySelectorAll('button[aria-label="Next"]').length === 1) { document.querySelector('button[aria-label="Next"]').click(); } else if (document.querySelectorAll('button[aria-label="Next"]').length === 2) { document.querySelectorAll('button[aria-label="Next"]')[1].click(); nextBtns = 2; } else { document.querySelector('svg[aria-label="Next"]').closest('button').click(); } } else if (event.shiftKey && event.key === 'ArrowLeft') { document.querySelector('svg[aria-label="Go Back"]').closest('button').click(); } else if (event.key === 'ArrowLeft') { if (document.querySelectorAll('button[aria-label="Go Back"]').length === 1 && backBtns === 2) { document.querySelector('svg[aria-label="Go Back"]').closest('button').click(); } else if (document.querySelectorAll('button[aria-label="Go Back"]').length === 1) { document.querySelector('button[aria-label="Go Back"]').click(); } else if (document.querySelectorAll('button[aria-label="Go Back"]').length === 2) { document.querySelectorAll('button[aria-label="Go Back"]')[1].click(); backBtns = 2; } else { document.querySelector('svg[aria-label="Go Back"]').closest('button').click(); } } }, true);