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

Unified Diff: tools/callstats.py

Issue 2464053005: Revert of [tools] Support custom script injection for callstats.py (Closed)
Patch Set: Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/callstats.py
diff --git a/tools/callstats.py b/tools/callstats.py
index 0d052ce9cb42c804393cb23cb8400eec54d8904e..262f9a6ade6b6557a223ff626f6797cd181e6ba5 100755
--- a/tools/callstats.py
+++ b/tools/callstats.py
@@ -84,8 +84,6 @@
def generate_injection(f, sites, refreshes=0):
print >> f, """\
(function() {
- var sites =
- """, json.dumps(sites), """;
var s = window.sessionStorage.getItem("refreshCounter");
var refreshTotal = """, refreshes, """;
var refreshCounter = s ? parseInt(s) : refreshTotal;
@@ -101,15 +99,7 @@
url_wanted = "https://" + url_wanted.substr(7);
}
return url.startsWith(url_wanted);
- }
- function runCustomScript(site) {
- if (site.script === undefined) return;
- /* Combine a script from the given array. */
- if (typeof site.script !== "string") {
- site.script = site.script.join(' ');
- }
- eval(site.script);
- }
+ };
function onLoad(url) {
for (var item of sites) {
if (!match(url, item)) continue;
@@ -127,15 +117,13 @@
window.location.reload();
}
}, timeout);
- runCustomScript(item);
return;
}
console.log("Ignoring: " + url);
};
- /* Avoid re-triggering the runtime stats for html imports */
- if (document.currentScript.ownerDocument === document) {
- onLoad(window.location.href);
- }
+ var sites =
+ """, json.dumps(sites), """;
+ onLoad(window.location.href);
})();"""
def get_chrome_flags(js_flags, user_data_dir):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698