michaelfox + userscripts 67
User Scripts - The Chromium Projects
december 2010 by michaelfox
Chromium and Google Chrome (version 4 and higher) have built-in support for Greasemonkey-style user scripts.
To use, click on any .user.js file. You should see an install dialog. Press OK to install.
Known issues:
Chromium does not support @require, @resource, unsafeWindow, GM_registerMenuCommand, GM_setValue, or GM_getValue.
GM_xmlhttpRequest is same-origin only.
Match Patterns
The preferred way to specify the pages that a user script should run against in Chromium is the @match attribute. Here are some examples of its use:
// ==UserScript==
// @match http://*
// @match http://*.google.com/*
// @match http://www.google.com/*
// ==/UserScript==
See these comments for details on the @match syntax.
Support for Greasemonkey-style @include patterns is also implemented for compatibility, but @match is preferred.
With Greasemonkey-style @include rules, it is not possible for Chrome to know for certain the domains a script will run on (because google.* can also run on google.evil.com). Because of this, Chrome just tells users that these scripts will run on all domains, which is sometimes scarier than necessary. With @match, Chrome will tell users the correct set of domains a user script will run on.
chrome
javascript
userscripts
greasemonkey
wiki
reference
To use, click on any .user.js file. You should see an install dialog. Press OK to install.
Known issues:
Chromium does not support @require, @resource, unsafeWindow, GM_registerMenuCommand, GM_setValue, or GM_getValue.
GM_xmlhttpRequest is same-origin only.
Match Patterns
The preferred way to specify the pages that a user script should run against in Chromium is the @match attribute. Here are some examples of its use:
// ==UserScript==
// @match http://*
// @match http://*.google.com/*
// @match http://www.google.com/*
// ==/UserScript==
See these comments for details on the @match syntax.
Support for Greasemonkey-style @include patterns is also implemented for compatibility, but @match is preferred.
With Greasemonkey-style @include rules, it is not possible for Chrome to know for certain the domains a script will run on (because google.* can also run on google.evil.com). Because of this, Chrome just tells users that these scripts will run on all domains, which is sometimes scarier than necessary. With @match, Chrome will tell users the correct set of domains a user script will run on.
december 2010 by michaelfox
gist: 626834 - userscript: Drop the UTM params from a URL when the page loads- GitHub
october 2010 by michaelfox
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http://*
// ==/UserScript==
// save this as utmstrip.user.js and drag it into Chrome or Firebug (with greasemonkey)
if (/^\?utm_/.test(location.search) && window.history.replaceState){
window.history.replaceState({},'', location.href.replace(/\?utm_.*/,''));
}
// also..
// this is just as useful on your own site.. in case you have feedburner tracking or whatever.
gist-626834
gist
userscripts
javascript
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http://*
// ==/UserScript==
// save this as utmstrip.user.js and drag it into Chrome or Firebug (with greasemonkey)
if (/^\?utm_/.test(location.search) && window.history.replaceState){
window.history.replaceState({},'', location.href.replace(/\?utm_.*/,''));
}
// also..
// this is just as useful on your own site.. in case you have feedburner tracking or whatever.
october 2010 by michaelfox
Conditional Logging - GreaseSpot
april 2010 by michaelfox
An even simpler option, retaining all of Firebug's console routines, and not interfering with additional parameters.
const DEBUG = 1;
if (!DEBUG) {
var console = {
log: function() {},
info: function() {},
warn: function() {},
error: function() {},
};
}
greasemonkey
userscripts
javascript
debug
console
firebug
firefox
logging
webdev
tools
snippets
code
browser
const DEBUG = 1;
if (!DEBUG) {
var console = {
log: function() {},
info: function() {},
warn: function() {},
error: function() {},
};
}
april 2010 by michaelfox
Location hack - GreaseSpot
april 2010 by michaelfox
The location hack is an ugly but useful way to interact with the content scope of the page being user scripted. It does this by indirectly evaling strings within that scope.
greasemonkey
userscripts
javascript
bookmarklets
april 2010 by michaelfox
related tags
addons ⊕ ajax ⊕ applescript ⊕ apps ⊕ autopagerize ⊕ bookmarklets ⊕ browser ⊕ calendar ⊕ campfire ⊕ chrome ⊕ cocoa ⊕ code ⊕ console ⊕ css ⊕ custom ⊕ customization ⊕ debug ⊕ delicious ⊕ design ⊕ development ⊕ digg ⊕ dotjs ⊕ environment ⊕ extension ⊕ extensions ⊕ firebug ⊕ firefox ⊕ flickr ⊕ fluid ⊕ gist ⊕ gist-626834 ⊕ github ⊕ gmail ⊕ GM_config ⊕ google ⊕ googleanalytics ⊕ googlereader ⊕ greasemonkey ⊕ hacks ⊕ history ⊕ html5 ⊕ ical ⊕ inspiration ⊕ install ⊕ instapaper ⊕ iphone ⊕ javascript ⊕ jquery ⊕ keyboard ⊕ logging ⊕ mac ⊕ macros ⊕ mail ⊕ node ⊕ parsing ⊕ pinbaord ⊕ plugin ⊕ plugins ⊕ programming ⊕ proxy ⊕ reader ⊕ reddit ⊕ reference ⊕ replacestate ⊕ resources ⊕ rss ⊕ safari ⊕ script ⊕ scripts ⊕ server ⊕ shim ⊕ snippets ⊕ stackexchange ⊕ stackoverflow ⊕ stylesheet ⊕ stylish ⊕ template ⊕ text ⊕ textmate ⊕ theme ⊕ tools ⊕ twitter ⊕ URL ⊕ userchrome ⊕ usercontent ⊕ userscripts ⊖ userstyles ⊕ video ⊕ webdev ⊕ wiki ⊕ wikipedia ⊕ xcode ⊕ youtube ⊕Copy this bookmark: