userchrome script for customized text in url address bar
Hello! I would like to edit the default text in the new tab url bar to say something else. The text says "Search with Google or enter address" i want to say something like "what are you looking for?" (ill think of something more clever). In addition i would also like to have the text be in a different color permanently, i have managed to change the color for new tabs but when i search for something the color reverts back to normal. Any help would be much appreciated :) !
All Replies (7)
You can look at this CSS file to find some of the rules that are applied.
- resource://gre-resources/forms.css
These are possible selectors for that text.
#urlbar textarea > .anonymous-div + div #urlbar textarea::placeholder
See also:
Izmjenjeno
hi im really sorry to be a bother but neither of these are working for me. or maybe im just phrasing it wrong? could you possibly send me a sample code? also this goes in to userchrome.css right? not usercontent? sorry i am very much new to this and i am only googling my way through.
Some resources for you :
Google into github.com
i have been to those sites already. however i cannot seem to find the browser toolbox Mr. cor-el mentioned, i think it will be a great help if I can access it. I have the general idea on how to write my code, but I'd appreciate it if somebody posted an example of the code. I've tried both selectors now and neither works, and since I can't access the browser toolbox I am guessing at this point. I thank you both for your effort, can anyone else please help?
@CuriosNewbie, unfortunately this is a help for default FF problems they can't always on here do your programming for you. That is something you must find from css sites or ask those sites on such programming.
Izmjenjeno
Sorry about the confusion. I forgot to place the code in pre tags and the leading '#' got interpreted as a numbered list instead of #urlbar selector.
This works for me:
#urlbar *|input::placeholder { color: red !important; }
The Browser Toolbox is one of the developer tools. You need to enable a couple optional settings before it appears on the menu. See: https://developer.mozilla.org/docs/Tools/Browser_Toolbox
CSS rules cannot replace the "placeholder" text. However, CSS rules can generate new text elements. I can't figure out how to do that cleanly for the URL bar; the positioning and trying not to interfere with text you want to read is quite fidgety. But as a starting point:
/* Hide the normal placeholder text */ #urlbar *|input.urlbar-input::placeholder { opacity: 0 !important; } /* Overlay text on the URL bar with exceptions for when there's a valid address, it's hovered, focused, or partially filled */ #urlbar[pageproxystate="invalid"]:not(:hover):not([focused]):not([usertyping="true"])::after { /* Text of the overlay */ content: "Click me, Click me!"; /* Text styling */ opacity: 0.6; /* Text positioning -- adjust left to account for toolbar buttons */ position: absolute; left: 125px; padding-top: 2px; }