Javascript error - Toolbox plugin

Hey guys,
I wrote a script that uses the toolbox plugin @mishav to request access to video and microphone, and I’m getting this error when the access is blocked.
VM1809:15 Uncaught ReferenceError: PERMISSION_DENIED is not defined
at eval (eval at (PLUGIN_Toolbox-update–Expression-.js:1), :15:16)

This is the script :
navigator.getUserMedia (
// constraints
video: true,
audio: true

// successCallback
function(localMediaStream) {

// errorCallback
function(err) {

And the script is not even running first when the page is opened, So I’m not sure why it is evaluating it as a toolbox kind of error.

Please help :slight_smile:

A few solutions to come to mind.

  • check that the browser is not blocking the script for some reason. Chrome blocks certain requests until the page has user interactions. (like media playback and vibrated)

NB im not a JS coder. but i had (have ) a script that does a calculation to check if a point is inside a grid polygon. This script was working perfectly fine for months never changed it or anything. and last nighe i had an error saying a missing ‘]’ bracket. checked like 6 thimes there was no missing bracket. decided to test the exact script on a new test page and it works, no errors (suspect it might be some other pluging i installed probably messing with it.)
Played with the code and my solution that fixed it was to remove all the semi colons. ‘;’
it works now and i dont know why it was giving those weird errors.