Skip to content

Instantly share code, notes, and snippets.

@jcwillox
Created August 8, 2021 09:24
Show Gist options
  • Save jcwillox/b790653f57572cf1c23dfd5f3e133c32 to your computer and use it in GitHub Desktop.
Save jcwillox/b790653f57572cf1c23dfd5f3e133c32 to your computer and use it in GitHub Desktop.
Userscript extension to log version and name of the script to the console
function logVersion(primary = "#039BE5", secondary = "white") {
let name = GM_info.script.name.toUpperCase();
let version = GM_info.script.version;
console.info(
`%c ${name} %c ${version} `,
`color: ${secondary}; background: ${primary}; font-weight: 700;`,
`color: ${primary}; background: ${secondary}; font-weight: 700;`
);
}
console.info(
`%c ${GM_info.script.name.toUpperCase()} %c ${GM_info.script.version} `,
`color: white; background: #039BE5; font-weight: 700;`,
`color: #039BE5; background: white; font-weight: 700;`
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment