// ==UserScript== // @author DanielOnDiordna // @name IITC plugin: Fix desktop portal links // @category Tweak // @version 1.0.0.20240120.110400 // @updateURL https://softspot.nl/ingress/plugins/iitc-plugin-fixdesktopportallinks.meta.js // @downloadURL https://softspot.nl/ingress/plugins/iitc-plugin-fixdesktopportallinks.user.js // @description [danielondiordna-1.0.0.20240120.110400] Add /intel to the Portal link and Permalink. Also add map location to portal links. Links will then match stock intel links. This fix is only needed for Desktop IITC-CE and IITC Button users, from version IITC 0.31.1 and up. Not needed for mobile users. // @id iitc-plugin-fixportallinks@danielondiordna // @namespace https://softspot.nl/ingress/ // @match https://intel.ingress.com/* // @namespace https://softspot.nl/ingress/ // @match https://intel-x.ingress.com/* // @grant none // ==/UserScript== function wrapper(plugin_info) { // ensure plugin framework is there, even if iitc is not yet loaded if(typeof window.plugin !== 'function') window.plugin = function() {}; // use own namespace for plugin window.plugin.fixdesktopportallinks = function() {}; var self = window.plugin.fixdesktopportallinks; self.id = 'fixdesktopportallinks'; self.title = 'Fix desktop portal links'; self.version = '1.0.0.20240120.110400'; self.author = 'DanielOnDiordna'; self.changelog = ` Changelog: version 1.0.0.20240120.110400 - first release - use an eval function to replace some code in function window.makePermalink, default include MapView, add /intel `; self.namespace = 'window.plugin.' + self.id + '.'; self.pluginname = 'plugin-' + self.id; self.fixPermalink = function() { if (!window.makePermalink) return; try { eval("window.makePermalink = " + window.makePermalink.toString().replace("{}","{includeMapView:true}").replace("'/'","'/intel'")); } catch(e) { console.warn(self.title + " - eval window.makePermalink failed"); } } var setup = function() { self.fixPermalink(); console.log('IITC plugin loaded: ' + self.title + ' version ' + self.version); }; // Added to support About IITC details and changelog: plugin_info.script.version = plugin_info.script.version.replace(/\.\d{8}\.\d{6}$/,''); plugin_info.buildName = 'softspot.nl'; plugin_info.dateTimeVersion = self.version.replace(/^.*(\d{4})(\d{2})(\d{2})\.(\d{6})/,'$1-$2-$3-$4'); plugin_info.pluginId = self.id; let changelog = [{version:'This is a softspot.nl plugin by ' + self.author,changes:[]},...self.changelog.replace(/^.*?version /s,'').split(/\nversion /).map((v)=>{v=v.split(/\n/).map((l)=>{return l.replace(/^- /,'')}).filter((l)=>{return l != "";}); return {version:v.shift(),changes:v}})]; setup.info = plugin_info; //add the script info data to the function as a property if (typeof changelog !== 'undefined') setup.info.changelog = changelog; if(!window.bootPlugins) window.bootPlugins = []; window.bootPlugins.push(setup); // if IITC has already booted, immediately run the 'setup' function if(window.iitcLoaded && typeof setup === 'function') setup(); } // wrapper end // inject code into site context var script = document.createElement('script'); var info = {}; if (typeof GM_info !== 'undefined' && GM_info && GM_info.script) info.script = { version: GM_info.script.version, name: GM_info.script.name, description: GM_info.script.description }; script.appendChild(document.createTextNode('('+ wrapper +')('+JSON.stringify(info)+');')); (document.body || document.head || document.documentElement).appendChild(script);