MozTW 討論區

各項 Mozilla 相關軟體與技術討論
現在的時間是 2025-08-07, 22:52

所有顯示的時間為 UTC + 8 小時





發表新文章 回覆主題  [ 1 篇文章 ] 
發表人 內容
文章發表於 : 2008-06-15, 15:24 
離線

註冊時間: 2005-08-06, 05:55
文章: 25
最近發現 userChrome.js 的 userChrome.js
碼幾乎都是用這種方式來分享
如下官方網站中的連結
http://mozilla.zeniko.ch/userchrome.js.html
中的

Sub-Script/XUL Loader

就是以以下的這串程式碼做為了連結

data:text/javascript,%2F*%20%3A%3A%3A%3A%3A%3A%3A%3A%20Sub-Script%2FXUL%20Loader%20%3A%3A%3A%3A%3A%3A%3A%3A%3A%3A%3A%3A%3A%3A%3A%20*%2F%0A%0A%2F%2F%20automatically%20includes%20all%20files%20ending%20in%20.uc.js%20and%20.uc.xul%20from%20the%20profile%27s%20chrome%20folder%0A%0A%28function%28%29%20%7B%0A%09var%20getURLSpecFromFile%20%3D%20Components.classes%5B%22%40mozilla.org%2Fnetwork%2Fio-service%3B1%22%5D.getService%28Components.interfaces.nsIIOService%29.getProtocolHandler%28%22file%22%29.QueryInterface%28Components.interfaces.nsIFileProtocolHandler%29.getURLSpecFromFile%3B%0A%09var%20chromeDir%20%3D%20Components.classes%5B%22%40mozilla.org%2Ffile%2Fdirectory_service%3B1%22%5D.getService%28Components.interfaces.nsIProperties%29.get%28%22UChrm%22%2C%20Components.interfaces.nsILocalFile%29%3B%0A%09var%20files%20%3D%20chromeDir.directoryEntries.QueryInterface%28Components.interfaces.nsISimpleEnumerator%29%3B%0A%09var%20xul_files%20%3D%20%5B%5D%3B%0A%09%0A%09while%20%28files.hasMoreElements%28%29%29%0A%09%7B%0A%09%09var%20file%20%3D%20files.getNext%28%29.QueryInterface%28Components.interfaces.nsIFile%29%3B%0A%09%09if%20%28%2F%5C.uc%5C.js%24%2Fi.test%28file.leafName%29%29%0A%09%09%7B%0A%09%09%09setTimeout%28function%28aFile%29%20%7B%0A%09%09%09%09Components.classes%5B%22%40mozilla.org%2Fmoz%2Fjssubscript-loader%3B1%22%5D.getService%28Components.interfaces.mozIJSSubScriptLoader%29.loadSubScript%28getURLSpecFromFile%28aFile%29%29%3B%0A%09%09%09%7D%2C%200%2C%20file%29%3B%0A%09%09%7D%0A%09%09else%20if%20%28%2F%28%5EuserChrome%7C%5C.uc%29%5C.xul%24%2Fi.test%28file.leafName%29%29%0A%09%09%7B%0A%09%09%09xul_files.push%28file%29%3B%0A%09%09%7D%0A%09%7D%0A%09%0A%09setTimeout%28function%28%29%20%7B%0A%09%09if%20%28xul_files.length%20%3E%200%29%0A%09%09%7B%0A%09%09%09document.loadOverlay%28getURLSpecFromFile%28xul_files.shift%28%29%29%2C%20null%29%3B%0A%09%09%09setTimeout%28arguments.callee%2C%200%29%3B%0A%09%09%7D%0A%09%7D%2C%200%29%3B%0A%7D%29%28%29%3B%0A%0A

如果有什麼方法可以轉換的話,那就能很方便的分享程式碼了


回頂端
Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-TW; rv:1.8.1.14) Gecko/20080417 Firefox/2.0.0.14 (tete009 SSE PGO)
 個人資料  
引用回覆  
顯示文章 :  排序  
發表新文章 回覆主題  [ 1 篇文章 ] 

所有顯示的時間為 UTC + 8 小時


誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 5 位訪客


不能 在這個版面發表主題
不能 在這個版面回覆主題
不能 在這個版面編輯您的文章
不能 在這個版面刪除您的文章
不能 在這個版面上傳附加檔案

搜尋:
前往 :  
cron
Powered by phpBB® Forum Software © phpBB Group
正體中文語系由 竹貓星球 維護製作
© moztw.org, Mozilla Foundation
MozTW,Mozilla 台灣社群