Skip to content

Instantly share code, notes, and snippets.

@groovecoder
Created May 16, 2017 14:28
Show Gist options
  • Select an option

  • Save groovecoder/78d1efd76e2e03bebe60982cb9155e81 to your computer and use it in GitHub Desktop.

Select an option

Save groovecoder/78d1efd76e2e03bebe60982cb9155e81 to your computer and use it in GitHub Desktop.
async function checkExtensionInfo() {
const manifestPath = browser.extension.getURL("manifest.json");
const response = await fetch(manifestPath);
console.log('response.json(): ', response.json());
const extensionInfo = response.json();
if (MAJOR_VERSIONS.indexOf(extensionInfo.version) > -1) {
browser.browserAction.setBadgeBackgroundColor({color: "rgba(0,217,0,255)"});
browser.browserAction.setBadgeText({text: "NEW"});
}
}
checkExtensionInfo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment