requestly / requestly/interceptor

[ENGG-1977] MV3: 2KB limit for regexFilter in DNR

Open
#47 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
TypeScript
Stars
87
Forks
23
Avg merge
14h
Merged PRs (30d)
3

Description

When creating host regex rules Unchecked runtime.lastError: Rule with id 1 was skipped as the "regexFilter" value exceeded the 2KB memory limit when compiled. Learn more: https://developer.chrome.com/docs/extensions/reference/api/declarativeNetRequest#regex-rules

Possible Solutions

1. Using URL source conditions instead of HOST source conditions

If you are using HOST - EQUALS | CONTAINS | MATCHES | WILDCARD, then try switching it to URL source condition.

2. Try using Redirect Rule

Almost all the usecases that are supported by replace rule are also supported by Redirect Rule . Try creating a redirect rule instead

Some patterns to convert Replace rule into Redirect rule

Pattern 1

Current Replace Rule
CleanShot 2024-06-27 at 12 51 57@2x

Converted Redirect Rule
CleanShot 2024-06-27 at 12 55 11@2x

Pattern 2

Current Replace Rule
CleanShot 2024-06-27 at 13 36 51@2x

Converted Redirect Rule
CleanShot 2024-06-27 at 13 37 23@2x

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Chrome declarativeNetRequest error with host-based regex rules and review the linked regex-rules documentation. Compare the suggested URL source conditions and redirect-rule approach against the affected replace-rule use cases. Done means supported rules no longer exceed the 2KB compiled regexFilter limit.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.