CryptoJS is not defined on Chrome
I'm running into an unusual error when I try to move the master password web files to a live web server. I always get this error in Chrome:
Uncaught ReferenceError: CryptoJS is not defined
at pbkdf2.js:117
at scrypt.js?1:127
at Function.calculateKey (mpw.js?1:76)
at new MPW (mpw.js?1:19)
at updateMPW (main.js?3:6)
This is true using both the most current version of the MPW javascript code ( from https://github.com/tmthrgd/mpw-js), and using exact copies of the javascript saved from the live site (https://js.masterpassword.app/). I do not get this error on any other browser (firefox and safari on iOS).
Interestingly I don't get it in chrome either if I go to the local index.html on my computer. Is there some setting I am forgetting to enable on the web server?
- chrome.JPG 31.5 KB
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Maarten Billemo... on 07 Aug, 2018 10:59 PM
Seems to work just fine when I try it out in Chrome. What are your browser specifics?
Mine are:
Version 67.0.3396.99 (Official Build) (64-bit)
System:
macOS 10.13.6 (17G65)
2 Posted by chrome web iss... on 08 Aug, 2018 07:11 AM
Mine is Version 68.0.3440.84 (Official Build) (64-bit)
System is Windows 10.
Interestingly this only happens on a live web server. I can go to the files hosted locally in a random directory and it will work fine.
3 Posted by chrome web iss... on 08 Aug, 2018 07:43 AM
I think I figured out the problem.
It was the fact that the attached block was commented out, and my site does not have https so chrome makes window.crypto.subtle undefined (while the CryptoJS stuff isn't being imported). I uncommented the section and it didn't work in my case because the javascript code was being taken from the browser cache. I ended up moving the commented section to a script tag on the main index.html page to solve the issue. I'm pretty sure adding a randomized parameter to the script import calls using PHP would force the browser to always pull fresh javascript from the server.
4 Posted by Giuseppe on 15 Jan, 2021 10:27 AM
Hello together,
I have installed the source code from Masterpassword on my debian distribution where it is on apache2 installed. I have the same issue. I need a solution.
Kind regards
Giusepp