vasa1
June 4th, 2011, 12:57 PM
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: http://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):
[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.
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: http://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):
[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.