New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 923332 link

Starred by 1 user

Issue metadata

Status: Unconfirmed
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Can't load generated *.mojom.js lazily when it contains dependencies

Reported by d...@yandex-team.ru, Jan 18 (4 days ago)

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 YaBrowser/18.11.1.715 (beta) Yowser/2.5 Safari/537.36

Steps to reproduce the problem:
1. Create some mojo interface with dependencies (that's when you use "import "some/path"" in your *.mojom file)
2. Build the project
3. Load the generated *.mojom.js script lazily (document.createElement('script') etc.)

What is the expected behavior?
The script has successfully connected to the document.

What went wrong?
Have an error:

mojo_bindings.js:124 Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
loadMojomIfNecessary @ mojo_bindings.js:124

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 70.0.3538.102  Channel: n/a
OS Version: 
Flash Version: 

Seems like we shouldn't use "document.write".
 

Comment 1 by d...@yandex-team.ru, Jan 18 (4 days ago)

I've made a fix https://chromium-review.googlesource.com/c/chromium/src/+/1421899
It could work exactly like document.write (connects script right after parent script) but allows to load parent script lazily.

Comment 2 by susan.boorgula@chromium.org, Jan 20 (2 days ago)

Labels: Needs-Milestone

Comment 3 by viswa.karala@chromium.org, Today (20 hours ago)

Cc: jam@chromium.org ben@chromium.org viswa.karala@chromium.org
Components: Internals>Mojo
Labels: Triaged-ET
As per comment# 1 from the reporter, fix has been provided. Hence CC'ing the Owners of Internals>Mojo component team help in providing further inputs on this issue.

Ref URL: https://cs.chromium.org/chromium/src/mojo/OWNERS?q=mojo&sq=package:chromium&dr=C&l=9

Thanks!

Sign in to add a comment