Greasy Fork is available in English.

The Weather Channel定位

天气预报GPS定位

// ==UserScript==
// @name         The Weather Channel定位
// @namespace    http://caiyh.xyz/
// @version      0.1
// @description  天气预报GPS定位
// @author       sky
// @match        https://weather.com/zh-CN/weather/today/l/CHXX0008:1:CH
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var geo = getLocation()
    function getLocation(){
        if(navigator.geolocation){
            //判断是否有这个对象
            navigator.geolocation.getCurrentPosition(function(pos){
                window.location.replace("https://weather.com/zh-CN/weather/today/l/"+pos.coords.latitude+","+pos.coords.longitude)
            })
        }else{
            console.log("当前系统不支持GPS API")
        }
    }
})();