0

Problem Background

I'm working on a browser plugin that facilitates recording LeetCode and I'm having trouble getting the solution to the problem

The problem is described as follows

LeetCode code is written with monaco editor support, the content is dynamically displayed and only part of the content is kept on the DOM

see this

So I couldn't parse the DOM directly to get the user's code.

I tried to simulate the user's click behavior and dispatched click events to some elements of the monaco editor, but it didn't work

Do you have any good way to parse the monaco editor?

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
  • The ideal solution is to use the [editor API](https://microsoft.github.io/monaco-editor/api/index.html) in [page context](/a/9517879). It'd be trivial In case they expose a global `monaco` object, otherwise it's trickier. – wOxxOm Feb 02 '23 at 13:49

0 Answers0