MozTW 討論區 https://forum.moztw.org/ |
|
善用 keyconfig 增加自訂的快速鍵 https://forum.moztw.org/viewtopic.php?f=11&t=13082 |
第 2 頁 (共 4 頁) |
發表人: | ttru [ 2007-03-19, 18:49 ] |
文章主題 : | |
coolcd 寫: 這篇蠻讚的,我也自訂了一個快捷鍵來開啟/關閉尋找工具列: 代碼是從 Findbar Basics 偷來的。 代碼: if((document.getElementById('FindToolbar')).hidden == true) onFindCmd(); else closeFindBar(); 原本用 Ctrl+F 只能開啟 findbar 必須按 Esc 才能關閉 改成這樣後,用 Ctrl+F 就能開啟也能關閉尋找列了。 不知為何我用這個code沒效果,改用這個才有效: 代碼: var findToolbar = document.getElementById("FindToolbar");
if(typeof gFindBar == "object") { //Bon Echo 2.0a3 if(findToolbar.hidden) gFindBar.onFindCmd(); else gFindBar.closeFindBar(); } else { if(findToolbar.hidden) onFindCmd(); else closeFindBar(); } |
發表人: | yuoo2k [ 2007-04-26, 14:56 ] |
文章主題 : | |
搭配 MinimizeToTray 與 keyconfig 自訂縮小熱鍵用: 代碼: window.extensions.mook.minimizetotray.minimizeWindow();
|
發表人: | kesdoputr [ 2007-04-26, 20:03 ] |
文章主題 : | |
有沒有辦法自訂切換語系的快速鍵?常用的幾個語系 每次還要按右鍵選擇感覺好麻煩 |
發表人: | gamer [ 2007-06-02, 16:37 ] |
文章主題 : | |
單獨彈出About:config 代碼: toOpenWindowByType('pref:pref', 'About:config');
|
發表人: | it [ 2007-06-06, 18:38 ] |
文章主題 : | |
列一下我有在用的keyconfig(後面是我用的快速鍵),有些是網路上看到,有些由 extension source code看來的,有些是自己試出來的(和tab有關的一些功能可能要裝TabMix Plus才動得了?不確定) Open Javascript Console C-S-J 代碼: toJavaScriptConsole(); View Page Info : C-I 代碼: BrowserPageInfo(); 開啟視窗 "擴充套件管理員" 代碼: toOpenWindowByType('Add-ons:manager', 'chrome://mozapps/content/extensions/extensions.xul'); copy curent url A-c 代碼: var gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper); gClipboardHelper.copyString(window._content.location.href); nextField : C-; 曾經有個叫first field的extension,讓你很快focus在 input text field,這算是加強版吧 代碼: /* CODE */ _content.focus(); /* handle google maps */ if(window.content.document.location.href.match("maps.google.com")){ var field = window.content.document.getElementById('q_d'); field.focus(); field.select(); return; } var focused = document.commandDispatcher.focusedElement; var doc = window.content.document; snapshots = doc.evaluate("//input", doc, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); if(focused==null || focused.type != "text"){ var i=0; while(snapshots.snapshotItem(i).type!="text") i++; field=snapshots.snapshotItem(i); } else { for (var i = 0; i < snapshots.snapshotLength; i++) { if(focused==snapshots.snapshotItem(i)){ i = (i+1)%snapshots.snapshotLength; while(snapshots.snapshotItem(i).type!="text") i = (i+1)%snapshots.snapshotLength; field=snapshots.snapshotItem(i); break; } } } field.focus(); field.select(); Switch Search Engine : C-S-h 代碼: var searchMenu = document.getAnonymousElementByAttribute(document.getElementById('searchbar'), 'anonid', 'searchbar-popup'); var searchIcon = document.getAnonymousElementByAttribute(document.getElementById('searchbar'), 'class', 'searchbar-dropmarker'); if (searchMenu) { searchMenu.showPopup(searchIcon, -1, -1, 'popup', 'bottomleft', 'topleft'); } Move Tab to the Left 代碼: if(gBrowser.mCurrentTab.previousSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab._tPos-1); Move Tab to the Right 代碼: if(gBrowser.mCurrentTab.nextSibling) gBrowser.moveTabTo(gBrowser.mCurrentTab,gBrowser.mCurrentTab._tPos+1); Undoclosetab 代碼: gBrowser.undoRemoveTab(); Back Menu 代碼: /* CODE */ var elm = document.getElementById("back-button"); var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + 25; document.getElementById("backMenu").showPopup(elm, x, y, "popup", null, null); Forward Menu 代碼: var elm = document.getElementById("forward-button");
var x = elm.boxObject.x; var y = elm.boxObject.y + elm.boxObject.height + 25; document.getElementById("forwardMenu").showPopup(elm, x, y, "popup", null,null); |
發表人: | goldie [ 2007-06-06, 20:20 ] |
文章主題 : | |
it 寫: === 恕刪 ===
開啟視窗 "擴充套件管理員" 代碼: toOpenWindowByType('Add-ons:manager', 'chrome://mozapps/content/extensions/extensions.xul'); 感謝提供 for Firefox 2.0.x 的新 Code 前一頁我也更新好了 Orz... ※ 真神… 我一直找不到這個新版的 Code |
發表人: | gamer [ 2007-06-07, 02:26 ] |
文章主題 : | |
離缐工作(開/關) 代碼: BrowserOffline.toggleOfflineStatus();
|
發表人: | it [ 2007-06-28, 12:18 ] |
文章主題 : | |
goldie 寫: it 寫: === 恕刪 === 開啟視窗 "擴充套件管理員" 代碼: toOpenWindowByType('Add-ons:manager', 'chrome://mozapps/content/extensions/extensions.xul'); 感謝提供 for Firefox 2.0.x 的新 Code 前一頁我也更新好了 Orz... ※ 真神… 我一直找不到這個新版的 Code 補充一下怎麼找 大部分的 code 都在 Mozilla Firefox\chrome\browser.jar 用解 zip 的工具將其解開(可能要在沒開 firefox 時才能作此動作) 裡面的js檔大致是程式碼,xul檔則大致是"視窗介面" 所以有時要找某功能若可由視窗access到的話(ex:工具->擴充套件)可先由xul找,看這個動作是呼叫什麼function 另一個手段是對所有js/xul檔找關鍵字(有時要猜一下就是) 不管如何,通常你還需要有足夠的耐心或運氣 若某extension有想要的功能也可如法泡製 |
發表人: | jakiesun1 [ 2007-06-28, 17:22 ] |
文章主題 : | |
有個擴充套件叫autoslideshow,雖然他已經有熱鍵可以切換圖片,但是沒有可以啟動slideshow的熱鍵,不知道可以用這個套件增加熱鍵嗎? 自問自答,自己用DOM觀察器找到怎麼用 代碼 button_slideshow(); |
發表人: | chaos0518 [ 2007-06-29, 10:31 ] |
文章主題 : | |
可以麻煩提供一下 新同文堂裡面的 剪貼簿:轉簡體 的code嗎 找的好久還是不太懂 OTZ... |
發表人: | 紅蓮默示錄 [ 2007-07-01, 04:42 ] |
文章主題 : | |
jaconet 寫: Keyconfig
[] Global:我都打開, 不知道這是做什麼的? Global:讓熱鍵在非FireFox的視窗中依然有效,簡單的說就是全域熱鍵 例如Ctrl+B是開啟側邊書籤,打開Global後, 就算你目前在聊MSN,也能打開側邊書籤,不用再切換視窗到FireFox 會知道是因為foobar也有同樣的選項... |
發表人: | kesdoputr [ 2007-07-10, 16:58 ] |
文章主題 : | |
coolcd 寫: 這篇蠻讚的,我也自訂了一個快捷鍵來開啟/關閉尋找工具列:
代碼是從 Findbar Basics 偷來的。 代碼: if((document.getElementById('FindToolbar')).hidden == true) onFindCmd(); else closeFindBar(); 原本用 Ctrl+F 只能開啟 findbar 必須按 Esc 才能關閉 改成這樣後,用 Ctrl+F 就能開啟也能關閉尋找列了。 可以問一下這個代碼怎麼用嗎?我加了以後快速鍵設成Ctrl+F,還是不能用Ctrl+F開/關 Findbar -- ps.使用ttru兄提供的代碼就ok了 |
發表人: | it [ 2007-08-02, 18:26 ] |
文章主題 : | |
kesdoputr 寫: 有沒有辦法自訂切換語系的快速鍵?常用的幾個語系
每次還要按右鍵選擇感覺好麻煩 你可以參考下面code再依自己需要修改,因為我通常只用這兩種就直接寫在一個function了 Change Charset 代碼: var docCharset = getBrowser().docShell.QueryInterface(Components.interfaces.nsIDocCharset); var orig_charset = docCharset.charset; if(orig_charset!='Big5'){ SetForcedCharset('Big5'); } else { SetForcedCharset('UTF-8'); } 再補一個 firefox 用的,要裝 Copy Url Plus Copy Url Plus : Title 代碼: _content.focus(); doCopyURLPlus('title'); 其實有三種 代碼: doCopyURLPlus('title'); doCopyURLPlus('sel'); /* Copy Url + Selection */ doCopyURLPlus('titlesel'); /* Copy Url + Title + Selection */ 以下是 thunderbird 的 Keyconfig extension: Thunderbird - MozillaZine Knowledge Base 有列出很多function 切換左側folder view (all/unread/favorite/recent) Cycle Folder View Forward 代碼: CycleFolderView(1); Cycle Folder View Backward 代碼: CycleFolderView(0); 管理訂閱狀態(mailbox://nobody... 那一串可能要視配置修正) Manage RSS Subscriptions 代碼: /*manageSubscriptions();*/ var gIncomingServer=GetMsgFolderFromUri("mailbox://nobody@News%20%26%20Blogs").server; const kWindowMediatorContractID = "@mozilla.org/appshell/window-mediator;1"; const kWindowMediatorIID = Components.interfaces.nsIWindowMediator; const kWindowMediator = Components.classes[kWindowMediatorContractID].getService(kWindowMediatorIID); var lastSubscriptionWindow = kWindowMediator.getMostRecentWindow("Mail:News-BlogSubscriptions"); if (lastSubscriptionWindow) lastSubscriptionWindow.focus(); else window.openDialog("chrome://messenger-newsblog/content/feed-subscriptions.xul", "", "centerscreen,chrome,dialog=no,resizable", { server: gIncomingServer}); Remove Duplicate Messages - 要裝Remove Duplicate Messages extension 代碼: removeDuplicateMessages(); Focus Folder 代碼: var folders = document.getElementById("folderTree"); if (folders) folders.focus(); Focus Thread 代碼: var messages = document.getElementById("threadTree"); if (messages) { messages.focus(); } Focus Message 代碼: /* NostalgyFocusMessagePane(); */ SetFocusMessagePane(); var i = 10; while (i > 0 && document.commandDispatcher.focusedWindow.name != "messagepane") { document.commandDispatcher.advanceFocus(); i--; } Open in browser /* open current rss mail in browser */ 代碼: if ("content-base" in currentHeaderData) { var url = currentHeaderData["content-base"].headerValue; var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); messenger.launchExternalURL(url); } Open All /* open all unread rss mails in browser */ 代碼: function openMsg() {
if(count++>=max){ clearInterval(timer); return; } if(succeeded) { var url = currentHeaderData["content-base"].headerValue; messenger.launchExternalURL(url); } else { clearInterval(timer); } succeeded = ScrollToMessage(nsMsgNavigationType.nextUnreadMessage, true, true); } var messenger = Components.classes["@mozilla.org/messenger;1"].createInstance(); messenger = messenger.QueryInterface(Components.interfaces.nsIMessenger); var interval = 300; var max=15; var count=0; var succeeded = ScrollToMessage(nsMsgNavigationType.nextUnreadMessage, true, true); timer=setInterval( openMsg, interval); 最後離題一下,對愛用鍵盤者,thunderbird 的 GMailUI, Nostalgy extension 不錯用 |
發表人: | kesdoputr [ 2007-08-02, 18:50 ] |
文章主題 : | |
it 寫: kesdoputr 寫: 有沒有辦法自訂切換語系的快速鍵?常用的幾個語系 每次還要按右鍵選擇感覺好麻煩 你可以參考下面code再依自己需要修改,因為我通常只用這兩種就直接寫在一個function了 Change Charset 代碼: var docCharset = getBrowser().docShell.QueryInterface(Components.interfaces.nsIDocCharset); var orig_charset = docCharset.charset; if(orig_charset!='Big5'){ SetForcedCharset('Big5'); } else { SetForcedCharset('UTF-8'); } 可不可以請教一下如果我想分開做,例如按Alt+C就切換到Big5 按Alt+J就切換到Shift JIS應該怎麼寫?謝謝^^ |
發表人: | it [ 2007-08-02, 21:19 ] |
文章主題 : | |
kesdoputr 寫: it 寫: kesdoputr 寫: 有沒有辦法自訂切換語系的快速鍵?常用的幾個語系 每次還要按右鍵選擇感覺好麻煩 你可以參考下面code再依自己需要修改,因為我通常只用這兩種就直接寫在一個function了 Change Charset 代碼: var docCharset = getBrowser().docShell.QueryInterface(Components.interfaces.nsIDocCharset); var orig_charset = docCharset.charset; if(orig_charset!='Big5'){ SetForcedCharset('Big5'); } else { SetForcedCharset('UTF-8'); } 可不可以請教一下如果我想分開做,例如按Alt+C就切換到Big5 按Alt+J就切換到Shift JIS應該怎麼寫?謝謝^^ 一個用 SetForcedCharset('Big5'); 一個用 SetForcedCharset('Shift_JIS'); |
第 2 頁 (共 4 頁) | 所有顯示的時間為 UTC + 8 小時 |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |