Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Pages: 1234Next
Current Page: 1 of 4
Basic adblock
Posted by: Dorian
Date: August 31, 2015 07:26PM

I've noticed that I was using this for 1 year now. I've stopped worked on it and never shared it, so i'm posting it just in case someone find it useful.

This plugin use adblock+ rules to block popup and external ads. It doesn't block inline ads (## rules)

Rules must be in adblock.txt in your profile. There is no cache, it can increase startup time if there is a lot of rules or/and your computer is slow.

Preferences:

  • kmeleon.plugins.adblock.subscriptions: list or url separated by '|'
    Ex: https://easylist-downloads.adblockplus.org/liste_fr+easylist.txt|https://secure.fanboy.co.nz/fanboy-social.txt
    If adblock.txt does not exist in profile, adblock.txt is created using those urls. There is no auto update.
  • kmeleon.plugins.adblock.logging: create adblock.log with list of matching rules.
  • kmeleon.plugins.adblock.disabled

There is no interface and no way to control what is blocked or not from kmeleon. A macro could be done for on/off button and maybe to delete adblock.txt regularly for an auto update.

Works with KMeleon 75.x and 76
Installation: unzip in the kplugins folder (in your profile, preferably)


EDIT: Fixed bug, some rules did not apply properly



Edited 2 time(s). Last edit at 12/28/2015 04:52PM by Dorian.

Attachments: adblock75.zip (55.7 KB)   adblock76.zip (57.5 KB)  
Options: ReplyQuote
Re: Basic adblock
Posted by: rodocop
Date: August 31, 2015 10:46PM

Great stuff!
Love this browser more and more!

Options: ReplyQuote
Re: Basic adblock
Posted by: Chanson Yu
Date: September 01, 2015 11:26AM

Dorian,thanks for all your efforts! smiling smiley
Tried it in KM75,it works well,but I'm using KM74 with Adblock Edge.

________________________________________
K-Meleon zh-CN: http://pan.baidu.com/s/1o6NoHfG

Options: ReplyQuote
Re: Basic adblock
Posted by: JamesD
Date: September 01, 2015 01:30PM

Quote
Dorian
There is no interface and no way to control what is blocked or not from kmeleon. A macro could be done for on/off button and maybe to delete adblock.txt regularly for an auto update.

This macro may or may not be what you had in mind. I did not yet add the part for deleting the addblock.txt file or the log file. That can be done, but the necessary statements have not been announced.

Also what about viewing/editing the addblock.txt and addblock.log files? Should I consider adding those functions? Is there a reason to have the ability to change/add to the subscriptions list?

The macro seems to work for me, but should be considered 'under development'. All suggestions are welcome.

Attachments: Addblockplugin.7z (921 bytes)  
Options: ReplyQuote
Re: Basic adblock
Posted by: rodocop
Date: September 01, 2015 02:48PM

I think macro should simply delete old txt-subscriptions OnQuit...

Options: ReplyQuote
Re: Basic adblock
Posted by: JamesD
Date: September 01, 2015 08:24PM

Quote
rodocop
I think macro should simply delete old txt-subscriptions OnQuit..

Surely not more than once in twenty-four hours?

Options: ReplyQuote
Re: Basic adblock
Posted by: rodocop
Date: September 02, 2015 05:29AM

I'm not sure that subs are updated more frequently themselves...

Options: ReplyQuote
Re: Basic adblock
Posted by: siria
Date: September 02, 2015 06:06AM

Of course that's up to the user... IMO automatic web downloads are a hassle, so I would let him choose weekly or manually... :cool:

Options: ReplyQuote
Re: Basic adblock
Posted by: JamesD
Date: October 02, 2015 01:21AM

I have a set of controls for the adblock.dll file. As Dorian said of the dll file, extract these files to your profile.

