// ==UserScript== // @name DOTABUFF Player Shortcuts // @namespace bazetts // @include https://dotabuff.com/* // @grant GM_getValue // @grant GM_setValue // @description Add player shortcut links to DOTABUFF // @version 1 // @downloadURL https://update.greasyfork.icu/scripts/3661/DOTABUFF%20Player%20Shortcuts.user.js // @updateURL https://update.greasyfork.icu/scripts/3661/DOTABUFF%20Player%20Shortcuts.meta.js // ==/UserScript== // JQuery fix for chrome function with_jquery(f) { var script = document.createElement("script"); script.type = "text/javascript"; script.textContent = "(" + f.toString() + ")(jQuery)"; document.body.appendChild(script); }; with_jquery(function($) { // GM_getValue for chrome if (!this.GM_getValue || (this.GM_getValue.toString && this.GM_getValue.toString().indexOf("not supported")>-1)) { this.GM_getValue=function (key,def) { return localStorage[key] || def; }; this.GM_setValue=function (key,value) { return localStorage[key]=value; }; this.GM_deleteValue=function (key) { return delete localStorage[key]; }; } // Shortcut-div function updateShortcuts() { $('#shortcuts').remove(); var text = '