General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
Hosts File Problem
Posted by: clutterless
Date: February 20, 2018 07:15AM

I've never seen anything like this before. There may not be a solution.

For business reasons, I frequently visit sites with links to the same junk
website. I'm trying to completely block this site, but it's not working.

I added this line to the Hosts file - 127.0.0.1 garbagesite.com.

If I select a link to garbagesite.com it appears in the address bar. K-Meleon
instantly closes (I don't know why) or an error message appears:

https://pasteboard.co/H8tIbWLv.jpg

If the Hosts file won't block this domain name, what else can I do to protect
K-Meleon from this junk website?

Options: ReplyQuote
Re: Hosts File Problem
Posted by: hermes
Date: February 20, 2018 08:26AM

I had a similar task about three years ago. There was a very impudent advertising with a hard redirect, and it is not blocked by a HOSTS file or solutions such as adblock (unfortunately).
However, a solution has been found and has since been used successfully for three years.

This silent block: https://addons.mozilla.org/ru/firefox/addon/silentblock/
Little and very powerful firewall based on regular expressions rules:
https://en.wikipedia.org/wiki/Regular_expression .

All simple:
Quote

Minimum and fast URL blocking by regular expressions.

*Create contentblock-regex.txt in profile folder and write regular expressions to block matching URLs.
*contentblock-whitelist-regex.txt for white list.
*Restart Firefox to reload files.
*See error console or browser console for blocker results.
(Disabled by default. Toggle extensions.silentblock.logging.enabled .)
*No GUI.

Rule: garbagesite\.com (in contentblock-regex.txt).

We screen with the slash ("\") the service symbols:
«\», «?», «#», «|», «(«, «)», «[«, «]», «{«, «}», «^», «$», «+», «.».

Replace the service symbols of the mask with the corresponding analogs in regular expressions:
"*" is replaced with ".*", and "?" with ".".

This should not be difficult.



Edited 3 time(s). Last edit at 02/20/2018 08:42AM by hermes.

Options: ReplyQuote
Re: Hosts File Problem
Posted by: J.G.
Date: February 20, 2018 01:46PM

And what about Adblock with the rule *garbagesite*? :s

Options: ReplyQuote
Re: Hosts File Problem
Posted by: hermes
Date: February 20, 2018 03:50PM

@J.G.

To give an example, take the address of this forum: http://kmeleonbrowser.org/forum .

Then create a rule for adblock: kmeleonbrowser.org/forum

/* not important what specifically AdblockPlus, build-in adblock or similar, all of them have
this vulnerability */

Ideally, we should not get anything, but it is only to disable external styles, scripts
and pictures. The page itself will be loaded anyway! If it was advertising
based on CGi ( https://en.wikipedia.org/wiki/Common_Gateway_Interface ) adblock
and similar (except for direct firewalls, as silent block) will not be able to block such a page.

You can perform an even tougher test by creating a rule in adblock: * (which will lead
to a similar result as described above on the example of this forum).

However, if you use silent block with a rule: kmeleonbrowser\.org/forum

Not only will the page not be loaded, it will not even be requested at the browser
level. That is, the browser will not even try to request or ping such an address.

There is a huge difference.

Options: ReplyQuote
Re: Hosts File Problem
Posted by: J.G.
Date: February 20, 2018 05:42PM

@hermes thank you for the useful explanation, I have understood it now! smiling smiley

Options: ReplyQuote
Re: Hosts File Problem
Posted by: Tim
Date: February 20, 2018 10:07PM

You might have just had bad timing. Try it again now. The K-Meleon website was down last week and if you have the default preference setting enabled for "update checker", it would crash. We had to roll back a ton of machines to older versions or manually edit each user's prefs file.

Options: ReplyQuote
Re: Hosts File Problem
Posted by: siria
Date: February 20, 2018 11:20PM

@Hermes:
don't know about script-redirects, but blocking normal websites works fine with ExExceptions: by blocking "document".
Really no chance in adblock.txt with something like garbagesite.com$document? (syntax?)

Roytam, Dorian: any chance that adblock.dll could get 2 commands that can be called by macro? 1) To download fresh lists from the web and 2) to import the current disk list again in the middle of a session, because I have a little macro that adds more rules to it? (posted awhile ago, mainly for $ImageURL, but user can crop path shorter or edit more if he knows syntax)

Hermes PS: the other thread, with the operalike-search-macro, have tried just for curiosity (am doing the same with bookmark-nicks since years), but that $OnLoad-macro gives me "invalid URL" (or similar) popup errors each time. Is it just my old system, or perhaps a pref that can stop those alerts? It would be harmless if the error were just on the page, but it's a popup "alert".

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

@Tim:
Errr.... important info, thank, but creates some giant "???" in my head now, from 3 innocent lines
Just curious, you have KM running on "a ton of machines"?? You mean our beloved little browser is running on more than perhaps 100 computers in the world? ;-)
And - it crashes when Sourceforge is down and updates enabled???
YIKES... does that mean that nearly all KM users out there were now left with a crashed browser, had no clue why, and if they looked on the KM-website with another browser it was broken too - no help and no clue anyhwere??
And - you're doing something as complicated as rolling back to an old version just to change a default pref? To my knowledge "default" means it is not stored in the user's prefs file, only in a standard js-file in the browsers default folder (kmeleon.js?), so this file could simpler be distributed. Another possiblility would be to distribute a macro file with a few setpref-lines in it. Or delete the kplugin update.dll And being Mozilla, there sure are also some 'expert' methods of which I have no clue, being just a user.
PS: which version was crashing?



