Unable to get text from a Monaco editor using Shortcuts action extension

I’m trying to get the text from Monaco, an editor that runs on a webpage.

I have something that works from the browser development tools on a regular computer also with Safari on the phone, but I cannot get the same thing to work from the Shortcuts action extension.

As a example I tried this page:

Checking with developer tools there should be a global variable “monaco” but this is missing when evaluating from the action extension.

What could be happening and how can I access this editor?

In a very quick scan of the source I can see some references in the JavaScript to iFrames and in the DOM. Perhaps the variable is only available for reference within the scope of the frame?

1 Like

Somehow things assigned to window global variables is inaccessible in the action extension. I looks like you are mainly supposed to access through document.

I tried with the most basic example:

   window.hello = "Hello World!";

and window.hello isn’t available from the “Run JavaScript on Web Page”.

Right. iFrames have always been a pain to navigate into. At least from in-page javascript.