Skip to content

Instantly share code, notes, and snippets.

View SouzaRM's full-sized avatar

Rogerio M. Souza SouzaRM

View GitHub Profile
@danharper
danharper / background.js
Last active February 13, 2026 12:47
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
@JT5D
JT5D / xpath.js
Created February 25, 2014 19:31 — forked from antimatter15/xpath.js
javascript:(function(){
//inspired by http://userscripts.org/scripts/show/8924
var s = document.createElement('script');
s.setAttribute('src','http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js');
if(typeof jQuery=='undefined') document.getElementsByTagName('head')[0].appendChild(s);
(function() {
if(typeof jQuery=='undefined') setTimeout(arguments.callee, 100)
else{
jQuery("*").one("click",function(event){
//http://snippets.dzone.com/posts/show/4349
@1995eaton
1995eaton / background.js
Created July 30, 2014 21:22
A simple Chrome extension that opens random links
// A background script is needed in order to store
// persistent objects in memory. Content scripts
// run a seperate instance for each open tab in Chrome.
var nextLink = (function(linkArray) {
// Initialize a copy of the original links
var currentSet = linkArray.slice();
return function() {
@ejoubaud
ejoubaud / simulate_keypress.js
Last active April 9, 2024 18:38
Simulate keypress that works in Google nav in Chrome
// Based on http://stackoverflow.com/a/10520017/1307721 and http://stackoverflow.com/a/16022728/1307721
Podium = {};
Podium.keydown = function(k) {
var oEvent = document.createEvent('KeyboardEvent');
// Chromium Hack
Object.defineProperty(oEvent, 'keyCode', {
get : function() {
Generated: Wed, 28 Jan 2015 05:59:39 GMT
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.16 Safari/537.36
Extensions: 53
- Context v0.412: https://chrome.google.com/webstore/detail/aalnjolghjkkogicompabhhbbkljnlka
Sort extensions into groups and easily switch between them.
- 1Password: Password Manager and Secure Wallet v4.2.5.90: https://chrome.google.com/webstore/detail/aomjjhallfgjeglblehebfpbcfeobpgk
1Password extension for Google Chrome.
- Anything to QRcode v1.0.5: https://chrome.google.com/webstore/detail/calkaljlpglgogjfcidhlmmlgjnpmnmf
Anything to QRcode ( absolute locally and offline, no ads ) : the url of current page, any text/image/link in the page, etc.
@wunki
wunki / config
Last active June 28, 2018 08:06
Faster SSH connections by putting this in your `.ssh/config`. Don't forget to create the `~/.ssh/sockets` directory for it to work.
Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 600
@epatr
epatr / popup.js
Created October 27, 2015 16:32
Bookmarklet to pop up websites in window without browser toolbars
javascript:window.open('http://','windowName','width=960,height=720,scrollbars=yes,status=no,titlebar=no,toolbar=no');void(0);
@jeffgca
jeffgca / output.json
Last active April 16, 2026 10:55
Get 10k extensions from the chrome web store.
[
"https://chrome.google.com/webstore/detail/ballloon-for-chrome/kbmligehjhghebleanjcmenomghmcohn",
"https://chrome.google.com/webstore/detail/shine-for-reddit/acoiihnnfofnpbnofdcgcapbjlcopifa",
"https://chrome.google.com/webstore/detail/tag-assistant-by-google/kejbdjndbnbjgmefkgdddjlbokphdefk",
"https://chrome.google.com/webstore/detail/highly-highlighter/hjpahjhcglfdopbholajmhpamgblhjhg",
"https://chrome.google.com/webstore/detail/screencastify-screen-vide/mmeijimgabbpbgpdklnllpncmdofkcpn",
"https://chrome.google.com/webstore/detail/sms-from-gmail-facebook-m/iffdacemhfpnchinokehhnppllonacfj",
"https://chrome.google.com/webstore/detail/wot-web-of-trust-website/bhmmomiinigofkjcapegjjndpbikblnp",
"https://chrome.google.com/webstore/detail/mega/bigefpfhnfcobdlfbedofhhaibnlghod",
"https://chrome.google.com/webstore/detail/time-is-money/ooppbnomdcjmoepangldchpmjhkeendl",
@onpaws
onpaws / nativeEvents.js
Created August 3, 2016 19:01
simulate a click without jQuery (native fire event)
function eventFire(el, etype){
if (el.fireEvent) {
el.fireEvent('on' + etype);
} else {
var evObj = document.createEvent('Events');
evObj.initEvent(etype, true, false);
el.dispatchEvent(evObj);
}
}
eventFire(document.getElementById('submitButton'), 'click');
// ==UserScript==
// @name jQueryfy
// @namespace http://rafasales.com
// @version 0.1
// @description Loads jQuery in any page
// @match http*://*
// @copyright 2012+, Rafael Sales
// ==/UserScript==
if (typeof(unsafeWindow.jQuery) != 'undefined') {
return;