GithubHelp home page GithubHelp logo

Comments (12)

aminomancer avatar aminomancer commented on May 12, 2024 4

Alright I spent pretty much all day on this so I hope it's similar to what you had in mind

from uc.css.js.

aminomancer avatar aminomancer commented on May 12, 2024 4

Try updating, the latest version adds a right click context menu. The click & hold menus caused some bugs. I was able to get them to mostly work but they caused some complicated issues that are really hard to explain. So I just deleted them, no click & hold menus, just right click.

Making the popup only show under certain circumstances isn't such a good idea. Because what happens when it's not showing? You need to show a tooltip instead. But tooltips have entirely different machinery that tells them whether to open or not. So it's not really a good idea to just say something like if (tab is loaded) load popup; else load tooltip. The machinery in this script isn't designed to open the tooltip, it's intended to suppress the tooltip and open this popup instead.

That's obviously why I put the tooltip stuff inside the popup. Because the popup needs to completely replace the tooltip, but then you're losing valuable information. So I just replaced the tooltip with a tooltip that has more features.

One possibility is to just hide the buttons when the popup is opened on an unloaded tab. In other words, when the tab is unloaded, the popup becomes just identical to the tooltip, except it has a favicon. That's not hard to do. But I don't think this is very useful because the reload button still does something on unloaded tabs. I mean, the refresh button loads an unloaded tab. So it's not true that there's no need for the popup if the tab is unloaded or if there's no navigation history. That's just a misunderstanding.

And no, that obviously cannot be done with CSS. The popup is in the main popup set, its CSS selector doesn't know anything about the tab it was loaded on. The only way it would is if I used javascript to add attributes to the popup that correspond to attributes of the tab. But even the tab doesn't know whether it can go back or forward. That information is all contained in tab.linkedBrowser.webNavigation, a javascript object. It's not accessible at all from CSS and would need to be somehow instantiated in DOM attributes for CSS to ever be aware of it.

from uc.css.js.

aminomancer avatar aminomancer commented on May 12, 2024 2

I'm pretty sure I can finish it, it's just a real headscratcher. Like it literally hurts my brain when I work on it so it's hard to make much progress. There are so many mouse event handlers that all need to cancel and reset each other and shit. The hard part is like 75% finished. But then there's a lot of other busy work like setting up the buttons' click handlers

from uc.css.js.

aminomancer avatar aminomancer commented on May 12, 2024 1

Yeah I remember. Sorry it's just an extremely complicated request and I'm still working on it. I know it sounds simple but it gets pretty complicated. You can't really use a tooltip, there's C++ code that makes tooltips automatically close when you move your mouse enough. Even if your mouse stays on the tooltip, moving it will close the tooltip. So my understanding is you just can't keep a tooltip open artificially. So I decided to use a panel instead. But that means I needed to recreate all the code involved in opening the popup when you've hovered something long enough. And because it's not a tooltip and it has buttons inside it, the buttons need to have tooltips. And they're trying to handle so much functionality. Not just back/forward/reload but also middle-click to duplicate, and also what to do when the hovered tab is multiselected? Go back in all the selected tabs? That's what I did in the tab context menu navigation script. So it seems a bit silly not to do it here. So yeah it has just gotten very complicated. But I do think I will finish it soon

from uc.css.js.

aminomancer avatar aminomancer commented on May 12, 2024 1

Yes it's possible to add the navigation context menu/list thing. It's just very complicated because that menu is only designed to work in the active tab, and only one tab at a time. The popup menu operates on whatever tab you hovered, and potentially on multiple tabs at once. So the existing menu won't work at all, and making a new one that is compatible is a lot more complicated. So I skipped it.

I could have done something where the context menu only opens if you're hovering on the selected tab, since then the built-in menus would work. But I figured that would be kind of redundant since the toolbar buttons already do the same thing.

Idk what you mean by "the pure 3 navigation buttons version." You are saying you want to hide everything except the buttons? I wouldn't recommend editing the script at all. The only parts that are designed to be edited are in the config object at the very top of the script. You can just use CSS if you want to hide the labels and favicon.

#tab-nav-separator,
#tab-nav-tooltip-box {
    display: none !important;
}

Not sure what decreasing the 500ms delay would do. That only affects how long it takes for the popup to open or close.

from uc.css.js.

Decopi avatar Decopi commented on May 12, 2024

Bravo! You are a warrior. I really appreciate all your effort, your time and your dedication.

I am sorry that my request has become very complicated, and I apologize for taking and consuming your attention. But as I said, I do appreciate everything you are doing. Thank you!

Please @aminomancer, take all the time you need. I have been waiting for this javascript for almost two months, but no problem, I can keep waiting. Do not hurry!

I hope you can build this javascript because it will be very useful to me. But if you can't, don't worry, no problem, I will always be grateful to you for everything you dedicated to my request.

from uc.css.js.

Decopi avatar Decopi commented on May 12, 2024

It's so coooooooooooooooooooool! Amazing job @aminomancer! Kudos! Thank you from the bottom of my heart. You spent your whole day on this... priceless, you deserve zillions of u$s.

I can't run a complete set of tests now, but I was so excited that I ran a quick test, and I can tell you that you did a mega job, it's much more than I requested (you added url address, favicon etc). Later I'm going to test your tabTooltipNavButtons.uc.js in deep, and I promise you my feedback. Until then, please if you can, I would like to know:

  1. Do you think is possible to add to back and forward buttons the navigation history list (like in Firefox back and forward button on mouse-right-click)? It's not a request, it's just a question. If by chance is something easy to be done, then in the future you may think about adding this feature. But if this navigation history is not easy to be done, please forget the idea, it's not critical nor a priority, your current script is already wonderful.

  2. I don't want to mess with your script, and I know nothing about javascript, so I prefer to ask you. I want the 3 pure navigation buttons version. Which one will be the correct way:
    To decrease the 500 millisec?
    To remove the favicon?
    To remove the url address?

Please, It'll be enough if you point me the number of the line in your script. Thank you!

from uc.css.js.

Decopi avatar Decopi commented on May 12, 2024

@aminomancer, after hours of experimenting with your Tab Navigation Buttons uc.js, my impression is that it is great. Again, congrats and thank you for your great work.

So far I have not found bugs or problems. You have attended my request in an excellent way, and everything seems to be working fine, therefore feel free to close this issue whenever you want.

Yes it's possible to add the navigation context menu / list thing. It's just very complicated because that menu is only designed to work in the active tab, and only one tab at a time. The popup menu operates on whatever tab you hovered, and potentially on multiple tabs at once. So the existing menu won't work at all, and making a new one that is compatible is a lot more complicated. So I skipped it.

As you know, there are pages that automatically redirect to other pages. And when we click the back button we fall into a loop of endless redirects. I solve this with mouse-right-click on the back-button, and then from the list I choose the page where I want to go back. I understand that it is too difficult to do that within your Tab Navigation Buttons uc.js, but what about a simple button showing the navigation history? If it is easy to do, then I leave you the idea for the future. And if it's difficult to do, again, please forget this idea.

# tab-nav-separator,
# tab-nav-tooltip-box {
display: none! important;
}

Works perfectly, thank you! And I added other css customizations, everything works like a charm.

Jumping to a different subject and as a suggestion, IMHO the whole (Tab Navigation Buttons uc.js) popup should be visible only in loaded tabs, and only when # tab-nav-back or # tab-nav-forward are active (at least one of the two buttons). I don't see the need of back or forward buttons in an unloaded tab. Also, if a tab has nothing to go back or forward, then IMHO there is no need for the popup. So, by hiding the popup in these two cases (unloaded tab, and no back or forward to) the visual pollution will be reduced, the (Tab Navigation Buttons uc.js) popup will be visible only in loaded tabs, and only when there is something to go back or forward. My hope is that this can be done with css.

from uc.css.js.

Decopi avatar Decopi commented on May 12, 2024

Absolutely fantastic! The right click is amazing. Your Tab Navigation Buttons uc.js exceeded all my expectations by far, and with each new version it improves more and more. Yeah, now I can totally remove my standard navigation buttons (I don't need them anymore, and I can make a better use of that space). Your Tab Navigation Buttons uc.js is all what I need, IMHO is much more useful than standard navigation buttons.

After your explanation about the difficulty with browsing history, I was expecting nothing, and at best I was expecting something ugly. You managed to do it in a very elegant way. Again I congratulate you @aminomancer, and again I thank you for your beautiful work.

Making the popup only show under certain circumstances isn't such a good idea. Because what happens when it's not showing? You need to show a tooltip instead.

I know nothing about javascript, but from my ignorance this idea seems very useful to me. I accept your explanation that my idea is difficult to be done, or maybe it is impossible to be done. But despite the js programming involved, and only speaking from a functional point of view, it would be great if nothing appears in unloaded tabs. Using your words, in this case the conditional might be if (tab is loaded) then load popup/tooltip; else go to end (stop the script, show nothing, no popup, no tooltip, zero).

So it's not true that there's no need for the popup if the tab is unloaded or if there's no navigation history.

You're right, it may be needed, but that would be a kind of exceptional situation. In real life it is not often that an user needs to click back or forward for an unloaded tab (and if he wants to, then user can use overflow menu/history for this exceptional situation). The reload/refresh is also not frequently used in unloaded tab (after all, if user clicks on the unloaded tab, it becomes a loaded tab, no need for the reload button). And again, for all these exceptional situations, the tab context menu also can refresh tabs.

Same logic when there is nothing to go back and forward (even in a loaded tab). In that case the only useful button would be reload/refresh, but it does not justify showing the whole popup/tooltip, user can refresh by using the tab context menu. Just for tab refresh, IMHO there is no need to make Tab Navigation Buttons uc.js visible all the time.

Anyway, IMHO it is not pleasant to see the Tab Navigation Buttons uc.js popup/tooltip when it is not really necessary, it distracts me and causes visual pollution. I confess that I would be very pleased if you manage to eliminate Tab Navigation Buttons uc.js in unloaded tabs, and when there is nothing to go back and forward (at both, loaded and unloaded tabs).

IMHO, the power of Tab Navigation Buttons uc.js is in back, forward, and history. If those 3 functions are not really necessary, then I think that by removing the popup/tooltip users are going to gain in minimalism, clean vision, less distraction and less visual pollution. Again, you're right, some users may want Tab Navigation Buttons uc.js visible all the time, I respect that. I'm just saying that by hiding Tab Navigation Buttons uc.js in few cases, the gain is much major than the lost. IMHO it's more practical and functional to see Tab Navigation Buttons uc.js only when is really useful.

I hope I don't need to clarify that Tab Navigation Buttons uc.js as it is now, is already great, brilliant. And if you don't agree with my logic on removing the popup/tooltip, or if my logic can't be programmed in javascript etc., none of that will change the fact that Tab Navigation Buttons uc.js is already great in the way it is now ver 1.2.0.

from uc.css.js.

aminomancer avatar aminomancer commented on May 12, 2024

Why would it be great for nothing to appear on unloaded tabs? Unloaded tabs still have titles and URLs. You still need to show a tooltip on them. Firefox has always worked that way. The tooltip is especially important for when the tab's width is too small for the full title to fit. But even if the title is fully visible, you still can't see the URL in a tab without the tooltip unless you click it and load it. You shouldn't have to load an unloaded tab to find out what its URL is. Hence, the tooltip must show on every tab.

And I'm not sure what you're talking about. You can't "click back or forward for an unloaded tab." Unloaded tabs have no navigation history until they're loaded. They can only be loaded, e.g. by the refresh button. The reason you need to show a tooltip for unloaded tabs is so the title and URL can be visible without loading the tab. Has nothing to do with needing to click back/forward buttons.

If you have such strong opinions about how browsers should be designed then you should learn how to implement those things yourself. I'm not like a freelance programmer getting paid to fulfill your wishes. I only wrote this script because I thought the basic idea made sense. But I don't agree that aspects of the tab should be checked to determine if the popup should be shown. For one, it makes the event handlers slower. It requires more computation before the popup can be shown. Already large amounts of code are running in the process of showing the popup. I don't want there to be a lag so adding even more blocking synchronous code to that process is a bad idea that will make it slow on old hardware.

But more importantly, there just isn't any point in doing that. If I stopped the popup from showing on unloaded tabs, it would just mean it's showing the vanilla tooltip on unloaded tabs instead. And the vanilla tab is basically identical to the new popup, except the new popup also includes a favicon and navigation buttons. So what was the point? Probably the reason you are finding this to be a problem is because the very first thing you did with the script was to hide the title and URL from the new popup, so that it no longer serves as a complete replacement for the vanilla tooltip.

Anyway I really don't have time to argue further about this. Everyone has their own opinions. That's why firefox is so great, it lets you customize the browser to suit your own purposes. That's what I do, and this repo is just a place where I upload my customizations, so it's not a democracy. But you're always free to do your own thing. There are resources in the readme for learning how to do everything I have done on this repo. All of this stuff is incredibly simple by real world standards. I'm a novice in terms of javascript and particularly programming with javascript for firefox. I only began learning this stuff about a year ago. Anyone can easily learn all the same things and I posted the exact resources I used to learn it in here.

from uc.css.js.

Decopi avatar Decopi commented on May 12, 2024

Why would it be great for nothing to appear on unloaded tabs? Unloaded tabs still have titles and URLs. You still need to show a tooltip on them. Firefox has always worked that way. The tooltip is especially important for when the tab's width is too small for the full title to fit. But even if the title is fully visible, you still can't see the URL in a tab without the tooltip unless you click it and load it. You shouldn't have to load an unloaded tab to find out what its URL is. Hence, the tooltip must show on every tab.

I understand you, but I only use the back, forward and history functions. I hide with css all the rest. That's the reason I don't need popup/tooltip for unloaded tabs. I don't expect you to agree with me, I'm just sharing with you my logic under my point of view. The first js you kindly made for me was a 3 navigation button for tab menu context. So, for me a Tab Navigation Buttons uc.js showing the 3 buttons and history... is more than perfect, I don't need and never requested the rest.

And I'm not sure what you're talking about. You can't "click back or forward for an unloaded tab." Unloaded tabs have no navigation history until they're loaded. They can only be loaded, e.g. by the refresh button. The reason you need to show a tooltip for unloaded tabs is so the title and URL can be visible without loading the tab. Has nothing to do with needing to click back/forward buttons.

For 99% of the cases, an unloaded tab first must exists as a loaded tab, so loaded and unloaded tabs always are in navigation history. And users can access that info through overflow menu/history.
Tab Navigation Buttons uc.js showing navigation history for loaded tabs, I love it!, because is a must. But there is no need for that in unloaded tabs, because only 1% of the cases are going to go back/forward in an unloaded tab (and that 1% can be done through overflow menu/history).

If you have such strong opinions about how browsers should be designed then you should learn how to implement those things yourself.

My opinion never was about browsers, was only about Tab Navigation Buttons uc.js, and only related to unloaded tabs and disabled back/forward, that's all. And even that never was a "strong opinion", was just a personal request based in good arguments.

Once again @aminomancer, thank you for your great Tab Navigation Buttons uc.js, excellent job. And thank you for all the time you spent on it. Feel free to close this issue.

from uc.css.js.

aminomancer avatar aminomancer commented on May 12, 2024

For 99% of the cases, an unloaded tab first must exists as a loaded tab, so loaded and unloaded tabs always are in navigation history. And users can access that info through overflow menu/history.
Tab Navigation Buttons uc.js showing navigation history for loaded tabs, I love it!, because is a must. But there is no need for that in unloaded tabs, because only 1% of the cases are going to go back/forward in an unloaded tab (and that 1% can be done through overflow menu/history).

No that's not true. Tabs start unloaded, then they load. And they never load if they were restored from a previous session. Most users who use session store wind up with quite a lot of unloaded tabs open at any given time. I have hundreds of them. The vast majority of my tabs are unloaded. Also, you can't unload tabs in vanilla firefox. You would need an extension or something. So I think you might be mistaken on what "unloaded" means. Unloaded means a pending attribute. I have no idea what you mean by "overflow menu/history."

because only 1% of the cases are going to go back/forward in an unloaded tab (and that 1% can be done through overflow menu/history).

No, more like 0%. Unloaded tabs CAN'T go back/forward. It's impossible for them to go back or forward. They have no navigation history because they're unloaded. Their navigation history is only exposed once they are loaded. Like I said before, the reason for showing the popup on unloaded tabs has nothing to do with back/forward buttons. It's shown because 1) the title and URL need to be shown on hover the same way the tooltip does in vanilla firefox, and 2) the reload button loads the unloaded tab.

Like I said before, your problem stems from the fact that you immediately decided to hide the title and URL. This was your mistake. If you didn't second-guess my script and just used it the way it was meant to be used, you wouldn't be so confused right now. Obviously you're going to think it's useless on unloaded tabs, because you're hiding the god damn title and URL, so it's not functioning as a tooltip. The whole point of the title & URL is to replace the tooltip. By hiding the title & URL you're making the popup useless on unloaded tabs. Does that make sense? It is useless because you modified it to be useless

from uc.css.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.