electron-devtools-vendor
Version:
<div align="center"> <h2>electron-devtools-vendor</h2> <img alt="MIT" src="https://img.shields.io/github/license/BlackHole1/electron-devtools-vendor?color=9cf&style=flat-square"> <img alt="GitHub repo size" src="https://img.shields.io/github/r
42 lines (34 loc) • 979 B
JavaScript
/*global chrome*/
/**
* Extension options for Chrome.
* This allows the user to decide if the Ember icon should show when visiting
* a webpage that has Ember running.
*
* see:
* https://developer.chrome.com/extensions/options
*/
(function() {
"use strict";
/**
* Load the options from storage.
*/
function loadOptions() {
chrome.storage.sync.get('options', function(data) {
var options = data.options;
document.querySelector('[data-settings=tomster]').checked = options && options.showTomster;
});
}
/**
* Save the updated options to storage.
*/
function storeOptions() {
var showTomster = this.checked;
chrome.storage.sync.set({
options: { showTomster: showTomster }
}, function optionsSaved() {
console.log("saved!");
});
}
document.addEventListener('DOMContentLoaded', loadOptions);
document.querySelector('[data-settings=tomster]').addEventListener('click', storeOptions);
}());