Bug 1931288 - Implement HostGetCodeForEval() hook as per the HTML spec. r=smaug,dom-core,peterv

See https://html.spec.whatwg.org/multipage/webappapis.html#hostgetcodeforeval(argument)

Differential Revision: https://phabricator.services.mozilla.com/D229478
This commit is contained in:
Frédéric Wang
2024-12-13 08:54:52 +00:00
parent 634f8a4954
commit 0f0df595a9
13 changed files with 28 additions and 55 deletions

View File

@@ -67,6 +67,7 @@
#include "mozilla/ExtensionPolicyService.h"
#include "mozilla/ResultExtensions.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/dom/TrustedTypeUtils.h"
#include "mozilla/dom/WorkerCommon.h"
#include "mozilla/dom/WorkerPrivate.h"
#include "nsContentUtils.h"
@@ -1564,7 +1565,7 @@ void nsScriptSecurityManager::InitJSCallbacks(JSContext* aCx) {
static const JSSecurityCallbacks securityCallbacks = {
ContentSecurityPolicyPermitsJSAction,
nullptr, // codeForEvalGets
TrustedTypeUtils::HostGetCodeForEval,
JSPrincipalsSubsume,
};