Karma Blocker for Firefox - a guide by a beginner

Discussion in 'other software & services' started by vasa1, Jun 4, 2011.

Thread Status:
Not open for further replies.
  1. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    The simplest use of Karma Blocker is to prevent something specified by an URL from being loaded by Firefox.

    The components of an URL are described here: http://www.w3schools.com/html/html_url.asp

    Using the same url (or link) as an example ...

    scheme (protocol) = http in this case (but could also be https or ftp or file)
    domain host = www (often omitted)
    domain name = w3schools.com (usually shown differently in most browsers from the rest of the URL. Fx6 will have this as well.)
    :port = ... not usually specified but the default is 80
    path = root in this example (/)
    filename = html_url.asp

    In this, http://portableapps.com/apps/office/libreoffice_portable, the file aka page "libreoffice_portable" is in a subdirectory and not at root.

    :::::

    brainrb1 has posted a useful image here: https://www.wilderssecurity.com/showpost.php?p=1880654&postcount=586

    That window is accessed by Alt, Tools, Addons and clicking on "options" in the Karma Blocker row.

    The basic install of Karma Blocker has some default content starting with "# This default ruleset".

    My suggestion is to copy the complete contents of the window and save it somewhere safe as a text file. Then delete everything from the pane.

    Also disable Sync which is on by default (and just below the blue bar at the top).

    Now, paste the following into the pane (from which everything has been deleted):
    Code:
    [Settings]
    threshold=1
    cutoff=1
    collapse=false
    
    [Group]
    name='Learning'
    match=any
    score=1 #rules follow after leaving one blank line
    
    Once that is done, you start entering the rules, one per line. For the rule to take effect, you have to click "save" and restart Firefox and empty cache, if necessary.

    I will give an example of my net banking site which has a bunch of pictures I don't really need to see.

    Anyone can access the site. You don't need to login.

    The site is -https://www.axisbank.co.in-

    After you open the page, you'll see something like this in the address bar:
    ht tps: / /ww w.ax isbank. co.in/ BankAway/%28sfwoaa454fbc2e55e2fkew45%29/web/L001/retail/jsp/user/RetailSignOn.aspx?RequestId=89129

    The stuff in bold is randomly generated for each session.

    Now right-click on the images and copy the image location.
    It should be something like this:
    lady in white ...
    -https://www.axisbank.co.in/BankAway/(sfwoaa454fbc2e55e2fkew45)/web/L001/retail/jsp/user/images/login_banner.jpg

    picture of mouse ...
    -https://www.axisbank.co.in/BankAway/(sfwoaa454fbc2e55e2fkew45)/web/L001/retail/jsp/user/images/icon/icon_trubble.gif

    picture of question mark ...
    -https://www.axisbank.co.in/BankAway/(sfwoaa454fbc2e55e2fkew45)/web/L001/retail/jsp/user/images/icon/icon_newuser.gif

    picture of computer screen ...
    -https://www.axisbank.co.in/BankAway/(sfwoaa454fbc2e55e2fkew45)/web/L001/retail/jsp/user/images/demo.gif

    We want to block those images from loading. We know the random number will change from session to session.

    This is the rule:
    rule=$url.path=~'.*BankAway/(.*)/web/L001/retail/jsp/user/images/.*'

    Please note the single quote marks. They're necessary.
    So far, all the rules I've used have "rule=$url" at the start.

    "=~" indicates we're going to use wild cards (regex) to cover more than one case (and to shorten the rule).

    (A perfectly matching rule (no wild cards) would have rule=$url==)

    The first instance of ".*" means anything before the string "BankAway". So we're not specifying the scheme (protocol), domain host, domain name or port and dealing straight away with the path.

    The next instance of ".*" takes care of the first random string.

    The third ".*" means we want the rule to cover anything in the subdirectory "/images".

    The ".*" means any character (represented by ".") followed any number of times ("*").

    So we paste in that rule,
    click on "status" to know if the rule is acceptable to Karma Blocker (syntax, etc) and then click on save and restart Firefox. It also helps to clear the cache!

    If you now go to -www.axisbank.co.in, you shouldn't seen those images. You can check about:cache to ensure that they're actually blocked and not just hidden from view.

    Also note that the page layout hasn't changed because we've set "collapse=false" (near the top).

    If you want to add comments, the line must start with a hash (#). Anything on the line after the # is ignored by KB.

    One rule you can try "globally" is to block avatars in forums (if you haven't used forum settings to do so already):
    rule=$url.path=~'.*avatar.*'
    should do it.

    I'm sure I've forgotten to mention something vital :D , so if things don't work ...

    Also, the example shows only a limited aspect of KB. I'm sure there's more.
     
  2. brainrb1

    brainrb1 Registered Member

    Joined:
    Mar 15, 2010
    Posts:
    475
    Karma Blocker is good but it takes so much time/know how to setup the rules.If they had something like fanboys or easylist so you can copy paste a lot more people would be interested.This is the era of 'fast food' so anything that takes time and effort to learn/setup will not be popular.
    Another thing is that there is not much online information on how to set it up.... as well as the settings option is not helpful at all.I am almost ready to give up. Thank you for your guide.
     
  3. acr1965

    acr1965 Registered Member

    Joined:
    Oct 12, 2006
    Posts:
    4,954
    I kept getting an error message on Youtube when trying to play videos so I uninstalled- now no problems.
     
  4. kupo

    kupo Registered Member

    Joined:
    Jan 25, 2011
    Posts:
    1,122
    You should create a group for your own whitelist and give it a value of -10 or something to make sure it is not blocked, but still, I changed back to adblock plus, just download a filter then there you go, :D
     
  5. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    I've switched from Karma Blocker to SimpleBlock.
     
  6. brainrb1

    brainrb1 Registered Member

    Joined:
    Mar 15, 2010
    Posts:
    475
  7. vasa1

    vasa1 Registered Member

    Joined:
    May 1, 2010
    Posts:
    4,152
    For a user-friendly add-on, everyone will agree that ABP is it.

    I like to fiddle and learn and so don't mind a bit of head-scratching. Plus, I'm the sole user of the PC which makes it easier.
     
Loading...
Thread Status:
Not open for further replies.