简体   繁体   中英

Using functions from my website in chrome console or firefox console?

I have a webpage up and running that has two js files with a bunch of functions. My HTML code loads these scripts as modules on startup. Problem is that i have a function called "showAdminTools()" and im afraid that this functions perhaps can be accessed through the chrome dev tools by non admins?

If the user isn't an admin, then don't send anything to their browser which should only be available to admins.

If the script is sensitive, then put it behind Authn/Authz and don't include it in a <script> if the user isn't an admin.

Yes everyone can access them with the console.

Actually im stupid, i already have server side code that prevents requests from client unless the user already is admin, so it does not matter if they can go into admin tools or not, any request from the admin tools page will be denied by server...

SORRY FOR WASTING TIME

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM