Commit c8bb939e authored by Paul Clark's avatar Paul Clark Committed by Florian Bruhin
Browse files

Support regex format include rules in user scripts


For user scripts with `@include` and `@exclude` directives in their
headers, if the value starts and ends with `/` then assume it is a
regular expression to be matched against a URL. This feature has been in
the original greasemonkey module since 2011 and currently in webengine
regex include rules are being blindly passed to the glob matcher.

An alternative to this approach of leaving the bracketing slashes on the
values as a kind of in-band signalling (and making the glob escaping
conditional) would be to add new members to the UserScriptData struct for
holding regex patterns.

This commit also applies cleanly to v5.8 and every release after it.

[ChangeLog][][UserScript] User script metadata parsing now supports regular
expressions in @include and @exclude rules.

Task-number: QTBUG-65484
Change-Id: Ie2e483419f6784f995131ffb7d2d5e91c2c55b1d
Reviewed-by: default avatarJüri Valdmann <juri.valdmann@qt.io>
Reviewed-by: default avatarSzabolcs David <davidsz@inf.u-szeged.hu>
Reviewed-by: default avatarFlorian Bruhin <qt-project.org@the-compiler.org>
Reviewed-by: default avatarAllan Sandfeld Jensen <allan.jensen@qt.io>
parent a7f37f48
Showing with 52 additions and 9 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment