Greasy Fork is available in English.

Definition Button for spellbee.org

Click on the words found to go to its definition on Merriam Webster

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Definition Button for spellbee.org
// @author       Minjae Kim
// @version      1.05
// @description  Click on the words found to go to its definition on Merriam Webster
// @match        https://spellbee.org/
// @icon         https://spellbee.org/assets/img/spelling-bee-game.png?v2
// @run-at       document-idle
// @grant        none
// @license      MIT
// @namespace    https://greasyfork.org/en/users/1529082-minjae-kim
// ==/UserScript==

addDefinition();

const enterButton = document.querySelector('#submit_button');
enterButton.addEventListener('click', (event) => {
   addDefinition();
});


window.addEventListener('keydown', (event) => {
    if (event.key === 'Enter') {
        event.preventDefault();
        addDefinition();
        }
});

function addDefinition() {
    'use strict';

    let wordList = document.querySelectorAll('.block-words-select__dropdown-els li');

    wordList.forEach((element) => {
        let word = element.innerText.trim();
        element.style.cursor = 'pointer';
        element.style.backgroundColor = 'rgba(222, 206, 31, 0.4)';
        element.addEventListener('click', () => {
            const url = `https://www.merriam-webster.com/dictionary/${word}`;
            window.open(url, '_blank'); // Opens the definition in a new tab
        });
    });

}