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.