Skip to content

Instantly share code, notes, and snippets.

@xulapp
Created April 18, 2010 16:54
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 xulapp/370358 to your computer and use it in GitHub Desktop.
Save xulapp/370358 to your computer and use it in GitHub Desktop.
viewLinkSource.uc.js
// ==UserScript==
// @name viewLinkSource.uc.js
// @description リンクのソースを表示
// @include main
// @compatibility Firefox
// @namespace http://twitter.com/xulapp
// @author xulapp
// @license MIT License
// @version 2010/04/19 01:50 +09:00
// @note リファラ送らず
// ==/UserScript==
(function viewLinkSource() {
var contentAreaContextMenu = $('contentAreaContextMenu');
var menuitem = document.createElement('menuitem');
menuitem.setAttribute('id', 'context-viewlinksource');
menuitem.setAttribute('label', U('リンクのソースを表示'));
menuitem.setAttribute('accesskey', 'V');
menuitem.setAttribute('oncommand', 'gViewSourceUtils.viewSource(gContextMenu.linkURL);');
contentAreaContextMenu.insertBefore(menuitem, $('context-viewsource').nextSibling);
contentAreaContextMenu.addEventListener('popupshowing', function VLS_onContextPopupShowing() {
gContextMenu.showItem(menuitem, gContextMenu.onLink);
}, false);
function U(text) 1 < 'あ'.length ? decodeURIComponent(escape(text)) : text;
function $(id) document.getElementById(id);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment