Skip to content

Instantly share code, notes, and snippets.

@to
Forked from youpy/gist_ubiquity.user.js
Created September 2, 2008 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save to/8377 to your computer and use it in GitHub Desktop.
Save to/8377 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name gist - ubiquity
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://gist.github.com/*
// @require http://gist.github.com/raw/3242/1a7950e033a207efcfc233ae8d9939b676bdbf46
// ==/UserScript==
(function() {
var data = $X('id("gist_data")');
if(!data)
return;
if(data[0].textContent.match(/(CmdUtils\.CreateCommand|makeSearchCommand)/)) {
var link = document.createElement('link');
with(link) {
setAttribute('rel', 'commands');
setAttribute('href', $X('//a[text()="raw"]')[0].href);
setAttribute('name', data[0].textContent.match(/name: ?("((?:\\.|[^"])*)"|'((?:[^']|\\.)*)')/)[3]);
}
$X('//head')[0].appendChild(link);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment