1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-23 02:32:10 +02:00
Commit Graph

42 Commits

Author SHA1 Message Date
David Rosca
e8cddd16ea AdBlock: Add support for exception css rules
Closes #1446
2014-09-16 09:39:25 +02:00
David Rosca
ed866dc9a4 AdBlock: Add support for parsing CSS Element hiding exceptions
Those rules are however not supported at the moment.
2014-09-16 00:37:13 +02:00
David Rosca
eb8ae20cc1 [AdBlockRule] Improve performance of rule matching with QStringMatcher
Use QStringMatcher instead of QString::contains in RegExpFilters.
QStringMatcher internally uses fast Boyer-Moore algorithm.
2014-04-13 11:49:39 +02:00
nowrep
463fa96e04 [Build] Fixed building with Qt5 2014-04-06 13:50:09 +02:00
nowrep
db664184d0 [AdBlock] Improved performance of loading rules
Don't use regexps for parsing rules.
Added benchmark for loading subscriptions

Before:

********* Start testing of AdBlockParseRule *********
Config: Using QTest library 4.8.6, Qt 4.8.6
PASS   : AdBlockParseRule::initTestCase()
RESULT : AdBlockParseRule::parseEasyList():
     596.3 msecs per iteration (total: 2,982, iterations: 5)
PASS   : AdBlockParseRule::parseEasyList()
PASS   : AdBlockParseRule::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of AdBlockParseRule *********

After:

********* Start testing of AdBlockParseRule *********
Config: Using QTest library 4.8.6, Qt 4.8.6
PASS   : AdBlockParseRule::initTestCase()
RESULT : AdBlockParseRule::parseEasyList():
     481.8 msecs per iteration (total: 2,409, iterations: 5)
PASS   : AdBlockParseRule::parseEasyList()
PASS   : AdBlockParseRule::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of AdBlockParseRule *********
2014-04-06 13:36:42 +02:00
nowrep
6874df57d7 [Coding Style] Edited coding style (use linux style brackets)
Linux style brackets are now used also for source files.
One line blocks can now be without brackets.

Example:

if (test)
    foo();

Multi-line if statements are now written with conditionals (||, &&, ...)
at the end of line. The last line of if body does not ends with closing
bracket, instead the closing bracket is written on separate line.
One line blocks in multi-line if statements should not be without brackets.

Example:

if (test ||
    test2 &&
    test3
   ) {
    foo();
}

[ci skip]
2014-04-05 14:53:45 +02:00
nowrep
fe0b03fdb7 Include QDebug in qzcommon.h
It's annoying to always include it just to remove a moment after...
2014-03-16 13:22:41 +01:00
nowrep
493edfc655 [AdBlockRule] Save some memory with dynamic allocation and removing member variables
m_regExpStrings are now also dynamically allocated only for RegExp rules
m_cssSelector is now merged with m_matchString (m_matchString was empty
for Css Rules)
2014-03-12 13:25:12 +01:00
Jonathan Hooverman
d917f43cf0 Updated copyright year to 2014 2014-01-11 16:11:42 +01:00
nowrep
da15e5868d [CodingStyle] Don't use references when assigning to local variable
Let the compiler do the optimization
2013-12-30 13:43:48 +01:00
nowrep
5fbf11c8f2 AdBlock: Fix issue when enabling rule didn't work until restart.
When attempting to enable rule that was already disabled on startup,
it won't have an effect until completely restarting the browser.
2013-11-04 16:06:07 +01:00
nowrep
4a85e59778 AdBlockRule: Add new rule type Invalid for invalid rules 2013-11-02 17:41:51 +01:00
nowrep
1b617068b2 [AdBlock] Fixed hiding rules when more than 5000 rules in subscription.
Closes #873
2013-05-02 21:01:17 +02:00
nowrep
5f5cf7417d [Code] Updated coding style with patched Astyle + normalized signals.
Code was formatted with patched astyle that correctly formats
foreach macro.
Normalize tool is now used to normalize all signal/slots signatures
to normalized format. It saves few reallocations on connections.
2013-03-06 09:08:29 +01:00
nowrep
9d6e34e3e5 [Code] Rewritten AdBlockRule to use enums for rule options.
Instead of using boolean variables for every option, use one QFlag
for options and second for exceptions.
2013-02-27 21:26:41 +01:00
nowrep
7e6d619516 AdBlock: Greatly improves performance of regexp rules.
Regexp will be parsed into parts that can be used with
QString::contains for quick match. If url contains all parts,
real QRegExp matching is applied.

