Can I open the OS native emoji picker in a web page?

Short answer is no.

In order to access any OS feature from javascript, you need a corresponding browser API to support.

AFAIK, there isn’t an API for that. There’s a discussion here which suggests adding <input emoji /> to standard but seems no traction gained.


Edit: Below is my original answer, revised. Comments pointed out I was focusing on the wrong aspect of the question, I totally agree.

However, the OP obviously has some wrong idea about what you can do in javascript to leverage browser ability. So I think it’s still worth clarification.

You can’t send arbitrary emulated keyboard event from js and hoping the OS will respond. Were it possible, it’d be a severe security issue on browser’s part. Imagine open a website and it fires a series of keyboard event to your OS and wipes out your desktop (totally feasible through shortcuts).

You need to understand the runtime env inside the browser is basically isolated from the one of native OS. Whatever OS feature that’s accessible to your javascript is totally up for browser vendors to decide. For security reason, they are super careful in making these decisions.

Also, make a distinction on “what browser can do”, and “what browser allows you to do in js”. Seeing Chrome has an “Emoji & Symbols” context menu item, doesn’t necessarily mean it decides to grant you the same ability in js.

To further clarify why the emulated keyboard event is fundamentally different from the native one, I include a graph here. The blue arrow is how emulated keyboard event flows. The farthest place it can reach is the browser’s internal event bus. It never got a chance to reach the OS event bus, so no way to notify native emoji picker.
keyboard event flow

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)