Skip to content

Commit

Permalink
add: mediamarkt.de (fixes #66)
Browse files Browse the repository at this point in the history
  • Loading branch information
martok committed Dec 7, 2022
1 parent 904f509 commit 35205ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/builtin-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ www.ikea.com
matlab.mathworks.com
std-customElements
! --
assets.mediamarkt.de/mms-*/libs_webmobile-pwa_shared_form_src_components_fields_CityField_tsx-libs_webmobile-pwa_shared_*.js$script
$script-content,mm-regexp
! --
learn.microsoft.com
std-customElements,std-PerformanceObserver,std-ElementReplaceChildren
! --
Expand Down
6 changes: 6 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ function evaluateFix(fix, script, csp, contentReplace) {
contentReplace.push(["if (didCutTheMustardBox)", "if (true)"]);
contentReplace.push(["if (didCutTheMustardSERP)", "if (true)"]);
break;
case "mm-regexp":
contentReplace.push([String.raw`/^(?<fourDigits>[0-9]{4}) *(?<twoLetters>[A-Za-z]{2})$/`,
String.raw`/^([0-9]{4}) *([A-Za-z]{2})$/`,]);
contentReplace.push([String.raw`const{fourDigits:l,twoLetters:a}=t.groups`,
String.raw`const[fourDigits,twoLetters]=t.slice(1)`,]);
break;
case "notion-regexp":
contentReplace.push([`\\p{L}`, pf.Regex_UnicodePropertyLetter]);
break;
Expand Down

0 comments on commit 35205ac

Please sign in to comment.