This speedup affects rules that are internally converted into
regexp, not AdBlock's regexp rules (but those rules are very rarely used
in subscriptions, so there's no need to optimise them)
2013-02-26 15:48:47 +01:00
nowrep
9f226b9738 Significant memory savings in AdBlock (~ 30MB with just EasyList)
Even empty QRegExp can occupy a lot of space in memory, which can
grow into a big number with tens of thousands AdBlock rules.
QRegExp is now allocated with new, and only when really needed.
2013-02-26 10:45:33 +01:00
nowrep
bed43ed0c8 [Qt5] Use RegExp wrapper to take advantage of new regexp engine.
QzRegExp wrapper is using QRegExp directly on Qt 4 and
QRegularExpression (with PCRE engine) on Qt 5.
2013-02-24 10:57:58 +01:00
nowrep
e4ebeb3252 [Code] Use QString::SkipEmptyParts in QString::split. 2013-02-15 12:36:25 +01:00
nowrep
3b301e8446 [adblock] Added support for $image rules.
It tests whether the url ends with .jpg/.jpeg/.gif/.png
2013-02-07 11:04:09 +01:00
nowrep
9f2de4b73a [Code] Made all helper functions static. 2013-01-22 18:12:21 +01:00
nowrep
cadfd63b1e Fixed rendering pages with Qt 5
Filtering "\" from AdBlock CSS rules.
2012-12-20 22:57:58 +01:00
nowrep
528f398cbe Using QLatin1String and QLatin1Char now everywhere
- it saves few unnecessary allocations
2012-09-04 12:42:45 +02:00
nowrep
40a335bc1f AdBlock: Improved string performance when parsing rules
- using QLatin1String and QLatin1Char
2012-09-04 11:24:41 +02:00
nowrep
b2181f0bab Coding style: Use empty QString() constructor instead of "" everywhere 2012-09-02 11:42:41 +02:00
nowrep
b442492c27 Fixed small bug with domain matching
- accounts.youtube.com won't be matched by s.youtube.com anymore
- fixes ||s.youtube.com^ AdBlock rule matching anything from
  https://accounts.youtube.com
2012-09-01 11:41:12 +02:00
nowrep
06c5118e6f AdBlock: New options in AdBlock menu to disable it for domain
- and also "only for this page"
2012-08-09 19:02:25 +02:00
nowrep
435ab60e79 AdBlock: Fixed $subdocument matching.
- also improved a little blocked element's placoholders hiding
2012-07-13 14:12:48 +02:00
nowrep
14e0040a9f AdBlock: Fixed $third-party option when Referer header is empty
- should fix a lot of false positives with $third-party rules

see #444
2012-07-13 11:04:14 +02:00
nowrep
d8e0556d3e AdBlock: Changes to element blocking rules are now instant.
- instead of need to reload settings / restart browser
2012-07-04 17:53:49 +02:00
nowrep
2dc0785aff AdBlock: Support for $elemhide and $document exception rules
- with @@||qupzilla.com^$document you can completely disable
  AdBlock from running on qupzilla.com site
2012-07-04 16:00:53 +02:00
nowrep
138ffdfe93 AdBlock: Better and faster hiding placeholders of blocked elements
- also Ctrl+C in AdBlock tree now copies url filter into clipboard
2012-07-04 10:08:55 +02:00
nowrep
608135ac95 AdBlock: Using QString::endsWith in domain matching
- instead of QString::contains
2012-07-02 09:58:56 +02:00
nowrep
c73c9820e4 AdBlock: Fixed domain match rules ||domain.com^
- it should also match something.domain.com
2012-07-02 01:40:32 +02:00
nowrep
699f309ffd AdBlock: Disabling rules now persist through subscription updates 2012-07-01 20:11:37 +02:00
nowrep
a37b29b275 Using QString::left instead of QString::mid(0, ) 2012-07-01 18:11:43 +02:00
nowrep
1b000812b9 AdBlock: Improved performance in 2 types of rules
- ||domain.com^ and anything| rules are now using string matching
- edited updating EasyList to download more rules
   * only 50 rules are slow now (use regexp) in EasyList
2012-07-01 14:44:01 +02:00
nowrep
6228082225 AdBlock: Support for $object $subdocument and $xmlhttprequest options
- also there's now support for blocking all netscape plugins,
  not just flash plugin
2012-07-01 12:07:00 +02:00
nowrep
c6ccd6bd1f AdBlock: Added full support for $third-party option
- checking Referer of network request to determine
  if it is third party request or not
   * matching is performed on second-level domains
     (there is minor issue with it in Qt < 4.8)
2012-06-28 01:41:01 +02:00
nowrep
847469e0be AdBlock: Support for element hiding rules & improved performance
- improved performance with not using regexps when not necessary
- added support for element hiding even with domain restrictions
- almost all types of rules are supported now
   * exceptions are only some special cases when rule has
     unssuported options (part of rule after $ character)
   * those rules are ignored
2012-06-25 16:07:25 +02:00
nowrep
a0b9c0fc69 Fixed building on Windows + whole compilation is now faster. 2012-02-29 18:33:50 +01:00
nowrep
9c789792f4 Rearranged directory structure. All sources are under src/ dir now.
- updated Italian homepage translation
2012-02-23 19:18:08 +01:00