vim-vixen
vim-vixen copied to clipboard
Fix opaque console iframe overlaying some websites
This PR fixes the following issue where the console iframe is not transparent on sites that specify a color-scheme
, such as GitHub:
The issue is caused by a change in Firefox where it will now make iframes opaque if their color-scheme
differs from the parent page. The Vim Vixen iframe currently doesn't specify a color-scheme
, but sites like GitHub do, hence the issue.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1738380 and https://fvsch.com/transparent-iframes
This PR makes two changes to solve this:
1. Set the appropriate color-scheme
on the console.
The ConsoleFramePresenter
gets the computed color-scheme
for the <body>
tag where the <iframe>
will be injected and passes it to the console page via a query string parameter.
The console page takes the query string parameter and updates the colorScheme
style property on the root element.
While this does fix the issue once the page has loaded, the white overlay is still briefly visible while it's loading.
I tried several methods to set the color-scheme
but this was the only way I could set the value with the cross-origin of the <iframe>
. I'm open to alternatives.
2. Shrink the <iframe>
when not in use.
To hide the white overlay while the page is loading, I've set the initial height of the <iframe>
to 0px
. The useAutoResize
hook already sets the correct height on the <iframe>
once the user triggers it.
While not strictly necessary, I've also set the <iframe>
height back to 0px
when the console is closed. This solves a minor issue I've had during web development where the browser element selector will highlight the invisible Vim Vixen <iframe>
at the bottom of the page which makes it hard to select items underneath it.
The shrinking of the <iframe>
makes setting the color-scheme
almost unnecessary. However, I've left it for a few reasons:
- When closing the console, occasionally I was able to see the white background briefly before the resize kicks in.
- When the console is open, there is a thin white line visible above it. This could probably be solved with CSS.
- Making the background transparent is presumably valuable for those with a semi-opaque console background theme.
Fixes #1424 Fixes #1429 Fixes #1433
For anyone that wants to try this, you can build my branch as follows. You will need Git, Node, Yarn, and a Firefox edition that supports unsigned addons. Make sure you understand the risks before continuing.
git clone [email protected]:jessarcher/vim-vixen.git
cd vim-vixen
git checkout fix-console-bg
yarn install
yarn package
This should create a vim-vixen-1.2.4.zip
file in this directory which you can install from about:addons
.
Again, only do this if you understand and accept the risks of enabling unsigned addons and always compile from source!
@ueokande I'm also considering opening a PR for #111. Can you let me know if you're welcoming PRs here?
Just installed this patch and it seems to be working. Thanks @jessarcher
Also confirm this looks good. I don't really see any other means of communicating the color-scheme to the iframe, either. This LGTM.
Installed and works as intended. Thanks for the fix.
i have a question, when this PR will be merge ?
How do you install the add-on? I've disabled xpinstall.signatures.required but still getting not verified error. On latest macOS and Firefox 102.0.1.
@johalun it's because you dont use developer version of firefox
You can migrate to the dev version using your normal FF profile by doing firefox -p
Thanks for the clarification. I don't wanna mess anything up so I'll just wait for this to be merged.
The developer of this plugin seems to be inactive :/ maybe we need a community fork?
To all that complain: can we please cut some slack to the project maintainer(s)? Being passionate about this project does not mean that entitled comments are fine either.
There are some workarounds explained in the comments, there is a patch ready for review that can be applied with some legwork. There are even alternatives to this extensions.
This is a FOSS project I've been happily using for free out of the goodwill of the maintainer(s) and by no means I expect them to service me like I'm a paying customer.
The developer of this plugin seems to be inactive :/ maybe we need a community fork?
Too soon for calling the repo dead. My guess is that they're prolly on vacation. It is the middle of summer after all.
either way it would be good to have co-maintainers for a project as big and good as this ;)
To all that complain: ...
I don't see any complaints, rather suggestions on how to avoid disruptions in development. There's nothing wrong with having multiple maintainers for a project that many depends on in their daily life/work. It would also take stress and burden off the main developer.
What is missing to get this PR merged?
What is missing to get this PR merged?
The maintainer?
The maintainer posted a blog post 6 days ago, so he's definitely alive.
Update: I've messaged him directly on Twitter.
@fosskers Any luck there? Wondering if a fork is prudent. Thank you for your work! And thanks @jessarcher!
He hasn't responded. I happen to live in the same city as him and he has publicly posted his workplace. Should I just go in person and leave him a message? Would that be creepy? Please vote, I have no natural sense for these things, I just want the damn extension fixed hahah.
😆, No, definitely do not go and do that. Perhaps we can request that someone else be temporarily added as a maintainer, and if that fails, someone can fork this project. I love this add-on!
Roger. I'll sit tight. But how to request that someone else be added if he's not responding anywhere?
Any ff add-on dev here who wouldn't mind forking and publishing a fix? The developer clearly isn't committed to this project at the moment (which is fine, things change people move on etc). But, would be nice if the project survived / didn't rot too much. If the maintainer resurfaces and is committed they can always backport updates from the fork.
We might be at the stage where a fork is necessary.
Hey @fosskers is there any news about What's happened with the PR merge status or about the fork that you mentioned? It's pretty strange that the solution is there but nobody merged it
At this point someone will have to volunteer to manage a fork of the project. I just started a new job and have many other FOSS projects, so it would be irresponsible of me to personally volunteer.
I suspect part of the problem is that no single person wants to put their hand up to take on the project. As demonstrated by the comments on this PR, we clearly have an engaged community using this fantastic extension, and many hands make light work, as the expression goes.
Are there people here that would be willing to help co-manage a fork?
Edit: Add a thumbs up here if you'd like to join the wonderful team of volunteers. 🙌
@nattyg93 I've been a developer for a lot of time but I've never participated in an open-source project, I think that It's a good opportunity for me. I'm in
@LordPax I'll take that thumbs up react to mean you're volunteering?
I'm in much the same position as @codeDude64 - I've never participated in an open-source project (other than contributing an occasional PR). It would be fantastic to have a volunteer with some experience working on a team to manage an open-source project. Any takers?
Professional front-end developer for over 5 years now, love open source, I could help with some code review or something if you need me? Sign me up.