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.

  4. 4 Posted by Giuseppe on 15 Jan, 2021 10:27 AM

    Giuseppe's Avatar

    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

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

09 Oct, 2023 03:28 PM
09 Oct, 2023 02:56 PM
22 Jun, 2022 11:22 AM
02 Feb, 2022 02:22 PM
25 Jan, 2022 11:25 PM

 

31 Dec, 2021 11:42 AM
22 Dec, 2021 06:41 PM
04 Nov, 2021 01:24 AM
30 Oct, 2021 08:29 PM
21 Oct, 2021 08:44 AM
14 Sep, 2021 08:02 AM