Re: [w3c/editing] Universal interface to modify content in a JS editor from unrelated JS code. (Issue #551)

GaurangTandon left a comment (w3c/editing#551)

> the question is how can we get them to play nicely together

Exactly my thoughts as well. I agree that we can provide the non-normative guidance to editor developers. In addition to it, what are your thoughts on providing a built-in browser API as well? The browser API would allow extensions to perform text insertion and deletion on the user's behalf. Here's what I think:

1. Feedback never reaches the developers who can fix the bug. When a grammar extension fails on site X, the user either gives up or blames the extension, because the site works fine when they type manually. So the editor developer rarely hears about the breakage, and the extension developer who does hear about it can do nothing if the editor ignores synthetic beforeinput.
2. A user installing (for example) a grammar correction extension signals strong user intent to the browser: the user expects the extension to be able to modify their text on their behalf. A website should generally not be able to disregard this user intent. There is precedent for this, like password managers or ad blockers.
3. There are already ways to produce automated input a website cannot ignore, for example, via OS-level dictation tools or programs like AutoHotkey. A browser extension should be able to input text similarly. 
4. Editor developers can deliberately ignore the non-normative note. As such, extension authors who wish to scale to millions of users will forever continue to need shipping with various _tricks_ (like building a library of supported sites). This creates a high barrier to entry for new extension authors who wish to work with text insertion/deletion across the web.

Assuming we agree that a built-in browser API is the right call, then we already have - almost - a great API for this. `execCommand("paste")` for text insertion and `execCommand("delete")` for deletion. They both fire the same of events that trusted user input does, except a trusted beforeinput event. Firefox already fixed this, but Chrome has not (as discussed in https://github.com/w3c/editing/issues/200#issuecomment-5951475331). Once Chrome makes the change, all (Chrome) extension authors will then have a level playing field to create reliable extensions for grammar correction, text expansion, etc.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/551#issuecomment-6042702283
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/editing/issues/551/6042702283@github.com>

Received on Wednesday, 7 October 2026 17:03:10 UTC