Skip to content

Instantly share code, notes, and snippets.

@louismoura
louismoura / append-css-link-or-rule.js
Created July 18, 2024 16:36 — forked from chrisyip/append-css-link-or-rule.js
Dynamically add CSS link or rule to DOM w/ pure JavaScript
@louismoura
louismoura / Copy-Paste Multiple Texts.js
Created July 3, 2024 11:57 — forked from BigSalmon2/Copy-Paste Multiple Texts.js
Copy Multiple Text on a Page at Once
// ==UserScript==
// @name Copy Concatenator with Enable and Clear Buttons
// @namespace your-namespace
// @version 1
// @description Concatenates copied text and adds enable/disable and clear buttons to the page
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
@louismoura
louismoura / copy-to-clipboard-bookmarklet.md
Created July 3, 2024 11:38 — forked from stefanmaric/copy-to-clipboard-bookmarklet.md
Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard

Copy-to-clipboard Bookmarklet

Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.

This is the base javascript:

(function (text) {
  var node = document.createElement('textarea')
  var selection = document.getSelection()
@louismoura
louismoura / gist:71c4991bf76ebe6e010a5bae920b15ca
Created April 25, 2021 14:24 — forked from agibsonsw/gist:409e59d0dcef906dbc41
Bookmarklet to display element stats on mouse over and click
javascript:
(function(){
var d=document,useMine=true,prevEl,info;
function addHandler(orig,mine){
return function(e){
if(useMine){
mine(e);
}
else
if(orig){
@louismoura
louismoura / gist:f039e35e5d727cb98adbb94578ff75b6
Created April 25, 2021 14:20 — forked from agibsonsw/gist:a993c14ee172dfeb4d96
Bookmarklet to highlight selected word
javascript: (function() {
var els, i, txt = "";
if (window.getSelection) {
txt = window.getSelection();
} else if (document.getSelection) {
txt = document.getSelection();
} else if (document.selection) {
txt = document.selection.createRange().text;
} else {
txt = "";
@louismoura
louismoura / gist:1a200c09340810272d9e9f306eb2a35f
Created April 25, 2021 14:18 — forked from agibsonsw/gist:5a4702c0b697c6f4bb66
Bookmarklet to add a comment box at selection
javascript: (function() {
var d = document;
var wrap = d.createElement('span');
wrap.style.position = 'relative';
wrap.className = 'wrap';
var cmt = d.createElement('textarea');
cmt.style.backgroundColor = 'yellow';
cmt.style.top = '1.5em';
cmt.style.position = 'absolute';
cmt.style.zIndex = '99';
@louismoura
louismoura / gist:464867ab6b2e0d216ccf249c4d9970d3
Created April 25, 2021 13:18 — forked from lyons/gist:b8226240a599470b8add
~☆❉Fancy Text❉☆~ Bookmarklets
/* Handy bookmarklets to add excitement to ~✦☀selected text☀✦~
Any site you might actually want to use these on probably breaks them
with their own weird javascript.
*/
// Light sparkles bookmarklet
javascript:(function(){
function randomElement(array) {
return array[Math.floor(Math.random() * array.length)];
}
@louismoura
louismoura / copy-element-text-bookmarklet.js
Created April 25, 2021 13:11 — forked from foobear/copy-element-text-bookmarklet.js
JavaScript bookmarklet to click an element and copy its text contents. See https://makandracards.com/makandra/46962
(function() {
var overlay = document.createElement('div');
Object.assign(overlay.style, {
position: 'fixed',
top: 0,
left: 0,
width: '100vw',
height: '100vh',
zIndex: 99999999,
background: 'transparent',
@louismoura
louismoura / chrome-autoscroll-bookmarklet.js
Created April 12, 2021 02:54 — forked from RayBB/chrome-autoscroll-bookmarklet.js
Auto Scroll Bookmarklet (for Chrome)
javascript:(function(window, document) {
var isScrolling, scrollTimeout;
var defaultScrollSpeed = 50;
var scrollSpeed = 50;
var adjustIncrement = 2;
var jumpIncrement = 50;
function start() {
window.addEventListener('keydown', keyPressed);
window.addEventListener('keyup', keyReleased, false);