Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.onMessageReceived(message => {
let { name, version } = message;
if (name === 'version-mismatch') {
let previousVersions = config.previousEmberVersionsSupported;
let [fromVersion, tillVersion] = config.emberVersionsSupported;
let neededVersion;
if (compareVersion(version, fromVersion) === -1) {
neededVersion = previousVersions[previousVersions.length - 1];
} else if (tillVersion && compareVersion(version, tillVersion) !== -1) {
neededVersion = tillVersion;
} else {
return;
}
this.onVersionMismatch(neededVersion);
}
});
this.sendMessage({ type: 'check-version', from: 'devtools' });
function loadEmberDebug() {
let minimumVersion = config.emberVersionsSupported[0].replace(/\./g, '-');
let xhr;
return new Promise((resolve) => {
if (!emberDebug) {
xhr = new XMLHttpRequest();
xhr.open("GET", chrome.runtime.getURL(`/panes-${minimumVersion}/ember_debug.js`));
xhr.onload = function() {
if (xhr.readyState === 4) {
if (xhr.status === 200) {
emberDebug = xhr.responseText;
resolve(emberDebug);
}
}
};
xhr.send();
} else {