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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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;
  }
});