1// Copyright 2013 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 5var target = document.body; 6var callback = arguments[arguments.length - 1] 7 8var timeout_id = setTimeout(function() { 9 callback() 10}, 5000); 11 12var observer = new MutationObserver(function(mutations) { 13 clearTimeout(timeout_id); 14 timeout_id = setTimeout(function() { 15 callback(); 16 }, 5000); 17}).observe(target, {attributes: true, childList: true, 18 characterData: true, subtree: true}); 19