-
Notifications
You must be signed in to change notification settings - Fork 22
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tab title in location bar (without replacing url) #54
Comments
Hmm, I am interested in having the label right beside the Panel UI button that I have moved to top left (with Custom CSS for Fx) and much free space right of it. I used to have the tab label there in the past, but it stooped working after some Firefox code changes. Since there is no |
You will have to run some tests, but in general it is possible to move that title item anywhere. Replace with
and add this to your userChrome.css/my_userChrome.css: #tab_label_in_urlbar {
position: absolute !important;
display: flex !important;
padding-inline-start: 95px !important;
margin-bottom: -18px !important;
} I also enabled |
Mighty cool. I somewhat know CSS and JS a bit myself, so I can say: impressive 🥇 ! For my style in WaterFox macOS, I'm using |
Ha, using Interestingly, applying this to the first version of the script does work here without any CSS. But, there is an annoying and strange new issue with both versions: The window control buttons are not visible anymore, but do still work (the mouse over shows it, and I also tested with minimize and maximize), only the box behind them is moved to the bottom partly hiding some buttons, cf. image: Left is the Firefox window, right is an explorer window showing, how the controls should look. Apparently, I am still on Windows 7. I hope this is not important, but:
I use |
I made a slight modification in the code to make the title line up better with the URL: It was this: #tab_label_in_urlbar { I changed it to this: #tab_label_in_urlbar { |
@Speravir On Win7 (AeroGlass) caption buttons are hard coded and adding another item to titlebar vertical box causes the caption buttons to shift. Therefor the themes area for them shifts too. But Win7 buttons stay where the belong and the result can be seen on your screenshot. We have to solve this using position absolute. In my tests (currently on Win 10) caption buttons do not shift. Try this code: // 'Tab label in titlebar' script for Firefox by Aris
(function() {
try {
var titlebarlabelbox = document.createXULElement("hbox");
titlebarlabelbox.setAttribute("id","tab_label_in_titlebar_box");
var titlebarlabel = document.createXULElement("label");
titlebarlabel.setAttribute("id","tab_label_in_titlebar");
titlebarlabelbox.appendChild(titlebarlabel);
document.getElementById("titlebar").insertBefore(titlebarlabelbox, document.getElementById("titlebar").firstChild);
updateLabel();
// catch cases where tab title can change
document.addEventListener("TabAttrModified", updateLabel, false);
document.addEventListener('TabSelect', updateLabel, false);
document.addEventListener('TabOpen', updateLabel, false);
document.addEventListener('TabClose', updateLabel, false);
document.addEventListener('load', updateLabel, false);
document.addEventListener("DOMContentLoaded", updateLabel, false);
function updateLabel() {
titlebarlabel.setAttribute("value",gBrowser.selectedBrowser.contentTitle);
}
var {Services} = Components.utils.import("resource://gre/modules/Services.jsm", {});
var sss = Components.classes["@mozilla.org/content/style-sheet-service;1"].getService(Components.interfaces.nsIStyleSheetService);
var uri = Services.io.newURI("data:text/css;charset=utf-8," + encodeURIComponent('\
\
#tab_label_in_titlebar_box { \
position: absolute !important; \
display: flex !important; \
padding-inline-start: 95px !important; \
}\
\
'), null, null);
sss.loadAndRegisterSheet(uri, sss.AGENT_SHEET);
} catch(e) {}
}()); (works with CustomCSSforFx options @glennpc |
@Aris-t2 Here is what I am seeing. |
I see this on your screenshot. |
@Aris-t2 |
And now that you speak of it I suddenly remember that I once had asked you already something in regards to these buttons (blushing 😊). Should be somewhere in the closed threads of CustomCSSforFx.
Works great! Thank you. I assume there are too much preconditions for styling to add it as regular script, right? (At least I saved the url and will certainly notice updates on the titlebar_in_urlbar script).
And with appbutton_in_titlebar styles, as well, which is why you supposedly have added the start-padding. |
👍 👍 I am blushing even more, especially for your idea with var settings. |
There is this tab_title_url.uc.js script (by sdavidg) that displays a tooltip on the address bar. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I received a few requests about adding tab title to location bar in the past.
Instead of replacing the url, the script adds the tab title into 'page action buttons' box.
https://github.com/Aris-t2/CustomJSforFx/blob/master/scripts/tab_label_in_urlbar.uc.js
2021-12-21 update
The text was updated successfully, but these errors were encountered: