[Ext] PrefBar - The all in one button container

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
M-Reimer
Posts: 76
Joined: July 2nd, 2013, 4:29 am

Re: [Ext] PrefBar - The all in one button container

Post by M-Reimer »

A new release (6.5.0) is available. This release contains the fix, required to clear the cache on Firefox 32 and a few smaller interface changes. For a full list of changes have a look at the changelog.
User avatar
ElTxolo
Posts: 2806
Joined: July 30th, 2007, 9:35 am
Location: Localhost

Re: [Ext] PrefBar - The all in one button container

Post by ElTxolo »

M-Reimer wrote:A new release (6.5.0) is available. This release contains the fix, required to clear the cache on Firefox 32 and a few smaller interface changes. For a full list of changes have a look at the changelog.

Well done! Image
How to Ask Questions The Smart Way - How to Report Bugs Effectively ;)
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20240109 SeaMonkey/2.53.18.1
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20240324 SeaMonkey/2.53.19 :lildevil:

~
good4000
Posts: 19
Joined: June 15th, 2014, 11:19 pm

Re: [Ext] PrefBar - The all in one button container

Post by good4000 »

i want to create a checkbox so that when i check the checkbox a prefstring with a string value be changed to zero .and when i uncheck that checkbox prefstring gets back to its default value . can you tell me what should i write in topref and frompref section ? i know how to do this for boolean and integer values but it is not working for string values .
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Re: [Ext] PrefBar - The all in one button container

Post by dickvl »

A possibility is to use an Extcheck button.
Such a button allows to have more control over set and get functions.

I have a button like this:

Code: Select all

{
  "prefbar:info": {
    "formatversion": 3
  
},
  "prefbar:menu:enabled": {
    "items": [
      "prefbar:button:ext_uagent_locale"
    ]
  },
  "prefbar:button:ext_uagent_locale": {
    "type": "extcheck",
    "label": "L",
    "getfunction": "value = (goPrefBar.GetPref("general.useragent.locale", "undefined") != "en-US");",
    "browserbtnupdatefor": "false",
    "setfunction": "pref = "general.useragent.locale";\nvalue = goPrefBar.GetPref(pref);\nif(event.shiftKey){\n value=goPrefBar.msgPrompt(null,pref+"\\n"+value,value,'general.useragent.locale');\n if(value){goPrefBar.SetPref(pref,value);}\n}\nelse{\n if(value != "en-US"){goPrefBar.ClearPref(pref);}\n}"
  }
}
 
good4000
Posts: 19
Joined: June 15th, 2014, 11:19 pm

Re: [Ext] PrefBar - The all in one button container

Post by good4000 »

ok there are 3 sections in a Extcheck. set-function get-function and init-function . im not expert about these codes how can i use your code here ?
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Re: [Ext] PrefBar - The all in one button container

Post by dickvl »

You didn't give much details to work with.

With zero, do you mean the number zero as a String (or Integer) value ("0") or is this an empty String value ("")?

You can use this function call to reset a pref or possibly use SetPref() to set the pref to a specific String value and use GetPref() to get the current value.
See: chrome://prefbar/content/goprefbar/main.js

Code: Select all

goPrefBar.ClearPref("<pref name>");
goPrefBar.SetPref("<pref name>", "<String value>");
goPrefBar.GetPref("<pref name>");


The Get-function tab defines what JavaScript is evaluated to get the checkmark (true) or not (false).

Code: Select all

var pref = "<pref name>" 
var value = (goPrefBar.GetPref(pref) ==  "0");


Set-function:

Code: Select all

var pref = "<pref name>" 
var value = goPrefBar.GetPref(pref);
if (value == "0") {
 goPrefBar.ClearPref(pref);
} else {
 goPrefBar.SetPref(pref, "0");
}


The Init-function is not needed.
good4000
Posts: 19
Joined: June 15th, 2014, 11:19 pm

Re: [Ext] PrefBar - The all in one button container

Post by good4000 »

thank you . it is working .
normanbg
Posts: 1
Joined: November 22nd, 2014, 7:23 am

Re: [Ext] PrefBar - The all in one button container

Post by normanbg »

I am new to FireFox and just installed PrefBar. It seems very versatile, and just what I need, but I have been unable to set up a button that launches a local executable file (.exe).
Any help would be greatly appreciated. (FireFox 30.0, Windows XP)
M-Reimer
Posts: 76
Joined: July 2nd, 2013, 4:29 am

Re: [Ext] PrefBar - The all in one button container

Post by M-Reimer »

Thanks for your feedback and sorry for the late answer. Now, I subscribed to this topic so I hope in future I'll be able to answer in time.

