0

I want to make a Chrome extension that initially blocks the access to a specific website (e.g. example.com), and then, based on some conditions, it allows the user to access it.

As a starting point, I have used the source code from Github that blocks the access to the above mentioned domain name. However, I have read the official documentation from here, but I have not found any specifications concerning how to modify the RuleActionType of a static rule. There is mentioned just how to enable/disable rules, not how to modify there parameters.

Any help is appreciated. Many thanks in advance!

  • You add a new rule for this url with a bigger `priority` and type: allow. – wOxxOm Aug 29 '23 at 03:42
  • Hi, @wOxxOm! Based on some additional conditions in the onRuleMatchedDebug method, I would like to further block, or allow the request to the URL. I would like something like "return {cancel: true};" as I would do in the onBeforeRequest method in manifest v2. But, I do not know how to do the same for onRuleMatchedDebug in chrome.declarativeNetRequest. – rstoleriu Aug 29 '23 at 20:31
  • There's no such thing. It's rule-based so you need to add a rule for each condition. – wOxxOm Aug 30 '23 at 00:43

0 Answers0