SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-08-02 03:31:38

chillicampari
Pinball Wizard
Registered: 2009-10-09
Posts: 1,875

A Midori browser tips thread

Many of us are using Midori and once in a while in different threads one of us will mention that it would be cool if we had a Midori tips thread so wheeee, here we go! big_smile I know you gals and guys have some so please add them on! If you're not using Midori yet it's a pretty fun little browser. It's still sort of rough around the edges but pretty fast and sort of cute. The current version is 2.6 as of this post. A couple of forum members are maintaining packages for it which is really cool!

Hadret has a Debian PPA at:

http://hadret.rootnode.net/

Stemp has an Ubuntu PPA at:

https://launchpad.net/~midori/+archive/ppa

But I haven't tested it with #9.04 and you might need a library upgrade- so I really don't know! smile

But to get this going I'll start with today's tip if you're already using Midori and want a little more control over the Adblocking by using custom filters, inspired by a rather obnoxious new Youtube feature called "Leanback" that sets autoplay to "on" and has a running strip of thumbnails at the bottom.

If you're using the Adblock extension in Midori, you already know that it's a bit on the basic side so far, you can add online filter lists though the configuration dialog which generally work well and filter out most things and you can right click to block specific images, though that part doesn't always work reliably, so we're going to work around that, and add something new with blocking other elements besides images while we're in there.

What we're gonna do is make our own list to use alongside our subscriptions, let Midori know where it is and (optionally) set up a quick shortcut for adding to our custom block list from the terminal or make a custom launcher in the Openbox menu to fire up your editor in the right place if you wish.

First, let's set up a directory for our filter list(s). We can use multiple lists if we want and select and deselect them through Midori itself, but right now just doing one simple list to start with.

You'll want to create a new directory (I called it "filters") in .local/share/midori

Within the filters directory create a new file (I called mine "myblock.txt")

Here are the current contents:

!This is a comment, it is prepended by an exclamation point
!images

!animated thread indicator gifs, a little bit busy for my taste
forums.debian.net/styles/*/imageset/topic_*.gif

!Lolflag gotta go
ubuntuforums.org/images/smilies/smiley-faces-75.gif

!styles

!They tried to make me use the Leanback and I said no, no, no
youtube.com##DIV#quicklist-tray
youtube.com##DIV#quicklist-bar-container
youtube.com##DIV#quicklist-bar

The first two parts are some animated images, the second part is the styling for the new Youtube feature I added today.

There is support for wildcards, so in the case of the Debian forums, which have several themes to choose from (I recommend "Minimal" and "Bl@ck") instead of listing all of the themes, I just stuck an asterisk wildcard in where the themes are named in the path. It's actually easier than it seems when you read what I typed out. But that way, no matter what theme I'm using, I don't see the .gifs. If I were you I would not copy that part of my list unless you want to not see new and hot thread indicators but it makes a good example to check with so I'm using that.

It's also a lot faster when blocking multiple images from the same site than right clicking to block if they are coming from the same server. If you're having trouble actually finding what exactly to block, the Element Inspector comes in handy (via right-click).

Onto the Youtube thing. This wasn't as straightforward, I didn't go looking for the what to put into the filter myself, I saw it from a handy post on Identi.ca with a Digg link from @gamerchick:

http://gamerchick02.status.net/notice/172865

which takes you here:

http://www.lifelan.com/blog/remove-yout … -gray-bar/

which is good reading, shows us how to block the Youtube thing in other browsers, and it also gave us enough info as to what we want to filter on for Midori, so yay!!!

Back to our "myblock.txt" file, add in the youtube code and save it.

Now we're gonna show Midori where it is, go to  Tools -> Configure Advertisement Filters

In the entry box put the path to the local file prepended with "file://" so...

file://.local/share/midori/filters/myblock.txt

Make sure it's checked, save your changes and restart Midori.

Since there are several ways of attacking the same thing, this could also probably be done using custom styles or scripts, but this is pretty darn easy.

---some of you might want to skip the rest, but if you want some shortcuts ---

Let's make it even easier for the future.

** Openbox launcher string for your copy and paste enjoyment, smile if you do it this way, just skip the .bashrc stuff (just call it anything you want in the Openbox menu)

gedit ./local/share/midori/filters/myblock.txt

-or- if you want to use the terminal

in .bashrc (or the config file of your choice that allows aliases)

alias mblock='vi .local/share/midori/filters/myblock.txt'

(I use vim, replace with editor of your choice, if it's a graphical one don't forget the ampersand to keep your window free)

(make sure you're in your home dir and refresh .bashrc)

cd

source .bashrc

Now test "mblock"

------------------------

Add new filters as you come across stuff and it should go away the next time you start Midori.

Should work, if not check your path, check for typos in the filter if it's not copied from somewhere else (-or- check this post for typos, I've been known to make them, or I might have dropped a step somewhere neutral).

Also, Youtube for any other place can change their stuff around at any time so you might need to update it once in a while.

This all looks like a bunch of stuff, but once it's set up it really just takes seconds to add new filters to nutty things as you come across them to make the web a more enjoyable place. big_smile

And now that I've typed this up I realized that there very well could be a one-line fix out there, and if so, lemme know!

Last edited by chillicampari (2010-08-02 05:52:23)


#! forum moderator

Offline

Help fund CrunchBang, donate to the project!

#2 2010-08-02 07:00:20

oupsemma
#! Junkie
From: Cumbria / UK
Registered: 2008-12-06
Posts: 316

Re: A Midori browser tips thread

There are some nice  tips here: http://wiki.xfce.org/midori/faq

As Midori can use Opera's User Javascripts, you can download "CustomizeGoogle for Opera" from here: http://cg.smir.de/
extract the 2 scripts  in your ~/opera folder, under user.js, and modify them in a text editor the way you would do with CustomizeGooogle for Firefox.


#Linux user 482038, eeepc 901 with #!, freed 901Go with Trisquel & gNewSense,
901 with Manjaro & ArchBang

Offline

#3 2010-08-02 07:52:58

chillicampari
Pinball Wizard
Registered: 2009-10-09
Posts: 1,875

Re: A Midori browser tips thread

Very cool, I didn't know about the CustomizeGoogle script! Thanks for the FAQ link (I totally forgot to include that, yeek!) big_smile


#! forum moderator

Offline

#4 2010-08-02 12:00:27

oupsemma
#! Junkie
From: Cumbria / UK
Registered: 2008-12-06
Posts: 316

Re: A Midori browser tips thread

Slitaz Doc has a good tutorial too: http://doc.slitaz.org/en:guides:midori

And, incidentally, the coming Windows 8 has Midori as a codename!


#Linux user 482038, eeepc 901 with #!, freed 901Go with Trisquel & gNewSense,
901 with Manjaro & ArchBang

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo