CryptoJS is not defined on Chrome

chrome web issues's Avatar

chrome web issues

07 Aug, 2018 08:33 PM

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?

  1. Support Staff 1 Posted by Maarten Billemo... on 07 Aug, 2018 10:59 PM

    Maarten Billemont's Avatar

    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. 2 Posted by chrome web iss... on 08 Aug, 2018 07:11 AM

     chrome web issues 's Avatar

    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. 3 Posted by chrome web iss... on 08 Aug, 2018 07:43 AM

     chrome web issues 's Avatar

    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.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • chrome.JPG 31.5 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

19 Oct, 2018 12:34 AM