Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 8a5813bea1
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (37 sloc) 1.496 kb
<html>
<body>
<script>
const ID = 'cokgbflfommojglbmbpenpphppikmonn';
const URL = 'https://chrome.google.com/webstore/detail/' + ID;
// add click event listenr
chrome.browserAction.onClicked.addListener(function(tab) {
// get all apps
chrome.management.getAll(function(apps) {
// loop through apps
for (var i in apps) {
var app = apps[i];
// found it!
if (app.id == ID) {
console.log(app)
if (app.enabled) {
// is it enabled?
//launch it
chrome.management.launchApp(app.id);
} else {
// enable it
chrome.management.setEnabled(app.id, true, function() {
// then launch it
chrome.management.launchApp(app.id);
});
}
// we are done here
return;
}
}
// fail! go to store!
chrome.tabs.create({'url': URL});
});
});
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.