Skip to content

Exception: This document requires 'TrustedHTML' assignment #199

Closed

Description

@ademenev

Running singlefile 2.0.83 with Chrome 146.0.7680.165 on MacOS

./single-file-aarch64-apple-darwin --browser-headless=false "https://www.youtube.com/watch?v=uJjxz3zjoT4"

singlefile never exits. In the browser's console, the following error is logged:

This document requires 'TrustedHTML' assignment. The action has been blocked.

It can be traced to this call:

let a = new Vk().parseFromString(e, "text/html");

and earlier there is

Vk = globalThis.DOMParser

Activity

  1. gildas-lormeau commented on Aug 25, 2026

    @gildas-lormeau
    Owner

    This is fixed by dda6045 and c4dfefb and will be included in the next release. The problem was that youtube.com enforces Trusted Types via the require-trusted-types-for 'script' CSP directive, which also applies to the isolated worlds created via the DevTools protocol, unlike the isolated worlds of browser extensions. The CLI now clears the CSP of the isolated world where SingleFile runs, like browser extensions do. This requires a browser based on Chromium 151 or newer. With older browsers, you can use the new --browser-bypass-CSP option to bypass the CSP of the page instead. Thank you for the detailed report!

  2. added a commit that references this issue on Aug 25, 2026
    dda6045
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions