Skip to content

Instantly share code, notes, and snippets.

@MohannadNaj
Created January 28, 2020 18:08
Show Gist options
  • Save MohannadNaj/035122e1cd1a1fe2d9040f3a3e0f1212 to your computer and use it in GitHub Desktop.
Save MohannadNaj/035122e1cd1a1fe2d9040f3a3e0f1212 to your computer and use it in GitHub Desktop.
User Script: Clear console by calling 'cls'

Using Tampermonkey extension:

// ==UserScript==
// @name         cls
// @version      0.1
// @description  Clear console by calling 'cls'
// @author       MohannadNaj
// @match        *://*/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    Object.defineProperty(window, 'cls', {get () { console.clear() }});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment