// ==UserScript== // @name 获取本机外网IP地址 // @namespace http://tampermonkey.net/ // @version 0.1 // @description 获取本机的外网IP地址 // @author jflmao // @match *://*/* // @icon https://www.google.com/s2/favicons?sz=64&domain=ipip.net // @grant GM_registerMenuCommand // @grant GM_xmlhttpRequest // @connect myip.ipip.net // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; GM_xmlhttpRequest({ url:"https://myip.ipip.net/", method :"GET", headers: { "Content-type": "application/x-www-form-urlencoded" }, onload:function(xhr){ console.log(xhr.responseText); GM_registerMenuCommand(xhr.responseText, () => { }); } }); })();