blob: 2c1c94dc9657512ca7bc7dd3c99321133cbaae63 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
window.addEventListener('message', function(e) {
var response = '';
var data = JSON.parse(e.data);
if (data[0] == 'visibilityState-request') {
response = document.visibilityState;
} else {
response = 'FAILED';
}
e.source.postMessage(
JSON.stringify(['visibilityState-response', response]), '*');
});