A way to block Google's annoying new sidebar (leftnav)

Forums » General Opera topics » Customizing Opera

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

7. May 2010, 14:59:00

str4ngS

Posts: 34

A way to block Google's annoying new sidebar (leftnav)

Dear Community,

Google has presented a new navigation sidebar which I find useless and annoying. I'm also used to seeing search results at the leftmost part of the screen, so I wrote a few CSS lines to block it, here it is.

Step-by-step howto

  1. Navigate to \Program Files\Opera\styles\
  2. Open a text editor (Notepad is perfect)
  3. Paste the following lines into the newly opened editor
    #leftnav { display: none !important }
    #center_col { margin-left: 1px !important; }
    
  4. Save it as google.css (make sure you save it to \Program Files\Opera\styles\)
  5. Open Google by the link you always use it (default: www.google.com)
  6. Right-click the page, select Edit Site Preferences...
  7. Select the tab Display then look for My style sheet (bottom)
  8. Paste \Program Files\Opera\styles\google.css
  9. Press Refresh*

* Sometimes Opera won't reload stylesheets immediately. If you experience this, you must restart the browser. This was tested with Opera 9.64.

A little technical background


New sidebar is called leftnav represented in source code as follows:

This is a DIV element that we want to hide. Since Opera can override the stylesheet of the visited site, we should only tell it not to show this element. There are two common ways to refer to DIVs in CSS, #divname and DIV[id="divname"], I used the first method. Hiding is done by the { display: none !important } expression.

After we hid leftnav we experience that the sidebar gets empty, but doesn't disappear. This is because the sidebar itself is not a unique element, just a little free space given to leftnav. The center column is center_col and it is also a DIV, its style in the source is the following:

Center column is indented 168 pixels right with margins so the important part is margin-left:168px; that can be overridden with { margin-left: 1px !important; }.

Cheers,
str4ngS

7. May 2010, 16:01:07

Moderator

Leevi

Posts: 859

That sidebar is useless and redundant, so it needs to go away.

Quicker and easier way to get rid of it

Tools > Preferences > Search Tab > add &hl=all to Google search address: so it’s like this
http://www.google.com/search?q=%s&hl=all&sourceid=opera&num=%i&ie=utf-8&oe=utf-8

7. May 2010, 19:00:13

artmil

d(^_^)b

Posts: 368

I don't understand why people don't like the sidebar... On widescreen monitors the space on the side was wasted. They finally did something with that. I personally like the sidebar p
Krita.org
Opera: 12.1x

7. May 2010, 20:46:38

paulb39

Posts: 12

Originally posted by Leevi:

That sidebar is useless and redundant, so it needs to go away.

Quicker and easier way to get rid of it

Tools > Preferences > Search Tab > add &hl=all to Google search address: so it’s like this
http://www.google.com/search?q=%s&hl=all&sourceid=opera&num=%i&ie=utf-8&oe=utf-8



Thank you!

8. May 2010, 08:23:53

EmilianoH

Posts: 11

Originally posted by Leevi:

That sidebar is useless and redundant, so it needs to go away.

Quicker and easier way to get rid of it

Tools > Preferences > Search Tab > add &hl=all to Google search address: so it’s like this
http://www.google.com/search?q=%s&hl=all&sourceid=opera&num=%i&ie=utf-8&oe=utf-8



great !! thanks bigsmile

10. May 2010, 17:41:33

str4ngS

Posts: 34

Well, hl=all is good enough, if you don't want to use a preferred search language with search tips like "show pages in this language only". In this case if you specify hl=all, you lose the tips, even if you have modified language settings and stored them in cookie.

This is what I'm talking about (Hungarian):


It says:Tip: Show only Hungarian results. Search language can be set at Settings page.
[/B]

I tried to change main language to another one (Romanian), but this tip did not appear, so I don't know it might be a special feature for Hungarians bigsmile

10. May 2010, 21:43:12

Moderator

Leevi

Posts: 859

Originally posted by str4ngS:

Well, hl=all is good enough, if you don't want to use a preferred search language with search tips like "show pages in this language only". In this case if you specify hl=all, you lose the tips, even if you have modified language settings and stored them in cookie.

Ah, so it seems. Didn't notice that before, I guess I have been very specific on my searches when I been searching in my own language.

Easy and fast fixes aren't always the best solutions available! Never said that adding hl=all on the search string would permanently make that sidebar go away, it doesn't do anything if you go google.com and search from there, but your CSS solution does that. Which is good smile

hl=all works for me, don't care if my google is in english or if I have to write few more search words when I need to find something in my language. Never really liked the language specific search results anyway.

19. May 2010, 23:22:36

paulb39

Posts: 12

Originally posted by Leevi:

That sidebar is useless and redundant, so it needs to go away.

Quicker and easier way to get rid of it

Tools > Preferences > Search Tab > add &hl=all to Google search address: so it’s like this
http://www.google.com/search?q=%s&hl=all&sourceid=opera&num=%i&ie=utf-8&oe=utf-8



Been using this fix since you reported it, just noticed this though.

With the fix, the top of google's search results shows this



normal google shows this

20. May 2010, 04:05:17

Nosophorus

Posts: 108

Hi!

It seems that the guys and gals at Google have removed the option to access Google main page through the URL you aforementioned:

http://files.myopera.com/Nosophorus/files/new_google_.png

It seems the former URL given by the fellow some posts above:

http://www.google.com/search?q=%s&hl=all&sourceid=opera&num=%i&ie=utf-8&oe=utf-8

When used is changed to this one:

http://www.google.com/search?client=opera&rls=pt-BR&q=opera&hl=all&sourceid=opera&num=%i&ie=utf-8&oe=utf-8

In this case, I searched for "opera". The "pt-BR" is my language, Brazilian Portuguese. The print screen I took was given by that URL.

I'm still using Opera 10.10, since no new releases have been made to Linux users.

See you!

Nosophorus

20. May 2010, 17:02:08

Moderator

Leevi

Posts: 859

Yeah, just noticed it myself too, so I switched to str4ngS' css solution.
Also noticed that search language selection was moved to the sidebar, so the bar would now seem to have reason ...unfortunately the old way was better.

21. May 2010, 15:13:51

dapxin

Posts: 159

thanks for the css and the tutorial too smile


but how did you get the applicable css to display highlighted like that ?

23. May 2010, 17:47:15

oion

Posts: 59

Whew, thanks for this. I'm using 9.64 and the CSS solution in OP worked magically. Why Google felt the need to add screen junk after years of minimalism (that's one reason WHY they got popular, right?) is beyond me...

Another option for minimalist folks is to use the mobile search form instead: http://www.google.com/m

I kinda wonder how many hits Google has been getting for removal of their own left "everything" bar. lol

Forums » General Opera topics » Customizing Opera