Review main Merged

73025[TASK] Support FLAG_USE_TOP_WINDOW for ESM instructions

Benjamin Franzke CR +2 V +2 Normal +99 −9 updated 01/22/22, 19:23

Commit message

Implement top-frame-module loading for ES6 modules.
With RequireJS we could simply invoke top.require(), but
for native ES modules and dynamic import() statements
top.import() is not possible, as import is not a function
but a statement, and therefore not invokable on `top.`.

This has been marked as todo in #96510 as it is a
non trivial change that is better implemented in a
separately testable patch.

An event is used that is dispatched on the top document.
It is filled by a global event handler with a promise
that reveals the result of the import() statement
performed in the context of the top frame.

Top frame module loading is used when modals
or notifications are shown in the outer-frame,
therefore EXT:redirect and EXT:install are adapted
to make use of this feature and avoid the prior
RequireJS indirection.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 3

Files 12