Last Comment Bug 463189 - Provide an easy method for theme developers to style the browser in private browsing mode
: Provide an easy method for theme developers to style the browser in private b...
Status: VERIFIED FIXED
: dev-doc-complete
Product: Firefox
Classification: Client Software
Component: Theme (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 3.1b2
Assigned To: :Ehsan Akhgari
:
Mentors:
Depends on: PrivateBrowsing
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-05 01:13 PST by :Ehsan Akhgari
Modified: 2009-02-13 22:31 PST (History)
8 users (show)
mbeltzner: blocking‑firefox3.5-
ehsan: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (v1) (1.20 KB, patch)
2008-11-05 01:13 PST, :Ehsan Akhgari
mconnor: review+
Details | Diff | Splinter Review
Unit test (3.64 KB, patch)
2008-11-06 06:39 PST, :Ehsan Akhgari
gavin.sharp: review+
Details | Diff | Splinter Review
Unified patch (4.84 KB, patch)
2008-11-06 11:53 PST, :Ehsan Akhgari
ehsan: review+
mconnor: approval1.9.1b2+
Details | Diff | Splinter Review

Description :Ehsan Akhgari 2008-11-05 01:13:17 PST
Created attachment 346417 [details] [diff] [review]
Patch (v1)

We should provide an easy method for theme developers to make some parts of the browsers UI look different in private browsing mode.  I think this will be a common request from theme developers, and unless we do something about it, this can only happen with an extension.

So, I'm proposing a really simple change to make rules such as the below possible in themes in case the designer wants to turn the background of the location bar gray for example.

[browsingmode=private] #urlbar {
  background: #eee;
}

It'd be great if we can take this for Beta 2 in order to give theme developers some time to play with this idea.
Comment 1 Mike Connor [:mconnor] 2008-11-05 17:59:26 PST
Comment on attachment 346417 [details] [diff] [review]
Patch (v1)

makes sense.
Comment 2 :Ehsan Akhgari 2008-11-06 06:39:19 PST
Created attachment 346657 [details] [diff] [review]
Unit test

Simple unit test for the patch.
Comment 3 :Ehsan Akhgari 2008-11-06 11:53:46 PST
Created attachment 346720 [details] [diff] [review]
Unified patch

Unified patch including the test.  Should have minimal risk.  Requesting approval to land on Beta 2 in order to give theme developers a chance to explore the possibilities of theming the private browsing mode.
Comment 5 :Ehsan Akhgari 2008-11-09 09:28:17 PST
I added some docs for this to <https://developer.mozilla.org/En/Theme_changes_in_Firefox_3.1>, but I'm not sure if that's considered enough, so I'm leaving the dev-doc-needed flag set.
Comment 6 Alex Faaborg [:faaborg] (Firefox UX) 2008-11-10 21:33:44 PST
This is great, we'll want to take advantage of this in 3.2 for an ambient change in the theme.
Comment 7 Eric Shepherd [:sheppy] 2009-02-12 01:35:45 PST
The existing coverage is about all that we ever do for changes like this, so I'm calling this doc complete.
Comment 8 Henrik Skupin (:whimboo) 2009-02-13 20:56:55 PST
Ehsan, while trying to verify this enhancement I'm not able to see any change of the urlbar when using the given example from comment 0. I put the lines into my userChrome.css and restarted the browser. But the location bar doesn't change its background color when entering the Private Browsing mode.

I ran the test with Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090213 Minefield/3.2a1pre
Comment 9 :Ehsan Akhgari 2009-02-13 22:18:52 PST
How about:

[browsingmode=private] #urlbar {
  background: #eee !important;
}

?  The code part of this patch should work fine, since its unit test has been passing on all platforms...
Comment 10 Henrik Skupin (:whimboo) 2009-02-13 22:31:36 PST
Here we are. Important was the important fix here. Thanks Ehsan.

Verified fixed on Windows and OS X with:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3pre) Gecko/20090213 Shiretoko/3.1b3pre

Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1b3pre) Gecko/20090213 Shiretoko/3.1b3pre

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