-
-
Save stuartphilp/d48d4f13b97bbfc3fdc7 to your computer and use it in GitHub Desktop.
Telemetry Searches
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var maxSearches = 10; | |
var time = 0; | |
var searchEngines = ["Google", "Yahoo", "Bing", "Wikipedia (en)", "Amazon.com", "DuckDuckGo", "eBay", "Twitter"] | |
var searchInitiators = ["urlbar", "searchbar", "abouthome", "newtab", "contextmenu"] | |
for (var key in searchInitiators) { | |
for (var k in searchEngines){ | |
var searchInitiator = searchInitiators[key]; | |
var searchEngine = searchEngines[k]; | |
console.log("Searching for " + searchEngine + "." + searchInitiator + " " + maxSearches + " times") | |
for (var i = 0; i < maxSearches; i++) { | |
time += 0; //if you are running real searches you might need to add a throttle | |
(function (s, e) { | |
setTimeout(function() { | |
//let engine = BrowserSearch._loadSearch("test search ", false, s); | |
let engine = Services.search.getEngineByName(e); | |
if (engine) { | |
BrowserSearch.recordSearchInHealthReport(engine, s); | |
} | |
}, time); | |
})(searchInitiator, searchEngine) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment