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
function saveImage(elem) {// I dont need prompt option | |
let doc = elem.ownerDocument; | |
let urlStr = window.makeURLAbsolute(elem.baseURI, elem.src); | |
let uri = makeURI(urlStr, null, null); | |
window.urlSecurityCheck(uri, doc.nodePrincipal); | |
// ?の除去(ファイル名に使えないから) | |
let tmp = elem.src.replace(/\?/g, ''); | |
let ext = tmp.match(/\/[^\/]+(\.[^.\/]+)$/); | |
// 拡張子の無いURLの場合 | |
if(ext == null){ |
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
key.setCaretKey('z', function(ev){ | |
var frame = document.commandDispatcher.focusedWindow | |
|| gBrowser.contentWindow; | |
var selection = frame.getSelection(); | |
var range = frame.document.createRange(); | |
var elem = frame.document.createElement('span'); | |
range.setStart(selection.focusNode, selection.focusOffset); | |
range.setEnd(selection.focusNode, selection.focusOffset); | |
elem.innerHTML = "<I>"; | |
elem.setAttribute("style","background-color: green; zIndex: 1000; position:absolute;"); |
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
// stop searching by hit Enter on search box | |
gFindBar.getElement("findbar-textbox") | |
.addEventListener("keypress", emacslike_search, false); | |
function emacslike_search(ev){ | |
if(ev.ctrlKey && ev.charCode == 115){ // C-s | |
gFindBar.onFindAgainCommand(false); | |
} | |
if(ev.keyCode == 13){ // Enter | |
gFindBar.onFindAgainCommand(true); |
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
key.setViewKey(['C-c', 'C-a'], function (ev) { | |
children = document.getElementById("nav-bar").children; | |
for(i=0; i<children.length; i++){ | |
children[i].style.backgroundColor = "pink"; | |
} | |
util.setBoolPref("accessibility.browsewithcaret", true); | |
}, "Start Caret-Browse Mode"); | |
key.setCaretKey(['C-c', 'C-a'], function (ev) { | |
children = document.getElementById("nav-bar").children; |
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
key.setViewKey(['C-c', 'C-p'], function(ev){ | |
var loc = getBrowser().contentDocument.URL; | |
var doc = frame = document.commandDispatcher.focusedWindow.document | |
|| gBrowser.contentWindow.document; | |
if(loc.match(/www\.amazon\./)){ | |
asin = loc.split("/")[5]; | |
r = doc.evaluate("//div[@class='buying']",doc,null,XPathResult.FIRST_ORDERED_NODE_TYPE, null); | |
list = r.singleNodeValue.textContent.split("\n"); | |
var info = Array(); | |
for(i=0; i<list.length; i++ ){ |
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
key.setViewKey(['C-c', 'C-d'], function () { | |
f='http://www.delicious.com/save?url='+encodeURIComponent(getBrowser().contentDocument.URL)+'&title='+encodeURIComponent(getBrowser().contentDocument.title)+'&v=5&'; | |
a=function(){ | |
if(!window.open(f+'noui=1&jump=doclose','deliciousuiv5','location=yes,links=no,scrollbars=no,toolbar=no,width=550,height=550')) | |
location.href=f+'jump=yes' | |
}; | |
if(/Firefox/.test(navigator.userAgent)){ | |
setTimeout(a,0) | |
} else { | |
a() |
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
diff -Naur old/content/brief-overlay.xul new/content/brief-overlay.xul | |
--- old/content/brief-overlay.xul 2010-12-19 04:37:16.000000000 +0900 | |
+++ new/content/brief-overlay.xul 2011-02-23 22:38:31.000000000 +0900 | |
@@ -12,21 +12,21 @@ | |
<key id="Brief_open" key="d" modifiers="accel alt" | |
oncommand="Brief.open()"/> | |
- <key id="Brief_selectNextEntry" key="j" | |
- oncommand="Brief.doCommand('selectNextEntry')"/> | |
- <key id="Brief_selectPreviousEntry" key="k" |
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
;; use trash for remove files | |
(defun my-trash-file (FILENAME) | |
(call-process-shell-command (concat "trash " FILENAME) | |
nil 0)) | |
;; call-process-shell-command doesnt wait, with BUFFER 0 | |
(defalias 'delete-file 'my-trash-file) | |
(defalias 'delete-directory 'my-trash-file) |
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
(defadvice get-free-disk-space (after get-free-disk-gb activate) | |
"Return free disk space with GByte order" | |
(let ((kb (string-to-number ad-return-value))) ; this is reserved variable | |
(if (> kb 1024) | |
(progn (setq kb (/ kb 1024)) | |
(if (> kb 1024) | |
(setq ad-return-value (format "%.0f GB" (/ kb 1024))) | |
(setq ad-return-value (format "%.0f MB" kb)))) | |
(setq ad-return-value (format "%.0f kB" kb)) | |
))) |
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
(setq my-log-key-counter 0) | |
(defun my-log-key (&optional acmd) | |
(let | |
((cmd (symbol-name (or acmd this-command))) | |
(file "~/logging")) | |
(save-current-buffer | |
(set-buffer (get-buffer-create "logging")) | |
(when (= 0 my-log-key-counter) | |
(insert-file-contents-literally file)) | |
(goto-char (point-max)) |
OlderNewer