kustodian / extended-statusbar

Firefox addon which adds a statusbar with speed, percentage, time and loaded size (similar to Opera's one)
https://addons.mozilla.org/en-US/firefox/addon/extended-statusbar/
GNU General Public License v3.0
18 stars 6 forks source link

Automatically hide local sites (e.g. "about:" & "file:"). #18

Closed adoxa closed 5 years ago

adoxa commented 10 years ago

Addresses #15. I would prefer to make it configurable, but not sure of the best way to go about it. For new users, these sites could be the default hidden list, but that's problematic for existing users (if it's blank is that because they don't want to hide anything, or haven't hidden anything and these sites should be added?; if it's not blank, do we add these, or have they already been added?). Perhaps another edit field for local sites might be the go? Or just always leave them hidden.

sipertruk commented 10 years ago

I would add a "hide local sites + list of keywords" checkbox in the "don't show on these sites" group controlling a boolean pref which default is false for box unchecked and local sites not hidden. So nothing is changed for existing user, new users would quickly find it if needed.

adoxa commented 10 years ago

I was thinking of adding another edit field "Don't show if the site matches the pattern", which would be a verbatim regexp, defaulting to the local sites.

kustodian commented 10 years ago

But ESB is useless on anything which is not remote, the information is usually flawed and useless. It feels even odd to see ESB in about:addons, for example.

I was even thinking to hide ESB on everything but http/https/ftp.

@adoxa we already have a text field for hiding on sites.

adoxa commented 10 years ago

Using the new progress listener shows about:addons is about 261 KB, so the information is there. In any event, for the terminally curious it should be an option, whatever that option ends up being. I don't think it should be a checkbox, though. Perhaps introduce another preference to replace hideonsites, which would default to the local list + hideonsites. That way the existing hidden list is automatically updated to hide locals, which can then be edited to remove them for those that care (although there's still a duplicates issue if users have hidden them themselves).

kustodian commented 10 years ago

I like the idea with the checkbox the most. We should add a checkbox callled "Hide on local addresses" and it should be checked by default, so the new users don't see ESB on them. Advance users which would like to see ESB on local/internal addresses, will find the option and enable it if they need/want it.

adoxa commented 10 years ago

Okay, I'll go ahead and do that.

adoxa commented 10 years ago

Done. I added it to the right side below the edit field, with a tooltip indicating which addresses it will hide. Being naughty and doing more than one thing, I also changed things like if (bool) var = true; else var = false; to just var = bool; and tweaked appendStyleAtribute (which I just now noticed is misspelt).

adoxa commented 10 years ago

The listeners don't apparently work with FTP, and I couldn't find anything about it, so perhaps it might be better to call it "Web only", with a tip saying "Only show on http or https protocols."? Or maybe "All protocols" with "Show on protocols other than http or https.". Yeah, I like "All protocols", but the tip needs work...

sipertruk commented 10 years ago

It works fine. Just a little thing : Hide on local sites would sound better.

adoxa commented 10 years ago

Or even just Local sites, as it's already in a "Don't show" group (same with the Hide individual elements group - remove Hide from each element). However, I'd now rather use something other than "local" - after all, http://127.0.0.1 is local, so to be pedantic it should hide with that and localhost and probably connections to routers and the like as well. Non-web sites doesn't sound very nice (and it's basically a double negative). Web only (or All protocols) sounds better, but is opposite to hiding, so would need another group.

adoxa commented 10 years ago

I really liked the idea of using protocol, so that's what I've done - a new "Show on Protocols" group to select "Web Protocols" (default) or "All Protocols" (I didn't really want to say "Protocols" again, but did so r could be used as an access key).

adoxa commented 10 years ago

Added a special test for customize, as it is actually about:customizing, making it local, thus hiding ESB when it shouldn't.

adoxa commented 10 years ago

After hiding on a blank tab, ESB wouldn't show up again until the location changed, which may be a little while. Now the display state is set on STATE_START and restored with the old values on STATE_STOP.

Sometimes a blank tab had values (maybe because of Super Start) and so it wouldn't hide using "All Protocols", so "about:blank" is explicitly hidden.

If Firefox is started with a blank tab, the style would still be visible, so hide ESB's status bar on init.

A strange problem occurred when customizing from a second blank tab or from Super Start (which creates a new tab for customizing) - values would not update. Turns out .value = string would not work, but .setAttribute("value", string) would, so to be safe the labels are now set properties, using setAttribute.

adoxa commented 9 years ago

Turns out opening a new tab from an external application (such as an email link) means the start state is not yet the current browser, so onLocationChange has to set the display state anyway. The whole hide/show thing needs a bit of an overhaul, now...