Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name GM_woker test 2
// @namespace gWorkerTest
// @include *
// @version 0.1
// @author Erik Vergobbi Vold
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @resource worker http://erikvold.com/tests/greasemonkey/gmWorker/worker-error.js
// ==/UserScript==
// ==UserScript==
// @name GM jQuery Test
// @namespace gmJQueryTest
// @require http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js
// @resource x https://gist.github.com/images/modules/header/logo_gist.png
// @include *
// @author Erik Vergobbi Vold
// ==/UserScript==
GM_notification('t');
@erikvold
erikvold / blank.user.js
Created July 3, 2010 20:15
A blank user script.
// blank userscript test.
alert(window);
alert(unsafeWindow);
alert(window.wrappedJSObject);
alert(unsafeWindow.wrappedJSObject);
alert(document);
alert(document.wrappedJSObject);
/* A facade for the Web Worker API that fakes it in case it's missing.
Good when web workers aren't supported in the browser, but it's still fast enough, so execution doesn't hang too badly (e.g. Opera 10.5).
By Stefan Wehrmeyer, licensed under MIT
*/
var WorkerFacade;
if(!!window.Worker && !iCanHasFastBrowser()){
WorkerFacade = (function(){
return function(path){
return new window.Worker(path);
@erikvold
erikvold / autoAccessAnalytics.user.js
Created August 15, 2010 06:26
This userscript auto presses the "Access Analytics" button, if it is displayed.
// ==UserScript==
// @id [email protected]
// @name Auto Access Google Analytics
// @author Erik Vold <[email protected]>
// @datecreated 2008-7-9
// @lastupdated 2010-09-28
// @namespace autoAccessAnalytics
// @match http://google.com/analytics/
// @match http://google.com/intl/*/analytics/
// @match http://google.ca/analytics/

There are several well known & proved interfaces defined by w3c & acquiring those instead of inventing similar ones could benefit extension developers (specially newbies) a lot, since:

  1. They are already familiar with those interfaces.
  2. They may be able to reuse code across webapps & extensions.

Description of proposed API's:

CmdUtils.CreateCommand({
name: "LinkedIn Search",
author: { name: "Nalini Kartha", email: "[email protected]" },
description: "Lookup someone on LinkedIn",
help: "Looks up the specified person (select or enter FULL name) on LinkedIn."+
"The middle intitals or names are ignored when searching.",
preview: function( pblock ) {
var msg = 'Lookup someone on LinkedIn. Supported Formats - <br/>' +
'"Firstname (Middle Initials or Names) Lastname"';
pblock.innerHTML = _( msg );
// ==UserScript==
// @name GM_woker test 3
// @namespace gWorkerTest
// @include *
// @author Erik Vergobbi Vold
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @resource worker http://erikvold.com/tests/greasemonkey/gmWorker/worker-xhr.js
// @noframes
// ==/UserScript==
onmessage = function(event) {
postMessage(event.data);
onCancel(); // causes "onCancel is not defined" error
}
// ==UserScript==
// @id [email protected]
// @name Resource Test
// @namespace test
// @include *
// @resource text http://erikvold.com/robots.txt
// @resource ico http://erikvold.com/favicon.ico
// ==/UserScript==
alert(GM_getResourceText("text"));