Edited 3 time(s). Last edit at 02/20/2018 11:33PM by siria.

Options: ReplyQuote
Re: Hosts File Problem
Posted by: clutterless
Date: February 21, 2018 02:07AM

Silent Block is a Firefox add-on. If I remember correctly, a few Firefox add-on
scripts have been altered so they work like K-Meleon extensions. The vast majority
of Firefox add-ons are not compatible with K-Meleon.

There is a K-Meleon extension for AdBlockPlus:

http://kmext.sourceforge.net/ext1.htm

The description says, "a content-filter based extension to remove image or flash
advertisements from websites by using an up-to-date and constantly maintained
filter-subscriptions."


I've never used AdBlock, so I'm not sure how it would block a website. If the
description is correct, AdBlock is about removing unwanted images or flash
advertisements.

There is a K-Meleon extension called Domain Blocker. It's just a quicker way to add
domain names to the Hosts file.

Tinkering with a Firefox add-on or an app like AdBlock is too much for me. I need a
relatively simple way to block that junk site. I don't see an extension on the list that
will do the job.

This is completely off topic, but my favorite K-Meleon extension is Tab All Windows.
If you must visit a site with too many pop-ups, I prefer they appear as tabs that can
be quickly closed. I don't like pop-up blockers. They usually fail to differentiate
between annoying pop-ups and legitimate pop-up windows.

You can find Tab All Windows here:

http://kmext.sourceforge.net/ext7.htm



Edited 1 time(s). Last edit at 02/21/2018 02:07AM by clutterless.

Options: ReplyQuote
Re: Hosts File Problem
Posted by: hermes
Date: February 21, 2018 04:05PM

@siria, clutterless, J.G. (for the rest can also be interesting)

For a more visual demonstration, i recorded a three minute of video (fully by default):
(direct link) https://getfile.dokpub.com/yandex/get/https://yadi.sk/d/imXtWAxX3Seg4H (~442 Kcool smiley.

Here you can clearly see that the use of silent block does not allow the browser to even send a service request to a prohibited address.

When testing on a local web server, this is even more significant (because you can see the server side, too).

Always check about:networking for addresses that you are trying to filter. The presence of them in the list indicates not a complete ban. Because this is the list of nodes that were requested.

Options: ReplyQuote
Re: Hosts File Problem
Posted by: J.G.
Date: February 21, 2018 04:37PM

@hermes thank you for the video, silentblock should be added by default imho! smiling smiley

Options: ReplyQuote
Re: Hosts File Problem
Posted by: rodocop
Date: February 21, 2018 09:30PM
Options: ReplyQuote
Re: Hosts File Problem
Posted by: hermes
Date: February 22, 2018 02:01AM

I can offer my own, but I must warn it is very specific and cuts cloudflare and similar servers.

Options: ReplyQuote
Re: Hosts File Problem
Posted by: gordon451
Date: February 23, 2018 04:22AM

Quote
clutterless
I've never seen anything like this before. There may not be a solution.

For business reasons, I frequently visit sites with links to the same junk
website. I'm trying to completely block this site, but it's not working.

