Falkon Adblock popup blocking

In the Qt5 it was not easily possible to block the new (popup) window request because the function “createWindow” which handles the window creation did not provide the required information (destination URL). It was not imposibble but not straightforward either, so it was not implemented. It Qt6.2 there is a new signel “newWindowRequested” which provides the destination url and also if the request was initiated by human or not. This is ideal for selective blocking of the window creation, eg. popup blocking in AdBlock.

Falkon part

To implement this in AdBlock (which is an extension), I first modified the main Falkon code to move from the “createWindow” implementation to “newWindowRequested”. I used this chance to add an option to preferences to “Block automatic popups” which are all popups not originating from human interaction (or so I hope).

Next I went and implemented similar (more like same) plugin interface which is used for “acceptNavigationalRequest” function and which is also available for plugins. Having an example is awesome. Also Falkon has multiple APIs for extensions. The C++ is straghtforward normal code, Python I hope will catch it all as well (I truly just hope) and Qml needs special attention since it is manualy made API contrary to Python support which is mostly automatically generated (even when it produces a lot of warnings).

The results can be seen in the merge request 120.

AdBlock part

The AdBlock part of the implementation is relatively simple. I tried to reuse the original code for network interceptor, since it looks and behave the same way and done. Well, it was simple after the needed API was introduced. The implementation passes both Popup and Popup Exception testpages.

The results can be seen in the merge request 121.

Conclusion

As the popups are the most annoying part of advertisements and very important part of adblockers it is great that it is now possible to block them in Falkon as well.

This continues my lurking around Falkon AdBlock code. The number of supported features is slowly increasing (but it gets me a good headache while working on it).

I also updated the Falkon ABP Test Page results.

Articles from blogs I follow:

Why is your open source project still hosted on GitHub?

Perhaps the younger generation don't know anything about the past "evils" of Microsoft and naively believe that Microsoft is now the good friend to open source, but the truth is that all Microsoft acquisitions of open source projects is a busi…

via unixdigest.com May 22, 2025

StarFive VisionFive v2 and FreeBSD

This week I powered up the StarFive VisionFive v2 board that I have. I figured I would give FreeBSD another whirl on it, in the vague hope that RISC-V boards are a more cohesive family than ARM boards were five years ago. tl;dr: I didn’t get it to work as…

via [bobulate] May 20, 2025

Steve Ballmer was an underrated CEO

There's a common narrative that Microsoft was moribund under Steve Ballmer and then later saved by the miraculous leadership of Satya Nadella. This is the dominant narrative in every online discussion about the topic I've seen and it's a commo…

via danluu.com October 28, 2024

Generated by openring