Open Bug 1540215 Opened 2 years ago Updated 1 year ago

Implement declarativeContent.IgnoreRules action

Categories

(WebExtensions :: General, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: robwu, Assigned: robwu)

References

(Blocks 1 open bug)

Details

The declarativeContent API from Chromium does currently not offer any way to hide page actions, or to exclude actions on certain URLs.
In contrast, the page_action.hide_matches manifest key from bug 1419842 does offer the ability to hide the page action on certain URLs.

I want to ignore page_action.hide_matches and page_action.show_matches when the declarativeContent API is used. For this reason, declarativeContent should at least cover the existing functionality (i.e. offer the ability to show a page action on certain URLs, excluding some others).

Introducing a new rule would solve this problem:

  1. declarativeContent.IgnoreRules (NEW) + hide_matches pattern as condition. High prio.
  2. declarativeContent.ShowPageAction + show_matches pattern as condition. Low prio.

Since rules are processed in the order of priority, the first condition would allow extensions to ignore the ShowPageAction rule on certain pages.
In this simple example, IgnoreRules does not need any arguments. I do however intend to add a way to be more specific about the rules that an extension can ignore, e.g. a field to limit to certain priorities, and/or a field to limit to certain rule IDs.

Relevant external resources:

Priority: -- → P3

Sounds like a good addition to the API. Bump to P2 if it makes sense to add this feature while you are already working with the declarativeContent API (and the scope of this addition doesn't push out other commitments for 68/69).

You need to log in before you can comment on or make changes to this bug.