User CSS mode (like opera)

Discussion of features in Mozilla Firefox
dunda
Posts: 126
Joined: January 27th, 2003, 7:22 am

User CSS mode (like opera)

Post by dunda »

The last thing I am really missing as an ex opera user is the user css mode where you could change the page to white background black text and standard coloured links etc.. It really helps on badly designed pages.

I found something in prefsbar where you can turn colors/fonts off but its not really the same, is there any way of achieving this?

thanks.
User avatar
Thumper
Posts: 8037
Joined: November 4th, 2002, 5:42 pm
Location: Linlithgow, Scotland
Contact:

Post by Thumper »

User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

No, that's for alternative style sheets provided by the website. This topic has been discussed before, though.
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
seb
Posts: 1578
Joined: November 4th, 2002, 11:26 pm
Location: Paris, France
Contact:

Post by seb »

Add this bookmarklet to your bookmarks toolbar, and just click on it when you want to modify the CSS of a website.

(Kudos to the author of the bookmarklet, I forgot who he is)

Code: Select all

javascript:(function(){function update(){if(!x || x.closed){ ta.style.backgroundColor="#ddd";return;}try { x.bookmarkletStyleSheet; } catch (er){ta.style.backgroundColor="#fdc"; setTimeout(update, 150);dead=true;return;}if(dead){ dead=false;ta.style.backgroundColor="";oldCSS=null;}if(!x.bookmarkletStyleSheet){var newSS; newSS=x.document.createElement("link"); newSS.rel="stylesheet"; newSS.type="text/css"; x.document.documentElement.childNodes[0].appendChild(newSS); x.bookmarkletStyleSheet=newSS; oldCSS=null; x.bookmarkletStyleWindow=window;} if(oldCSS!=ta.value) { oldCSS=ta.value;x.bookmarkletStyleSheet.href="data:text/css,"+ta.value; } setTimeout(update, 150);} if(window.bookmarkletStyleWindow && !bookmarkletStyleWindow.closed) { bookmarkletStyleWindow.focus(); } else { var y;y=window.open('','','resizable,width=450,height=300'); y.document.write('<title>New CSS Style Sheet</title><body style="margin: 0px;"><form name="f" style="margin: 0px;"><textarea name="ta" wrap="hard" style="margin: 0px; border: 0px; width:100%; height:100%;">/* Type CSS rules here and they will automatically be\napplied to pages from '+location.host+'\nas long as you keep this window open. */\n\n\n </textarea><script>'+update+'dead=false; oldCSS=null; x=opener; ta=document.f.ta; if (x.bookmarkletStyleSheet)ta.value=x.bookmarkletStyleSheet.href.slice(14); ta.focus(); update();<'+'/script>');y.document.close();}})();
Last edited by seb on March 23rd, 2003, 2:20 pm, edited 2 times in total.
Jesse
Posts: 398
Joined: November 4th, 2002, 7:00 pm
Location: Mountain View, CA
Contact:

Post by Jesse »

The bookmarklet is called <a href="http://www.squarefree.com/bookmarklets/webdevel.html">test styles</a>, and I am the author. (Btw, has anyone else noticed that this forum doesn't let you post links with # in them?)
sag
Posts: 387
Joined: November 19th, 2002, 8:56 pm

Post by sag »

goodben
Posts: 61
Joined: January 15th, 2003, 3:28 pm

Re: User CSS mode (like opera)

Post by goodben »

What is the CSS code to make a page look like this?

dunda wrote:The last thing I am really missing as an ex opera user is the user css mode where you could change the page to white background black text and standard coloured links etc.. It really helps on badly designed pages.
seb
Posts: 1578
Joined: November 4th, 2002, 11:26 pm
Location: Paris, France
Contact:

Post by seb »

Code: Select all

body {
 background-color:white !important;
}

* {
  color: black !important;
}

:link {
  color: blue !important;
}
dunda
Posts: 126
Joined: January 27th, 2003, 7:22 am

Post by dunda »

I think it also removes background page images.

I couldnt get that bookmarklet to work but if it works for you I am no doubt doing something wrong and will try again.

Its still not up to opera though because when you click a link the colours will revert back.

I might end up using proximitron to do it but its not ideal..
Vigil
Posts: 71
Joined: January 28th, 2003, 2:40 am
Contact:

Post by Vigil »

The ideal solution is to expand the alternate-stylesheet switcher extension to allow entries for user stylesheets also. These entries could be added and removed via the "Settings" dialog of the extension.
User avatar
Allenz
Posts: 788
Joined: December 12th, 2002, 5:44 am
Location: Atlanta, GA

Post by Allenz »

I'm just curious. Is this page extremely wide for everyone or just me? I have to scroll forever to get to the right side of the page.
User avatar
Chris Cook
Posts: 898
Joined: December 14th, 2002, 9:57 am
Location: Québec, Canada
Contact:

Post by Chris Cook »

Allenz wrote:I'm just curious. Is this page extremely wide for everyone or just me? I have to scroll forever to get to the right side of the page.

It is because of the code that Netsabes posted. Perhaps he should change it to a link to the code instead.
seb
Posts: 1578
Joined: November 4th, 2002, 11:26 pm
Location: Paris, France
Contact:

Post by seb »

Sorry. I added a few spaces here and there. It shoud display normally now.
Jesse
Posts: 398
Joined: November 4th, 2002, 7:00 pm
Location: Mountain View, CA
Contact:

Post by Jesse »

chris cook: It's also because this forum uses a table-heavy layout. Forums that use CSS layouts do not suffer from this problem. In a CSS layout, the long line would create a scrollbar, but other lines (and lines in other posts) would not be affected, so you would only need to use the horizontal scrollbar to read the post with the long line in it.

netsabes: The page is still a little wide for me (maximized Phoenix @ 800x600).
seb
Posts: 1578
Joined: November 4th, 2002, 11:26 pm
Location: Paris, France
Contact:

Post by seb »

Jesse wrote:netsabes: The page is still a little wide for me (maximized Phoenix @ 800x600).
And now?
(sorry, I'm using 1280*1024, I assumed it'd be fine in lower resolutions too)
Post Reply