您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
update google location automatically
当前为
- // ==UserScript==
- // @name google location auto update
- // @namespace http://tampermonkey.net/
- // @version 0.4.2
- // @description update google location automatically
- // @author Door Ma
- // @match https://www.google.com/search?q=*
- // @match https://bard.google.com/chat*
- // @match https://gemini.google.com/app*
- // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // 对于 search 的提交时间间隔
- setInterval(function() {
- if (window.location.href.includes('www.google.com/search?q=')) {
- let element_search = document.querySelector('update-location');
- if (element_search) {
- element_search.click();
- } else {
- console.log('未找到更新按钮');
- alert('未找到更新按钮');
- }
- }
- }, 600000); // 毫秒,执行一次位置提交
- // 对于 gemini 的提交时间间隔
- setInterval(function() {
- if (window.location.href.includes('gemini.google.com/app')) {
- let element_gemini = document.querySelector('.update-location-text.location-clickable');
- if (element_gemini) {
- element_gemini.click();
- } else {
- console.log('未找到更新按钮');
- alert('未找到更新按钮');
- }
- }
- }, 3600000); // 毫秒,执行一次位置提交
- })();