stylus/health.js
tophf a0c5674f6f Wait for background page to load on Chrome startup
At startup Chrome lazy-loads extension's background page,
thus occasionally breaking apply.js and Stylish own pages
2015-05-05 21:36:16 +03:00

12 lines
285 B
JavaScript

healthCheck();
function healthCheck() {
chrome.extension.sendMessage({method: "healthCheck"}, function(ok) {
if (ok === undefined) { // Chrome is starting up
healthCheck();
} else if (!ok && confirm(t("dbError"))) {
window.open("http://userstyles.org/dberror");
}
});
}