Advanced javascript options (new prefs ui only)

Talk about add-ons and extension development.
NetOne
Posts: 209
Joined: March 15th, 2004, 3:50 am

Post by NetOne »

It seems that the prefs in the Javascript option dialog is saved when the "OK" button of the Firefox option dialog is pressed, not when the "OK" button of the Javascript option dialog. I think saving the prefs when the "OK" button of the Javascript option dialog would be better.

Anyway, great extension. Thanks!
User avatar
Mossop
Posts: 717
Joined: January 11th, 2004, 7:24 am
Location: Swansea, UK

Post by Mossop »

NetOne wrote:It seems that the prefs in the Javascript option dialog is saved when the "OK" button of the Firefox option dialog is pressed, not when the "OK" button of the Javascript option dialog. I think saving the prefs when the "OK" button of the Javascript option dialog would be better.


Yeah, you'll find that the same thing happens with all the other windows that can be opened from the options window. Ben made that decision for some reason, I chose to follow his lead.

Mossop
NetOne
Posts: 209
Joined: March 15th, 2004, 3:50 am

Post by NetOne »

mossop wrote:
NetOne wrote:It seems that the prefs in the Javascript option dialog is saved when the "OK" button of the Firefox option dialog is pressed, not when the "OK" button of the Javascript option dialog. I think saving the prefs when the "OK" button of the Javascript option dialog would be better.


Yeah, you'll find that the same thing happens with all the other windows that can be opened from the options window. Ben made that decision for some reason, I chose to follow his lead.

Mossop
Need to get used to that:)
User avatar
Moonwolf
Posts: 531
Joined: December 7th, 2003, 2:50 pm
Location: Hertfordshire, England
Contact:

Post by Moonwolf »

It's actually the "proper" way to do things.

The Cancel button on the main options window has to cancel everything you've done since it was opened. That's what the button's there for.

You wouldn't like it if you changed your mind about something you'd just done, hit "Cancel" and then found your changes had been applied anyway.
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050223 Firefox/1.0.1
Thunderbird 1.0 (20041206)
EMbuttons: Buttons & options for the Extension Manager. Easy Get Mail Button is here too.
NetOne
Posts: 209
Joined: March 15th, 2004, 3:50 am

Post by NetOne »

Yes, I think it's the proper way. Most Windows application do it in the "improper" way. That's why I need to get used to it. :)
User avatar
BenneJezzerette
Posts: 1482
Joined: November 1st, 2004, 1:47 am
Location: Ghost in the Machine

Post by BenneJezzerette »

mossop wrote:
NetOne wrote:It seems that the prefs in the Javascript option dialog is saved when the "OK" button of the Firefox option dialog is pressed, not when the "OK" button of the Javascript option dialog. I think saving the prefs when the "OK" button of the Javascript option dialog would be better.


Yeah, you'll find that the same thing happens with all the other windows that can be opened from the options window. Ben made that decision for some reason, I chose to follow his lead.

Mossop


Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.8b2) Gecko/20050330 Firefox/1.0+

Is my current config, as you see I am not using Windows anymore. Will this work for Linux (Slackware 1.1 2.4.29 Linux) too? Just curious.
Vista Home Premium 64 AMD 9950 Quad Core + 8GB DDR2 1066 1x500GB 1X750GB Partitioned 1X1TB MSI GTX260 896
Firefox Safe Browsing - Pocomail Safe E-Mail from Script Kitties
True Internet Surfing + E-Mail not Junk
User avatar
Mossop
Posts: 717
Joined: January 11th, 2004, 7:24 am
Location: Swansea, UK

Post by Mossop »

BenneJezzerette wrote:
mossop wrote:
NetOne wrote:It seems that the prefs in the Javascript option dialog is saved when the "OK" button of the Firefox option dialog is pressed, not when the "OK" button of the Javascript option dialog. I think saving the prefs when the "OK" button of the Javascript option dialog would be better.


Yeah, you'll find that the same thing happens with all the other windows that can be opened from the options window. Ben made that decision for some reason, I chose to follow his lead.

Mossop


Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.8b2) Gecko/20050330 Firefox/1.0+

Is my current config, as you see I am not using Windows anymore. Will this work for Linux (Slackware 1.1 2.4.29 Linux) too? Just curious.


If you mean the javascript options in general then yes, I use it myself under Fedora. As for whether the options update instantly or after the main options window is closed then I can't say I remember, I think the options will set as soon as you click ok on the javascript options, but it will follow whatever the platform defaults are.

Mossop
User avatar
BenneJezzerette
Posts: 1482
Joined: November 1st, 2004, 1:47 am
Location: Ghost in the Machine

Post by BenneJezzerette »

mossop wrote:
BenneJezzerette wrote:
mossop wrote:
NetOne wrote:It seems that the prefs in the Javascript option dialog is saved when the "OK" button of the Firefox option dialog is pressed, not when the "OK" button of the Javascript option dialog. I think saving the prefs when the "OK" button of the Javascript option dialog would be better.


Yeah, you'll find that the same thing happens with all the other windows that can be opened from the options window. Ben made that decision for some reason, I chose to follow his lead.

Mossop


Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.8b2) Gecko/20050330 Firefox/1.0+

Is my current config, as you see I am not using Windows anymore. Will this work for Linux (Slackware 1.1 2.4.29 Linux) too? Just curious.


If you mean the javascript options in general then yes, I use it myself under Fedora. As for whether the options update instantly or after the main options window is closed then I can't say I remember, I think the options will set as soon as you click ok on the javascript options, but it will follow whatever the platform defaults are.

Mossop


Installed and works like it should under Slackware. Thank you thank you. Has 2 good extensions jslib and jsoptions. Woohoo!!
Vista Home Premium 64 AMD 9950 Quad Core + 8GB DDR2 1066 1x500GB 1X750GB Partitioned 1X1TB MSI GTX260 896
Firefox Safe Browsing - Pocomail Safe E-Mail from Script Kitties
True Internet Surfing + E-Mail not Junk
User avatar
fab97
Posts: 122
Joined: December 9th, 2002, 5:07 am
Location: Lyon, France.

Post by fab97 »

hello,
thank you very much for giving back this advanced option.
I see you enhanced it a little bit :)

Then, I have a suggestion,
I would like to see options to disable "onLoad" and "onUnload" javascript code.
for example, with this option checked, onload code would not be triggered.
(of course these option should be unchecked by default as it may break some website)

if you can add such feature, it would be very nice :)
thank you.
fab.
User avatar
Mossop
Posts: 717
Joined: January 11th, 2004, 7:24 am
Location: Swansea, UK

Post by Mossop »

fab97 wrote:I have a suggestion,
I would like to see options to disable "onLoad" and "onUnload" javascript code.
for example, with this option checked, onload code would not be triggered.


The way that the option work at the moment is they are basically a front end to the javascript options already available in about:config. As far as I know there are no options already in firefox to disable the load and unload events so I would have to figure out how to write some code to do this. Unfortunatly right now I am really snowed under with other things so this is unlikely to happen in the forseeable future.

Mind you, if someone knows of an option that already does this, or has some code that does it, I would be happy to include it in this extension, just let me know.

Mossop
User avatar
Mossop
Posts: 717
Joined: January 11th, 2004, 7:24 am
Location: Swansea, UK

Post by Mossop »

Just a note about my plans for this extension. Once the Developer Preview of Firefox 1.1 is out I will be doing a check through to make sure everything works, then probably think about submitting to update.mozilla.org. If anyone is interested in seeing this extension in different languages and you are able to translate the bits that need it (probably less than 50 short sentences) then drop me a line.

Mossop
twanno
Posts: 284
Joined: February 10th, 2004, 8:58 am
Contact:

Post by twanno »

kluwitter wrote:
diaz8 wrote:Something odd, i have just downloaded last 1.0 version and "Ok" button doesn´t work for me.


I had had the same problem (upgrading from 0.7). I remove all entries in "localstore.rdf" containing references to js , now it <b>WFM.</b>

I think it was an old windows position stored in localstore (screenX, ScreenY) ...

Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.8b2) Gecko/20050308 Firefox/1.0+ (MOOX M1)

I had the same problem with the OK button not working, and I everytime I opened the options dialog, the panel had no contents. So I looked in localstore.rdf and I noticed this line:

Code: Select all

  <RDF:Description RDF:about="chrome://browser/content/preferences/preferences.xul#BrowserPreferences"
                   lastSelected="paneJSOptions" />

I removed that and now everything works again: both the OK button and the appearence of the content when opening the options dialog. I haven't seen anybody else complaining about an empty panel when opening the options dialog, so I wonder if this is what is/was causing the problems by other people.
User avatar
Mossop
Posts: 717
Joined: January 11th, 2004, 7:24 am
Location: Swansea, UK

Post by Mossop »

twanno wrote:I removed that and now everything works again: both the OK button and the appearence of the content when opening the options dialog. I haven't seen anybody else complaining about an empty panel when opening the options dialog, so I wonder if this is what is/was causing the problems by other people.


Sorry I must have forgotten to post in this thread, but I discovered the reason why some people were getting a blank options panel and yeah its that rogue entry in localstore.rdf. There is a bug for it and a patch waiting for review that should solve it.

Mossop
User avatar
BenneJezzerette
Posts: 1482
Joined: November 1st, 2004, 1:47 am
Location: Ghost in the Machine

Post by BenneJezzerette »

mossop wrote:
twanno wrote:I removed that and now everything works again: both the OK button and the appearence of the content when opening the options dialog. I haven't seen anybody else complaining about an empty panel when opening the options dialog, so I wonder if this is what is/was causing the problems by other people.


Sorry I must have forgotten to post in this thread, but I discovered the reason why some people were getting a blank options panel and yeah its that rogue entry in localstore.rdf. There is a bug for it and a patch waiting for review that should solve it.

Mossop


get everything updated and working finally? did you use thta patch for the FC3 to get FF working correctly?
Vista Home Premium 64 AMD 9950 Quad Core + 8GB DDR2 1066 1x500GB 1X750GB Partitioned 1X1TB MSI GTX260 896
Firefox Safe Browsing - Pocomail Safe E-Mail from Script Kitties
True Internet Surfing + E-Mail not Junk
User avatar
Zulithe
Posts: 658
Joined: May 3rd, 2003, 5:45 pm
Location: San Francisco, CA

Post by Zulithe »

Love your extension. That "disable common annoyances" feature seems kinda weak to me. I get what the point behind it is, but I think it will confuse people more than it helps them, since the description of that option doesn't tell you much about what it is disabling.
Post Reply