G'day clutterless -

Are you running Win8+ or W10 ? Both of those need 0.0.0.0 instead of 127.0.0.1. See There's no place like 127.0.0.1 for all the good goss.

To speed up some timeouts when using hosts, try eDexter, a small proxy which traps hosts requests and serves back a small paw-print.

____________________
Understanding the scope of the problem is the first step on the path to true panic. [Florence Ambrose, "Freefall" 01372 January 22, 2007 http://freefall.purrsia.com/ff1400/fv01372.htm]

Options: ReplyQuote
Re: Hosts File Problem
Posted by: siria
Date: February 23, 2018 10:39PM

Another possibility:
This is one of my most favorite tools:
ExExceptions!

It's just a little XUL-editor for the permissions.sqlite database in the profile folder, used since ages by KM itself for storing cookie and popup permissions. If type "document" is blocked, the page itself is blocked (html-pages etc.), but better block all the other types too. It only works for domains, not for finetuning of subfolders etc

Download only HERE, version for KM7X, last mod. by rodocop:
http://kmeleonbrowser.org/forum/file.php?9,file=1517,filename=exexceptions2017.7z

It creates a red circle as button.

All types have choices for:
- allow (=whitelist)
- deny (=blacklist)
- Site (=only own stuff, no third party)





Edited 2 time(s). Last edit at 02/23/2018 10:44PM by siria.

Options: ReplyQuote
Re: Hosts File Problem
Posted by: J.G.
Date: February 25, 2018 02:23AM

Quote
siria
Another possibility:
This is one of my most favorite tools:
ExExceptions!

It's just a little XUL-editor for the permissions.sqlite database in the profile folder, used since ages by KM itself for storing cookie and popup permissions. If type "document" is blocked, the page itself is blocked (html-pages etc.), but better block all the other types too. It only works for domains, not for finetuning of subfolders etc

Download only HERE, version for KM7X, last mod. by rodocop:
http://kmeleonbrowser.org/forum/file.php?9,file=1517,filename=exexceptions2017.7z

It creates a red circle as button.

All types have choices for:
- allow (=whitelist)
- deny (=blacklist)
- Site (=only own stuff, no third party)


This tool should also be included by default in upcoming versions! smiling smiley



Edited 1 time(s). Last edit at 02/25/2018 02:24AM by J.G..

Options: ReplyQuote
Re: Hosts File Problem
Posted by: Anonymous User
Date: August 09, 2018 08:44AM

This wonderful and powerful extension made my life a lt easier and I have been using it since KM 1.6 upto 75.1

UNFORTUNATELY, it DOESN NOT WORK on KM 76 RC1 and RC2.

exexceptions2017.7z CRC=8F3BFB53 files date= 2017-11-01 or near
ExExceptions.7z CRC=F9B06CBF files date= 2013-01-27

Option in the Tool menu appears BUT it just shows an empty window (showing chrome://..../exception.xul OR so in the title bar).
Any help in this regard? looking forward for help from Siria and other gurus.

ALSO:
The first post on this forum using KM76 RC2, this post pages lacks its icon, just text showing on the tool/edit bar of this reply page, see 2 attached images:



AM I doing anything wrong?

EDIT: images are not showing guess sabercathost.com changed somethjing , you can still download these images, rightclick or so until i manage to upload somewhere else, sorry.
https://sabercathost.com/5g0q/km76rc2_01.png
https://sabercathost.com/5g0p/km76rc2_02.png

Edit:
https://ibb.co/igTid9
https://ibb.co/muaUJ9






Edited 6 time(s). Last edit at 08/09/2018 09:11AM by Wasi.

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: siria
Date: August 09, 2018 10:44AM

Little correction :cool:
Quote
Wasi
Any help in this regard? looking forward for help from Siria and other gurus.
Am greatly missing some previous supporters too, but glad Hermes and Yogi are still hanging on, or there would really be no one around anymore, sigh.

No idea really, so here's just a general shoot in the dark, what often helps:
- Make sure you have only the 2017 version installed. If you tried the older one too, hunt down all the files and remove them, then install the newer one again.
- Not sure if KM76RC still needs this pref, but if missing create it in about:config:
kmeleon.install_firefox_extension (BOOL) = true
- Delete the StartupCache folder in the profile and restart KM

And would recommand this little informational macro, it's made for such 'tapping in the dark' probs, just to give some ideas where to look:
http://kmeleonbrowser.org/forum/read.php?9,142878

About the forum editor, perhaps just settings?

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: Anonymous User
Date: August 09, 2018 12:47PM

Thank you Siria for such a quick reply.
I will try what you suggested and hope some miracle, thanks.
Yes sure this makes me sad too when facing some problems and no one for help is here, but thats not actually true, just bad dreams, because you guys are always here for help as much as you can, thanks.
Besides all good and bad and sad things, I love K-Meleon for reasons you guys already know, I feel like a community here.
Will post the result next day.

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: hermes
Date: August 09, 2018 01:37PM

@Anonymous User

siria is right. The module by link is fully compatible with KM Goanna.
...
I recorded a small explanatory video: (640x480 ~40 sec.)
(direct link) http://getfile.dokpub.com/yandex/get/https://yadi.sk/d/irFcaJ1C3a59A7 (~120 Kcool smiley


Quote
siria
Another possibility:
This is one of my most favorite tools:
ExExceptions!

It's just a little XUL-editor for the permissions.sqlite database in the profile folder, used since ages by KM itself for storing cookie and popup permissions. If type "document" is blocked, the page itself is blocked (html-pages etc.), but better block all the other types too. It only works for domains, not for finetuning of subfolders etc

Download only HERE, version for KM7X, last mod. by rodocop:
http://kmeleonbrowser.org/forum/file.php?9,file=1517,filename=exexceptions2017.7z

It creates a red circle as button.

All types have choices for:
- allow (=whitelist)
- deny (=blacklist)
- Site (=only own stuff, no third party)



Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: Wasi
Date: August 09, 2018 04:48PM

@Siria
Thank you a lot lot lot
I spend half of my day and couldn't get any success. And then I was not hoping some miracle from your advice but it did it.
Adding:
kmeleon.install_firefox_extension true

was not in about:config, so I added and hey, ExExs Permission windows popup-ed nicely and its working.
Thank you for your kind consideration and help, you really did magic.
That is why I said I feel like a community here.
But now another thing, during all those editing my previous post regarding images not showing, KM forum now refuses my login and I get this message
Invalid phorum user

I can't login :O

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: Wasi
Date: August 09, 2018 04:58PM

@hermes
Thank you hermes
I love this extension and my permission.sqlite is now 805 KiB.
I need some explanations regarding this extension:
What is ObjectSub? I understand Object but ObjectSub?
Also anyone help me with my log-in problem?
NOTE: the Anonymous User was me (Wasi) I was logged in and then spend too much time on the issue of pictures I posted not showing then I posted and I suddenly logged out and no can not log in? what happened?

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: siria
Date: August 09, 2018 07:18PM

@Wasi:
Glad it works again smiling smiley

Regarding your account, it looks like someone has accidentally deactivated/deleted it, probably one wrong click while hurriedly cleaning the hundred spam posts of the last days... sad smiley At any rate those spam posts have vanished around the same time as your account. And from your "Edit" line above, with your name, it's clear that you were logged in when editing.
No idea if it can be reactivated, or is forever lost??
If not, a mod or admin can only edit your postings and restore at least your name again, without a user account behind it.

And I've done a forum search for your past postings, funnily that still finds (or found?) those few postings with your deleted name - even those without an "Edit" line :cool: But not sure how long it will keep that memory before re-indexing again.
Have now noticed you're already since 7 years in this forum and a great KM-fan, wow! 👍
Also noticed you seem (luckily) not very much attached to your accounts and username, using a couple variations of "Wasi". There's even another account, WasiAzeem - perhaps use this one again?

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: hermes
Date: August 09, 2018 08:46PM

@Wasi

ObjectSub or Object-subrequest — requests initiated by plugins like Flash.
It is useful to examine: https://adblockplus.org/en/filters#options
...
And if its is interested for you: http://kmeleonbrowser.org/forum/read.php?19,146713



Edited 1 time(s). Last edit at 08/09/2018 08:47PM by hermes.

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: siria
Date: August 09, 2018 08:58PM

There's one big prob with ExExceptions - the description is wrong, very misleading:



"You can specify which websites are allowed to load various objects."
Not true.
Perhaps the original author didn't know it better, but actually I don't know a better wording either, which doesn't sound just as confusing sad smiley
But from this line every user will wrongly believe that the specified domains were about those in the URLBAR, defining "top-down" what this domain is allowed to load or not. But in reality it's Mozilla's fault, in their infinite wisdom they have it all backwards - their exception system works bottom-up: not the target-domain in the urlbar is the specified one, but the source-domain of every single page element! If a domain is blacklisted (blocked), it means that elements FROM this domain are blocked on all websites. If a domain is whitelisted (allow), it means elements FROM this domain are allowed on all websites too, not just on their own.

Exceptions are not meant "for" a target domain, but "from" which source domain page elements come.

That's not ExExceptions fault, this addon is merely an easier GUI to fill Mozilla's permissions.sqlite file, the blocking itself is done by the native engine.

That sounds all very confusing, but everyone can do this simple little test:
Block images for "kmeleonbrowser.org", then reload this forum page...
Oops - of course I mean "from" kmeleonbrowser.org!!
Now look at the green bar: the KM-logo and the flags are hosted on "kmeleonbrowser" - those are blocked. But the 2 sourceforge icons are still showing - those images are loaded "from" sourceforge.net!
Or allow youtube.com only site frames (subdocument=3): that does not mean that "on" youtube 3rd party iFrames were blocked. They are not. Instead it means, that no other websites are allowed to embed iframes "from" youtube.

That said, at least Mozilla's DEFAULT permissions work as one expects naturally.
For those the domain of the current page matters. A little self-test:
permissions.default.image = 3 (same domain)
Reload the forum and look at the green bar - now the 2 images loaded from sourceforge are blocked!

But there's yet another unexpected complication: iFrames!
permissions.default.subdocument = 1,2,3
As far as I know frames are little websites inside other websites. Regarding permissions, that probably means they are fully independant? If a user isn't aware that half the page he views is in reality another website, that can produce confusing blocking behaviour too...

My personal css userstyle is set to mark all iframes with a dotted light blue line, very handy, even more so because I have all 3rd party iframes blocked by default (reduces all that FB&Co tracking everywhere!) If anyone wants that marking too:
iframe { border: dotted 2px cyan ! important; }

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: hermes
Date: August 09, 2018 11:05PM

@siria

Quote

But from this line every user will wrongly believe that the specified domains were about those in the URLBAR, defining "top-down" what this domain is allowed to load or not. But in reality it's Mozilla's fault, in their infinite wisdom they have it all backwards - their exception system works bottom-up: not the target-domain in the urlbar is the specified one, but the source-domain of every single page element! If a domain is blacklisted (blocked), it means that elements FROM this domain are blocked on all websites. If a domain is whitelisted (allow), it means elements FROM this domain are allowed on all websites too, not just on their own.

Exceptions are not meant "for" a target domain, but "from" which source domain page elements come.

I thought it was obvious. If you do not have additional tools and you do not read the source code (where it becomes obvious or if you write your own filters, e.g. for ABP, silentblock and similar filters), possible to use a special service page: about:networking. Drawback of this method is impossibility of its nullification (of this page) without a browser restart. The list will show all requested domains.

I often try attention to this, because this is a very effective method:
http://kmeleonbrowser.org/forum/search.php?0,search=about%3Anetworking,author=hermes,page=1,match_type=ALL,match_dates=0,match_forum=ALL,match_threads=0

Quote

My personal css userstyle is set to mark all iframes with a dotted light blue line, very handy, even more so because I have all 3rd party iframes blocked by default (reduces all that FB&Co tracking everywhere!) If anyone wants that marking too:
iframe { border: dotted 2px cyan ! important; }

I use a similar construction: (and a number of others for these reasons)
frame, iframe{outline:1px dashed red !important}



Edited 2 time(s). Last edit at 08/09/2018 11:14PM by hermes.

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: rodocop
Date: December 02, 2018 11:44PM

siria,
should I change this misleading description and update the ExExceptions package?

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: siria
Date: December 03, 2018 09:20PM

Not sure why you're asking me regarding the xul-part, but of course a better description would be great.

Options: ReplyQuote
Re: Hosts File Problem / ExExceptions addon
Posted by: rodocop
Date: December 04, 2018 08:55PM

Just 'cause we can change it inside ;-)

Options: ReplyQuote


K-Meleon forum is powered by Phorum.