您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
天气预报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") } } })();