5 ms·
Hello everybody! I created a browser extension called TabFloater, which can replicate the picture-in-picture functionality with any website. It moves a chosen t
by ba32107 6y ago
Hello everybody! I created a browser extension called TabFloater, which can replicate the picture-in-picture functionality with any website. It moves a chosen tab into a smaller window, which is going to remain always on top, so you can interact with both websites at the same time.
This is my very first post on HN. I have been working on this pet project for a bit over a year now. The motivation for it was simple: because I use my browser in a single, fully maximized window, many times I found myself switching back and forth between two tabs, for example to copy something from one website and use it on another. I know there are many extensions that can rearrange tabs for you, but I wanted something a little bit different. I really liked how picture-in-picture works for videos - I wanted to do the same!
Easy enough, I thought. I just need to create a new browser window, move the given tab into it, then... I just need to make it always on top. Right? Well, turns out, the browser API doesn't allow you to do that. So after a lot of trial end error, I came up with a way to achieve it: I implemented a small app in C++ that can manipulate the browser window and set the always-on-top property. Then "all I needed" was to hook it up with the browser extension and voila.
I also implemented a feature I call "Smart positioning": if you enable it, the extension will analyze the DOM structure of a given site and tries to identify the largest empty area and puts the floating tab there. This way, it doesn't cover up any text, pictures or videos. It more or less works :)
Sounds pretty simple, but I spent a LOT of time trying out different things. I use Linux, so naturally I implemented it for that platform first, but I knew it would never be useful for other people if there wasn't a Windows version as well - so I did that too. I worked on this project on evenings and weekends, and I learned a lot. This was my first proper pet project and I'm really glad I was able to see it through!
The extension is available for Chrome and Firefox, and you can use it on Windows and most Linux distros. The native application doesn't have an OS/X version - sorry :) I don't own a Mac and I don't know anything about the Apple ecosystem. I'm looking for help in that department, if you're interested! :)
Reminder: in addition to the browser extension, you must also install the native application (called Companion).
Site: https://www.tabfloater.io/ https://www.tabfloater.io/
GitHub: https://github.com/tabfloater/tabfloater https://github.com/tabfloater/tabfloater
Chrome Web Store: https://chrome.google.com/webstore/detail/iojgbjjdoanmhcmmihbapiejfbbadhjd https://chrome.google.com/webstore/detail/iojgbjjdoanmhcmmih...
Firefox Addon: https://addons.mozilla.org/en-US/firefox/addon/tabfloater/ https://addons.mozilla.org/en-US/firefox/addon/tabfloater/
Thanks!
- scottfr 6y agoInterestingly Chrome use to support always on top windows in extensions. They eventually got removed There is a very interesting comment from one of the developers on the removal bug (https://bugs.chromium.org/p/chromium/issues/detail?id=467808 https://bugs.chromium.org/p/chromium/issues/detail?id=467808): > While closing this issue as "Fixed", I feel I need to offer a couple of words of personal explanation to the users of Trello who were directed here by the developer of the app, as well as others who can be interested. > I'm the original developer of Panels in Chrome, and I'm the engineer who's lead a team to maintain them. I also finally removed them. Panels were a part of my life in form of time, thoughts, inspiration and passion. Our initial plans were to enable panels to all apps which wanted to use them, and we saw how those can be useful of course. It is with sadness but also with appreciation of the experience that I had to remove the feature from Chrome M54. > The time passes and things change, we all learn. In case of Panels, we "proved" by practice that it takes a team of a few engineers full time to be able to catch up with teams of OS developers in Windows, OSX, Linux and even our own ChromeOS. The window management and graphics/input subsystems are constantly evolving and it is more or less prohibitively expensive for a small team to try to build and keep a high quality but non-standard window management mode. OSes have too many mechanisms that are linked to a specific windows behaviors (focus, window switching, active windows treatment, titlebars, where input goes, shortcuts, animations, multiple desktops, other OS gadgets etc), and usually OSes do not provide 'hooks' or APIs to integrate with those, which makes it necessary to 'reverse-engineer' and hack around. While it can be done, it quickly leads to 'card house' design that falls down even easier with the next major OS update... So the costs of development and testing rise. > There was another factor that kept us from enabling panels for all apps. The specific UI Panels provide does not scale well if/when multiple apps are using it. It is very easy to get in trouble with multiple always-on-top windows popping up from multiple apps. Several independent apps using panels at the same time actually makes the interface annoying and hard to control. We had several apps using Panels at the same time and it was hard to manage windows because they were all intermixed. There were several design ideas on how to build some 'panel managers' and corresponding APIs but they increased the complexity significantly, especially considering those would be in addition to APIs OS provides for other windows. So we never were able to enable it for every app. > Now, if the major OSes would adopt the concept and built into their window managers, it'd be much much easier to support it in Chrome. But it's not the case, except for ChromeOS where panels stay. > So at the end, this was a great experiment. We are now way past the point where additional discussion can move the needle much. Google Hangouts app had millions of users and some of them loved Panels. Apparently Plus for Trello has passionate followers. The YouTube viewers is a neat idea. But we all need to move forward, the platforms change much faster and generally to the better :) Hope developers of your favorite apps will figure out even better ways to implement great UI their users demand!