OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 // This file adheres to closure-compiler conventions in order to enable |
| 6 // compilation with ADVANCED_OPTIMIZATIONS. See http://goo.gl/FwOgy |
| 7 |
| 8 // Script to set windowId. |
| 9 |
| 10 |
| 11 // Namespace for module, used as presence beacon for injection checks. |
| 12 __gCrWeb['windowIdObject'] = {}; |
| 13 |
| 14 new function() { |
| 15 // CRWJSWindowIdManager replaces $(WINDOW_ID) with appropriate string upon |
| 16 // injection. |
| 17 __gCrWeb['windowId'] = '$(WINDOW_ID)'; |
| 18 |
| 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(); |
| 29 } |
| 30 }, 0); |
| 31 } |
OLD | NEW |