您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Right/left keys will go to the next/previous image within a multi-image post, as well as between posts. While holding the shift key, right/left only jumps between posts (the current default behavior)
当前为
- // ==UserScript==
- // @name Instagram: Arrow Key Navigation for Multi-Image Posts
- // @description Right/left keys will go to the next/previous image within a multi-image post, as well as between posts. While holding the shift key, right/left only jumps between posts (the current default behavior)
- // @match https://www.instagram.com/*
- // @version 0.2
- // @namespace greasyfork.org/users/12559
- // @license MIT
- // ==/UserScript==
- 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.querySelector('button[aria-label="Next"]')) {
- document.querySelector('button[aria-label="Next"]').click();
- } 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.querySelector('button[aria-label="Go Back"]')) {
- document.querySelector('button[aria-label="Go Back"]').click();
- } else {
- document.querySelector('svg[aria-label="Go Back"]').closest('button').click();
- }
- }
- }, true);