Release notes
Adblockplugin.kmm
Requirements:  K-Meleon 75.1 beta or later

 1) New spelling for macro name.  --  Adblockplugin.kmm
    [ Will not overwrite the old 'Addblockplugin.kmm' file.
      If old macro exists, delete or disable before using new.]
 2) Added toolbar and buttons for enable/disable.
 3) Added 'Actions' menu with:
    "Subscriptions' List"
    "View the rules"
    "Clear the rules" (A)
    "View the log"
    "Clear the log"
    "View the macro's log" (A)
 4) Added 'Automactics' menu with:
    "Auto delete the rules"
    "Set interval for rules" (cool smiley
    "Auto delete the log"
    "Set interval for log" (cool smiley
 5) Added a quick view of the settings.

A. Rules and log files, adblock.txt and adblock.log, are not reloaded
   until K-Meleon is restarted.  The automatic deletions occur at the
   OnQuit event so that the system is not run without them.  Since the
   events in the error console are lost when KM is restarted, it was 
   necessary to create a log for the macro which would be retained 
   between sessions.  If the user deletes the rules, adblock.txt, then
   the toolbar button will show 'dead' until a restart.

B. The initial run of the macro will set the interval for automatic
   deletions to 5 days.  This can be changed later by the user.     


Attachments: adblock controls.7z (9.3 KB)  
Options: ReplyQuote
Re: Basic adblock
Posted by: Slickone
Date: December 05, 2015 05:49PM

I don't see the control anywhere. Any idea why? The macro is enabled in preferences.

Options: ReplyQuote
Re: Basic adblock
Posted by: JamesD
Date: December 06, 2015 04:37PM

Quote
Slickone
I don't see the control anywhere. Any idea why? The macro is enabled in preferences.

Click on the attachment "Adblock Controls.7z" at the bottom of my earlier post, and download the 7z file. Extract the files to K-Meleon root and restart KM.

If this is done then check the VIEW TOOLBARS to see if the adblock_plugin toolbar is checked.



Edited 1 time(s). Last edit at 12/06/2015 05:03PM by JamesD.

Options: ReplyQuote
Re: Basic adblock
Posted by: Slickone
Date: December 06, 2015 05:07PM

I already have the AdBlock Controls installed, and in preferences, the macro is listed, and it's checked. I just don't see the icon anywhere.

In View > Toolbars, it's not listed. I do still have the "Adblock Plus (ABP7)" listed there, though it's not enabled. That shouldn't affect it should it?



Edited 2 time(s). Last edit at 12/06/2015 05:54PM by Slickone.

Options: ReplyQuote
Re: Basic adblock
Posted by: JamesD
Date: December 06, 2015 06:26PM

What version of K-Meleon are you using?

There is a version check built into the macro. In line #315 is this statement.
if (($VERSION >= 33685507) and (pluginexist(adblock)) ) {  # K-Meleon 75.1 or greater and adblock plugin


Options: ReplyQuote
Re: Basic adblock
Posted by: Slickone
Date: December 06, 2015 06:39PM

76b2

Options: ReplyQuote
Re: Basic adblock
Posted by: JamesD
Date: December 06, 2015 07:04PM

OK, you have version 33751042. That will work. You can double-check using this macro. https://dl.dropboxusercontent.com/u/1522294/specific.7z "Specifications" appears in the help menu.

In EDIT > PREFERENCES - K-MELEON PLUGINS you should have:
adblock (no information available)
That should be checked.

Those two items satisfy the test in the macro.

In your root\skins\shared folder, you should have three png files named adblock_dead, adblock_green, and adblock_red.

Unfortunately, I do not know if anything from AdblockPlus can interfere.

The only other thing which might play a part in this is if your toolbars are locked. I say might because I am not sure if locked toolbars would prevent a new toolbar from showing.

Options: ReplyQuote
Re: Basic adblock
Posted by: siria
Date: December 06, 2015 07:21PM

Have it just installed for a quick check in KM76beta2 up1+up2
Icon shows up fine in both, a light blue icon.

Do you see the menu in Tools?

It's funny though that you still see the ABP7-toolbar, since you disabled the macro. Disabled macros create no toolbars. Or do you have added that toolbar manually in toolbars.cfg?
At any rate make sure to disable not only the "macro", which does nothing except create menus and buttons, but especially disable also the rest of the other extension.

The prob is, if you installed rodocops ABP package, it has overwritten the original file omni.ja with a modified one, without a backup. Overwriting native files usually means "mysterious" trouble after uninstallation. So if you haven't replaced it yet with the native file try it now.
As he explained here:
http://kmeleonbrowser.org/forum/read.php?9,132173,135643#msg-135643

Quote
rodocop
try new fresh portable install, unpack ABP into it and create new profile. Should definitely work.

The only crucial files during installation are
- macros\AdBlockPlus7.kmm - is added
- browser\extensions\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.xpi - is added
- browser\omni.ja - overrides default one


Options: ReplyQuote
Re: Basic adblock
Posted by: rodocop
Date: December 06, 2015 07:57PM

WoW-WoW! My ABP-package SHOULDN'T be installed into KM76!!!

It's made only for 75 and earlier (every package for the specific branch of KM).

You should unpack an official KM76 into you installation once again (overriding files) to fix all that was broken.



Edited 1 time(s). Last edit at 12/06/2015 07:58PM by rodocop.

Options: ReplyQuote
Re: Basic adblock
Posted by: Slickone
Date: December 07, 2015 12:26AM

Quote
JamesD
OK, you have version 33751042. That will work. You can double-check using this macro. https://dl.dropboxusercontent.com/u/1522294/specific.7z "Specifications" appears in the help menu.

In EDIT > PREFERENCES - K-MELEON PLUGINS you should have:
adblock (no information available)
That should be checked.

Those two items satisfy the test in the macro.

In your root\skins\shared folder, you should have three png files named adblock_dead, adblock_green, and adblock_red.

Unfortunately, I do not know if anything from AdblockPlus can interfere.

The only other thing which might play a part in this is if your toolbars are locked. I say might because I am not sure if locked toolbars would prevent a new toolbar from showing.
It says I have version 33685506. Could have sworn I installed 76b2, but maybe not.
I do have the 3 PNG's.
I don't have the toolbars locked, but it should still appear in the View menu, shouldn't it?

Where on the toolbars should the icon appear?

Options: ReplyQuote
Re: Basic adblock
Posted by: Slickone
Date: December 07, 2015 12:42AM

Quote
siria
Have it just installed for a quick check in KM76beta2 up1+up2
Icon shows up fine in both, a light blue icon.

Do you see the menu in Tools?

It's funny though that you still see the ABP7-toolbar, since you disabled the macro. Disabled macros create no toolbars. Or do you have added that toolbar manually in toolbars.cfg?
At any rate make sure to disable not only the "macro", which does nothing except create menus and buttons, but especially disable also the rest of the other extension.

The prob is, if you installed rodocops ABP package, it has overwritten the original file omni.ja with a modified one, without a backup. Overwriting native files usually means "mysterious" trouble after uninstallation. So if you haven't replaced it yet with the native file try it now.
As he explained here:
http://kmeleonbrowser.org/forum/read.php?9,132173,135643#msg-135643

Quote
rodocop
try new fresh portable install, unpack ABP into it and create new profile. Should definitely work.

The only crucial files during installation are
- macros\AdBlockPlus7.kmm - is added
- browser\extensions\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}.xpi - is added
- browser\omni.ja - overrides default one
I don't see it in the Tools menu.

The ABP toolbar was still listed because I didn't have the ABP extention disabled then. I had just noticed it after posting that (and disabled it). I had only removed the icon from the toolbar when I posted originally.

I remember when installing ABP, that he (or someone) said it was OK to over right omni.ja, so I did. And for any future readers with this problem, this is the omni.ja in \K-Meleon\browser, not the larger one in the root.
I still had the original that I'd renamed, so I copied it back, but it didn't help.

Options: ReplyQuote
Re: Basic adblock
Posted by: Slickone
Date: December 07, 2015 12:46AM

Quote
rodocop
WoW-WoW! My ABP-package SHOULDN'T be installed into KM76!!!

It's made only for 75 and earlier (every package for the specific branch of KM).

You should unpack an official KM76 into you installation once again (overriding files) to fix all that was broken.
I didn't install ABP into KM76. I had KM75 with ABP and then upgraded to KM76.
There's nothing saying ABP won't work with KM76, that I've seen. You need to make this more clear.

Options: ReplyQuote
Re: Basic adblock
Posted by: rodocop
Date: December 07, 2015 01:01AM

Due to different catalog structure upgrading (through overextracting new files into old installation) from 75 to 76 isn't good idea in general.

But this way you don't need to uninstall ABP - you just should get it not working after update.

Options: ReplyQuote
Re: Basic adblock
Posted by: siria
Date: December 07, 2015 01:16AM

So your KM-version is just too old, that's why the new macro doesn't show.
The plugin doesn't work so the macro is intentionally hidden too, as James already wrote:

Quote
JamesD
What version of K-Meleon are you using?

There is a version check built into the macro. In line #315 is this statement.
if (($VERSION >= 33685507) and (pluginexist(adblock)) ) {  # K-Meleon 75.1 or greater and adblock plugin


Options: ReplyQuote
Re: Basic adblock
Posted by: Slickone
Date: December 07, 2015 01:36AM

Quote
siria
So your KM-version is just too old, that's why the new macro doesn't show.
The plugin doesn't work so the macro is intentionally hidden too, as James already wrote:

Quote
JamesD
What version of K-Meleon are you using?

There is a version check built into the macro. In line #315 is this statement.
if (($VERSION >= 33685507) and (pluginexist(adblock)) ) {  # K-Meleon 75.1 or greater and adblock plugin
Yeah that was the problem. I did go through the process of installing KM76b2 last week. Not sure how it didn't actually install.

So the control is working now. Thanks guys.

Options: ReplyQuote
Re: Basic adblock
Posted by: rodocop
Date: December 11, 2015 10:56PM

Now I should to present my own vision of this extension assuming it should be comfortable not only for powerful users but also for novices.

First try the file attached - it is packaged with new icons as I see them in action and edited macro (imagefile names and menu items with macroinfos changed).

I'm providing images in ico-format as it can store several sizes of image in one file.
I tried my own png-images but if use 32x32 size - then KM resizes icons not very good. But KM is able to choose right 16x16 icon from my ico file (contains 32, 24 and 16px).

I want to ask some changes to new skinning system from Dorian - related with ico-handling (it's much more easier when KM chooses right size from ico-file according to the value entered in Preferences-GUI Appearance-Toolbar size - without consulting with skin.cfg)

But here I want to request some new stuff (mentioned by siria too) from James - if possible.

This includes the need of GUI-dialog where user would be able add his own subscriptions not digging deep into kmm files and about:config.
Well it may be some 'readfile' which should be prepared by user as txt for example - or 'prompt' dialog. I don't know what is more convenient to you, James.

The second query is simplier: I think we should change some logics of menu items - it's strange when checkmark present means 'disabled'.
We should choose between reversing the pref itself (involves Dorian) or just rename the menu item like i did here in attach.



Edited 3 time(s). Last edit at 06/25/2016 06:28PM by rodocop.

Attachments: adblock controls_newicon.7z (6.3 KB)  
Options: ReplyQuote
Re: Basic adblock
Posted by: rodocop
Date: December 12, 2015 12:00AM

Dorian,

adblock-log shows a number of error entries:
Unknow option elemhide:

I understand that km-adblock cannot hide elements like ABP - it may be worth to autodelete all filters with 'elemhide' string? Or may be convert them for adblock.css?

Options: ReplyQuote
Re: Basic adblock
Posted by: siria
Date: December 12, 2015 12:17AM

Quote
JamesD
Please try this updated version of the adblock macro. Hopefully it addresses the question of what a new user sees the first time he/she installs the adblock plugin.
https://dl.dropboxusercontent.com/u/1522294/Adblockplugin22.7z

Let's say, it's a step into the right direction ;-)
But that timing "at next browser" start isn't quite convincing. Way too late. And if restarting the browser right away, the previous session is deleted and user can't restore it anymore.
I understand you cannot do much about it, it would require a new comand created by Dorian that allows users to say "update NOW". With a choice if they want their updates silently or only after confirmation. Especially in a browser that wants to give users "control" ;-)

PS: the latest change creates an error in the console :cool:

Regarding the toggle function, it is double inside the macro:
"_Adblockplugin_toggle" + "_Adblockplugin_disable"
This one could really use a "statusbar" message after toggling, like the cookie-etc-toggles in the privbar (can be copied from main.kmm)

Am not sure about menu naming, but lean a bit more towards "Disabled" too...
It's probably again that hen-egg thing. User might not be sure "What" is disabled? The Ads? The plugin? "Adblock Disabled"? "No AdBlocking"? "AdBlock Off"? Or perhaps really "Ads allowed", as rodocop prefers...

macroinfo= _("Toogle AdBlock on/off (checked = Ads allowed, AdBlock disabled");

Options: ReplyQuote
Re: Basic adblock
Posted by: JamesD
Date: December 12, 2015 12:24AM

Quote
rodocop
This includes the need of GUI-dialog where user would be able add his own subscriptions not digging deep into kmm files and about:config.
Well it may be some 'readfile' which should be prepared by user as txt for example - or 'prompt' dialog. I don't know what is more convenient to you, James.

The second query is simplier: I think we should change some logics of menu items - it's strange when checkmark present means 'disabled'.
We should choose between reversing the pref itself (involves Dorian) or just rename the menu item like i did here in attach.

I like the icons. I think the new label for 'disable' is OK, too.
Something does not work there, when do that from menu. Icon does not change until a re-touch by mouse.

I am close to having the offline working. One test passed. Several more to try.

Yes, the current subscriptions are hard coded. However they are only read once at the initial use of macro or in case the pref is deleted.

I can try to get something for a add to them, but as you have seen, some lists may not work. I think I would want Dorian's blessing on the idea of users adding unknown lists, before I start that.

Options: ReplyQuote
Re: Basic adblock
Posted by: JamesD
Date: December 12, 2015 02:42PM

I hope that I have the offline situation handled in this version. Could some one please test these two cases.

Case 1.
part 1.
User uses menu ACTIONS > CLEAR THE RULES, sets KM offline and restarts.
part 2.
User set KM online and restarts.

Case 2.
part 1.
User has automatic rules delete on, KM offline and restarts KM at a time past the automatic delete time.
part 2.
After doing part 1, the user changes KM to online and restarts

I hope that I have covered both situations.

Development version 2.4 is here:
https://dl.dropboxusercontent.com/u/1522294/Adblockplugin24.7z

Note that I have not changed icons yet. Just doing one step at a time.

Options: ReplyQuote
Re: Basic adblock
Posted by: Slickone
Date: December 13, 2015 05:57PM

http://www.tvguide.com/listings/
With Basic adblock, the schedule grid here won't appear unless adblock is disabled. This problem didn't happen with ABP. Is there anything that can be done to prevent having to disable adblock every time?

And if not, is there a way to whitelist a page?

Options: ReplyQuote
Re: Basic adblock
Posted by: JamesD
Date: December 13, 2015 10:04PM

Have you added any other item to your subscriptions list? I can see the page just fine.

By grid, I assume that you mean the stuff with "all channels | movies | sports | etc and the time bar and shows below that. I can see all of that.

The grid with the shows does not appear if JavaScript is off, but they post a big notice of that.

Options: ReplyQuote
Pages: 1234Next
Current Page: 1 of 4


K-Meleon forum is powered by Phorum.