2

I want to create a simple button that when pressed, changes the value of the setting browser.display.document_color_use to 1, and when pressed a second time is changed back to 2.

I have no idea where to even begin.

Salman S
  • 47
  • 1
  • 15
jason8974
  • 21
  • 2
  • 1
    Firefox has a tutorial on this https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Your_first_WebExtension. This question isn’t really suitable for Stack Overflow so you’ll probably find this gets closed soon, but hope that helps. Good luck. – Zoe Edwards Mar 21 '18 at 10:37
  • I just came from that site before I submitted this post to stackoverflow and sadly it does not help as I can't find how to make a button that "toggles" a setting inside the about:Config tab with a single click – jason8974 Mar 21 '18 at 10:39
  • You probably won’t be able to change other settings from your extension for security reasons. Potentially look at https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/Preferences_system on how to access your own settings. Also similar: https://stackoverflow.com/questions/6157173/a-firefox-extension-that-changes-a-value-in-the-aboutconfig – Zoe Edwards Mar 21 '18 at 10:42
  • Checked the links, thanks. I'm still confused though, as the second link leads to now unsupported methods and the first seems to maybe help a bit with how to change a setting, but still nothing about how to make a button. lol XD – jason8974 Mar 21 '18 at 10:48
  • Have you tried Googling “firefox extension create button”? – Zoe Edwards Mar 21 '18 at 10:51
  • Yeah but it doesnt tell me how to tie it to changing a setting via "toggle". I am reading this link now that seems relevant but I really cant program so its difficult piecing it all together https://developer.mozilla.org/en-US/Add-ons/WebExtensions – jason8974 Mar 21 '18 at 11:01
  • I found this, but I'm not sure how to edit this to make it change the desired setting (under Answer) https://stackoverflow.com/questions/40603655/how-i-can-make-a-browser-action-button-that-looks-and-acts-like-a-toggle – jason8974 Mar 21 '18 at 11:11
  • tried to sign up to discourse mozilla but ended up in 15 different log in loops. Nice design there. – jason8974 Mar 21 '18 at 11:44
  • aarghhhghhhhhggh – jason8974 Mar 21 '18 at 18:08

0 Answers0