Showing a Window on Double Click: Chrome Extension Dev

I am working on making a chrome extension that shows info about text when you double click on it. I want to have the user double click on text and it will show a popup under the selected text. The popup will need to be able to access what the selected text is.

Here is my code so far:
manifest.json:

{
    "manifest_version": 3,
    "name": "Language Practice",
    "description": "A extension to help the user to learn a new language.",
    "version": "1.0",
    "content_scripts": [
        {
            "matches": [
                "http://*/*",
                "https://*/*"
            ],
            "js": [
                "js/contentscript.js"
            ]
        }
    ]
}

contentscript.js:

document.body.ondblclick=function() {
    // what do I put here?
};