Creating a small example for "execute some software via button" is on my todo-list. There were some example buttons, in the past, directly built into PrefBar, but they were not really useful. A small tutorial would be much better to explain how to use the required backend function.
Scott_1A
Posts: 207
Joined: March 25th, 2006, 5:12 pm

Re: [Ext] PrefBar - The all in one button container

Post by Scott_1A »

I have PREFBAR 6.5.0 installed under FF 36.0.4 and can no longer IMPORT buttons directly from the PREFBAR “More Buttons” list. If I choose "import", I get a message saying that the "import" process has started but it just hangs at that point and never completes. The problem still exists even with all other extensions disabled so the problem is not an extension conflict. I can download the particular button first and import it that way but I prefer being able to import the button directly from the "more buttons" list. Can anyone tell me why direct "Import" no longer works and is there a way to get it working properly again? Thanks.
emf10679
Posts: 20
Joined: April 15th, 2009, 8:07 pm

Re: [Ext] PrefBar - The all in one button container

Post by emf10679 »

I have been using a checkbox in Prefbar I had made to toggle between webpage and system colors. Its elements were the following:

To: togglecolors
Label: colors
Set-function:
goPrefBar.SetPref("browser.display.use_system_colors", !value);
goPrefBar.SetPref("browser.display.use_document_colors", value);
Get-function:
value = goPrefBar.GetPref("browser.display.use_document_colors");

Unfortunately now it does not work. Now it seems that in the Options > Content > Colors... to have the same effect as before I have to toggle between

Checked Use system colors
and
Override the colors specified by the page with my selections above: Always

and

Unchecked Use system colors
and
Override the colors specified by the page with my selections above: Never

(The reason I need to have system colors unchecked when viewing document colors, is that some webpages specify background (white) but not color, and my system color is white; for example, turn your system colors to white on black and try to see a blank tab page, that is supposed to show sites you visit: it will appear totally white. So I have specified FF colors black on white, to be able to see it as intended.)

*Some additional information:*

When I have about:config open to follow what is going on with the browser.display.use... keys, when I check the PrefBar checkbox, the values change accordingly in about:config (with no effect on the webpage display). When, however, I change Never and Always from the Options, these values do *not* change (though the display does). Obviously there is some other key involved. Which one?

It's very important for me. Please help!

Thanks,

emf

--
Natal Transits Calculator
https://files.nyu.edu/emf202/public/nt/ ... nsits.html
emf10679
Posts: 20
Joined: April 15th, 2009, 8:07 pm

Re: [Ext] PrefBar - The all in one button container

Post by emf10679 »

The new key to change document colors is browser.display.document_color_use and it takes 3 values: 0, 1, and 2. the old checkbox to change document colors does not work any more.

Now I need to make a checkbox for Prefbar to toggles between

browser.display.use_system_colors = true;
browser.display.document_color_use = 2;

and

browser.display.use_system_colors = false;
browser.display.document_color_use = 1;

How do I do this?
DERoss
Posts: 35
Joined: August 20th, 2004, 5:15 pm
Location: California
Contact:

Re: [Ext] PrefBar - The all in one button container

Post by DERoss »

It appears that implementation of bug #639134 impacts PrefBar's Color checkbox. See https://bugzilla.mozilla.org/show_bug.cgi?id=639134.
User avatar
dickvl
Posts: 54145
Joined: July 18th, 2005, 3:25 am

Re: [Ext] PrefBar - The all in one button container

Post by dickvl »

Code: Select all

{
  "prefbar:info": {
    "formatversion": 3
  },
  "prefbar:menu:enabled": {
    "items": [
      "prefbar:button:but_document_color"
    ]
  },
  "prefbar:button:but_document_color": {
    "type": "check",
    "label": "doc",
    "prefstring": "browser.display.document_color_use",
    "topref": "value?1:2",
    "frompref": "(value!=1)"
  }
}
emf10679
Posts: 20
Joined: April 15th, 2009, 8:07 pm

Re: [Ext] PrefBar - The all in one button container

Post by emf10679 »

Thanks dickvl. I created a checkbox using the lower part of the code above (prefstring, topref, frompref), and another one for the system colors. They work, though I cannot understand the prefbar:info and the prefbar:menu:enabled part. and have no idea how I can make use of them.

Now I have a sysclr checkbox checked and a docclr checkbox that I check to see the document colors and uncheck to use my colors.

So far so good. But as I said I'd prefer to have a single checkbox so I won't have to check the and uncheck the other alternatively (though it is true that this is not often necessary). How can I make one?
Post Reply