Thread Closed

Firefox 6.0, Windows XP, Toolbar Buttons version

For accessibility reasons, I need one button that simultaneously toggles both:
(1) browser.display.use_document_colors and
(2) browser.display.use_system_colors

The 'Page Colours' custom button toggles (1) above but not (2).

Is it possible to locally modify the button so a single button toggles both fields?

I am not a CSS programmer and I do not know where in the Firefox profile to look for the code. With a little guidance I could hopefully change this if it is even possible to do so.

Thank you in advance!
I'm not a programmer either, but for some reason I decided to give it a try. I found ways to modify both version 1.0 and the old custom version so that the existing button also toggles system colors. (Unknown why anyone would want to do it though.) I'll explain more if you want. Basically, for the old version, some code is added to script.js, which is in the .jar file in the .xpi file. The added part is between the ------ mod ------ lines:
function toggleDocumentColors(item) {
    var prefs = Components.classes[';1'].getService(Components.interfaces.nsIPrefBranch);
    if (prefs.getBoolPref("browser.display.use_document_colors")) {
        prefs.setBoolPref("browser.display.use_document_colors", false);
        item.checked = true;
    } else {
        prefs.setBoolPref("browser.display.use_document_colors", true);
        item.checked = false;

/* --------- system colors mod ----------- */
    if (prefs.getBoolPref("browser.display.use_system_colors")) {
        prefs.setBoolPref("browser.display.use_system_colors", false);
    } else {
        prefs.setBoolPref("browser.display.use_system_colors", true);
/* --------- end system colors mod ---------- */


If you list your buttons, I can create an installer for you to try.

Edited by Ln on Aug. 31, 2011, 6:40 a.m.

Thank you Ln!

The only custom button I'm using is 'Page Colours'.

I see the code in the script.js file and I understand your modification.

Is modifying the script.js file and then re-installing the xpi, the only way to change this? Or is it possible to add your mod directly somewhere?

Thanks again!
you can edit the file's in firefox's application data
then open the extensions folder everything you want is in there
toolbar buttons is in {03B08592-E5B4-45ff-A0BE-C1D975458688}
Thank you AZ!

I do not have any extension folder = {03B08592-E5B4-45ff-A0BE-C1D975458688} .

Only .

Here is the contents of my Install.rdf file:

<?xml version="1.0" ?>
<RDF xmlns="" xmlns:em="">
<Description about="urn:mozilla:install-manifest">
<em:name>Custom Toolbar Buttons</em:name>
<em:description>A customized version of Toolbar Buttons including the buttons : Page Colours</em:description>
<em:creator>Michael Buckley</em:creator>

<!-- Flock -->
<!-- Firefox -->

Any Suggestions?
Thanks again!

Edited by Orionstar on Sept. 3, 2011, 4:54 a.m.

Due to the maxVersion problem, it's sort of necessary to modify the xpi anyway. I plan to post files within a day.
to make it install edit this line
should not need another edit till after firefox 8
you can just disable the addon compatibility check with a addon compatibility reporter i thought you were going to edit more than the max version limit
i put code tags on your install.rdf for you
az: Thanks for adding code tags to my code as I could not see any way to do this. I have just installed addon compatibility reporter. I was previously adding "extensions.checkCompatibility.6.0" items manually. I understand about versioning. :)
Ln: Thank you for the modded xpi. It works! :)
Happy Labor Day everyone ! ! !

Edited by Orionstar on Sept. 4, 2011, 2:31 a.m.

Is it possible to press the button via a keyboard shortcut?

possibly with a code edit what would be the key code?
modifiers are easer for it (eg hold ctrl when clicking to do something else)
Color toggle seems to do the job using a keyboard shortcut, but its button can't be moved from the add-on bar. And it doesn't work right while the Toolbar Button is installed. Reviewers like the add-on, but they want a better button.
What is the conflict between the buttons?
also here is a button that you can move around and click to replace the default button in color toggle
just made (slapped it together) it for you
Color toggle along with the az color toggle button looks like a good combo. I didn't know about the Custom Link Buttons page you used. Very nice.

Color toggle doesn't work with the Toolbar Button because the toolbar button toggles preferences which are then applied to color toggle's Scheme 1. The result isn't what's wanted.
You asked "possibly with a code edit what would be the key code?
modifiers are easier for it (eg hold ctrl when clicking to do something else)"

All I need is F2 function key.


Also, are you able to tell me how to mod this myself, as the previous mod that Ln gave me works superbly otherwise?

Thanks again!

Thread Closed