Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: chrome/renderer/resources/extensions/tag_watcher.js

Issue 1840453002: [Extensions] More bindings hardening (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function watchForTag(tagName, cb) { 5 function watchForTag(tagName, cb) {
6 if (!document.body) 6 if (!document.body)
7 return; 7 return;
8 8
9 function findChildTags(queryNode) { 9 function findChildTags(queryNode) {
10 $Array.forEach(queryNode.querySelectorAll(tagName), function(node) { 10 $Array.forEach(queryNode.querySelectorAll(tagName), function(node) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 var useCapture = true; 45 var useCapture = true;
46 window.addEventListener('readystatechange', function listener(event) { 46 window.addEventListener('readystatechange', function listener(event) {
47 if (document.readyState == 'loading') 47 if (document.readyState == 'loading')
48 return; 48 return;
49 49
50 watchForTag(tagName, cb); 50 watchForTag(tagName, cb);
51 window.removeEventListener(event.type, listener, useCapture); 51 window.removeEventListener(event.type, listener, useCapture);
52 }, useCapture); 52 }, useCapture);
53 } 53 }
54 54
55 exports.addTagWatcher = addTagWatcher; 55 exports.$set('addTagWatcher', addTagWatcher);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698