function a11ycssOnload() {
	let getLevel = browser.storage.local.get("a11ycssLevel");
	getLevel.then(
		// when we got something
		(item) => {
			if (item && item.a11ycssLevel) {
				// Get current tab ID
				browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
					// If a setting is found for this tab
					if (item.a11ycssLevel[tabs[0].id]) {
						// a level was set already
						level.forEach(function (key) {
							if (key.value === item.a11ycssLevel[tabs[0].id].level) {
								key.checked = true;
							} else {
								key.checked = false;
							}
						});
					}
				});
			}
		},
		// we got nothing
		onError
	);

	let getStatus = browser.storage.local.get("a11ycssStatus");
	getStatus.then(
		// when we got something
		(item) => {
			if (item && item.a11ycssStatus) {
				browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
					// If a setting is found for this tab
					if (item.a11ycssStatus[tabs[0].id]) {
						button.setAttribute('aria-checked', item.a11ycssStatus[tabs[0].id].status);
					}
				});
			}
		},
		// we got nothing
		onError
	);
}
// (the first option is checked in the popup's HTML by default)
(the first option is checked in the popup's HTML by default)
( the first option is checked in the popup ' s HTML by default )
function a11ycssOnload() {
	let getLevel = browser.storage.local.get("a11ycssLevel");
	getLevel.then(
		(item) => {
			if (item && item.a11ycssLevel) {
				browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
					if (item.a11ycssLevel[tabs[0].id]) {
						level.forEach(function (key) {
							if (key.value === item.a11ycssLevel[tabs[0].id].level) {
								key.checked = true;
							} else {
								key.checked = false;
							}
						});
					}
				});
			}
		},
		onError
	);
	let getStatus = browser.storage.local.get("a11ycssStatus");
	getStatus.then(
		(item) => {
			if (item && item.a11ycssStatus) {
				browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => {
					if (item.a11ycssStatus[tabs[0].id]) {
						button.setAttribute('aria-checked', item.a11ycssStatus[tabs[0].id].status);
					}
				});
			}
		},
		onError
	);
}
function a11ycssOnload ( ) { let getLevel = browser . storage . local . get ( "a11ycssLevel" ) ; getLevel . then ( ( item ) => { if ( item && item . a11ycssLevel ) { browser . tabs . query ( { active : true , currentWindow : true } ) . then ( ( tabs ) => { if ( item . a11ycssLevel [ tabs [ 0 ] . id ] ) { level . forEach ( function ( key ) { if ( key . value === item . a11ycssLevel [ tabs [ 0 ] . id ] . level ) { key . checked = true ; } else { key . checked = false ; } } ) ; } } ) ; } } , onError ) ; let getStatus = browser . storage . local . get ( "a11ycssStatus" ) ; getStatus . then ( ( item ) => { if ( item && item . a11ycssStatus ) { browser . tabs . query ( { active : true , currentWindow : true } ) . then ( ( tabs ) => { if ( item . a11ycssStatus [ tabs [ 0 ] . id ] ) { button . setAttribute ( 'aria-checked' , item . a11ycssStatus [ tabs [ 0 ] . id ] . status ) ; } } ) ; } } , onError ) ; }
(the first option is checked in the popup's HTML by default)
( the first option is checked in the popup ' s HTML by default )
// when we got something // Get current tab ID // If a setting is found for this tab // a level was set already // we got nothing // when we got something // If a setting is found for this tab // we got nothing