ARTICLE AD BOX
The title says it all basically. In detail I'd like to:
store the state of a checkbox on the page in the userscript's storage every time its state changes and
set the checkbox's state from the userscript's storage at every page load, i.e. when the script is executed.
A) Is the following idea the best approach:
add a ChangeListener to the checkbox which performs the storing with GM_setValue(checkboxId, ['yes'|'no']) depending on the existence of the checkbox's checked attribute.
at the script's run at page load use GM_getValue(checkboxId, 'no') and add or remove the checkbox's checked attribute accordingly.
B) Or is it better to omit the 'no' value altogether and rely on the existence of the checkboxId key in the userscript's storage tied closely to the existence of the checkbox's checked attribute at the previous storing process.
P.S.: Is it really not possible to change the question's type from Advice to Best practices after posting?
