answer suggestr

This script will suggest answers as you type them so you don't have to type those long ones manually :) 8/16/2024

当前为 2024-08-16 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        answer suggestr
// @namespace   Violentmonkey Scripts
// @match       https://www.geoguessr.com/*
// @grant       none
// @version     1.0
// @author      cosmoMP
// @license MIT 
// @description This script will suggest answers as you type them so you don't have to type those long ones manually :)  8/16/2024
// @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2
// ==/UserScript==

const disconnect = VM.observe(document.body, () => {
  // Find the target node
  const guess_input = document.querySelector('[data-qa="typing-mode-input"]')
  if (guess_input) {
    const guess_input = document.querySelector('[data-qa="typing-mode-input"]')
    const answers_from_game = document.querySelector('[data-qa="area-list"]')
    const answers_array = answers_from_game.getAttribute('data-area-labels').split(',')

    const datalist_id = 'answer-list'
    guess_input.setAttribute('list',datalist_id)

    const answers_datalist = document.createElement("datalist")
    answers_datalist.setAttribute('id',datalist_id)
    console.log('MP')
    for (const el of answers_array){
      const new_option = document.createElement("option")
      new_option.setAttribute('value',el)
      answers_datalist.appendChild(new_option)

    }

    document.body.appendChild(answers_datalist)

    // disconnect observer
    return true;
  }
});