// ==UserScript== // @name Maddonz - Test 4.6 // @version 4.6 // @description Zbiór dodatków do Margonem // @author Barlag // @match http*://*.margonem.pl/ // @match http*://*.margonem.com/ // @exclude http*://margonem.*/* // @exclude http*://www.margonem.*/* // @exclude http*://new.margonem.*/* // @exclude http*://forum.margonem.*/* // @exclude http*://commons.margonem.*/* // @exclude http*://dev-commons.margonem.*/* // @grant GM_setValue // @grant GM_getValue // @grant GM_xmlhttpRequest // @connect margonem.pl // @connect margonem.com // @run-at document-body // ==/UserScript== (function() { const GLOBAL = true; const style = document.createElement('link'); style.rel = 'stylesheet'; style.type = 'text/css'; const script = document.createElement('script'); script.type = 'module'; const maddonz = {}; document.maddonz = maddonz; if (GLOBAL && typeof GM_setValue !== 'undefined') { maddonz.GM_getValue = GM_getValue; maddonz.GM_setValue = GM_setValue; } else { maddonz.GM_getValue = function(key) { return JSON.parse(localStorage.getItem(key)); }; maddonz.GM_setValue = function(key, value) { localStorage.setItem(key, JSON.stringify(value)); }; } maddonz.GM_xmlhttpRequest = GM_xmlhttpRequest; maddonz.GM_info = GM_info; let cacheToken = maddonz.GM_getValue('mz_cache_token'); if (!cacheToken) { cacheToken = Math.random() .toString(36) .substring(2); maddonz.GM_setValue('mz_cache_token', cacheToken); } function getResourceUrl(resource) { return `https://test.barlag.pl/${resource}?c=${cacheToken}`; } script.src = getResourceUrl('maddonz.js'); document.head.appendChild(script); style.href = getResourceUrl('maddonz.css'); document.head.appendChild(style); })();