Skip to content

Instantly share code, notes, and snippets.

@rynomad
Created April 10, 2023 03:52
Show Gist options
  • Save rynomad/4a0db50c136079f2adfb119fd3104be7 to your computer and use it in GitHub Desktop.
Save rynomad/4a0db50c136079f2adfb119fd3104be7 to your computer and use it in GitHub Desktop.
smiley
// ==UserScript==
// @name Smiley Face Button
// @namespace Violentmonkey Scripts
// @version 1
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Create the smiley face button element
var smileyButton = document.createElement('button');
smileyButton.style.position = 'fixed';
smileyButton.style.top = '10px';
smileyButton.style.right = '10px';
smileyButton.style.fontSize = '60px';
smileyButton.innerHTML = '😀';
// Add a click event listener to the smiley face button
smileyButton.addEventListener('click', function() {
alert('tee-hee');
});
// Append the smiley face button element to the body
document.body.appendChild(smileyButton);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment