DOMPurify icon indicating copy to clipboard operation
DOMPurify copied to clipboard

Bower issues : DOMPurify is not defined

Open HakumenNC opened this issue 1 year ago • 2 comments

Background & Context

Hi, sorry in advance for my broken english. We had a legacy project based on bower dependencies management. Thanks, this project is available in this.

Bug

When the project started, i have this :

Uncaught ReferenceError: DOMPurify is not defined

On check in bower file bower.json and .bower.json, the main file declared is :

"main": "src/purify.js",

I think the right file to use must be : /dist/purify.min.js After some tests with this dist file, it work like a charm

Input

<html>
    <head>
        <script type="text/javascript" src="./bower_components/dompurify/dist/purify.min.js"></script>
        <script>
            var clean = DOMPurify.sanitize("<p>dirty</p>", { ALLOWED_TAGS: [] });
            console.log(clean)
        </script>
    </head>
</html>

Here a mini use case : bower_and_dompurify.zip

Given output

Output with actual bower files :

Uncaught ReferenceError: DOMPurify is not defined

Expected output

No error

Regards

HakumenNC avatar May 21 '24 04:05 HakumenNC

Heya, oha, thanks for noticing, does the commit linked above fix the issue for you?

cure53 avatar May 23 '24 06:05 cure53

Hello, thanks for the reply 👍🏽

I reproduce this modification, and it works very well

thanks again 🙂

HakumenNC avatar May 23 '24 23:05 HakumenNC

Cool, we say thanks!

cure53 avatar May 27 '24 09:05 cure53

Hi,

Thanks for the new release. Can you make the same fix on 2.X branch or do you prefer i create a new issue for this?

HakumenNC avatar Jun 10 '24 04:06 HakumenNC

Aye, sorry - this is now fixed :smile:

cure53 avatar Jun 10 '24 06:06 cure53