Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8732947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:32:30+00:00 2026-06-13T09:32:30+00:00

As per the question title. Although not required; I would like to stop people

  • 0

As per the question title.

Although not required; I would like to stop people from executing functions on my page via the console… Is this even possible?

I’ve tried a few things, this is the closest I’ve come – but this doesn’t work 🙁

    window.onresize = function(){
        if((window.outerHeight - window.innerHeight) > 100) {
            //stop commands here?
        }
    }
    window.onload = function() {
        if (typeof console !== "undefined" || typeof console.log !== "undefined") {
            if (window.console && (window.console.firebug || window.console.exception)) {
                    //stop commands here?
            }
        }
    }

EDIT:
I don’t have to disable the console, just function calls made within it – either solution would be fine though 😉

EDIT2:
So, to get this right… There is now no way of detecting the console crossbrowser at all?

EDIT3:
I’ve sort of got around it by doing the following, although the JS functions are still in place – the elements that they relate to are not… Not a great fix, but I guess it’ll do… 🙁

        setInterval(function() {
            if (!$.browser.mozilla) {
                if((window.outerHeight - window.innerHeight) > 100) {
                    alert("DISABLED!");
                    $('body').remove();
                    return false;
                }
            }
            if (window.console && (window.console.firebug || window.console.exception)) {
                alert("DISABLED!");
                $('body').remove();
                return false;
            }
        }, 750);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:32:31+00:00Added an answer on June 13, 2026 at 9:32 am

    It is not good to try detecting console via window width. This may cause some issues on other Browsers, too. If you just want protect your functions:

    As you have e.g a button:

    <button onclick="someFunction()"></button>
    

    The someFunction is of course accessable via the console. But if you do not let the user know about your function name, he can not call the function, can he?
    See here:

    <script type="text/javascript">
    //obsfuscate this code
    $(function() {
    $("#theButton").on("click", someFunction);
    })
    </script>
    <button id="theButton"></button>
    

    This is just a possible solution. But rembember, no javascript solution can be 100% secure, because the User knows all of your code, obsfuscated or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is not a programming question per se, although the ultimate goal is to
I would like to start a community discussion. As per my question, when do
The title pretty much explains my question. I would like to be able to
As per the title I have three parts to this question... Is db4o object
I am having the same issues as per this question: WCF not deserializing JSON
Per a great answer from another question I have begun mounting global resources (css/js/images)
As per the title of the question, I’m wondering if there’s any mechanism to
I started with this question: Multiple Javascript gadgets per page . After reading up
Question as per the title really. I'm looking for a way to step through
I have two questions per div (page) that look like this: <div id=page5 class=page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.