var xhr = new XMLHttpRequest(),
	stylesheet = 'stable.css',
	stableVersion = 59;

if (/Chrome\/(\d\d)/.exec(navigator.userAgent)[1] > stableVersion) {
	stylesheet = 'canary.css';
}

xhr.open("GET", "/" + stylesheet, false);
xhr.send();
chrome.devtools.panels.applyStyleSheet(xhr.responseText);

function isStable() {
	return /Chrome\/(\d\d)/.exec(navigator.userAgent)[1] > stableVersion
}

const stableVersion = 60;
const stylesheet = isStable() ? 'stable.css' : 'canary.css'

fetch(`/${stylesheet}`)
	.then(res => res.text())
	.then(styles => chrome.devtools.panels.applyStyleSheet(styles))
	.catch(e => console.error(e));

Refactor theme injection method