Is there a code to disable the console for non-editors?

So, when I was messing around with keyvalues I realized they could be changed, so I’m just wondering that is there a code that basically disables the console.log for non-editors.

In App Lab, the Debug Console is automatically disabled for everyone but the owner.

In Game Lab, you’ll need to have the page hang indefinitely in order to keep people from messing with the keyvalues. This can be achieved by checking the URL:

if (window.getURLPath()[3] == "view") {
  while (true) {
    prompt("No.");
  }
}
1 Like

Oh yeah, I forgot to ask this hours earlier, can you be protected from data browsers, if so send me how to do it.

Add __proto__ to the first column that the browser opens. It works with App Lab.

What do you mean by that? Also does it work on gamelab?

In App Lab, go to the Data tab, select the first table that comes automatically, and add __proto__ as a column. Make sure at least one record is present.

It is possible on Game Lab, but it’s super risky and may end up bricking your project if you’re not careful, so I’m not going to share it.

Saw this just now - this isn’t foolproof, as someone can make a breakpoint at the start of the code and set the function to return a different string.

Funny though how gamelab allows others to use the console, pretty annoying.

For whatever reason, libraries ignore breakpoints and run anyway.

So, should I use a library or not?

Wait, aren’t debug commands blocked if the url has /view in it?

The console used to be unlocked for both modes, which allowed people to simply run commands in the console in App Lab. It’s locked for non-owners in App Lab, but there’s a way around it. There always is when it comes to code.org.

If you don’t want people running the code in view mode, then yes, use a library.