browser-action-jplib
browser-action-jplib copied to clipboard
Button sizes aren't perfect on install, after restart, and after moving the button
This is a minor imperfection. Doing these tests with Pinterest's extension (which is an old-style extension that requires a restart) doesn't cause any button weirdness. Tested this on Firefox Mac 28.0 (Beta channel). Here is what I did:
- Created a new extension with cfx init.
- Imported browser-action-jplib and toolbarwidget-jplib
- Created a primitive main.js:
var badge = require('browserAction').BrowserAction({
default_icon: 'mitro_logo-32.png',
});
- cfx xpi and install it from file. The initial size of the toolbar button is way too small:

- Open a new Window, and the button looks correct (on the new window, not the original window)

- Customize and drag the button to the add-on bar or the palette then back again:

- Open a new window. The new window is correct, but this icon is 1 pixel too high:

- Quit and restart the browser. The icon is still 1 pixel too high (see above). Its correct on new windows.
You can get the source code for my primitive extension here: https://github.com/evanj/ff-toolbar-bug
You can get the source code for my primitive extension here:
Where?
Oops, forgot to copy and paste. Added link.
Cannot reproduce on ArchLinux using:
- Firefox Nightly 30.0a1
- Addon SDK version 1.15 (
1de7d0d1dfbda3adfd68b2157fb6f2f3fd9bbedf) - toolbarwidget-jplib 1.3.3 4ff24e9b3a49a6e284fe8dec82ce5f9911f32150
- browser-action-jplib 0.2.4 (aab25cf0e4a6be00699b7689e8f3844b9ca977d1)
What I did:
cd /tmp
git clone https://github.com/evanj/ff-toolbar-bug.git
cd ff-toolbar-bug
# To load dependencies in packages/
git submodule init
git submodule update
# Activate Addon SDK and create XPI file
addon-sdk
cfx xpi
# Launch Firefox
mkdir /tmp/nightlyprof
firefox-nightly - profile /tmp/nightlyprof --no-remote /tmp/ff-toolbar-bug/
# When Firefox has been opened, click on the XPI file
# Follow the steps-to-reproduce from issue 12
Can you retry with Firefox Nightly and a new Firefox profile?
Sure, so that seems to "work", although I need to hack the HTML to make it look more like Firefox's buttons. The default result has the button border, so I can't tell if it is aligned correctly or not:

I supposed I can probably hack the browserAction.html to remove the button tag; although my quick attempt to do that didn't seem to work.
At any rate: It seems fine to me to say "I don't care because this will eventually fix itself", which is true. Although its going to be many months before that happens. Thanks.
Can't reproduce with Firefox 28.0b4 either, on Linux and Windows.
Did it "work" because you tested with Nighly, or did switching to a new Firefox profile solve your issue?
Oh, good point. I tried with Firefox Beta 28.0 b4 with a totally new profile: firefox-bin -profile /Users/ej/wtf and I got the same result as above. However, I also tried it on Windows 8 and Linux (Ubuntu), and it seems like it is a platform-specific bug. Translation: If this only happens on Mac OS X, it really is a "who cares" bug. I can deal with the few pixels being off.
Details:
On windows, there is a minor difference in appearance but not enough to care. The extension button on hover:

The native button on hover:

On Windows, I was able to get the "small" icon thing to happen after dragging the button to the toolbar palette and back into the toolbar (on hover). Just like on Mac, opening a new window fixes it:

On Linux, it doesn't look like I can get the bugs to happen, but I was able to get the focus "stuck" on the extension button. Click on the button to get the "pressed" state, then move the mouse off of it and release the button. The button remains looking like this:

The extension button is always a square, hence the size of the button might be different from the other buttons (esp. when these are rectangles).
The other bugs are really minor. I will not fix them, but if anyone sends a PR with an acceptable fix, I will review and merge it.
I agree with you: these are minor, and will go away with the new Firefox UI in 6 months time.