0

I am struggling to get the zxcvbn library to work while developing a chrome web extension. I am new to js and my current goal is to output the strength of the password entered into the password field of a website.

I have tried implementing the library on my own local web page and it works fine, however without an html page, I am not sure where to add:

<script type="text/javascript" src="D:\webpagezxcvbn\node_modules\zxcvbn\dist\zxcvbn.js"></script>

or the equivalent.

I have also tried using jsdelivr but this is also using html and I don't know how to get this to run so that within my js file, the library is recognised?

  • Put the file in the same directory as your other scripts in the extension and remove the path in html so it looks like `src="zxcvbn.js"` – wOxxOm Mar 31 '23 at 16:48
  • @wOxxOm My issue was that I don't have an HTML file so still not sure how this would work? I've managed to get the extension to work now by using const zxcvbn = require('zxcvbn'); and using webpack but don't think this is recommended for this library. – Megan Stone Mar 31 '23 at 17:21

0 Answers0