Skip to content

Commit c2871f9

Browse files
committed
see #1121
fix: rolling back recent changes until we have a better solution
1 parent 86e342d commit c2871f9

File tree

9 files changed

+17
-20
lines changed

9 files changed

+17
-20
lines changed

dist/purify.cjs.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.cjs.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.es.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ const getGlobal = function getGlobal() {
253253
* @return The policy created (or null, if Trusted Types
254254
* are not supported or creating the policy failed).
255255
*/
256-
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement, config) {
257-
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function' || config.RETURN_TRUSTED_TYPE === false) {
256+
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
257+
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
258258
return null;
259259
}
260260
// Allow the callers to control the unique policy name
@@ -649,7 +649,7 @@ function createDOMPurify() {
649649
} else {
650650
// Uninitialized policy, attempt to initialize the internal dompurify policy.
651651
if (trustedTypesPolicy === undefined) {
652-
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript, cfg);
652+
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
653653
}
654654
// If creating the internal policy succeeded sign internal variables.
655655
if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {

dist/purify.es.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/purify.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/purify.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,11 @@ const getGlobal = function (): WindowLike {
6262
*/
6363
const _createTrustedTypesPolicy = function (
6464
trustedTypes: TrustedTypePolicyFactory,
65-
purifyHostElement: HTMLScriptElement,
66-
config: Config
65+
purifyHostElement: HTMLScriptElement
6766
) {
6867
if (
6968
typeof trustedTypes !== 'object' ||
70-
typeof trustedTypes.createPolicy !== 'function' ||
71-
config.RETURN_TRUSTED_TYPE === false
69+
typeof trustedTypes.createPolicy !== 'function'
7270
) {
7371
return null;
7472
}
@@ -684,8 +682,7 @@ function createDOMPurify(window: WindowLike = getGlobal()): DOMPurify {
684682
if (trustedTypesPolicy === undefined) {
685683
trustedTypesPolicy = _createTrustedTypesPolicy(
686684
trustedTypes,
687-
currentScript,
688-
cfg
685+
currentScript
689686
);
690687
}
691688

0 commit comments

Comments
 (0)