Skip to content

Commit

Permalink
Do not leak links and last variables into global scope.
Browse files Browse the repository at this point in the history
  • Loading branch information
NV committed Feb 10, 2012
1 parent b0feb48 commit 5adca55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chrome/devtools.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@

function updateLastStylesheet() {
lastStylesheet = null;
chrome.devtools.inspectedWindow.eval('var links = document.querySelectorAll("link[rel=stylesheet][href]");\n\
chrome.devtools.inspectedWindow.eval('(function() {\n\
var links = document.querySelectorAll("link[rel=stylesheet][href]");\n\
var last = links && links.length && links[links.length - 1];\n\
last && last.href', function(href, fail) {
return last && last.href})()', function(href, fail) {
if (fail) return;
chrome.devtools.inspectedWindow.getResources(function(resources) {
var i = resources.length;
Expand Down

0 comments on commit 5adca55

Please sign in to comment.