Relative Content

Tag Archive for javascriptgoogle-apps-scriptgoogle-docsgoogle-docs-apichrome-extension-manifest-v3

How to update Google Docs in real-time using Chrome Extension content scripts?

I’m working on a task in my chrome extension that should replace certain words (shortcuts) with values assigned to them in real-time (like Grammerly or TextBlaze).
For example, when the user enters “..n1”, it should be replaced with its value immediately in real-time.
After some research, I found out that Google Docs uses an iframe “docs-texteventtarget-iframe” that listens to keypress or keyup events, which triggers these API calls: