Use id inside browserframe vaadin 7


I have a question, I use the component browserframe who content another site (externalressource).
I want interact with this site but it doesn’t work.

To do, i use javascript and i want put the text color of login in blue. So inplogin is id of the another site.

JavaScript.getCurrent().execute("document.getElementById('browserframe').getElementById('inplogin').style.color = 'blue';");

It doesn’t work, i have error in console.

JavaScript.getCurrent().execute("document.getElementById('tt').style.color = 'blue';");

It work.

BrowserFrame browserFrame = new BrowserFrame("",new ExternalResource("..."));
TextField t = new TextField("test");

So can we with Vaadin 7 use or manipulate dom (id) inside browserframe

Best regard

JavaScript can’t access <iframe> (BrowserFrame) contents unless the content is served from the same domain. It’s a browser security restriction, not related to Vaadin.

Ok, but can we use Vaadin and not JS to interact (manipulate DOM) with iframe (BrowserFrame). Maybe Vaadin 16 ?

Nope, unless you’re creating the content inside the iframe with another Vaadin app and you’re communicating with that other app somehow. Vaadin versions won’t really make a difference here. See more here: