Infocatcher / Private_Tab

Adds private tabs, restartless extension for Firefox (20.0+) and SeaMonkey (2.17+)
https://addons.mozilla.org/addon/private-tab/
Other
86 stars 20 forks source link

"New Private Tab" button in tab-bar eats "New Tab" button space (Australis) #137

Closed Dimas-sc closed 10 years ago

Dimas-sc commented 10 years ago

http://i.imgur.com/ffgPrLt.png

As you can see in the capture, putting the "New Private Tab" button next to the core "New Tab" button isn't accurate and when you want to click the core button the "New Private Tab" button is activated instead.

Infocatcher commented 10 years ago

Oh, I see, this is chrome://browser/skin/browser.css

.tabbrowser-tab {
  pointer-events: none;
}

.tab-background-middle,
.tabs-newtab-button,
.tab-close-button {
  pointer-events: auto;
}

trick for tabs (and "curves" of tabs isn't accessible). And this can't be easily used for toolbarbutton because image inside button isn't accessible. And (as I understand) accessibility may be changed only using custom binding, like following:

.tabs-newtab-button {
    pointer-events: none;
    -moz-binding: url("override.xml#toolbarbutton");
}
.tabs-newtab-button > .toolbarbutton-icon {
    pointer-events: auto;
    padding: 5px 12px;
}

with

<?xml version="1.0"?>
<bindings id="toolbarbuttonBindings"
    xmlns="http://www.mozilla.org/xbl"
    xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <binding id="toolbarbutton" display="xul:hbox" role="xul:toolbarbutton"
        extends="chrome://global/content/bindings/toolbarbutton.xml#toolbarbutton" />
</bindings>

But only one extension may override binding. So, this will break all extensions, that wants to use similar trick. :(

Infocatcher commented 10 years ago

But only one extension may override binding. So, this will break all extensions, that wants to use similar trick. :(

I used generated binding that extends current one, but this may break anyway (e.g. if you disable another restartless extension with similar trick). Also I had to handle left-click manually (but this shouldn't create any problems from user side).

Also added two hidden preferences:

And for added user styles (Stylish) and extensions like Classic Theme Restorer Private Tab styles aren't updated automatically (and you should re-enable extension).

Test version: private_tab-0.1.7.1pre2-fx-sm.xpi (source source).

Dimas-sc commented 10 years ago

It works perfectly now!

If you need some advanced testing tell me. Do you think we could create a Firefox bug for a better / no-conflict fix?

Thx!

Infocatcher commented 10 years ago

Do you think we could create a Firefox bug for a better / no-conflict fix?

May be, but how many extensions have buttons after last tab? I know only about Tab Mix Plus, but with only some GUI settings for New Tab button placement.

Also I corrected code to better resize button's icon, now should work better with other themes/extensions (e.g. with Tree Style Tab). Test version re-uploaded, link still the same.

Dimas-sc commented 10 years ago

Agree, solved! :D