Created
July 25, 2025 02:14
-
-
Save AWtnb/16663108473ca8d50e9d04bcf8212046 to your computer and use it in GitHub Desktop.
Amazonの商品ページからISBNで版元ドットコムに飛ぶ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name Amazon to hanmono.com | |
| // @namespace http://tampermonkey.net/ | |
| // @version 2025-07-25 | |
| // @description open hanmoto.com page by isbn | |
| // @author AWtnb | |
| // @match https://www.amazon.co.jp/*/dp/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=amazon.co.jp | |
| // @grant none | |
| // ==/UserScript== | |
| (function () { | |
| "use strict"; | |
| const elem1 = document.getElementById("rpi-attribute-book_details-isbn13"); | |
| if (elem1) { | |
| const elem2 = elem1.getElementsByClassName("rpi-attribute-value"); | |
| if (elem2) { | |
| const isbn = elem2[0].innerText.replace("-", ""); | |
| const url = "https://www.hanmoto.com/bd/isbn/" + isbn; | |
| document.onkeyup = function (e) { | |
| const pressed = (e.ctrlKey ? "C-" : "") + (e.altKey ? "A-" : "") + (e.shiftKey ? "S-" : "") + e.key.toLowerCase(); | |
| if (!["INPUT", "TEXTAREA"].includes(e.target.tagName)) { | |
| if (pressed == "h") { | |
| window.open(url, "_blank"); | |
| } | |
| } | |
| }; | |
| } | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment