Last Comment Bug 239533 - about:config shoulds support URL query for specific prefs
: about:config shoulds support URL query for specific prefs
Status: RESOLVED FIXED
[inbound]
: dev-doc-complete
Product: Toolkit
Classification: Components
Component: Preferences (show other bugs)
: Trunk
: All All
: -- enhancement with 3 votes (vote)
: mozilla8
Assigned To: Jez Ng [:int3]
:
Mentors:
: 250958 618512 1244965 (view as bug list)
Depends on: 928649
Blocks: 1208602
  Show dependency treegraph
 
Reported: 2004-04-03 11:47 PST by benc
Modified: 2016-02-16 10:03 PST (History)
19 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
config.js mod to support about:config?filter=<string> (646 bytes, patch)
2008-10-12 21:59 PDT, asmpgmr
no flags Details | Diff | Splinter Review
config.js mod to support about:config?filter=<string> (706 bytes, patch)
2008-10-25 09:28 PDT, asmpgmr
no flags Details | Diff | Splinter Review
config.js mod to support about:config?filter=<string> (668 bytes, patch)
2008-11-01 12:19 PDT, asmpgmr
no flags Details | Diff | Splinter Review
Patch v1 (1.39 KB, patch)
2011-08-01 02:59 PDT, Jez Ng [:int3]
no flags Details | Diff | Splinter Review
Patch v1 (1.38 KB, patch)
2011-08-01 03:12 PDT, Jez Ng [:int3]
gavin.sharp: feedback+
Details | Diff | Splinter Review
Patch v2 (1.40 KB, patch)
2011-08-02 12:32 PDT, Jez Ng [:int3]
no flags Details | Diff | Splinter Review
Patch v3 (1.39 KB, patch)
2011-08-02 12:38 PDT, Jez Ng [:int3]
gavin.sharp: review+
Details | Diff | Splinter Review

Description benc 2004-04-03 11:47:22 PST
about:config is too cool, and I use it all the time now, but the bigger problem
is that we have too many prefs!

What would be great is if we could use the URL parsing features to extend the
about:config so that it would allow the following:

1- display of a single pref:
about:config?network.online

2- display a subtree of the namespace:
about:config?network.proxy.*

3- display an arbitrary list of prefs:
about:config?network.online&offline.startup_state

This seems like it would be easier to do now that we support filters.
Comment 1 Andreas Otte 2004-04-03 14:52:49 PST
about is a simple URI which has it's own URL parser, so we are free to do
whatever we want. I like this idea.
Comment 2 Dave Anderson 2004-06-27 20:15:31 PDT
It would be extra-cool if you could change settings via URI. For example, I
would love to be able to create a bookmark or pair of bookmarks that allow me to
toggle a setting. It's OK, if it has to be complex, or javascript ala the google
search add-on. Just so I could toggle browser.tabs.loadInBackground without
having to dig into prefs. Other settings may interest other users.
Comment 3 Steve Chapel 2004-07-14 10:48:32 PDT
I would prefer the syntax:

about:config?filter=network.proxy.*

That will scale nicely as new features are added to about:config, such as being
able to search on multiple fields as in bug 213832:

about:config?filter=network.proxy.*&type=string&value=localhost*
Comment 4 WADA 2005-07-14 00:03:48 PDT
I'll be very happy and appreciated if "filter=net*.*ro?y*.*" format is accepted.
I prefer "DIR(Win)" or "ls(*nix)" like filtering.
Comment 5 WADA 2005-12-27 19:28:06 PST
Bug 213832, another enhancement of about:config filtering(regular expression), has been landed on 12/27 by Gavin Sharp.
Comment 6 MI 2008-07-07 06:35:06 PDT
I have been wishing for something like this for years. It is not trivial, but would add tremendous value. Particularly if there is a way to offer a preference change through a simple link, like Eudora did for it's own .ini settings. This being comlicated, a simple clickable filter would be very welcome in the meantime.

** Clickable about:config URIs to change settings:

* Security:

Obviously, a link changing a preference cannot be allowed to do it without a well-informed user confirmation. It needs a UI (popup?) presenting:

  - the meaning of the preference (see below)
  - the default value
  - the current value if different
  - the new value

So this can only work if we also have

* Documentation:

All settings need to be clearly documented. Currently, most (but not all?) are documented in various separate wiki pages, which cannot be automatically searched or exported. So this structured documentation effort would need to be done first. It would produce either a file which would be delivered with Mozilla apps for this purpose, or a searchable database which would be queried when a preference is changed this way, or both.

** In the meantime, a clickable URI with optional filter:

Something like what Steve suggests in comment #3 would seem fine. And this seems not too difficult to implement.

** Support for different Mozilla apps:

One additional feature would be the ability to specify the application to which the setting is to be applied. Preferences could apply to Firefox, Thunderbird, Sunbird, etc. What about an Intranet web page listing the recommended settings for Thunderbird? When clicked in Firefox, there should be a way for FF to know to send that to Thunderbird which would then handle the interface for the user approval. Of course, TB suggested settings could be sent through email (like what was done with Eudora), but what about Sunbird settings?

Maybe something like
  about:config?app=thunderbird;filter=mail.SpellCheckBeforeSend
  about:config?app=thunderbird;set=mail.SpellCheckBeforeSend;value=true
or
  about:config?thunderbird:mail.SpellCheckBeforeSend=true
Comment 7 benc 2008-07-08 11:10:15 PDT
MI:

In this bug, I don't want settable preferences. In fact, I'm pretty sure that links that set preferences are a bad idea.

If you want to request that, please file a new bug, and link to this bug as a blocker of that bug.
Comment 8 asmpgmr 2008-10-12 21:59:51 PDT
Created attachment 342843 [details] [diff] [review]
config.js mod to support about:config?filter=<string>
Comment 9 Samuel Sidler (old account; do not CC) 2008-10-15 09:34:24 PDT
Comment on attachment 342843 [details] [diff] [review]
config.js mod to support about:config?filter=<string>

This needs review before we'll consider it for approval, but likely this isn't branch material and should just get fixed in 1.9.1.
Comment 10 asmpgmr 2008-10-25 09:28:28 PDT
Created attachment 344752 [details] [diff] [review]
config.js mod to support about:config?filter=<string>

change patch format
Comment 11 Philip Chee 2008-11-01 08:40:58 PDT
Changing product/component to Toolkit::Preferences

+  var url = document.documentURI;
+  var str = /^about:config\?filter\=/;
+  if (str.test(url)) {

var filterstring = window.location.search.substr("?filter=".length, window.location.search.length);

(stolen from <http://mxr.mozilla.org/mozilla1.8.0/source/toolkit/mozapps/extensions/content/extensions.js#144>)

The following should be merged with the end of ShowPrefs() (see Bug 440154):

+    textbox.value = url.replace(str, "");

textbox.value = filterstring;

+    textbox.focus();
+    FilterPrefs();
Comment 12 Philip Chee 2008-11-01 08:45:07 PDT
> The following should be merged with the end of ShowPrefs()
Well the code in the whole patch should be moved to the end of ShowPrefs().

Also when you request for a review you have to fill in the requestee field otherwise the review request will never be noticed by anyone. Gavin Sharp or neil@parkway seem to be the most likely reviewers for this patches in this area.
Comment 13 asmpgmr 2008-11-01 12:19:41 PDT
Created attachment 345888 [details] [diff] [review]
config.js mod to support about:config?filter=<string>

updated to work with bug 440154
Comment 14 :Gavin Sharp [email: gavin@gavinsharp.com] 2009-09-29 11:23:02 PDT
Comment on attachment 345888 [details] [diff] [review]
config.js mod to support about:config?filter=<string>

Sorry for the delay... Shouldn't this just use location.search?
Comment 15 Jez Ng [:int3] 2011-08-01 02:59:57 PDT
Created attachment 549749 [details] [diff] [review]
Patch v1

So location.search seems to always be empty for about: URLs (see bug 675555). I've adapted the original patch to 1) use decodeURIComponent 2) call FilterPrefs() in only one place.

I'm not sure whether we should fill the textbox with the URL parameter if it already contains a value; my current patch does that while the original did not.

Do we have a test directory for about:config? I wanted to write a test for this but I wasn't able to find a tests/ directory under toolkit/components/viewconfig.
Comment 16 Jez Ng [:int3] 2011-08-01 03:12:35 PDT
Created attachment 549750 [details] [diff] [review]
Patch v1

Oops, the last patch had changes I hadn't intended to put in.
Comment 17 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-08-01 14:24:27 PDT
Comment on attachment 549750 [details] [diff] [review]
Patch v1

How about:
var uri = document.documentURIObject;
var matches = /[?&]filter=([^&]+)/i.exec(uri.path);
Comment 18 Jez Ng [:int3] 2011-08-02 12:32:00 PDT
Created attachment 550167 [details] [diff] [review]
Patch v2

Patch updated with suggestions.

Taking this since it's been a while since it was last touched.
Comment 19 Jez Ng [:int3] 2011-08-02 12:38:51 PDT
Created attachment 550168 [details] [diff] [review]
Patch v3
Comment 20 :Gavin Sharp [email: gavin@gavinsharp.com] 2011-08-02 12:51:10 PDT
Comment on attachment 550168 [details] [diff] [review]
Patch v3

I think this is actually not a particularly useful feature, since about:config isn't linkable, and if you're going to type the URL in manually you might as well type in the filter manually too, but we can just land this - let's just not spend any more time on this :)
Comment 21 Marco Bonardo [::mak] 2011-08-05 08:49:33 PDT
http://hg.mozilla.org/mozilla-central/rev/9bf06b1df475
Comment 22 Jorge Villalobos [:jorgev] 2011-08-18 16:57:53 PDT
Could be useful for add-on developers.
Comment 23 Eric Shepherd [:sheppy] 2011-10-17 14:29:02 PDT
Is this actually supposed to work? It doesn't for me.
Comment 24 Paul O'Shannessy [:zpao] (not reading much bugmail, email directly) 2011-10-17 15:16:13 PDT
(In reply to Eric Shepherd [:sheppy] from comment #23)
> Is this actually supposed to work? It doesn't for me.

This works for me. going to "about:config?filter=sessionstore" pre-fills the textfield and filters correctly (in both nightly & aurora)
Comment 25 Eric Shepherd [:sheppy] 2011-10-17 15:49:15 PDT
Ah, I didn't read enough, I wasn't including the "filter=" part. It does work.
Comment 26 Eric Shepherd [:sheppy] 2011-10-17 15:55:12 PDT
Documentation updated:

https://developer.mozilla.org/en/Preferences/A_brief_guide_to_Mozilla_preferences#Modifying_preferences

Also mentioned on Firefox 8 for developers.
Comment 27 Noah (oldtimer) [:Noah] 2012-08-17 11:24:57 PDT
*** Bug 618512 has been marked as a duplicate of this bug. ***
Comment 28 Dão Gottwald [:dao] 2013-04-11 14:38:49 PDT
*** Bug 250958 has been marked as a duplicate of this bug. ***
Comment 29 Karl Dubost :karlcow 2016-02-02 17:32:20 PST
*** Bug 1244965 has been marked as a duplicate of this bug. ***
Comment 30 mlissner 2016-02-16 10:03:53 PST
*** Bug 1248646 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.