// ==UserScript== // @name Clip-to-Gist Quote Script (ES5, Lemur Compatible) // @namespace http://tampermonkey.net/ // @version 2.3.1 // @description One-click clipboard quotes → GitHub Gist, with keyword highlighting, versioning & Lemur Browser compatibility // @author Your Name // @include *://*/* // @run-at document-end // @grant GM_setValue // @grant GM_getValue // @grant GM_xmlhttpRequest // @connect api.github.com // @downloadURL https://update.greasyfork.icu/scripts/534796/Clip-to-Gist%20Quote%20Script%20%28ES5%2C%20Lemur%20Compatible%29.user.js // @updateURL https://update.greasyfork.icu/scripts/534796/Clip-to-Gist%20Quote%20Script%20%28ES5%2C%20Lemur%20Compatible%29.meta.js // ==/UserScript== (function(){ 'use strict'; // --- Fallback wrappers --- var setValue = (typeof GM_setValue === 'function') ? GM_setValue : function(k, v){ localStorage.setItem(k, v); }; var getValue = (typeof GM_getValue === 'function') ? function(k, def){ var v = GM_getValue(k); return (v===undefined||v===null)?def:v; } : function(k, def){ var v = localStorage.getItem(k); return (v===undefined||v===null)?def:v; }; var httpRequest = (typeof GM_xmlhttpRequest === 'function') ? GM_xmlhttpRequest : function(opts){ var headers = opts.headers || {}; if(opts.method === 'GET'){ fetch(opts.url, { headers: headers }) .then(function(res){ return res.text().then(function(txt){ opts.onload({ status: res.status, responseText: txt }); }); }); } else { fetch(opts.url, { method: opts.method, headers: headers, body: opts.data }) .then(function(res){ return res.text().then(function(txt){ opts.onload({ status: res.status, responseText: txt }); }); }); } }; // --- Version key init --- var VERSION_KEY = 'clip2gistVersion'; if(getValue(VERSION_KEY, null) === null){ setValue(VERSION_KEY, 1); } // --- Inject global CSS via