fix: avoid popup being invisible in Firefox #1005
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of changes
For some time, the extension's popup window has used CSS that sets
body, html { height: 0px; }
as a workaround for a Chromium issue where, without that CSS, the popup window does not resize like it should when its content is zoomed in/out. It doesn't actually set the window height to 0; it forces it to dynamically fit the content.(note that, due to a separate Chromium issue, you can't zoom in/out on the popup content directly; to observe this, you need to have the popup open while you're zooming in/out on a different extension page, like the details page)
In Firefox, the original workaround has the effect you would actually expect, and causes the popup window to be of 0 height, ie, invisible. Using
fit-content
instead of0px
still achieves the desired dynamic zoom behavior in Chrome, but also achieves a correct popup window size in Firefox.Note that this fix does not allow for correct popup window zooming in Firefox; it only enables correct window sizing in Firefox at the 100% zoom level. Popup window sizing at other zoom levels is broken in Firefox due to Firefox bug 1570849, which appears to affect all extensions that use this type of popup window.
Before:
![firefox-before](https://user-images.githubusercontent.com/376284/62339965-b9fb7480-b492-11e9-97bd-d96e7367b2e9.gif)
Firefox:
Chrome:
![chrome-before](https://user-images.githubusercontent.com/376284/62339973-c2ec4600-b492-11e9-9db3-100b5af003a2.gif)
After:
![firefox-after](https://user-images.githubusercontent.com/376284/62339988-d39cbc00-b492-11e9-8e8b-598e86590acd.gif)
Firefox:
Chrome:
![chrome-after](https://user-images.githubusercontent.com/376284/62339972-c1bb1900-b492-11e9-8b18-594293749184.gif)
Pull request checklist
yarn test
)<rootDir>/test-results/unit/coverage
yarn precheckin
)