How to change/customize context menu on ios and android via Js on my web-project

help me solve a problem. How can I add functionality to the context menu on iOS and Android, or replace the context menu with a new one? In short, I want to create a web application that allows me to long-press on a word and display a context menu with the options that I want. As I understand, usually, this can be done with Swift for iOS and Kotlin for Android, but I need to do it with JavaScript. For example, when I long-press on a word, “adjustment handles” appear, and by selecting the desired text size, I can change the background color of the text by option marker or add a comment by another option in the context “add comment for selected area”(for example.). It might be necessary to create a menu on top of another context menu, but then I need to understand how the default context menu behaves. Sometimes it appears at the bottom, and sometimes at the top, depending on the finger’s position on the phone’s screen. But it would be better to rewrite the context menu. Are there any solutions? Thank you in advance.”

i have tried many methods but it still does not work