How does Facebook disable the browser's integrated Developer Tools?

后端 未结 12 1081
予麋鹿
予麋鹿 2020-11-22 06:12

So apparently because of the recent scams, the developer tools is exploited by people to post spam and even used to \"hack\" accounts. Facebook has blocked the developer too

12条回答
  •  温柔的废话
    2020-11-22 06:52

    I couldn't get it to trigger that on any page. A more robust version of this would do it:

    window.console.log = function(){
        console.error('The developer console is temp...');
        window.console.log = function() {
            return false;
        }
    }
    
    console.log('test');
    

    To style the output: Colors in JavaScript console

    Edit Thinking @joeldixon66 has the right idea: Disable JavaScript execution from console « ::: KSpace :::

提交回复
热议问题