Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
JamieRI
11 months agoOccasional Contributor
crypto.randomUUID is not a function S @ inject-content-scripts.js:5
FYI: I bumped into an error associated with 1Password Beta extension 8.10.56.22 when I was inspecting a site for an unrelated reason. This is not impacting me, just thought you might like to know. ...
1P_Dave
Moderator
11 months agoHello JamieRI! 👋
I'm sorry that you're seeing an unexpected error message in the console when using 1Password. The error message that you've reported matches a known issue that our developers released a fix for in version 8.10.58 of 1Password in the browser which was released back in January. Please update:
If you still see the issue with the latest version of 1Password then please let me know.
-Dave
!27383
- Arkkis12 days agoNew Contributor
I can still see a similar problem, console says:
inject-content-scripts.js:5 Failed to fetch chrome-extension://aeblfdkhhhdcdjpifhhbdiojplfjncoa/inline/injected.js, Import failed 3 times. Final error: window.crypto.randomUUID is not a functionThis happens because injected.js tries to call window.crypto.randomUUID().slice(0, 8) without first checking if that exists.
It does not exist on localhost environment for example, https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID#:~:text=Secure%20context%3A%20This%20feature%20is%20available%20only%20in%20secure%20contexts%20(HTTPS)%2C%20in%20some%20or%20all%20supporting%20browsers. This makes logging in to a localhost development environment (or any non https page) harder than it should be.
I was able to bypass this problem in chrome manually by following these steps:
- open chrome developer tools, navigate to injected.js from the console error
- enable debugging browser extensions in chrome
- add a breakpoint to the offending line in injected.js
- reload the page to rerun the 1password injection script
- paste the below code snippet to console
- resume script execution
This script uses the same approach you use elsewhere in injected.js to handle the same problem. To me this seems that in January 8.10.58 you fixed this issue for one use of randomUUID, but either the other use was missed or it was added later.
window.crypto = window.crypto || {}; window.crypto.randomUUID = window.crypto.randomUUID || (() => { let t = window.crypto || window.msCrypto, r = () => Math.random() * 16; try { if (t && t.randomUUID) return t.randomUUID().replace(/-/g, ""); if (t && t.getRandomValues) r = () => { let n = new Uint8Array(1); return t.getRandomValues(n), n[0]; }; } catch {} return ("10000000100040008000" + 1e11).replace(/[018]/g, n => (n ^ (r() & 15) >> n / 4).toString(16)); });Please add a check to your code for all the uses if randomUUID() exists and provides an fallback if it does not.
Please also add an automated test that checks your code for any new uses of randomUUID that they're handled properly, so that we do not need to come report this in future.
Thank you, have a nice day!
- voson1 month agoNew Contributor
still error
Chrome 143.0.7499.170(production) (arm64)
1password extension 8.11.22.27
- finwe1 month agoSuper Contributor
Hi Dave,
I am still seeing the error in Firefox 146, 1Password for Windows 8.11.23 (81123001) and extension 8.11.16.35.
- voson1 month agoNew Contributor
me too,
Chrome
143.0.7499.170(production) (arm64)