DRM Policy: Add a DRM policy manager - #9563
Merged
Merged
Conversation
0nko
force-pushed
the
feature/ondrej/drm-policy-manager
branch
from
August 20, 2026 23:12
c775152 to
bd4af10
Compare
0nko
force-pushed
the
feature/ondrej/drm-policy-manager
branch
from
August 20, 2026 23:15
bd4af10 to
c775152
Compare
0nko
force-pushed
the
feature/ondrej/drm-policy-manager
branch
from
August 21, 2026 12:50
cd1ff8b to
afb17d1
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit afb17d1. Configure here.
anikiki
approved these changes
Aug 21, 2026
anikiki
left a comment
Contributor
There was a problem hiding this comment.
Looks good and works a expected! 🎉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Task/Issue URL: https://app.asana.com/1/137249556945/project/1207418217763355/task/1217678542848172?focus=true
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/project/1207418217763355/task/1217623990825512
Description
This PR integrates the
emeprivacy config allow list and implements a central DRM policy manager.Steps to test this PR
Setup
https://gist.githubusercontent.com/0nko/6ba6564e43ec35095a08c0e2288bbdde/raw/3eb9c38d461e73739ebc0d84f7c352cb9d7082d1/privacyconfig.json("foxnews.com" inemeand "reference.dashif.org" inemeBlock)adb logcat | grep "drm policy decision"in a terminal and keep it open — every case below is verified by its log line, not by the absence of a dialogstatic.foxnews.com, notfoxnews.com)No rule matches (stock config, custom config URL OFF)
https://reference.dashif.org/dash.js/latest/samples/drm/widevine.htmlaction=PROMPT, reason=NO_RULESession choice (stock config)
https://reference.dashif.org/dash.js/latest/samples/drm/widevine.htmlaction=DENY, reason=SESSIONreason=NO_RULE)Remembered choice (stock config)
https://reference.dashif.org/dash.js/latest/samples/drm/widevine.htmlaction=DENY, reason=USER_DENY_ALWAYSaction=GRANT, reason=USER_ALLOW_ALWAYSGlobal DRM setting (stock config)
action=DENY, reason=GLOBAL_OFFAllow list (switch to the test config now)
https://www.foxnews.comand open an article with a videoaction=GRANT, reason=ALLOW_LISTstatic.foxnews.com— a subdomain matching thefoxnews.comentryBlock list (test config now)
https://reference.dashif.org/dash.js/latest/samples/drm/widevine.htmlaction=DENY, reason=BLOCK_LISTProtections off overrides the block list (test config)
action=GRANT, reason=PROTECTIONS_OFFand that the video playsUser choice beats the config lists (test config)
https://reference.dashif.org/dash.js/latest/samples/drm/widevine.htmlaction=GRANT, reason=USER_ALLOW_ALWAYS— the block-list entry is overriddenAllow list in Fire mode (test config)
https://www.foxnews.comand open an article with a videoaction=GRANT, reason=ALLOW_LISTstatic.foxnews.com— a subdomain matching thefoxnews.comentryFlag off (test config)
centralPolicyflag in the Settingshttps://www.foxnews.comand open an article with a videodrm policy decisionlines appear at alldevelop, and that a session deny still holds for that tabNote
Medium Risk
Changes how DRM (EME) is granted or denied, including auto-grant and auto-deny paths. Rollout is gated by an INTERNAL
drmPolicy/centralPolicyflag with a legacy fallback.Overview
Introduces a central DRM policy (behind
drmPolicy/centralPolicy) that is the single GRANT / DENY / PROMPT decision for EME requests. First match wins: global off, remembered site setting, per-tab session, block list, protections-off, then theemeallow list; otherwise prompt.When the flag is on,
SitePermissionsManagerImplapplies that decision instead of the old ask/grant path, and the DRM dialog no longer re-checks session or the block list. Session choices move to a tab-scopedDrmSessionStore(cleared with fireproof wipe). Flag-off keeps the previous app-wide session map and exact-host matching.Allow and block lists now match subdomains (
sameOrSubdomain). User settings and “protections off” also walk parent hosts so a choice on the page host still applies to a subresource origin.emedefaults to disabled when the privacy-config toggle is unset, so leftover exceptions cannot keep granting DRM after the feature is dropped from config.Reviewed by Cursor Bugbot for commit daaa1fc. Bugbot is set up for automated code reviews on this repo. Configure here.