Kira's Add-To-Favorites Hotkey For Rule34.xxx

Press R to Add to favorites int Rule34.xxx

// ==UserScript==
// @name         Kira's Add-To-Favorites Hotkey For Rule34.xxx
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Press R to Add to favorites int Rule34.xxx
// @author       Kiramastercrack
// @match        https://rule34.xxx/index.php?page=post&s=view&id=*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    var searchString = "Add to favorites";
    var hotkey = "KeyR";
    var found ="";

    document.addEventListener('keydown', logKey);

    function logKey(e) {
        if(e.code==hotkey){
            var tagNames = Array.from(document.getElementsByTagName('a'))
            for (var i = 0; i < tagNames.length; i++) {
                if (tagNames[i].textContent.includes(searchString)) {
                    found = tagNames[i];
                    found.click();
                    break;
                }
            }
        }
    }
})();