1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file adheres to closure-compiler conventions in order to enable
6 // compilation with ADVANCED_OPTIMIZATIONS. See http://goo.gl/FwOgy
8 // Script to set windowId.
11 // Namespace for module, used as presence beacon for injection checks.
12 __gCrWeb['windowIdObject'] = {};
15 // CRWJSWindowIdManager replaces $(WINDOW_ID) with appropriate string upon
17 __gCrWeb['windowId'] = '$(WINDOW_ID)';
19 // Wrap queues flushing in setTimeout to avoid reentrant calls.
20 // In some circumstances setTimeout does not work on iOS8 if set from
21 // injected script. There is an assumption that it's happen when the script
22 // has been injected too early. Do not place anything important to delayed
23 // function body, since there is no guarantee that it will ever be executed.
24 // TODO(eugenebut): Find out why setTimeout does not work (crbug.com/402682).
25 window.setTimeout(function() {
26 // Send messages queued since message.js injection.
27 if (__gCrWeb.message) {
28 __gCrWeb.message.invokeQueues();