DevTools: Address timing issue during load

During frontend load, there are a couple async points after
DOMContentLoaded before the UI can finish initializing. The first
is waiting for all modules to load. The second is waiting for
preferences to be retrieved.

The event for DevTools extensions was being fired on window
load, but it was possible for the above async work to take too long
and the event listener would not be subscribed in time.

This patch addresses this race condition by caching the event info
inside devtools_compatibility and using a callback instead of relying
on Extensions.ExtensionsServer to be constructed before window load.

Bug: 973701
Change-Id: I638a6915f7b7c37a32cebe3d876cbca4f94e9f49
Commit-Queue: Jeff Fisher <>
Reviewed-by: Andrey Kosyakov <>
Reviewed-by: Joel Einbinder <>
Cr-Commit-Position: refs/heads/master@{#672273}
5 files changed