Created
April 18, 2010 16:54
-
-
Save xulapp/370358 to your computer and use it in GitHub Desktop.
viewLinkSource.uc.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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