Skip to content
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

Page Title in Address Bar #428

Closed
LeeBinder opened this issue Nov 25, 2021 · 11 comments
Closed

Page Title in Address Bar #428

LeeBinder opened this issue Nov 25, 2021 · 11 comments

Comments

@LeeBinder
Copy link

Hi Aris-t2. I've read your issue blurb so I don't expect you to do anything to begin with. At this point I'd just like to hear your expert opinion if you consider it possible at all to revive legacy Firefox' tweak to show a page's title in Firefox' Address Bar rather than the URL?

The two old XUL extensions that did this in Firefox legacy are attached just for reference (simply remove the .zip from each file name)
add_page_title_to_url_bar-1.0.20-fx.xpi.zip
page_title_in_url_bar-6.2-fx.xpi.zip

Also there used to be a similar userChrome.css + url-title-hover.xml solution, but that stopped working, too, with some recent FFx update.

What do you think? Or have you maybe even looked into this at some point already?

@Aris-t2
Copy link
Owner

Aris-t2 commented Dec 6, 2021

It might be possible with JavaScript, but not with CSS.

@LeeBinder
Copy link
Author

Hi @Aris-t2, great to see you here 👍 !

I'd say I testify to that since all my attempts with CSS led to - nothing. And I'm not a pro in JS as you are. But I know a little bit of JS. If you have code snippets for me to try out, I'd be all in for that :)

@Aris-t2
Copy link
Owner

Aris-t2 commented Dec 17, 2021

I came up with something, that goes into the direction you requested.
Instead of replacing the url, the script adds a title label.

image

https://github.com/Aris-t2/CustomJSforFx/blob/master/scripts/tab_label_in_urlbar.uc.js

Continue here: https://github.com/Aris-t2/CustomJSforFx/issues

@Aris-t2 Aris-t2 closed this as completed Dec 17, 2021
@LeeBinder
Copy link
Author

LeeBinder commented Dec 17, 2021

Great, thank you @Aris-t2, will try 👍

For Waterfox Current (based on FF 91.4.0), is there one of the methods (M2 or M3) you would recommend over the other?

@Aris-t2
Copy link
Owner

Aris-t2 commented Dec 17, 2021

I can only recommend M2. M3 might work, but I haven't tested it for a while.

@LeeBinder
Copy link
Author

@Aris-t2 I'm sorry, but I can't manage to get this working at all, neither in Windows (Firefox) nor macOS (Firefox, Waterfox), all latest release-channel versions of both browsers. I tried in new empty profiles to make sure there is no interference, and after trying M2 also tried M3 (with its corresponding config.js and config-prefs.js) with all steps from your ReadMe incl. deleting startup cache etc.- same thing.

Have you tested this only in dev/ nightly Ffox? Or are you maybe also using specific CSS which is required for this to work?

I this also works for you in release Ffox: could you maybe just zip up (with max. compression) and attach your entire chrome folder while you have this working? That might be the easiest/ simplest, esp. for you. I'm sure I can narrow this down from there.

@Aris-t2
Copy link
Owner

Aris-t2 commented Dec 19, 2021

I run tests on release and Nightly using M2.

image

chrome.zip

@LeeBinder
Copy link
Author

yes @Aris-t2, thanks to your chrome folder I got this working now 👍 Turns out it was a quite blunt mistake: I downloaded https://github.com/Aris-t2/CustomJSforFx/blob/master/scripts/tab_label_in_urlbar.uc.js directly via right click, save as, having forgotten that on GithUb it's necessary to open such link first because it will display the file as a webpage embedded into GithUb, click onto "Raw", THEN download .. :) So for completion, here's the link to the directly downloadable raw script.

I even managed to maintain xiaoxiaoflood's config.js mods to also have his custom legacy Extensions still working, by merging his config.js into yours 😎:

click to expand
// This is a mixed config.js, Aris-t2 and xiaoxiaoflood merged by Lee Binder
lockPref('xpinstall.signatures.required', false);
const Cu = Components.utils;

Object = Cu.getGlobalForObject(Cu).Object;
const { freeze } = Object;
Object.freeze = obj => {
  if (Components.stack.caller.filename != 'resource://gre/modules/AppConstants.jsm')
    return freeze(obj);

  obj.MOZ_REQUIRE_SIGNING = false;
  Object.freeze = freeze;
  return freeze(obj);
}

try {
  Cu.import("resource://gre/modules/Services.jsm");
  Cu.import("resource://gre/modules/osfile.jsm");

  if (!Services.appinfo.inSafeMode) {
	Services.scriptloader.loadSubScript(
	  OS.Path.toFileURI(OS.Path.join(OS.Constants.Path.profileDir,
		"./chrome/userChrome/userChromeJS.js")), this, "UTF-8");	
  };

} catch(e) {};

try {
  const { Services } = Cu.import('resource://gre/modules/Services.jsm');
  Cu.import(Services.io.newFileURI(Services.dirsvc.get('ProfD', Ci.nsIFile)).spec + 'chrome/utils/boot.jsm');
} catch (ex) {};

Just one little caveat: if the page/ tab title is really long (which on quite a few pages it is), it completely covers the URL, making it impossible to edit or copy it..

Do you think it would be possible by any chance to insert a condition that onclick (best both, left and right), the label is hidden, or its visibility index is set to a value behind the URL?

@Aris-t2
Copy link
Owner

Aris-t2 commented Dec 20, 2021

CSS could save the day. ;-)
I did no run much tests yet, but this would simply hide the label once you hover the urlbar

#urlbar:hover #tab_label_in_urlbar {
  display: none !important;
}

Maybe I should add some "max width" by default or something similar.

@LeeBinder
Copy link
Author

Mighty fine, perfect 👌 ! Or should I say: stylish .. 😉

@Aris-t2
Copy link
Owner

Aris-t2 commented Dec 21, 2021

I did some more tweaks to the script. ;-)
Feedback: Aris-t2/CustomJSforFx#54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants