├── userChromeJS_Mix.xpi ├── src │ ├── skin │ │ ├── userChromeJS.css │ │ ├── img │ │ │ ├── icon16.png │ │ │ ├── icon20.png │ │ │ ├── icon32.png │ │ │ ├── icon16-old.png │ │ │ ├── icon16-old (2).png │ │ │ ├── jscmd_edit_add.png │ │ │ ├── jscmd_edit_del.png │ │ │ ├── showToolsMenu.png │ │ │ ├── toolbtn_rebuild.png │ │ │ ├── toolbtn_chromedir.png │ │ │ ├── toolbtn_openPrefs.png │ │ │ ├── toolbtn_setEditor.png │ │ │ └── toolbtn_restartApp.png │ │ ├── option.css │ │ └── rebuild_userChrome.css │ ├── content │ │ ├── script │ │ │ ├── tpl │ │ │ │ ├── mouseGesturesTemplate.js │ │ │ │ ├── quickDragTemplate.js │ │ │ │ ├── superDragTemplate.js │ │ │ │ └── easyDragTemplate.js │ │ │ ├── update.js │ │ │ ├── ScriptAddon.js │ │ │ └── utils.js │ │ ├── img │ │ │ ├── home.png │ │ │ ├── github.ico │ │ │ ├── kafan.ico │ │ │ ├── mozest.ico │ │ │ ├── bitbucket.png │ │ │ ├── download.gif │ │ │ ├── pan.baidu.ico │ │ │ ├── tieba.baidu.ico │ │ │ └── wiki.nothing.sh.ico │ │ ├── style │ │ │ ├── iconfont.woff │ │ │ ├── ziyunfei_creator.css │ │ │ └── index.css │ │ ├── update.html │ │ ├── options.js │ │ ├── bak │ │ │ └── userchrome_old.js │ │ └── options.xul │ ├── locale │ │ └── en-US │ │ │ └── userChromeJS.properties │ ├── chrome.manifest │ ├── defaults │ │ └── preferences │ │ │ └── userChromeJS.js │ ├── install.rdf │ └── components │ │ └── userChrome_js.js ├── build.bat ├── img │ ├── mainUI.jpg │ ├── setting.png │ ├── installBar.png │ ├── installedMsg.png │ ├── installedMsg2.png │ └── addMenu_启用禁用效果图.gif ├── userChromeJS_Mix.xpi ├── update.rdf ├── updateInfo.md └── README.md ├── 按钮图示合集.png ├── 编辑器参数.png ├── .修改版 ├── swf │ ├── update.bat │ └── update - 代理.bat ├── README.md └── _redirector.js ├── AddonsPage ├── 右键菜单.png ├── 详细页面.png ├── uc脚本详细页面.png ├── 右键菜单_GM.png ├── 右键菜单_uc.png ├── AddonsPage_userChromeJS.png └── README.md ├── uAutoPagerize ├── 分页导航.png ├── 分页导航2.png ├── 按钮图标.png ├── 按钮右键菜单.png ├── SITEINFO_Writer.png ├── SITEINFO_Writer_devtools.png └── _uAutoPagerize.js ├── uAutoPagerize2 ├── 分隔条.png ├── 右键菜单.png ├── 首选项.png ├── SITEINFO_Writer.jpg ├── uAutoPagerizeUI │ ├── main.css │ └── aardvark.css ├── _uAutoPagerize.js └── README.md ├── AutoClickModY ├── prefwindow.png └── README.md ├── ExternalVideoPlayer ├── 云点播.png └── README.md ├── SimpleMusicPlayer ├── 右键菜单.jpg ├── 弹出面板.jpg └── README.md ├── autoLaunchReader ├── 弹出的菜单.png ├── 按钮2种状态.png ├── 设置自动启用站点对话框.png └── README.md ├── InspectElementModY ├── setting.png ├── menuitem.png ├── xpi │ ├── InspectElementModY.xpi │ ├── build.bat │ └── src │ │ ├── chrome.manifest │ │ ├── chrome │ │ └── content │ │ │ ├── overlay.xul │ │ │ ├── overlay.js │ │ │ └── options.xul │ │ └── install.rdf └── README.md ├── SaveUserChromeJS ├── menuitem.png ├── github_install.png ├── isntall_banner.png └── README.md ├── fixViewSourceEditArgsForST.png ├── ExternalEditor ├── externalEditor.png └── README.md ├── SidebarModfix ├── SidebarModfix.png └── README.md ├── moveButton ├── moveButton移动菜单示例.png └── README.md ├── stylishEdit ├── stylish0.5_edit.uc.js.png └── README.md ├── viewSourceModoki ├── viewSourceModoki.png └── README.md ├── GreaemonkeyEnhancer └── README.md ├── Inspector_de_Info ├── Inspector_de_Info.png └── README.md ├── YoukuantiadsModY ├── swf │ ├── 17173_Player_file.swf │ ├── 17173_Player_stream.swf │ └── 17173_Player_file_out.swf └── README.md ├── rebuild_userChrome ├── rebuild_userChrome.png └── README.md ├── MyNovelReader └── README.md ├── WordHighlightToolbarFix ├── WordHighlightToolbar.uc.png └── README.md ├── Places_ShowBookmarkPath ├── src_Places_ShowBookmarkPath.png └── Places_ShowBookmarkPath.uc.js ├── .一些摘要 ├── Firefox 样式.md ├── Chrome 系扩展.md ├── Imagus 扩展摘要.md ├── README.md ├── 百度盘资源一览.md ├── Sublime text 摘要.md └── File IO.md ├── Space_nextpage ├── README.md └── space_nextpage.uc.js ├── uc_google_translator └── README.md ├── simpleAppButton └── README.md ├── chromejs.uc.js ├── ThunderLixianExporterPatch ├── README.md └── ThunderLixianExporterPatch.uc.js ├── placesToolbarMiddleClick.uc.js ├── .gitattributes ├── Disable ├── KeepBookmarksOnMiddleClick.uc.js └── inlineEditForBookmarkTitleOnSidebar.uc.js ├── .test ├── showMenubar.uc.js ├── testButton29+.uc.js └── PanelSubMenu.uc.js ├── showCompleteURL.uc.js ├── setRelativeEditPath.uc.js ├── statusbarButtonScrapbook.uc.js ├── UserScriptLoaderPlus └── README.md ├── TabFocus.uc.js ├── fixViewSourceEditArgsForST.uc.js ├── .gitignore ├── speedupErrorConsole.uc.js ├── openLinkTabThirdPart.uc.js ├── 论坛灌水.uc.xul ├── MoreToolsMenu.uc.js ├── Font └── README.md ├── DownloadEnhance.uc.js ├── uSuper_preloader └── README.md ├── OpenLinkinNewTabwithRightClick.uc.js ├── IME-Colors.uc.js ├── JSOff.uc.xul └── sendToGmail.uc.js /userChromeJS_Mix.xpi/src/skin/userChromeJS.css: -------------------------------------------------------------------------------- 1 | /* TODO */ -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/script/tpl/mouseGesturesTemplate.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /按钮图示合集.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/按钮图示合集.png -------------------------------------------------------------------------------- /编辑器参数.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/编辑器参数.png -------------------------------------------------------------------------------- /.修改版/swf/update.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/.修改版/swf/update.bat -------------------------------------------------------------------------------- /AddonsPage/右键菜单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/AddonsPage/右键菜单.png -------------------------------------------------------------------------------- /AddonsPage/详细页面.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/AddonsPage/详细页面.png -------------------------------------------------------------------------------- /AddonsPage/uc脚本详细页面.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/AddonsPage/uc脚本详细页面.png -------------------------------------------------------------------------------- /AddonsPage/右键菜单_GM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/AddonsPage/右键菜单_GM.png -------------------------------------------------------------------------------- /AddonsPage/右键菜单_uc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/AddonsPage/右键菜单_uc.png -------------------------------------------------------------------------------- /uAutoPagerize/分页导航.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize/分页导航.png -------------------------------------------------------------------------------- /uAutoPagerize/分页导航2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize/分页导航2.png -------------------------------------------------------------------------------- /uAutoPagerize/按钮图标.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize/按钮图标.png -------------------------------------------------------------------------------- /uAutoPagerize2/分隔条.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize2/分隔条.png -------------------------------------------------------------------------------- /uAutoPagerize2/右键菜单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize2/右键菜单.png -------------------------------------------------------------------------------- /uAutoPagerize2/首选项.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize2/首选项.png -------------------------------------------------------------------------------- /.修改版/swf/update - 代理.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/.修改版/swf/update - 代理.bat -------------------------------------------------------------------------------- /uAutoPagerize/按钮右键菜单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize/按钮右键菜单.png -------------------------------------------------------------------------------- /AutoClickModY/prefwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/AutoClickModY/prefwindow.png -------------------------------------------------------------------------------- /ExternalVideoPlayer/云点播.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/ExternalVideoPlayer/云点播.png -------------------------------------------------------------------------------- /SimpleMusicPlayer/右键菜单.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/SimpleMusicPlayer/右键菜单.jpg -------------------------------------------------------------------------------- /SimpleMusicPlayer/弹出面板.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/SimpleMusicPlayer/弹出面板.jpg -------------------------------------------------------------------------------- /autoLaunchReader/弹出的菜单.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/autoLaunchReader/弹出的菜单.png -------------------------------------------------------------------------------- /autoLaunchReader/按钮2种状态.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/autoLaunchReader/按钮2种状态.png -------------------------------------------------------------------------------- /InspectElementModY/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/InspectElementModY/setting.png -------------------------------------------------------------------------------- /SaveUserChromeJS/menuitem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/SaveUserChromeJS/menuitem.png -------------------------------------------------------------------------------- /fixViewSourceEditArgsForST.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/fixViewSourceEditArgsForST.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/build.bat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/build.bat -------------------------------------------------------------------------------- /ExternalEditor/externalEditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/ExternalEditor/externalEditor.png -------------------------------------------------------------------------------- /InspectElementModY/menuitem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/InspectElementModY/menuitem.png -------------------------------------------------------------------------------- /SidebarModfix/SidebarModfix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/SidebarModfix/SidebarModfix.png -------------------------------------------------------------------------------- /autoLaunchReader/设置自动启用站点对话框.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/autoLaunchReader/设置自动启用站点对话框.png -------------------------------------------------------------------------------- /moveButton/moveButton移动菜单示例.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/moveButton/moveButton移动菜单示例.png -------------------------------------------------------------------------------- /uAutoPagerize/SITEINFO_Writer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize/SITEINFO_Writer.png -------------------------------------------------------------------------------- /SaveUserChromeJS/github_install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/SaveUserChromeJS/github_install.png -------------------------------------------------------------------------------- /SaveUserChromeJS/isntall_banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/SaveUserChromeJS/isntall_banner.png -------------------------------------------------------------------------------- /uAutoPagerize2/SITEINFO_Writer.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize2/SITEINFO_Writer.jpg -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/img/mainUI.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/img/mainUI.jpg -------------------------------------------------------------------------------- /AddonsPage/AddonsPage_userChromeJS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/AddonsPage/AddonsPage_userChromeJS.png -------------------------------------------------------------------------------- /stylishEdit/stylish0.5_edit.uc.js.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/stylishEdit/stylish0.5_edit.uc.js.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/img/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/img/setting.png -------------------------------------------------------------------------------- /viewSourceModoki/viewSourceModoki.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/viewSourceModoki/viewSourceModoki.png -------------------------------------------------------------------------------- /GreaemonkeyEnhancer/README.md: -------------------------------------------------------------------------------- 1 | GreaemonkeyEnhancer.uc.js 2 | ========================= 3 | 4 | 给 Greasemonkey 的菜单增加鼠标中键点击打开主页、为本站搜索脚本等功能 -------------------------------------------------------------------------------- /Inspector_de_Info/Inspector_de_Info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/Inspector_de_Info/Inspector_de_Info.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/img/installBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/img/installBar.png -------------------------------------------------------------------------------- /YoukuantiadsModY/swf/17173_Player_file.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/YoukuantiadsModY/swf/17173_Player_file.swf -------------------------------------------------------------------------------- /rebuild_userChrome/rebuild_userChrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/rebuild_userChrome/rebuild_userChrome.png -------------------------------------------------------------------------------- /uAutoPagerize/SITEINFO_Writer_devtools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/uAutoPagerize/SITEINFO_Writer_devtools.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/img/installedMsg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/img/installedMsg.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/img/installedMsg2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/img/installedMsg2.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/userChromeJS_Mix.xpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/userChromeJS_Mix.xpi -------------------------------------------------------------------------------- /InspectElementModY/xpi/InspectElementModY.xpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/InspectElementModY/xpi/InspectElementModY.xpi -------------------------------------------------------------------------------- /MyNovelReader/README.md: -------------------------------------------------------------------------------- 1 | uNovelReader.uc.js 2 | ================== 3 | 4 | 小说阅读uc版,已弃用。请用 [小说阅读GM版](https://userscripts.org/scripts/show/165951) 5 | -------------------------------------------------------------------------------- /YoukuantiadsModY/swf/17173_Player_stream.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/YoukuantiadsModY/swf/17173_Player_stream.swf -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/img/addMenu_启用禁用效果图.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/img/addMenu_启用禁用效果图.gif -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/img/home.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/icon16.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/icon20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/icon20.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/icon32.png -------------------------------------------------------------------------------- /YoukuantiadsModY/swf/17173_Player_file_out.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/YoukuantiadsModY/swf/17173_Player_file_out.swf -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/img/github.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/img/github.ico -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/img/kafan.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/img/kafan.ico -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/img/mozest.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/img/mozest.ico -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/icon16-old.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/icon16-old.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/option.css: -------------------------------------------------------------------------------- 1 | #toolbtn_setEditor { 2 | list-style-image: url(chrome://userchromejs/skin/img/toolbtn_setEditor.png); 3 | } -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/img/bitbucket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/img/bitbucket.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/img/download.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/img/download.gif -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/img/pan.baidu.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/img/pan.baidu.ico -------------------------------------------------------------------------------- /WordHighlightToolbarFix/WordHighlightToolbar.uc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/WordHighlightToolbarFix/WordHighlightToolbar.uc.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/img/tieba.baidu.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/img/tieba.baidu.ico -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/style/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/style/iconfont.woff -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/icon16-old (2).png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/icon16-old (2).png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/jscmd_edit_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/jscmd_edit_add.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/jscmd_edit_del.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/jscmd_edit_del.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/showToolsMenu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/showToolsMenu.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/toolbtn_rebuild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/toolbtn_rebuild.png -------------------------------------------------------------------------------- /Places_ShowBookmarkPath/src_Places_ShowBookmarkPath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/Places_ShowBookmarkPath/src_Places_ShowBookmarkPath.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/locale/en-US/userChromeJS.properties: -------------------------------------------------------------------------------- 1 | extensions.userChromeJS@mozdev.org.description = Chrome customization when an extension is excessive. 2 | -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/toolbtn_chromedir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/toolbtn_chromedir.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/toolbtn_openPrefs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/toolbtn_openPrefs.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/toolbtn_setEditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/toolbtn_setEditor.png -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/img/wiki.nothing.sh.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/content/img/wiki.nothing.sh.ico -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/img/toolbtn_restartApp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/HEAD/userChromeJS_Mix.xpi/src/skin/img/toolbtn_restartApp.png -------------------------------------------------------------------------------- /InspectElementModY/xpi/build.bat: -------------------------------------------------------------------------------- 1 | REM 这是一个自动打包成 xpi 的命令,需要有 7z 命令的支持 2 | 3 | CD src 4 | 7z a 1.zip * 5 | MOVE 1.zip .. 6 | CD .. 7 | DEL InspectElementModY.xpi 8 | RENAME 1.zip InspectElementModY.xpi -------------------------------------------------------------------------------- /.一些摘要/Firefox 样式.md: -------------------------------------------------------------------------------- 1 | Firefox 样式 2 | ============ 3 | 4 | 浏览器界面 5 | --------- 6 | 7 | - [Selectively show bookmarks toolbar - userstyles.org](http://userstyles.org/styles/45803/selectively-show-bookmarks-toolbar),书签工具栏只有在新标签页或主页显示。 -------------------------------------------------------------------------------- /InspectElementModY/xpi/src/chrome.manifest: -------------------------------------------------------------------------------- 1 | content InspectElement chrome/content/ 2 | 3 | skin InspectElement classic/1.0 chrome/skin/ 4 | 5 | locale InspectElement en-US chrome/locale/ 6 | locale InspectElement zh-CN chrome/locale/ 7 | -------------------------------------------------------------------------------- /Space_nextpage/README.md: -------------------------------------------------------------------------------- 1 | space_nextpage.uc.js 2 | ==================== 3 | 4 | 空格键页面底部翻页 5 | 6 | - 依次调用 uAutoPagerize、uSuper_preloader、nextPage.uc.xul 7 | - 默认设置小说阅读脚本启用后禁用。 8 | 9 | 我本来用类似的扩展,但它有问题,如果用了加载下一页的扩展或脚本(如uAutoPagerize、小说阅读脚本等),则会翻到第一页的下一页,而不是最后一页的下一页,故写了这个脚本自己用。 -------------------------------------------------------------------------------- /Inspector_de_Info/README.md: -------------------------------------------------------------------------------- 1 | # Inspector_de_Info.uc.js 2 | 3 | SITEINFO 翻页规则生成器,需要 firefox 32+,改自 [Inspector_de_Info.uc.js · Griever/userChromeJS](https://github.com/Griever/userChromeJS/blob/master/Inspector_de_Info.uc.js) 4 | 5 | ![Inspector_de_Info.png](Inspector_de_Info.png) -------------------------------------------------------------------------------- /uc_google_translator/README.md: -------------------------------------------------------------------------------- 1 | uc\_google\_translator.uc.js 2 | ============================ 3 | 4 | **已弃用,请改用原 [dannylee 的版本](http://j.mozest.com/zh-CN/ucscript/script/115/)** 5 | 6 | ## 修改 7 | 8 | - `about` 开头的页面不会全文翻译 9 | - 改进了按钮的点击方式。现在点击按钮翻译,点击旁边的下拉小三角弹出菜单 10 | - 修改了右键菜单的名字 -------------------------------------------------------------------------------- /InspectElementModY/xpi/src/chrome/content/overlay.xul: -------------------------------------------------------------------------------- 1 | 2 | 4 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.test/showMenubar.uc.js: -------------------------------------------------------------------------------- 1 | 2 | (function(){ 3 | 4 | let button = document.createElement('button'); 5 | button.setAttribute('label', '菜单栏'); 6 | button.setAttribute('tooltiptext', '显示菜单栏'); 7 | button.setAttribute('image', ''); 8 | button.addEventListener('command', function(){ 9 | var menubar = document.getElementById('toolbar-menubar'); 10 | if (menubar.hasAttribute('inactive')) { 11 | menubar.removeAttribute('inactive') 12 | } else { 13 | menubar.setAttribute('inactive', 'true') 14 | } 15 | }, false); 16 | 17 | let helpBtn = document.getElementById('PanelUI-help'); 18 | helpBtn.parentNode.insertBefore(button, helpBtn); 19 | })() -------------------------------------------------------------------------------- /showCompleteURL.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @include chrome://mozapps/content/downloads/unknownContentType.xul 3 | // @note 2014.06.06 add delay to fixe for new userChrome.js 4 | // ==/UserScript== 5 | location=="chrome://mozapps/content/downloads/unknownContentType.xul"&&(function (s) { 6 | setTimeout(function(){ 7 | s.value = dialog.mLauncher.source.spec; 8 | s.setAttribute("crop", "center"); 9 | s.setAttribute("tooltiptext", dialog.mLauncher.source.spec); 10 | s.setAttribute("ondblclick", 'Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper).copyString(dialog.mLauncher.source.spec)') 11 | }, 200) 12 | })(document.querySelector("#source")) -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/defaults/preferences/userChromeJS.js: -------------------------------------------------------------------------------- 1 | pref("extensions.userChromeJS@mozdev.org.description", "chrome://userChromeJS/locale/userChromeJS.properties"); 2 | 3 | // userChrome. 是 rebuild_userChrome 的存储方式 4 | pref("userChrome.closeWindow", false); 5 | 6 | // userChrome.js 的实验模式 7 | pref("userChrome.EXPERIMENT", false); 8 | 9 | pref("userChrome.enable.reuse", true); 10 | 11 | // userChrome.js 的导入脚本的文件夹 12 | pref("userChrome.arrSubdir", ", xul, TabMixPlus, withTabMixPlus, SubScript, UCJSFiles, userContent, userMenu"); 13 | 14 | pref("userChrome.install_skipSelect", true); 15 | pref("userChrome.custom_prefs", "userChrome., userChromeJS., uAutoPagerize., addMenu."); 16 | 17 | pref("userChrome.FILE", "local\\userChromejs_mix.json"); -------------------------------------------------------------------------------- /WordHighlightToolbarFix/README.md: -------------------------------------------------------------------------------- 1 | WordHighlightToolbar.uc 2 | ======================= 3 | 4 | 改自 [WordHighlightToolba · Griever/userChromeJS](https://github.com/Griever/userChromeJS/tree/master/WordHighlightToolbar) 5 | 6 | - 汉化 7 | - 改按钮为菜单 8 | - 增加对 super_preloader 或 GoogleMonkey 或 BaiduMonkey 等加载下一页高亮的支持。采用通用的方式注册事件,AutoPagerizeFindHighlight.uc 也不需要了。 9 | - 修改图标左键点击增加单词高亮,右键点击启用禁用。 10 | 11 | ![Super_preloader支持效果图](WordHighlightToolbar.uc.png) 12 | 13 | 说明 14 | ---- 15 | 16 | ### 用 FireGestures 或其它方式打开链接不高亮的情况 17 | 18 | 因为 `WordHighlightToolbar.uc.js` 需要 `this.lastClickedTime` 来判断是否是新标签。默认支持 click 和 dragend 2个事件。 19 | 20 | 用鼠标手势或其它方式打开链接,需要增加下面这段代码即可正常高亮。 21 | 22 | if (window.gWHT) 23 | gWHT.lastClickedTime = new Date().getTime(); -------------------------------------------------------------------------------- /InspectElementModY/README.md: -------------------------------------------------------------------------------- 1 | InspectElementModY.uc.js 2 | ======================== 3 | 4 | 元素查看调用工具,在需要查看的元素上按“Shift + 鼠标右键”调用。[Element Inspector :: Firefox 附加组件](https://addons.mozilla.org/zh-CN/firefox/addon/element-inspector/?src=search) 增强版。 5 | 6 | **推荐使用下面的扩展,uc 脚本可能并不是最新的。** 7 | 8 | - 不同于 inspectElement.uc.js 脚本,本脚本提取自扩展。解决了原 uc 脚本其它窗口无效的问题。 9 | - 新增设置界面,可分别选择网页、主窗口的查看器(Firebug 是最优选择),其它窗口需要 DOM Inspector。 10 | - 打开设置的菜单在 `开发者` 菜单中。ID 为 `InspectElement-menuitem`,可添加至 rebuild_userChrome。 11 | - 新增功能:使用已经存在的查看器。如果 Firebug 或自带查看器已经在使用,则会重用,并不会打开新的查看器。 12 | - 如果使用了 StrokesPlus 会失效。需要把 firefox 加入到排除列表。 13 | - 需要 Firefox 20+ 14 | 15 | ![setting.png](setting.png) 16 | 17 | ![menuitem.png](menuitem.png) 18 | 19 | xpi 20 | ---- 21 | 22 | 是直接修改 Element Inspector 扩展,好处是启用停用无需重启。 23 | 24 | - 已知问题:ff30 在图中菜单点击无效,而 ff31 有效。ff30 请到工具 -> web开发者 菜单中点击或附加组件选项点击。 -------------------------------------------------------------------------------- /setRelativeEditPath.uc.js: -------------------------------------------------------------------------------- 1 | 2 | location == 'chrome://browser/content/browser.xul' && (function(){ 3 | 4 | var PATH = '/chrome/lib/Notepad2.exe'; 5 | 6 | var handleRelativePath = function (path) { 7 | if (path) { 8 | path = path.replace(/\//g, '\\').toLocaleLowerCase(); 9 | var ProfD = Cc['@mozilla.org/file/directory_service;1'].getService(Ci.nsIProperties) 10 | .get("ProfD", Ci.nsILocalFile).path; 11 | if (/^(\\)/.test(path)) { 12 | return ProfD + path; 13 | } else { 14 | return path; 15 | } 16 | } 17 | }; 18 | 19 | var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); 20 | file.initWithPath(handleRelativePath(PATH)); 21 | if (file.exists()) { 22 | gPrefService.setCharPref('view_source.editor.path', file.path); 23 | } 24 | 25 | })() -------------------------------------------------------------------------------- /YoukuantiadsModY/README.md: -------------------------------------------------------------------------------- 1 | 2 | youkuantiadsModY.uc.js 3 | ======================= 4 | 5 | 视频去广告去黑屏。基于 [youkuantiads.uc.js](http://bbs.kafan.cn/thread-1509944-1-1.html) 修改增强。 6 | 7 | - 自动在 chrome 目录下创建 swf 文件夹并下载播放器到本地(不需要 wget.exe),然后把网络地址替换为本地地址。 8 | - 在 `工具` 菜单中新增 `更新视频播放器` 菜单,更新完毕后会输出简易的相关信息。 9 | - 如果 `请求超时`,请使用代理。 10 | - 新增 2个 17173 播放器,来自 [catcat520](http://bbs.kafan.cn/thread-1725172-1-1.html)。 11 | - ~~新增:本地播放器检测功能。如果有本地播放器则使用本地的路径,否则使用默认的网络播放器。~~ 12 | - ~~新增:提前判断是否为 flash,加快速度。~~ *已反馈给作者,作者的7月2日版本已经增加。* 13 | - 修正打开新窗口而重复注册的问题。 14 | 15 | id 为 `youkuAntiADsMod`,执行命令为 16 | 17 | oncommand: "document.getElementById('youkuAntiADsMod').doCommand();" 18 | 19 | ### 网易云音乐增强器 20 | 21 | 提取自 [网易云音乐增强器\[Chrome\]](https://chrome.google.com/webstore/detail/nmlhnfbdfkfebdofdfffnjmnkfmjcdgb),具体说明看附件:网易云音乐增强器.rar 22 | 23 | [我的 Firefox 分享](http://pan.baidu.com/s/1sjjTpnR#dir/path=%2FShare%2FFirefox) -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/update.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 2.0 9 | 10 | 11 | {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 12 | 36.* 13 | 42.* 14 | https://github.com/ywzhaiqi/userChromeJS/raw/master/userChromeJS_Mix.xpi/userChromeJS_Mix.xpi 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /statusbarButtonScrapbook.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name statusbarButtonScrapbook.uc.js 3 | // @namespace http://space.geocities.yahoo.co.jp/gl/alice0775 4 | // @description right click on statusbar Button for Scrapbook 5 | // @include main 6 | // @compatibility Firefox 2.0 3.0 7 | // @author Alice0775 8 | // @version LastMod 2007/08/13 10:00 9 | // @Note 10 | // ==/UserScript== 11 | (function(){ 12 | var statusbarBottun = document.getElementById('ScrapBookStatusPanel'); 13 | if( !statusbarBottun ) return; 14 | statusbarBottun.removeAttribute('onclick'); 15 | statusbarBottun.addEventListener('click',function(event){ 16 | event.preventDefault(); 17 | event.stopPropagation(); 18 | if ( event.button == 2 ) 19 | document.getElementById('ScrapBookStatusPopup').showPopup(); 20 | else if ( event.button == 1 ) 21 | toggleSidebar('viewScrapBookSidebar'); 22 | },true); 23 | })(); -------------------------------------------------------------------------------- /UserScriptLoaderPlus/README.md: -------------------------------------------------------------------------------- 1 | # UserScriptLoaderPlus 2 | 3 | ## 文件说明 4 | 5 | - UserScriptLoaderMod.uc.js:**危险,请勿使用**,Greasemonkey 模拟器。新增 GM\_saveFile、GM\_download 等 API,个人用于特殊用途。 6 | - UserScriptLoaderPlus.uc.js 7 | 8 | ## UserScriptLoaderPlus.uc.js 9 | 10 | Greasemonkey 的 uc 脚本版。原脚本 [UserScriptLoader.uc.js By Griever](https://github.com/Griever/userChromeJS/tree/master/UserScriptLoader),[dannylee 的版本](http://g.mozest.com/viewthread.php?tid=41278&highlight=UserScriptLoader) 11 | 12 | - 本脚本根据 [boy3510817 整合 dannylee 和 lastDream2013 版本](http://bbs.kafan.cn/thread-1688975-1-1.html) 修改。 13 | - 新增:脚本如果没有下载地址,会用安装地址替换。 14 | - 新增:根据一定规则得到主页链接,在脚本菜单上鼠标中键点击打开主页。 15 | - 新增:@include 正则表达式的支持。 16 | - 新增:更新脚本功能。如果脚本已被修改,新脚本会被下载到 newVersion 目录下,否则会自动替换。 17 | - 新增:"为本站搜索脚本" 增加右键搜索关键词功能。 18 | - 新增:"保存当前页面的脚本" 增加保存后提示,并保存安装地址、安装时间等信息(统一保存在 UserScriptLoader.json 文件中)。 19 | - 新增:替换原 console,原 console 真的很弱,只能输出字符串。 20 | - 修正:nightly(Firefox 33)下 GM_xmlhttpRequest 失效的问题(参考 Greasemonkey 2.0 修正版)。 21 | - 其它细节上的改进。 22 | 23 | PS:由于我本人并没有使用这个脚本,所以可能不会更新。可使用 [feiruo 的版本](https://github.com/feiruo/userChromeJS/blob/master/UserScriptLoaderPlus.uc.js) 24 | 25 | 备注 26 | ---- 27 | 28 | 还有几个小问题,但并不影响使用。 -------------------------------------------------------------------------------- /.修改版/README.md: -------------------------------------------------------------------------------- 1 | 修改版 2 | ====== 3 | 4 | 这是修改他人 uc 脚本,**不保证更新,有问题请使用原版**。 5 | 6 | - 由于使用了 pentadactyl,隐藏了地址栏,故会对一些脚本进行修改。 7 | - 也可能是对脚本的一些完善和修正。 8 | 9 | 脚本列表 10 | 11 | - [ExternalFuncButtonM](ExternalFuncButtonM),修改为外置规则可重载版本。 12 | - [ExternalFuncButtonM-右键菜单版.uc.js](ExternalFuncButtonM-右键菜单版.uc.js),右键菜单版。 13 | - [autoContextmenu.uc.xul](autoContextmenu.uc.xul),选中文字后自动弹出右键菜单。 14 | - 排除 input 和 textarea。 15 | - [nextpageModY.uc.js](nextpageModY.uc.js),原脚本 [NextPage.uc.xul](http://j.mozest.com/zh-CN/ucscript/script/5/) 16 | - 从 uc.xul 改为 .uc.js 文件。 17 | - 修改了跨域链接的判断,以便支持优酷视频的评论翻页。[测试页面](http://v.youku.com/v_show/id_XMjE4MDU1MDE2.html)。 18 | - 增加了一个规则:www.google.com/cse 19 | - **我已放弃使用**,改用 [NextPageModY.user.js](https://github.com/ywzhaiqi/userscript/tree/master/NextPage)。 20 | - [Redirector.uc.js 外置规则版](Redirector.uc.js),修改为可移动按钮。 21 | - [原版卡饭链接](http://www.kafan.cn/forum.php?mod=viewthread&tid=1621837) 22 | - [原版 mozest.com 链接](http://j.mozest.com/zh-CN/ucscript/script/112/) 23 | - [smartproxy_可移动按钮.uc.js](smartproxy_可移动按钮.uc.js),完善可移动按钮,不支持放在 panelUI 里面。 24 | - [textLink.uc.js](textLink.uc.js) 25 | - 添加了一行 `&& doc.contentType != 'text/javascript'` 增加 js 文件的支持。 -------------------------------------------------------------------------------- /uAutoPagerize2/uAutoPagerizeUI/main.css: -------------------------------------------------------------------------------- 1 | @namespace url('http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'); 2 | 3 | .inspect { 4 | list-style-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACAUlEQVQ4jZXSQWgTURAG4D9pNYISakugKJ6860HBS8W1tiqmW2OVYgSpiKAHG1OaxJYgrDl5sBCXoAfFSlo8BESDspciqx4sbjapVtSiFQSRll5CtmlTuvveeLALVneDDszpzXxvYAZYH144hxeAx+XtV0iS5AUAWZZ3iqIYE4S2m8FgMDkyIu9eK3EH7OZodPBCSDy4PH73Ok08ucUejd+gi+d7zHA4nKyHNABAf//AgTO9R0y+NEXEP1q89pbRctEyy5Ns8HKY4vH4OQDI5XINjsCO7a0PFr6/JDKnV82yRtzQiVV04kbBmvuikHhUKKmquslxEkVR/CePd0xTdYq4UWS0WCQ7maETLWqUiPaZmqa1OgLZbHbzscNtBVoqETf09UBFJ6qVKHLptKW6AF4A6GwXxr5+ekbEPqxa5TfEKgUyyxqnlXfmwrcJErs6XiuK4nMFRkfH9p/qbq+tVItENMs4m2GcPjOiWStx5SyFQj1RANB1fcNfa7DXGIkMnOjuOvTj/u1r9EK5wx/eS1GnsPc9gMnmpqb5VCq1BwBUVW10RfL5/LahoWQ4MTzcF4td7ZUkqXlt5Od+v7+STqd3/V7vhPx5LB4AkGXZB+Cpz+erZjKZfY7bsBFVVRvtBOCxf5MkaSOAVy0tWx+7AnXCLt4SCASc7+Efkf9uqov8BEtwDwXhLuv5AAAAAElFTkSuQmCC); 5 | } 6 | .check { 7 | list-style-image: url('chrome://global/skin/icons/find.png'); 8 | -moz-image-region: rect(0px, 48px, 16px, 32px); 9 | } 10 | .inspect-devtools { 11 | list-style-image: url('chrome://browser/skin/devtools/inspect-button.png'); 12 | -moz-image-region: rect(0px, 16px, 16px, 0px); 13 | } -------------------------------------------------------------------------------- /ExternalVideoPlayer/README.md: -------------------------------------------------------------------------------- 1 | ## yunPlayer.uc.js 右键云点播 2 | 3 | ![云点播.png](云点播.png) 4 | 5 | - 迅雷云播打开磁力链接有问题,暂时复制链接到剪贴板 6 | 7 | ## ExternalVideoPlayer.uc.js 8 | 9 | 调用外部播放器播放网络视频。 10 | 11 | ### 原理 12 | 13 | 先通过 flvcd.com 解析得到地址列表,然后调用本地播放器播放。 14 | 15 | ### 视频网站 16 | 17 | - [优酷网](http://www.youku.com/)、[腾讯视频](http://v.qq.com/)、[新浪视频](http://video.sina.com.cn/)、[网易视频](http://v.163.com)、酷6网、PPS、激动网、糖豆网、百度贴吧视频、华数TV、风行网等 18 | - 视频链接、视频文字链接、百度云链接、flvcd 网站 19 | - 非分段:[音悦台](http://tv.letv.com/)、[乐视网](http://tv.letv.com/)、[56网](http://www.56.com)、[迅雷看看](http://www.kankan.com/) 20 | - 没法直接播放:[土豆网](http://www.tudou.com/)、[奇艺网](http://www.iqiyi.com/)、[搜狐视频](http://tv.sohu.com)、[PPTV](http://v.pptv.com) 21 | - 百度盘分享的视频可直接观看,体验不错。 22 | 23 | ### 使用说明 24 | 25 | 在支持的站点通过右键菜单调用。 26 | 27 | - **第一次会要求设置播放器路径**。 28 | - 菜单直接点击会启动播放(清晰度为 flvcd 网站设置的清晰度)。 29 | - 菜单二级菜单可以选择清晰度。 30 | - 脚本内 `IS_CLOSE_TAB` 为启动后是否自动关闭标签,false 为自动不关闭。 31 | - 特殊处理了百度盘链接。可通过 Share easy downloads helper 等脚本得到直接链接后,右键也会出现菜单,点击后可直接调用播放器播放。 32 | 33 | 播放列表文件的格式说明 34 | 35 | - 默认为 asx,wmp 需要安装解码器(完美解码等)。 36 | - mplayer、SMPlayer 为 pls。 37 | - vlc 为 xspf。 38 | - 如果为 BaiduPlayer,会启动播放器并复制链接到剪贴板。 39 | 40 | 其它说明 41 | 42 | - 脚本内 `DEFAULT_ENCODING` 为播放列表的编码,默认为 gbk。 43 | - 内置下载会同时开始,片段个数多的话会卡。 44 | - 脚本内 `IDM_PATH` 为 IDM 的路径,设置正确可调用 IDM 下载。 45 | - 有些链接没法用外部下载工具直接下载。 -------------------------------------------------------------------------------- /autoLaunchReader/README.md: -------------------------------------------------------------------------------- 1 | autoLaunchReader.uc.js 2 | ====================== 3 | 4 | 通过点击按钮调用阅读扩展或脚本进行阅读,也可通过添加地址自动调用。个人 小说阅读脚本和 Evernote Clearly 配合使用。 5 | 6 | ## 特性 7 | 8 | - 点击按钮手动调用阅读工具。 9 | - 输入地址后,在启用模式下,匹配地址会自动调用。 10 | - 小说阅读脚本支持的网站会优先调用,失败后会再次调用其它工具(需小说阅读脚本 2.0+)。 11 | 12 | ## 支持的阅读工具 13 | 14 | 按照顺序查找调用 15 | 16 | 1. [小说阅读脚本 for Greasemonkey](https://userscripts.org/scripts/show/165951) 17 | 2. [Evernote Clearly :: Firefox 附加组件 - Mozilla Add-ons](https://addons.mozilla.org/zh-cn/firefox/addon/clearly/) 18 | 3. [Readability 中文增强版 for Greasemonkey](https://userscripts.org/scripts/show/163581) 19 | 20 | ## 说明 21 | 22 | 按钮左键点击调用阅读工具,右键点击弹出菜单,`设置自动启用的站点` 点击后弹出设置对话框。 23 | 24 | #### 启用禁用自动阅读 25 | 26 | ![按钮2种状态](按钮2种状态.png) 27 | 28 | #### 弹出菜单 29 | 30 | ![弹出的菜单](弹出的菜单.png) 31 | 32 | #### 设置自动启用站点对话框 33 | 34 | ![设置自动启用站点对话框](设置自动启用站点对话框.png) 35 | 36 | **输入框1**:按`确定` 按钮或 输入框内 `确定键` 输入结果,地址经过简单处理,`原始地址` 显示当前页面的地址(未处理)。 37 | 38 | **输入框2**:全部地址列表,一行一个地址。 39 | 40 | **地址格式说明** 41 | 42 | - 格式一: 用 `*` 匹配地址,示例:`http://www.cnbeta.com/articles/*.htm` 43 | - 格式二: 开头 `re;`,后面接正则表达式,示例:`re;^http://www\.cnbeta\.com/articles/\d+\.htm$` 44 | 45 | ## 调用命令 46 | 47 | 通过 鼠标手势 等程序调用 48 | 49 | autoReader.launch(); 50 | 51 | ## 未完善的 52 | 53 | - Evernote Clearly 修改版 54 | - 加入中文下一页关键字,同时加入ajax头信息(防乱码) 55 | - 原扩展默认立即加载所有页面,故类似小说网站的,会从当前页加载到最后一页,可能会很卡。 -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/options.js: -------------------------------------------------------------------------------- 1 | let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; 2 | 3 | var mainWindow = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator) 4 | .getMostRecentWindow("navigator:browser"); 5 | 6 | var userChromeOptions = { 7 | init: function() { 8 | 9 | }, 10 | openEdit: function() { 11 | var path = this.setEditor(); 12 | if (path) { 13 | document.getElementById('editorPath').value = path; 14 | } 15 | }, 16 | onDialogAccept: function() { 17 | mainWindow.userChromejsScriptOptionsMenu.run(); 18 | }, 19 | setEditor: function() { 20 | var userChromejs = mainWindow.userChromejs; 21 | 22 | var fp = Components.classes['@mozilla.org/filepicker;1'] 23 | .createInstance(Components.interfaces.nsIFilePicker); 24 | fp.init(window, "设置全局脚本编辑器", fp.modeOpen); 25 | fp.appendFilter("执行文件", "*.exe"); 26 | if (fp.show() == fp.returnCancel || !fp.file) 27 | return; 28 | else { 29 | var ss = fp.file.path; 30 | mainWindow.gPrefService.setCharPref("view_source.editor.path", ss); 31 | userChromejs.editor = ss; 32 | return ss; 33 | } 34 | } 35 | }; 36 | 37 | window.addEventListener('load', userChromeOptions.init); -------------------------------------------------------------------------------- /uAutoPagerize/_uAutoPagerize.js: -------------------------------------------------------------------------------- 1 | // uAutoPagerize 的配置文件。Ver 0.2.2 以上专用。 2 | // 本体更新時に設定を書き換える手間を省くためのもので、無くても問題ない。 3 | 4 | // 排除列表 5 | var EXCLUDE = [ 6 | 'https://mail.google.com/*' 7 | ,'http://www.google.*/reader/*' 8 | ,'http://maps.google.*/*' 9 | ,'http://b.hatena.ne.jp/*' 10 | ,'http://www.livedoor.com/*' 11 | ,'http://reader.livedoor.com/*' 12 | ,'http://fastladder.com/*' 13 | ,'http://*mail.yahoo.*/*' 14 | ,'*/archives/*' 15 | 16 | // 一些不需要翻页的网站 17 | ,'https://app.yinxiang.com/*' 18 | ,'https://www.dropbox.com/*' 19 | ,'http://www.toodledo.com/*' 20 | ]; 21 | 22 | // 自定义站点,优先级最高 23 | var MY_SITEINFO = [ 24 | // 下面的都是示例 25 | //{ 26 | // siteName: "google", 27 | // url: '^https?\\:\\/\\/(www|encrypted)\\.google\\..{2,9}\\/(webhp|search|#|$|\\?)', 28 | // nextLink: "//a[div[@id=('nn')]] | //a[span/@id='nn'] | id('nav')//td[last()]/a | id('nn')/parent::a", 29 | // pageElement: "//div[@id='ires']", 30 | // exampleUrl: 'http://www.google.com.hk/' 31 | //}, 32 | //{ 33 | // siteName: '百度贴吧', 34 | // url: '^http://tieba\\.baidu\\.(cn|com)/f', 35 | // nextLink: '//div[@class="pager clearfix"]/descendant::a[@class="next"]', // xpath 36 | // nextLink: 'auto;', // Super_preloader 的自动查找 37 | // nextLink: 'css;.pager a.next', // Super_preloader 的 css 选择器 38 | // pageElement: '//ul[@id="thread_list"]', 39 | //} 40 | ]; 41 | 42 | // 本体に組み込まれている MICROFORMAT を利用するか? 43 | USE_MICROFORMAT = true; 44 | -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/install.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | userChromeJS_Mix@develop.com 8 | userChromeJS Mix 9 | 2.0 10 | 2 11 | true 12 | 13 | ywzhaiqi 14 | alta88 15 | zeniko (original author of userChrome.js) 16 | Alice0775 17 | dannylee 18 | chrome://userchromejs/content/options.xul 19 | chrome://userchromejs/skin/img/icon32.png 20 | 21 | https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/master/userChromeJS_Mix.xpi/update.rdf 22 | 23 | https://github.com/ywzhaiqi/userChromeJS/tree/master/userChromeJS_Mix.xpi 24 | 25 | 26 | 27 | 28 | {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 29 | 36.* 30 | 42.* 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /.一些摘要/Chrome 系扩展.md: -------------------------------------------------------------------------------- 1 | Chrome 系扩展 2 | ========= 3 | 4 | @[Chrome|Extension] 5 | 6 | ### 常用 7 | 8 | - **[Adkill and Media Download](https://chrome.google.com/webstore/detail/adkill-and-media-download/lcibdonokophlabplhpmmmjjbgohgcok?hl=zh-CN)**:去视频广告、视频音频下载、正常显示反盗链图片三合一。 9 | - **Tampermonkey** 10 | - [Super_preloaderPlus_one](https://userscripts.org/scripts/source/178900.user.js) 11 | - [My Novel Reader](https://userscripts.org/scripts/source/165951.user.js) 12 | - [booklink.me 增强](https://userscripts.org/scripts/source/165572.user.js) 13 | - [豆藤 Bean vine](http://userscripts.org/scripts/source/49911.user.js) 14 | - [Userscripts.org 风险脚本过滤器](https://userscripts.org/scripts/source/164600.user.js) 15 | - 百度盘:BaiduPanDownloadHelper、网盘工具箱、 16 | - **Stylish** 17 | - **[chromeIPass](https://chrome.google.com/webstore/detail/chromeipass/ompiailgknfdndiefoaoiligalphfdae?hl=zh-CN)** 18 | - Redirector:任意重定向URL/修改HTTP头 19 | - **[Vimium](https://chrome.google.com/webstore/detail/dbepggeogbaibhgnhhndojpepiihcmeb)** 20 | - [SimpleExtManager](https://chrome.google.com/webstore/detail/simpleextmanager/kniehgiejgnnpgojkdhhjbgbllnfkfdk/related) 21 | - [印象笔记·悦读](https://chrome.google.com/webstore/detail/iooicodkiihhpojmmeghjclgihfjdjhj) 22 | 23 | ### 可选 24 | 25 | - Adblock Plus(奶牛) 26 | - Smooth Gestures 27 | - 超级拖曳 28 | - Sexy Undo Close Tab 29 | - 有道词典Chrome划词插件 30 | - 如意淘 31 | - 可能需要的 32 | - LastPass 33 | - Lookup Companion for Wikipedia 34 | - Proxy SwitchySharp 35 | - FaWave(发微):多微博 36 | - 娱乐 37 | - 豆瓣FM 精美版 38 | - 虾壳 ~MusicCase~ -------------------------------------------------------------------------------- /rebuild_userChrome/README.md: -------------------------------------------------------------------------------- 1 | rebuild_userChrome.uc.xul 2 | ------------------------- 3 | 4 | uc 脚本管理器。[原作者地址(日文)](https://github.com/alice0775/userChrome.js/blob/master/rebuild_userChrome.uc.xul)。 5 | 6 | **已弃用,改用 userChromeJS_Mix 扩展。** 7 | 8 | - [rebuild_userChrome.uc.xul](rebuild_userChrome.uc.xul),基于 [UserChromeJS脚本管理器Dannylee强化版](http://g.mozest.com/thread-41292-1-1),修改为可移动版。 9 | - 旧的 [rebuild_userChrome(工具菜单版).uc.xul](rebuild_userChrome(工具菜单版).uc.xul) 10 | 11 | 旧的说明 12 | -------- 13 | 14 | ## 修改如下 15 | 16 | - 第64行 editor 为编辑器的路径,如果空则为 "about:config" 中 "view_source.editor.path" 的路径 17 | - 第44行 movedMenus 为 其它uc脚本设置的 id,加入后可移动到 "userChromeJS用户脚本命令" 处统一管理 18 | - 删除了原脚本的拖曳功能(需配合另一个脚本,且不好用) 19 | 20 | 用户脚本命令示例: 21 | 22 | "JSCSS-menuitem", // js、css、ahk 代码着色开关 23 | "addMenu-rebuild", // addMenu 重新载入配置 24 | "sw-menuitem", // siteinfo_write 25 | 26 | ## 原版 rebuild_userChrome 用户选项说明 27 | 28 | 可以把菜单(包含 uc脚本 添加的)添加到 "userchromeJS用户脚本命令" 菜单中进行统一管理。 29 | 30 | 方法:在 `rebuild_userChrome.uc.xul` 文件中下面的地方,自行添加菜单的 ID 31 | 32 | var userChromejsScriptOptionsMenu = { 33 | //あまり使わないメニューのリスト 34 | menues: [ 35 | // "easydragMODOption", // easydrag_customMOD.uc.js 36 | "wordhighlight-toolbar-menuitem", // WordHighlightToolbar.uc.js 37 | "JSCSS-menuitem", // js、css、ahk 代码着色 38 | "addMenu-rebuild", // addMenu 的重新载入配置 39 | // "sw-menuitem", // siteinfo_write 40 | // "uSuper_preloader-menuitem", 41 | 42 | // "ieviewModokiTool", 43 | // "linkloadInBackgroundToolMenu", 44 | // "SaveFolderToolsMenu", 45 | // "ucjs_copysysinfo-menu" 46 | ], 47 | -------------------------------------------------------------------------------- /AddonsPage/README.md: -------------------------------------------------------------------------------- 1 | AddonsPage.uc.js 2 | ================ 3 | 4 | 附件组件页面(about:addons)右键新增查看所在目录,详细信息页面新增安装地址或路径,新增 uc脚本管理页面。[卡饭论坛地址](http://bbs.kafan.cn/thread-1617407-1-1.html) 5 | 6 | ## 说明 7 | 8 | - 附件组件页面右键新增查看所在目录(支持扩展、主题、插件、uc脚本)、复制名字。Greasemonkey、Scriptish 自带已经存在。 9 | - 附件组件详细信息页面新增GM脚本、扩展、主题安装地址和插件路径,右键即复制。 10 | - 新增 uc脚本管理页面 11 | - 右键菜单 "查看附加组件" 需要 DOM Inspector 12 | - 右键菜单 "重载 uc 脚本(慎用)" 13 | - 修改调试用,重新载入 uc 脚本无需重启 14 | - **慎用**,仅部分脚本支持,不支持的脚本会出现重复添加按钮或菜单或事件等问题。 15 | - 需要在代码中设置 `debug: 1` 16 | - 如有问题,重启火狐。 17 | - **AddonsPageSimple.uc.js** 是精简版,仅在附加组件页面添加 uc脚本面板,无右键菜单等。 18 | 19 | #### 右键菜单 20 | 21 | ![右键菜单.png](右键菜单.png) 22 | ![右键菜单_GM.png](右键菜单_GM.png) 23 | ![右键菜单_uc.png](右键菜单_uc.png) 24 | 25 | #### uc脚本管理界面 26 | 27 | - 启用禁用需要 rebuild_userChrome.uc.xul 28 | - 详细页面新增的信息需要 [修改版userChrome.js](https://github.com/ywzhaiqi/userChromeJS/tree/master/userChrome.js) 29 | - 新增对uc脚本多个参数的识别:`// @homepageURL`、`// @reviewURL`、`// @optionsURL` 30 | - 需要脚本内的支持,我的一些脚本已经加上。 31 | - 编辑命令需要首先设置 view\_source.editor.path 的路径,可用网址 about:config?filter=view_source.editor.path 打开 32 | 33 | ![AddonsPage_userChromeJS.png](AddonsPage_userChromeJS.png) 34 | 35 | ![uc脚本详细页面.png](uc脚本详细页面.png) 36 | 37 | #### 详细页面 38 | 39 | ![详细页面.png](详细页面.png) 40 | 41 | ## 参考 42 | 43 | - [Add InstallUrl Or Path To AddonsPage 脚本 By Crab](http://j.mozest.com/zh-CN/ucscript/script/109/) 44 | - [Add-ons Manager Context Menu 扩展](https://addons.mozilla.org/zh-cn/firefox/addon/am-context/) 45 | - OpenAddonFolder.uc.js 46 | - Greasemonkey 和 Scriptish 扩展 47 | - Firefox 源代码 48 | 49 | ## 写这个脚本的说明 50 | 51 | - AM 扩展菜单太多了,在 Scriptish 页面更加混乱,且没有安装链接 52 | - AM 扩展不支持查看 plugin 的路径 -------------------------------------------------------------------------------- /.修改版/_redirector.js: -------------------------------------------------------------------------------- 1 | rules = [ 2 | // { 3 | // name: "about:haoutil", // 规则名称 4 | // from: "about:haoutil", // 需要重定向的地址 5 | // to: "https://haoutil.googlecode.com", // 目标地址 6 | // // 支持函数(function(matches){}),返回必须是字符串 7 | // // 参数 matches: 正则,匹配结果数组(match函数结果); 通配符,整个网址和(*)符号匹配结果组成的数组; 字符串,整个网址 8 | // wildcard: false, // 可选,true 表示 from 是通配符 9 | // regex: false, // 可选,true 表示 from 是正则表达式 10 | // resp: false, // 可选,true 表示替换 response body 11 | // state: false // 可选,true 表示该条规则生效 12 | // }, 13 | // { 14 | // name: "google链接加密", 15 | // from: /^http:\/\/(([^\.]+\.)?google\..+)/i, 16 | // exclude: /google\.cn/i, // 可选,排除例外规则 17 | // to: "https://$1", 18 | // regex: true 19 | // }, 20 | // { 21 | // name: "google搜索结果禁止跳转", 22 | // from: /^https?:\/\/www\.google\.com\/url\?.*url=([^&]*).*/i, 23 | // to: "$1", 24 | // regex: true 25 | // } 26 | { 27 | name: "userscripts:8080", 28 | from: /^https?:\/\/userscripts\.org\/(.*)/i, 29 | to: "http://userscripts.org:8080/$1", 30 | regex: true 31 | }, 32 | { 33 | // 包含手机版界面 34 | name: "百度随身听(音质改320)", 35 | from: /^http:\/\/music\.baidu\.com\/data\/music\/fmlink(.*[&\?])rate=[^3]\d+(.*)/i, 36 | to: "http://music.baidu.com/data/music/fmlink$1rate=320$2", 37 | regex: true 38 | } 39 | ]; -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/updateInfo.md: -------------------------------------------------------------------------------- 1 | 更新日志 2 | ======== 3 | 4 | ### 版本 2.0 2015-08-18 5 | 6 | * 更新到 userChromeJS.xpi 2.0 7 | 8 | ### 版本 1.8.1 2015-06-26 9 | 10 | * 更改了 id 不跟原版一致 11 | * 修正 ff36 安装脚本出错的问题,更改最小版本为 36 12 | * userChrome.js 跟随作者更新到 v3.0.48mod 13 | 14 | ### 版本 1.7.4 15 | 16 | * 一些修正 17 | 18 | ### 版本 1.7.3 2014-9-16 19 | 20 | * 在线网址按书写顺序排列 21 | * 修正导入设置按钮无效的问题 22 | * 管理界面启用禁用脚本增加对 restartless 脚本的支持 23 | * 更新界面增加对没有版本号的提示,并改成有序序列 24 | 25 | ### 版本 1.7.2 2014-9-15 26 | 27 | * 修正取消勾选 "使用脚本缓存" 时,新窗口解析 uc 脚本出错的问题。 28 | 29 | ### 版本 1.7.1 2014-9-13 30 | 31 | * 更改路径为 local\userChromejs_mix.json,并可从 userChrome.FILE 中读取值 32 | 33 | ### 版本 1.7.0 2014-9-12 34 | 35 | * 新增:新的 uc 脚本管理器 36 | * 新增:在安装时保存安装地址和安装时间等信息。 37 | * 修正:更新全部脚本的 bug 38 | * 转移部分菜单命令到新的 uc 脚本管理器中 39 | 40 | ### 版本 1.6.0 2014-9-6 41 | 42 | * 新增:检查脚本是否有更新的功能 43 | * 修改:紫云飞拖曳生成器的识别链接函数改为 Easy DragToGo+ 扩展的函数,并隐藏了部分搜索选中文字菜单。 44 | * 其它一些调整 45 | 46 | ### 版本 1.5.2 2014-9-5 47 | 48 | * 修正2个小问题 49 | 50 | ### 版本 1.5.1 2014-08-31 51 | 52 | * 增加 userChrome.js 导入中文目录的支持 53 | 54 | ### 版本 1.5 2014-8-3 55 | 56 | * 大量改进 57 | * 内置了 userChrome.js 文件 58 | * 新增了安装、卸载、启用禁用脚本,支持了无需重启的脚本。 59 | * 新增了导入导出脚本设置,addMenu 和紫云飞拖曳、手势生成器,在线网址等 60 | * 改进了设置界面 61 | * 修改 uc 脚本菜单到顶层 62 | * 其它 63 | 64 | ### 版本 1.4 2014-7-8 65 | 66 | * 新增:鼠标中键打开主页或下载链接,ctrl + 鼠标中键切换多脚本的启用或停用 67 | * 新增:扩展在附加组件界面的图标 68 | * 更新:注释了原脚本的附加组件栏拖曳保存功能。ff29+ 已经没有附加组件栏,且需要 saveFolderModoki 脚本,还不好用 69 | * 更新:第一层目录移动到顶层,简化目录的名字 70 | 71 | ### 版本 1.3 2014-7-7 72 | 73 | * 更新:分离样式和图片 74 | * 修正:按钮图标如果添加外边框样式会让图标显得很小的问题 75 | * 修正:启动时按钮或菜单需要很久才能隐藏的问题 76 | 77 | ### 版本 1.2 2014-7-7 78 | 79 | * 修正:更新地址 80 | 81 | ### 版本 1.1 2014-7-7 82 | 83 | * 新增:第一次使用不再需要拖出 84 | * 更新:更改更新地址、添加更新信息(正在试验中) 85 | * 修正:rebuild\_userChrome.uc.xul 移动菜单列表为空时出现的 bug 86 | 87 | ### 版本 1.0 2014-7-6 88 | 89 | * 更新: 初始版本 -------------------------------------------------------------------------------- /InspectElementModY/xpi/src/chrome/content/overlay.js: -------------------------------------------------------------------------------- 1 | var InspectElement = { 2 | handleEvent: function (e) { 3 | if (!e.shiftKey || e.button != 2) return; 4 | e.stopPropagation(); 5 | e.preventDefault(); 6 | if (e.type != "click") return; 7 | var elem = e.originalTarget; 8 | window.openDialog("chrome://inspector/content/", "_blank", 9 | "chrome, all, dialog=no", elem); 10 | this.closePopup(elem); 11 | }, 12 | closePopup: function (elem) { 13 | var parent = elem.parentNode; 14 | var list = []; 15 | while (parent != window && parent != null) { 16 | if (parent.localName == "menupopup" || parent.localName == "popup") { 17 | list.push(parent); 18 | } 19 | parent = parent.parentNode; 20 | } 21 | var len = list.length; 22 | if (!len) return; 23 | list[len - 1].hidePopup(); 24 | } 25 | }; 26 | 27 | window.addEventListener("click", InspectElement, true); 28 | // fix context menu bug in linux 29 | if (navigator.platform.indexOf("Win") == -1) { 30 | //window.addEventListener("mousedown", InspectElement, true); 31 | window.addEventListener("mouseup", InspectElement, false); 32 | window.addEventListener("contextmenu", InspectElement, true); 33 | } 34 | window.addEventListener("unload", function (e) { 35 | window.removeEventListener("unload", arguments.callee, false); 36 | window.removeEventListener("click", InspectElement, true); 37 | if (navigator.platform.indexOf("Win") == -1) { 38 | //window.removeEventListener("mousedown", InspectElement, true); 39 | window.removeEventListener("mouseup", InspectElement, false); 40 | window.removeEventListener("contextmenu", InspectElement, true); 41 | } 42 | }, false); 43 | -------------------------------------------------------------------------------- /TabFocus.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name TabFocus.uc.js 3 | // @startup window.tab_hover.onLoad(); 4 | // @shutdown window.tab_hover.onUnload(); 5 | // @version 2014.8.23 6 | // @note 修改为无需重启的方式 7 | // ==/UserScript== 8 | 9 | if (window.tab_hover) { 10 | window.tab_hover.onUnload(); 11 | delete window.tab_hover; 12 | } 13 | 14 | window.tab_hover = { 15 | delay: 150, 16 | 17 | event: null, 18 | tid: null, 19 | 20 | onLoad: function() { 21 | gBrowser.tabContainer.addEventListener("mouseout", tab_hover.onMouseOut, false); 22 | gBrowser.tabContainer.addEventListener("mouseover", tab_hover.onMouseOver, false); 23 | 24 | // 右键点击则暂停 focus,但由于点击的相应时间问题,可能会更混乱 25 | // gBrowser.tabContainer.addEventListener("click", tab_hover.onMouseClicked, false); 26 | }, 27 | onUnload: function() { 28 | gBrowser.tabContainer.removeEventListener("mouseover", tab_hover.onMouseOver, false); 29 | gBrowser.tabContainer.removeEventListener("mouseout", tab_hover.onMouseOut, false); 30 | // gBrowser.tabContainer.removeEventListener("click", tab_hover.onMouseClicked, false); 31 | }, 32 | 33 | onMouseOver: function(event) { 34 | tab_hover.event = event.target; 35 | tab_hover.tid = setTimeout(function() { 36 | gBrowser.selectedTab = tab_hover.event; 37 | tab_hover.event=null; 38 | }, tab_hover.delay); 39 | }, 40 | onMouseOut: function() { 41 | if (tab_hover.tid) { 42 | clearTimeout(tab_hover.tid); 43 | tab_hover.tid = null; 44 | } 45 | }, 46 | onMouseClicked: function() { 47 | if (tab_hover.tid) { 48 | clearTimeout(tab_hover.tid); 49 | tab_hover.tid = null; 50 | } 51 | }, 52 | }; 53 | tab_hover.onLoad(); -------------------------------------------------------------------------------- /.一些摘要/Imagus 扩展摘要.md: -------------------------------------------------------------------------------- 1 | 2 | Imagus 3 | ======= 4 | 5 | 极为强大的跨平台图片查看器扩展。 6 | 7 | 作者主页:[Deathamns - Extension: Imagus](http://my.opera.com/Deathamns/blog/opera-extension-imagus),中文汉化版本:[Imagus (极为强大的图片查看器)](http://www.firefox.net.cn/read-48000-1) 8 | 9 | 同类扩展或脚本 10 | 11 | - [Mouseover Popup Image Viewer for Greasemonkey](http://userscripts.org/scripts/show/109262),[我添加的一些规则](https://github.com/ywzhaiqi/userscript/tree/master/Mouseover%20Popup%20Image%20Viewer) 12 | - [PageExpand :: Add-ons for Firefox](https://addons.mozilla.org/en-US/firefox/addon/pageexpand/) 13 | - [picViewer for Greasemonkey](http://userscripts.org/scripts/show/105741) 14 | 15 | 鼠标悬停看原图 16 | -------------- 17 | 18 | 有效的站点 19 | 20 | - weibo 21 | - douban 22 | - taobao 23 | - Google 图片搜索 24 | - Userscript.org、Firefox 官方扩展中心 25 | 26 | - 出现原图后按住鼠标右键一会,图片会居中并 27 | 28 | Sieve 29 | ------ 30 | 31 | ### 一些注意事项 32 | 33 | The extension first removes the ^https?://(www\.)? from the beginning of the URL. 34 | For example: https://www.test.com/image_thumb.jpg becomes test.com/image_thumb.jpg, and that URL will be tested against the regex (which, in this case, would start like ^test\.com/image...). 35 | At the end, the removed part will be added back to the result, so if your match resulted test.com/image.jpg, then the final URL will be https://www.test.com/image.jpg . 36 | 37 | There is an unnecessary ".jpg" at the end in "to" parameter. 38 | 39 | ### 自定义 Sieve 40 | 41 | 更新于 2013-11-20 42 | 43 | {"Baidu Tieba":{"img":"^(hiphotos|imgsrc)\\.baidu\\.com/(.+?)/.+?([0-9a-f]{40})","to":"$1.baidu.com/$2/pic/item/$3"},"沪江碎碎":{"img":"^((?:[^.]+\\.)*hjfile.cn\\/.+)(_(?:s|m))(\\.\\w+)$","to":"$1$3"},"YYeTs":{"img":"^(res\\.yyets\\.com/ftp/(?:attachment/)?\\d+\\/\\d+)\\/[ms]_(.*)","to":"$1/$2","note":"http://www.yyets.com/resourcelist"}} 44 | 45 | 46 | **百度贴吧需要配合样式使用** 47 | 48 | .threadlist_media .threadlist_pic_highlight { display: none !important; } -------------------------------------------------------------------------------- /fixViewSourceEditArgsForST.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name fixViewSourceEditArgsForST.uc.js 3 | // @namespace https://github.com/ywzhaiqi 4 | // @description 自带的 `view_source.editor.args` 由于顺序问题无法传递 "行" 参数给 sublime text 5 | // @include main 6 | // @charset UTF-8 7 | // @version 2014.9.6 8 | // @homepageURL https://github.com/ywzhaiqi/userChromeJS 9 | // @downloadURL https://raw.githubusercontent.com/ywzhaiqi/userChromeJS/master/fixViewSourceEditArgsForST.uc.js 10 | // ==/UserScript== 11 | 12 | (function(){ 13 | /** 14 | * view_source.editor.args 由于顺序问题无法传递行给 sublime text,故修正下 15 | * 设置如下: 16 | * view_source.editor.args 为 %file:%line 17 | */ 18 | 19 | if (!window.gViewSourceUtils) { 20 | return; 21 | } 22 | 23 | gViewSourceUtils.buildEditorArgs = function(aPath, aLineNumber) { 24 | // Determine the command line arguments to pass to the editor. 25 | // We currently support a %LINE% placeholder which is set to the passed 26 | // line number (or to 0 if there's none) 27 | var editorArgs = []; 28 | var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch); 29 | var args = prefs.getCharPref("view_source.editor.args"); 30 | var isSublimeText = args && /^"?%file/.test(args); 31 | if (args) { 32 | if (isSublimeText) { 33 | args = args.replace('%file', aPath); 34 | } 35 | args = args.replace('%line', '%LINE%').replace("%LINE%", aLineNumber || "0"); 36 | // add the arguments to the array (keeping quoted strings intact) 37 | const argumentRE = /"([^"]+)"|(\S+)/g; 38 | while (argumentRE.test(args)) 39 | editorArgs.push(RegExp.$1 || RegExp.$2); 40 | } 41 | if (!isSublimeText) editorArgs.push(aPath); 42 | return editorArgs; 43 | }; 44 | })() -------------------------------------------------------------------------------- /Places_ShowBookmarkPath/Places_ShowBookmarkPath.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name Places_ShowBookmarkPath.uc.js 3 | // @description 在 "我的足迹" 中右键显示书签路径 4 | // @include chrome://browser/content/places/places.xul 5 | // @version 2014/10/12 6 | // ==/UserScript== 7 | 8 | var UC_PlacesShowPath = { 9 | bmsvc: Components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] 10 | .getService(Components.interfaces.nsINavBookmarksService), 11 | 12 | init: function() { 13 | var menuitem = document.createElement('menuitem'); 14 | menuitem.setAttribute('label', '在文件夹中显示'); 15 | menuitem.setAttribute('title', '书签路径'); 16 | menuitem.setAttribute('selectiontype', 'single'); 17 | // menuitem.setAttribute('oncommand', 'UC_PlacesShowPath.getFolders();'); 18 | 19 | // 插入 20 | var popup = document.getElementById('placesContext'); 21 | popup.appendChild(menuitem); 22 | 23 | // 显示 24 | var self = this; 25 | popup.addEventListener('popupshowing', function() { 26 | var folders = self.getFolders(); 27 | menuitem.setAttribute('label', folders || ''); 28 | menuitem.setAttribute('hidden', !folders); 29 | }); 30 | }, 31 | getFolders: function() { 32 | var node = PlacesUIUtils.getViewForNode(document.popupNode).selectedNode; 33 | if (node && node.itemId >= 0) { 34 | var parentId = node.itemId; 35 | var parents = []; 36 | while(true) { 37 | parentId = this.bmsvc.getFolderIdForItem(parentId); 38 | if (parentId == 0) break; 39 | 40 | var parentTitle = this.bmsvc.getItemTitle(parentId); 41 | if (!parentTitle) break; 42 | parents.unshift(parentTitle); // 放到最前面 43 | } 44 | 45 | return parents.join('\\'); 46 | } 47 | } 48 | }; 49 | 50 | UC_PlacesShowPath.init(); 51 | -------------------------------------------------------------------------------- /.一些摘要/README.md: -------------------------------------------------------------------------------- 1 | 总览 2 | ==== 3 | 4 | - [Mozilla 开发者网络](https://developer.mozilla.org/) 5 | - [Add-ons](https://developer.mozilla.org/Add-ons) 6 | 7 | Mozilla technologies 8 | -------------------- 9 | 10 | - [Places](https://developer.mozilla.org/en-US/docs/Mozilla/Tech/Places) 11 | - [Toolkit API](https://developer.mozilla.org/en-US/docs/Toolkit_API) 12 | - [XPCOM](https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM) 13 | - [XUL](https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL) 14 | 15 | Downloads 16 | --------- 17 | 18 | - [Open and Save Dialogs](https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/Tutorial/Open_and_Save_Dialogs) 19 | - 调用 [Downloads.jsm](https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Downloads.jsm) 模块或 [Downloading Files](https://developer.mozilla.org/en-US/Add-ons/Code_snippets/Downloading_Files) 进行下载 20 | 21 | 22 | KeyCode 23 | ------- 24 | 25 | - 来源: [Custom Buttons • View topic - Select an element to hide CB](http://custombuttons.sourceforge.net/forum/viewtopic.php?f=6&t=2130) 26 | - [sendKeyEvent()](https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindowUtils#sendKeyEvent()) 27 | - [Constants for keyCode value](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.keyCode#Constants_for_keyCode_value) 28 | 29 | ``` 30 | // simulate ctrl+shift+s 31 | var utils = document.commandDispatcher.focusedWindow. 32 | QueryInterface(Components.interfaces.nsIInterfaceRequestor). 33 | getInterface(Components.interfaces.nsIDOMWindowUtils); 34 | utils.sendKeyEvent("keypress", 0, KeyEvent.DOM_VK_K, 35 | Event.CONTROL_MASK | Event.SHIFT_MASK); 36 | 37 | // simulate shift+f4 38 | var utils = document.commandDispatcher.focusedWindow. 39 | QueryInterface(Components.interfaces.nsIInterfaceRequestor). 40 | getInterface(Components.interfaces.nsIDOMWindowUtils); 41 | utils.sendKeyEvent("keypress", KeyEvent.DOM_VK_F4, 0, 42 | Event.SHIFT_MASK); 43 | ``` -------------------------------------------------------------------------------- /moveButton/README.md: -------------------------------------------------------------------------------- 1 | moveButton.uc.js 2 | ================ 3 | 4 | 功能:移动或克隆按钮/菜单到任意位置 5 | 6 | 建议只移动不可移动的按钮。如果移动后位置不正确可能用css固定了,如果移动后出现空白 7 | 8 | ![moveButton移动菜单示例](moveButton移动菜单示例.png) 9 | 10 | 填写的 buttons 说明 11 | ------------------- 12 | 13 | id: 要移动的按钮或菜单的 Id, 也可以是 css 选择器。 14 | 15 | 示例1: 移动 "翻译按钮" 到 "scriptish按钮" 的前面 16 | 17 | { id: "translatorButton", insertBefore: "scriptish-button" }, 18 | 19 | 示例2: 移动 "翻译按钮" 到 "scriptish按钮" 的后面 20 | 21 | { id: "translatorButton", insertAfter: "scriptish-button" }, 22 | 23 | 示例3: 移动 "翻译按钮" 到 "附加组件栏" 的第一个位置 24 | 25 | { id: "translatorButton", bar: "addon-bar", pos: 1 } 26 | 27 | 示例4:移动 "翻译按钮" 到 原来的第一个位置。(不推荐,建议用css调整) 28 | 29 | { id: "translatorButton", pos: 1 } 30 | 31 | 示例5:移动 "工具菜单" 到 系统按钮弹出的菜单 "选项" 的下面。 32 | 33 | { id: "tools-menu", insertAfter: "appmenu_customize"} 34 | 35 | 示例6:克隆 "工具菜单" 到 系统按钮弹出的菜单 "选项" 的下面。 36 | 37 | { id: "tools-menu", insertAfter: "appmenu_customize", clone: true } 38 | 39 | 示例7:修改 Greasemonkey 按钮为右键弹出菜单的类型 40 | 41 | {id: "greasemonkey-tbb", 42 | attr: { 43 | type: "", 44 | context: "_child" 45 | } 46 | }, 47 | 48 | 示例8:改 User Agent Overrider 按钮为右键弹出菜单 49 | 50 | {id: "useragentoverrider-button", 51 | attr: { 52 | type: "", 53 | context: "_child" 54 | } 55 | }, 56 | 57 | 示例9:增加 Stylish 按钮右键点击弹出菜单的功能 58 | 59 | {id: "stylish-toolbar-button", 60 | attr: { 61 | context: "stylish-popup" 62 | } 63 | }, 64 | 65 | 参考的工具栏或按钮的Id 66 | ----------------------- 67 | 68 | nav-bar(导航工具栏) 69 | unified-back-forward-button(前进后退按钮) 70 | urlbar-container(整个地址栏) 71 | urlbar-icons(地址栏图标,如地址栏下拉按钮、刷新按钮等,uc脚本一般插入的位置) 72 | search-container(整个搜索栏) 73 | home-button(主页按钮) 74 | 75 | PersonalToolbar(书签栏) 76 | personal-bookmarks(书签栏中书签部分) 77 | addon-bar(附加组件栏) 78 | status-bar(状态栏,在附加组件栏中,按钮为不可移动) 79 | 80 | 主要参考了 addMenu.uc.js 和 rebuild_userChrome.uc.xul -------------------------------------------------------------------------------- /InspectElementModY/xpi/src/chrome/content/options.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 35 | 36 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /.一些摘要/百度盘资源一览.md: -------------------------------------------------------------------------------- 1 | 2 | 百度盘资源一览 3 | ========= 4 | 5 | @[百度盘|资源|一览|Markdown] 6 | 7 | 热门 8 | ---- 9 | 10 | - [热门视频资源](http://yun.baidu.com/share/home?uk=3728148270&view=share),网络最新热门电影资源。 11 | - [人人都看奥斯卡](http://yun.baidu.com/share/home?uk=2671209892&view=share),电影爱好者,分享一些个人比较喜欢和评分较高的电影。 12 | - [美剧集中营](http://yun.baidu.com/share/home?uk=4080204509&view=share),看美剧学英语这个美丽的借口真感人!。 13 | - [追剧大咖](http://yun.baidu.com/share/home?uk=3375467638&view=share),港剧、台剧一网打尽!日剧、韩剧迅速响应!美剧,英剧全线跟进!内地好剧不放过!爱追剧不解释! 14 | - [电子书精选](http://yun.baidu.com/share/home?uk=53993635&view=share),空闲的时间看点书。 15 | - [纯音乐i](http://yun.baidu.com/share/home?uk=1949795117&view=share),静静地聆听。 16 | - [Verycd Share](http://pan.baidu.com/share/link?shareid=146642&uk=2214641459#dir/path=%2FVerycd%20Share),计算机英文书籍大全。 17 | 18 | 视频 19 | ---- 20 | 21 | ### 创意、乐趣 22 | 23 | - [TMDgroup](http://yun.baidu.com/share/home?uk=2906519452&view=share#category/type=0),创造快乐,分享生活乐趣。 24 | 25 | ### 恶搞视频 26 | 27 | - [A何仙姑夫](http://yun.baidu.com/share/home?uk=154939496&view=share),恶搞视频制作者,代表作《麦兜找穿帮》系列、妹纸辣评系列。 28 | - [吟笑派](http://yun.baidu.com/share/home?uk=3308643816&view=share#category/type=0),吟诗作赋,笑谈风生。 29 | 30 | ### 游戏视频 31 | 32 | - [小苍estelle](http://yun.baidu.com/share/home?uk=2821042399&view=share),享受电竞,热爱生活。 33 | - [冷小莫LOL解说](http://yun.baidu.com/share/home?uk=3895920277&view=share)。 34 | - [LOL解说视频](http://yun.baidu.com/share/home?uk=1211233040&view=share),汇聚英雄联盟各大著名解说高端局视频。 35 | 36 | ### 动漫视频 37 | 38 | - [动漫旗舰店](http://yun.baidu.com/share/home?uk=3375832228&view=share),动漫,TV动画,动漫电影,剧场版、 39 | - [普罗米修斯2230](http://yun.baidu.com/share/home?uk=3190874423&view=share),动画、音乐、美图资源。 40 | 41 | ### 其它 42 | 43 | - [日剧君来了](http://yun.baidu.com/share/home?uk=3291077&view=share) 44 | - [BD盘影视](http://yun.baidu.com/share/home?uk=2838601171&view=share),高清影视大文件直接转存。 45 | - [网盘资源_分享](http://yun.baidu.com/share/home?uk=372502763&view=share) 46 | - [iEkber](http://yun.baidu.com/share/home?uk=3577130558&view=share),高清影视、MV、软件、游戏。 47 | 48 | 49 | 图片 50 | ---- 51 | 52 | ### 美女图片 53 | 54 | - [养眼美女集中营](http://yun.baidu.com/share/home?uk=204960419&view=share),世界美女大搜罗。 55 | - [you物gg](http://yun.baidu.com/share/home?uk=792127083&view=share#category/type=0),YOU物公馆是以帮助全国各地,有潜质的美女实现成为名模的梦想为基础创建起来的品牌。 56 | - [泷泽萝拉__Rola](http://yun.baidu.com/share/home?uk=3090251190&view=share)。 57 | 58 | 59 | 软件 60 | ---- 61 | 62 | - [黒仪大螃蟹](http://pan.baidu.com/share/home?uk=2467242534#category/type=0),firefox uc脚本。 -------------------------------------------------------------------------------- /uAutoPagerize2/_uAutoPagerize.js: -------------------------------------------------------------------------------- 1 | // uAutoPagerize2.uc.js 的配置文件。 2 | 3 | var prefs = { 4 | pauseA: true, // 快速停止翻页开关,需要刷新页面 5 | Pbutton: [0, 0, 0], // 需要按住的键.....0: 不按住任何键;1: shift鍵;2: ctrl鍵; 3: alt鍵;(同时按3个键.就填 1 2 3)(一个都不按.就填 0 0 0) 6 | mouseA: false, // 按住鼠标左键..否则.双击; 7 | Atimeout: 200, // 按住左键时..延时.多少生效..(单位:毫秒); 8 | stop_ipage: true, // 如果在连续翻页过程中暂停.重新启用后.不在继续..连续翻页.. 9 | ipages: [false, 2], // 立即翻页,第一项是控制是否在js加载的时候立即翻第二项(必须小于maxpage)的页数,比如[true,3].就是说JS加载后.立即翻3页. 10 | 11 | // 下一页图片延迟加载的移除,是 image 节点的属性。该功能会把属性地址替换到图片地址。 12 | lazyImgSrc: 'zoomfile|file|original|load-src|_src|imgsrc|real_src|src2|data-lazyload-src|data-ks-lazyload|data-lazyload|data-src|data-original|data-thumb|data-imageurl|data-defer-src|data-placeholder', 13 | }; 14 | 15 | // 页面不刷新的站点,通过延迟加载和额外添加 hashchange 事件来解决。 16 | var HashchangeSites = [ 17 | { url: /^https?:\/\/(www|encrypted)\.google\..{2,9}\/(webhp|#|$|\?)/, timer: 1500 }, 18 | { url: /^https?:\/\/www\.baidu\.com\/($|#wd=)/, timer: 1000 }, 19 | { url: /^https?:\/\/www\.newsmth\.net/, timer: 1000 }, // 水木清华社区延迟加载及下一页加载的修复 20 | ]; 21 | 22 | // 自定义站点,优先级最高 23 | var MY_SITEINFO = [ 24 | // 下面的都是示例 25 | // { 26 | // siteName: "google", 27 | // url: '^https?\\:\\/\\/(www|encrypted)\\.google\\..{2,9}\\/(webhp|search|#|$|\\?)', 28 | // nextLink: "//a[div[@id=('nn')]] | //a[span/@id='nn'] | id('nav')//td[last()]/a | id('nn')/parent::a", 29 | // pageElement: "//div[@id='ires']", 30 | // exampleUrl: 'http://www.google.com.hk/' 31 | // }, 32 | // { 33 | // siteName: '百度贴吧', 34 | // url: '^http://tieba\\.baidu\\.(cn|com)/f', 35 | // nextLink: '//div[@class="pager clearfix"]/descendant::a[@class="next"]', // xpath 36 | // nextLink: 'auto;', // Super_preloader 的自动查找 37 | // nextLink: 'css;.pager a.next', // Super_preloader 的 css 选择器 38 | // pageElement: '//ul[@id="thread_list"]', 39 | // } 40 | 41 | // 示例:ipages 参数的使用。打开百度后立即加载3页。 42 | // { 43 | // // 通过更改 pageElement 解决清爽百度的问题 44 | // name: '百度搜索', 45 | // url: "^https?://www\\.baidu\\.com/(?:s|baidu)\\?", 46 | // nextLink: '//p[@id="page"]/a[contains(text(),"下一页")][@href]', 47 | // pageElement: 'css;div#content_left', 48 | // stylish: '.autopagerize_page_info { margin-bottom: 10px; }', 49 | // ipages: [true, 3] 50 | // }, 51 | ]; 52 | 53 | // 本体に組み込まれている MICROFORMAT を利用するか? 54 | USE_MICROFORMAT = true; 55 | -------------------------------------------------------------------------------- /Space_nextpage/space_nextpage.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 空格键页面底部翻页(依次调用 uAutoPagerize、uSuper_preloader、nextPage.uc.xul) 3 | // @description 默认设置小说阅读脚本启用后禁用 4 | // @author ywzhaiqi@gmail.com 5 | // @include main 6 | // ==/UserScript== 7 | 8 | if(window.Space_nextpage){ 9 | window.Space_nextpage.uninit(); 10 | window.Space_nextpage = null; 11 | } 12 | 13 | window.Space_nextpage = { 14 | init: function(){ 15 | gBrowser.mPanelContainer.addEventListener('keypress', this, false); 16 | }, 17 | uninit: function(){ 18 | gBrowser.mPanelContainer.removeEventListener('keypress', this, false); 19 | }, 20 | handleEvent: function(event){ 21 | switch(event.type){ 22 | case "keypress": 23 | this.keypress(event); 24 | break; 25 | } 26 | }, 27 | goToNextPage: function(win){ 28 | if (win.ap) { 29 | let nextURL = win.ap.nextLink && win.ap.nextLink.href; 30 | if (nextURL) 31 | win.location = nextURL; 32 | } else if (win.uSuper_preloader) { 33 | win.uSuper_preloader.go(); 34 | } else if (window.nextPage) { 35 | nextPage.next(true); 36 | } 37 | }, 38 | space: " ".charCodeAt(0), 39 | keypress: function(event){ 40 | if (event.charCode != this.space) 41 | return; 42 | 43 | if (event.target.nodeName.match(/input|textarea|select/i)) 44 | return; 45 | 46 | var 47 | doc = event.target.ownerDocument, 48 | win = doc.defaultView, 49 | isFrame = (win.top != win) 50 | ; 51 | 52 | if(!doc.body) 53 | return; 54 | 55 | // 鲜果阅读器防止出错 56 | if(win.location.href.match(/xianguo\.com\/reader/i)) 57 | return; 58 | 59 | // 有小说阅读脚本的逃过 60 | if(doc.body.getAttribute("name") == "MyNovelReader") 61 | return; 62 | 63 | if(isFrame){ 64 | var clientHeight = doc.body.clientHeight; 65 | var scrollTop = doc.body.scrollTop | doc.documentElement.scrollTop; 66 | var windowHeight = doc.all ? doc.getElementsByTagName("html")[0].offsetHeight : win.innerHeight; 67 | // 为什么 Firefox 下要加1? 68 | if ((scrollTop + windowHeight + 1) >= clientHeight) 69 | this.goToNextPage(win); 70 | }else{ 71 | if(content.scrollMaxY <= content.scrollY) 72 | this.goToNextPage(win); 73 | } 74 | } 75 | }; 76 | 77 | window.Space_nextpage.init(); -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/skin/rebuild_userChrome.css: -------------------------------------------------------------------------------- 1 | /*#userChromebtnMenu { 2 | -moz-appearance: none; 3 | border-style: none; 4 | border-radius: 0; 5 | padding: 0 3px; 6 | margin: 0; 7 | background: transparent; 8 | box-shadow: none; 9 | -moz-box-align: center; 10 | -moz-box-pack: center; 11 | min-width: 18px; 12 | min-height: 18px; 13 | } 14 | #userChromebtnMenu > .toolbarbutton-icon { 15 | padding: 0 !important; 16 | margin: 0 !important; 17 | border: 0; 18 | background-image: none; 19 | background-color: transparent; 20 | box-shadow: none; 21 | -moz-transition: none; 22 | } 23 | 24 | #userChromebtnMenu dropmarker { 25 | display: none !important; 26 | } 27 | 28 | #userChromebtnMenu:not([disabled="true"]):hover, 29 | #userChromebtnMenu:not([disabled="true"])[type="menu"]:hover, 30 | #userChromebtnMenu:not([disabled="true"])[open="true"], 31 | #userChromebtnMenu:not([disabled="true"])[type="menu"][open="true"] { 32 | background-image: -moz-linear-gradient(rgba(242, 245, 249, 0.95), rgba(220, 223, 225, 0.67) 49%, rgba(198, 204, 208, 0.65) 51%, rgba(194, 197, 201, 0.3)); 33 | }*/ 34 | 35 | #userChromebtnMenu dropmarker { 36 | display: none!important; 37 | } 38 | #userChromebtnMenu > image { 39 | padding: 3px 7px!important; 40 | } 41 | 42 | 43 | #userChromebtnMenu, 44 | #userChromejs_Tools_Menu { 45 | /*list-style-image: url(chrome://userchromejs/skin/img/icon16.png);*/ 46 | list-style-image: url(chrome://userchromejs/skin/img/icon16.png); 47 | } 48 | 49 | #userChromejs_options #toolbtn_rebuild { 50 | list-style-image: url(chrome://userchromejs/skin/img/toolbtn_rebuild.png); 51 | } 52 | #userChromejs_options #toolbtn_chromedir { 53 | list-style-image: url(chrome://userchromejs/skin/img/toolbtn_chromedir.png); 54 | } 55 | #userChromejs_options #toolbtn_restartApp { 56 | list-style-image: url(chrome://userchromejs/skin/img/toolbtn_restartApp.png); 57 | } 58 | 59 | #userChromejs_options #toolbtn_openPrefs { 60 | list-style-image: url(chrome://userchromejs/skin/img/toolbtn_openPrefs.png); 61 | } 62 | 63 | #jscmd_edit_add { 64 | list-style-image: url(chrome://userchromejs/skin/img/jscmd_edit_add.png); 65 | } 66 | #userChromejs_options #jscmd_edit_del { 67 | list-style-image: url(chrome://userchromejs/skin/img/jscmd_edit_del.png); 68 | } 69 | #showToolsMenu { 70 | list-style-image: url(chrome://userchromejs/skin/img/showToolsMenu.png); 71 | } 72 | 73 | #userChrome_setting, #userChrome_homebtn { 74 | list-style-image: none; 75 | font-size: 12px; 76 | font-weight: normal; 77 | } 78 | 79 | 80 | #userChromejs_options menuitem[restartless="true"] { 81 | color: blue; 82 | } -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/README.md: -------------------------------------------------------------------------------- 1 | userChromeJS Mix 扩展 2 | ==================== 3 | 4 | **userChromeJS Mix 扩展 = userChromeJS 扩展 + userChrome.js + rebuild_userChrome.uc.xul + SaveUserChromeJS.uc.js** 5 | 6 | - userChromeJS 扩展为[官方的版本](http://userchromejs.mozdev.org/)。 7 | - userChrome.js 为 [Alice0775 的修改版](https://github.com/alice0775/userChrome.js)。 8 | - UC脚本管理器为 [dannylee 的UC脚本管理器(2014.4.29版)](https://g.mozest.com/thread-41292-1-4) 的修改版。 9 | - **安装后会自动更新,不再需要下载附件更新。** 10 | - 版本 1.5 以上有了大幅改进。 11 | 12 | 注意 13 | ---- 14 | 15 | - 如果你需要按钮在地址栏的,请使用 [url-addon-bar](https://addons.mozilla.org/zh-cn/firefox/addon/url-addon-bar/) 扩展实现。 16 | - 如果 chrome 目录下已经存在 rebuild_userChrome.uc.xul,请手动删除。 17 | - 由于扩展的更新机制会移除原有的再安装,如果在 content 里面放了文件,更新后会消失。 18 | - 如果没用过 Alice0775 版的 userChrome.js,里面的 uc 脚本可能存在失效的问题。 19 | - ~~第一次使用需要从定制拖出。~~ 20 | 21 | 镜像 22 | ---- 23 | 24 | - [直接下载地址](https://github.com/ywzhaiqi/userChromeJS/raw/master/userChromeJS_Mix.xpi/userChromeJS_Mix.xpi) 25 | - [卡饭链接地址](http://bbs.kafan.cn/thread-1753671-1-1.html) 26 | - [github 地址](https://github.com/ywzhaiqi/userChromeJS/tree/master/userChromeJS_Mix.xpi) 27 | 28 | 29 | 更新 30 | ---- 31 | 32 | 详见 [updateInfo.md](updateInfo.md) 33 | 34 | 反馈的问题 35 | ----------- 36 | 37 | - 使用了 zAutoPopup.uc.xul 后,滑过重启按钮,还没按下去便关了菜单。 38 | 39 | 1.5 以上说明 40 | ----------- 41 | 42 | ### 几个注意事项 43 | 44 | - 这是一个测试版,由于本人水平有限,可能存在问题,请慎用。 45 | - 内置了 userChrome.js 文件(由于修改了里面的内容),所以会强制对 chrome 目录下的 chrome.js 文件改名,可手动删除。 46 | 47 | ### 新增了以下几个功能 48 | 49 | - 安装脚本 50 | - 在浏览中打开 uc 脚本会出现 **安装工具条**。点击安装按钮后,会自动安装(保存该脚本,然后载入)。 51 | - 对不存在的脚本会直接安装(无需重启),只是很难判断是否为不存在的脚本,目前是根据id 或文件名判断,如果出现重复添加菜单等情况,请手动重启。 52 | - 菜单蓝色为无需重启的脚本。 53 | - 对无需重启的脚本,会直接生效。 54 | - 对非主窗口的脚本,会直接生效。 55 | - 卸载脚本 56 | - 在脚本的菜单上 Ctrl + 右键卸载。 57 | - 对无需重启的脚本,会直接生效,但并不是完全彻底的卸载,如果需要请手动重启。 58 | - 对非主窗口的脚本,会直接生效。 59 | - **注意:卸载脚本同时会删除文件。** 60 | - 启用禁用脚本 61 | - 对无需重启的脚本,会直接生效。 62 | - 对非主窗口的脚本,会直接生效(默认就支持)。 63 | - 设置界面 64 | - 编辑器路径为空则用 **代码片段速记器** 打开。 65 | 66 | *注:这里的无需重启的脚本指主窗口脚本,非主窗口脚本本身就支持无需重启。* 67 | 68 | ![installBar](img/installBar.png) 69 | 70 | ![installedMsg.png](img/installedMsg.png) 71 | 72 | ![installedMsg2.png](img/installedMsg2.png) 73 | 74 | ![setting](img/setting.png) 75 | 76 | ![addMenu_启用禁用效果图.gif](img/addMenu_启用禁用效果图.gif) 77 | 78 | ### 无需重启(restartless)脚本的说明 79 | 80 | 非主窗口的脚本默认支持无需重启,这里说的是主窗口的脚本。 81 | 82 | 主窗口的需要脚本支持,在支持的脚本中添加以下2个参数即可。 83 | 84 | // @startup window.uAutoPagerize.init(); 85 | // @shutdown window.uAutoPagerize.destroy(); 86 | 87 | 目前支持的脚本有: 88 | 89 | - 非主窗口的脚本 90 | - addMenuPlus.uc.js 91 | - uAutoPagerize2.uc.js 92 | - youkuantiadsModY.uc.js 93 | - SimpleDragModY.uc.js 94 | - SimpleMusicPlayer.uc.js 95 | - SITEINFO_Writer.uc.js -------------------------------------------------------------------------------- /.test/testButton29+.uc.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | CustomizableUI.createWidget({ 3 | id : "Sidebar-button", 4 | type: "custom", 5 | defaultArea : CustomizableUI.AREA_NAVBAR, 6 | onBuild: function(aDocument) { 7 | var button = aDocument.createElement('toolbarbutton'); 8 | 9 | var props = { 10 | id: "Sidebar-button", 11 | label : "侧边栏开关", 12 | tooltiptext : "左键:书签侧边栏右键:历史侧边栏中鍵:样式侧边栏", 13 | context: "userChromejs_options", 14 | }; 15 | for (var p in props) { 16 | button.setAttribute(p, props[p]); 17 | } 18 | 19 | button.addEventListener('click', function(event){ 20 | //console.log('11111', event.button) 21 | switch (event.button) { 22 | case 0: 23 | toggleSidebar('viewBookmarksSidebar'); 24 | break; 25 | case 1: 26 | toggleSidebar('viewStylishSidebar'); 27 | break; 28 | case 2: 29 | break; 30 | } 31 | }, false); 32 | 33 | return button; 34 | } 35 | }); 36 | 37 | var cssStr = '@-moz-document url("chrome://browser/content/browser.xul"){' 38 | + '#Sidebar-button .toolbarbutton-icon {' 39 | + 'list-style-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAACs0lEQVQ4jc2SXUhTYRjH375o06md5Zmb07VwWmnTTZx6csej25n70p0tvzamVqhTiOqmruxCMAjTu6SIyEqyBDGiorrwQkyCQMqioGUIpYlrtAZrTJfu6aZzXN7ssh74XbzPxe99n//zIvRflqPJ2Ynh2TN8kRwE0ty/4IvksD0tA5AA34SPAdqVChiGzzianJ2cKC0rZ76w0gRaazNQjBsqGTdQNjdQjBs0NAPXRsb6rY2t01eH7/RbG1qmb92b6BseHe8r0tLvMWnOK04kV5Zu0PXHwOxsB4urA6yuDrD8gXa0gEZvAzVlhmLKDGrKDAWEHpRHaNDQDGQdKgZOlKcioqTJAQRdB4ShDiqMNtAaGSCNDqgwMlCms4CmygwllAnUZA2oyBpQaQ1AGGyQqyrfFGUq8leL9TZgKSB0sOwPenyBYPdSINjlC4Y8/mDY4wuGunyBkMcXDHX5Q2GPPxT2ZObkxzhRqih7VVPjABal1gDzK9/LEy1pbmGxVIBL17kGHxOvEZZGYFFTJvi49E2VSPR89k0ZD5NEEELbEEIIJQklv0ibC1hKdLXgXfpRlEg0/myS5AnFYU4kwCUb+vo2YCGMdlhYDBQihFB8dlu5Of6oir9XHEYIbWczApOznYO0NsCnlcBh9ub4sVkQQmjk/hOKL5RE4sOG2tZujmrGBR+++g/EjxH/Yrb3dOolwRdmrMeJpGA/fpKDPuqGt97lg1szqW3tBnPjCZw9v/Z+0SQJxZv/aH++8nN9+2lgMTa0wejE4+rhuw91V26PmQeGbjh6By/bey4M1A0OXTc8mJwiX8x5S6325lN5hSXvONHZ872XZIqC2Z3JWIyXhsdS0qUbe8TyKJaVu5YuU0RxWV4Uy9wXSc6Q/uRhosiOJCyGdqeAWKaYPXOu52Ki7f6b+g1HclJ7IcMjNQAAAABJRU5ErkJggg==)' 40 | + '}}'; 41 | var sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService); 42 | var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService); 43 | sss.loadAndRegisterSheet(ios.newURI("data:text/css;base64," + btoa(cssStr), null, null), sss.USER_SHEET); 44 | })(); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.sublime-project 2 | *.sublime-workspace 3 | 4 | ################# 5 | ## Eclipse 6 | ################# 7 | 8 | *.pydevproject 9 | .project 10 | .metadata 11 | bin/ 12 | tmp/ 13 | *.tmp 14 | *.bak 15 | *.swp 16 | *~.nib 17 | local.properties 18 | .classpath 19 | .settings/ 20 | .loadpath 21 | 22 | # External tool builders 23 | .externalToolBuilders/ 24 | 25 | # Locally stored "Eclipse launch configurations" 26 | *.launch 27 | 28 | # CDT-specific 29 | .cproject 30 | 31 | # PDT-specific 32 | .buildpath 33 | 34 | 35 | ################# 36 | ## Visual Studio 37 | ################# 38 | 39 | ## Ignore Visual Studio temporary files, build results, and 40 | ## files generated by popular Visual Studio add-ons. 41 | 42 | # User-specific files 43 | *.suo 44 | *.user 45 | *.sln.docstates 46 | 47 | # Build results 48 | [Dd]ebug/ 49 | [Rr]elease/ 50 | *_i.c 51 | *_p.c 52 | *.ilk 53 | *.meta 54 | *.obj 55 | *.pch 56 | *.pdb 57 | *.pgc 58 | *.pgd 59 | *.rsp 60 | *.sbr 61 | *.tlb 62 | *.tli 63 | *.tlh 64 | *.tmp 65 | *.vspscc 66 | .builds 67 | *.dotCover 68 | 69 | ## TODO: If you have NuGet Package Restore enabled, uncomment this 70 | #packages/ 71 | 72 | # Visual C++ cache files 73 | ipch/ 74 | *.aps 75 | *.ncb 76 | *.opensdf 77 | *.sdf 78 | 79 | # Visual Studio profiler 80 | *.psess 81 | *.vsp 82 | 83 | # ReSharper is a .NET coding add-in 84 | _ReSharper* 85 | 86 | # Installshield output folder 87 | [Ee]xpress 88 | 89 | # DocProject is a documentation generator add-in 90 | DocProject/buildhelp/ 91 | DocProject/Help/*.HxT 92 | DocProject/Help/*.HxC 93 | DocProject/Help/*.hhc 94 | DocProject/Help/*.hhk 95 | DocProject/Help/*.hhp 96 | DocProject/Help/Html2 97 | DocProject/Help/html 98 | 99 | # Click-Once directory 100 | publish 101 | 102 | # Others 103 | [Bb]in 104 | [Oo]bj 105 | sql 106 | TestResults 107 | *.Cache 108 | ClientBin 109 | stylecop.* 110 | ~$* 111 | *.dbmdl 112 | Generated_Code #added for RIA/Silverlight projects 113 | 114 | # Backup & report files from converting an old project file to a newer 115 | # Visual Studio version. Backup files are not needed, because we have git ;-) 116 | _UpgradeReport_Files/ 117 | Backup*/ 118 | UpgradeLog*.XML 119 | 120 | 121 | 122 | ############ 123 | ## Windows 124 | ############ 125 | 126 | # Windows image file caches 127 | Thumbs.db 128 | 129 | # Folder config file 130 | Desktop.ini 131 | 132 | 133 | ############# 134 | ## Python 135 | ############# 136 | 137 | *.py[co] 138 | 139 | # Packages 140 | *.egg 141 | *.egg-info 142 | dist 143 | build 144 | eggs 145 | parts 146 | bin 147 | var 148 | sdist 149 | develop-eggs 150 | .installed.cfg 151 | 152 | # Installer logs 153 | pip-log.txt 154 | 155 | # Unit test / coverage reports 156 | .coverage 157 | .tox 158 | 159 | #Translations 160 | *.mo 161 | 162 | #Mr Developer 163 | .mr.developer.cfg 164 | 165 | # Mac crap 166 | .DS_Store 167 | -------------------------------------------------------------------------------- /Disable/inlineEditForBookmarkTitleOnSidebar.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name inlineEditForBookmarkTitleOnSidebar.uc.js 3 | // @namespace http://space.geocities.yahoo.co.jp/gl/alice0775 4 | // @description サイドバーにおいてブックマークのタイトルを直接編集できるようにする 5 | // @include chrome://browser/content/bookmarks/bookmarksPanel.xul 6 | // @compatibility Firefox 10- 7 | // @author Alice0775 8 | // @version 2012/12/08 22:30 Bug 788290 Bug 788293 Remove E4X 9 | // @version 2012/08/12 22:30 Bug 761723 implement toString of function objects by saving source 10 | // ==/UserScript== 11 | // @version 2012/02/06 編集終了Enterでブックマークが開かないように 12 | // @version 2012/02/06 13 | // @note 侧边栏书签按F2直接编辑标题 14 | // @note ツリーの左端をF2またはダブルクリックでブックマークのタイトルの編集開始 15 | // @note ブックマークフォルダはF2でタイトルの編集開始 16 | 17 | var inlineEditForBookmarkTitleOnSidebar = { 18 | 19 | get _BTree() { 20 | delete this._BTree 21 | return this._BTree = document.getElementById("bookmarks-view"); 22 | }, 23 | 24 | init: function(){ 25 | if (!this._BTree) 26 | return; 27 | 28 | var func = SidebarUtils.handleTreeKeyPress.toString(); 29 | func = func.replace( 30 | '{', 31 | ' \ 32 | $& \ 33 | var tree = aEvent.target.parentNode; \ 34 | if (tree.editing) \ 35 | return; \ 36 | ' 37 | ); 38 | //Replace function 39 | SidebarUtils.handleTreeKeyPress = new Function( 40 | func.match(/\(([^)]*)/)[1], 41 | func.replace(/[^{]*/, '').replace(/^{/, '').replace(/}$/, '') 42 | ); 43 | 44 | this._BTree.setAttribute('editable', true); 45 | this._BTree.addEventListener('keypress', this, false); 46 | window.addEventListener('unload', this, false); 47 | }, 48 | 49 | uninit: function(){ 50 | if (!this._BTree) 51 | return; 52 | 53 | this._BTree.removeEventListener('keypress', this, false); 54 | window.removeEventListener('unload', this, false); 55 | this._BTree = null; 56 | }, 57 | 58 | keypress: function(event) { 59 | if (event.keyCode != KeyEvent.DOM_VK_F2) 60 | return; 61 | 62 | var tree = event.target; 63 | if (tree.disabled) 64 | return; 65 | 66 | var b = tree.treeBoxObject; 67 | var row = b.view.selection.currentIndex; 68 | var col = tree.columns[0]; 69 | 70 | if (row == -1) 71 | return; 72 | 73 | if (tree.editable) 74 | if (tree.startEditing(row, col)) 75 | event.preventDefault(); 76 | }, 77 | 78 | handleEvent: function(event) { 79 | switch (event.type) { 80 | case "keypress": 81 | this.keypress(event); 82 | break; 83 | case "unload": 84 | this.uninit(); 85 | break; 86 | 87 | } 88 | }, 89 | 90 | debug: function(aMsg){ 91 | Components.classes["@mozilla.org/consoleservice;1"] 92 | .getService(Components.interfaces.nsIConsoleService) 93 | .logStringMessage(aMsg); 94 | } 95 | 96 | } 97 | 98 | inlineEditForBookmarkTitleOnSidebar.init(); 99 | -------------------------------------------------------------------------------- /speedupErrorConsole.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name speedupErrorConsole.uc.js 3 | // @namespace http://space.geocities.yahoo.co.jp/gl/alice0775 4 | // @description sppedup Error Console (hide long source code) Bug 840451 5 | // @include chrome://global/content/console.xul 6 | // @include chrome://console2/content/console2.xul 7 | // @include main 8 | // @compatibility Firefox 21+ 9 | // @author Alice0775 10 | // @version 2013/02/15 18:00 typo 11 | // @version 2013/02/11 12:30 12 | // ==/UserScript== 13 | (function() { 14 | function applyPatch() { 15 | if (!document.getElementById('ConsoleBox')) 16 | return; 17 | var func = document.getElementById('ConsoleBox').appendError.toString(); 18 | if (/\.indexOf\("CSS"\)/.test(func)) 19 | return; 20 | 21 | if(/aObject/.test(func)) { 22 | func = func.replace( 23 | 'if (aObject.sourceLine) {', 24 | '$&if (!aObject.category || aObject.category.indexOf("CSS") < 0 || aObject.columnNumber < 120) {' 25 | ).replace( 26 | 'row.mSourceLine = sourceLine;', 27 | '$&}else{}' 28 | ).replace( 29 | 'if (aObject.columnNumber) {', 30 | '$&if (!aObject.category || aObject.category.indexOf("CSS") < 0 || aObject.columnNumber < 120) {' 31 | ).replace( 32 | 'row.setAttribute("errorCaret", " ");', 33 | '} else {row.setAttribute("code", "Column: " + aObject.columnNumber || 0);row.setAttribute("hideCaret", "true");}' 34 | ); 35 | document.getElementById('ConsoleBox').appendError = new Function( 36 | func.match(/\(([^)]*)/)[1], 37 | func.replace(/[^{]*\{/, '').replace(/}\s*$/, '') 38 | ); 39 | } else { 40 | func = func.replace( 41 | /if \(aMessage\.sourceLine\)[\s\t\r]+\{/, 42 | '$& if (!aMessage.category || aMessage.category.indexOf("CSS") < 0 || aMessage.columnNumber < 120){' 43 | ).replace( 44 | 'row.setAttribute("errorDots", this.repeatChar(" ", aMessage.columnNumber));', 45 | '$&} else {row.setAttribute("code", "Column: " + aMessage.columnNumber || 0);}' 46 | ); 47 | document.getElementById('ConsoleBox').appendError = new Function( 48 | func.match(/\(([^)]*)/)[1], 49 | func.replace(/[^{]*\{/, '').replace(/}\s*$/, '') 50 | ); 51 | } 52 | } 53 | 54 | if (location.href == "chrome://browser/content/browser.xul") { 55 | var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] 56 | .getService(Components.interfaces.nsIWindowMediator); 57 | var enumerator = wm.getEnumerator(null); 58 | while(enumerator.hasMoreElements()) { 59 | var win = enumerator.getNext(); 60 | // win is [Object ChromeWindow] (just like window), do something with it 61 | if (win.location.href == "chrome://global/content/console.xul" || 62 | win.location.href == "chrome://console2/content/console2.xul") 63 | applyPatch(); 64 | break; 65 | } 66 | } else { 67 | applyPatch(); 68 | } 69 | })(); 70 | -------------------------------------------------------------------------------- /SimpleMusicPlayer/README.md: -------------------------------------------------------------------------------- 1 | SimpleMusicPlayer.uc.js 2 | ======================= 3 | 4 | 简单音乐播放面板,支持多个站点,参考了百度随心听播放栏UC脚本。 5 | 6 | - 只有一个按钮,默认在地址栏,点击弹出面板,右键弹出站点菜单。 7 | - 内置多个站点配置,可设置面板大小,是否设置 UA 为手机版,插入该站点的样式。 8 | - 右键点击站点菜单,会打开该网址。 9 | - [关于百度随心听的音质 - 卡饭论坛](http://bbs.kafan.cn/thread-1738286-1-1.html) 10 | 11 | ### 弹出面板 12 | 13 | ![弹出面板.jpg](弹出面板.jpg) 14 | 15 | ### 右键菜单 16 | 17 | ![右键菜单.jpg](右键菜单.jpg) 18 | 19 | ### 关于设置 UA 为手机版 20 | 21 | - 在网址载入前会临时设置 UA 为手机版 firefox,然后马上复原。 22 | - 在这个短暂的时间内,请不要在主界面打开网址,会被影响到。 23 | 24 | 站点配置 25 | ------- 26 | 27 | 站点示例,更多示例请查看代码。 28 | 29 | ### iframe 的方式 30 | 31 | ```js 32 | { 33 | name: "百度随心听(手机版)", 34 | url: "http://fm.baidu.com/", 35 | changeUA: true, 36 | iframeStyle: "width: 320px; height: 440px;", 37 | css: "#ad { display:none !important; }", 38 | control: { 39 | "play-pause": function(win) { 40 | var player = win.player; 41 | if (player.getState() == 'play') { 42 | player.pause(); 43 | } else { 44 | player.play(); 45 | } 46 | }, 47 | // "play": "win.player.play()", 48 | // "pause": "win.player.pause()", 49 | // "stop": "win.player.stop()", 50 | "love": "#playerpanel-btnlove", 51 | "hate": "#playerpanel-btnhate", 52 | "next": "#playerpanel-btnskip", 53 | // "reset": "win.player.reset()", 54 | } 55 | }, 56 | ``` 57 | 58 | - **name**: 右键菜单显示的名字。 59 | - **url**: 面板载入的网址。 60 | - **changeUA**: 会临时设置 UA 为手机版,如果不需要不要填。 61 | - **iframeStyle**: 主要用于设置面板的宽度和高度,`mobile` 为内置的 mobile 大小,也可自行设置,例如 `width: 740px; height: 570px;` 62 | - **css**: 插入到页面的样式,可隐藏广告或简化网站的界面使得弹出的面板变小。 63 | - **control** 64 | - "play-pause"、"love"、"hate"、"next" 等为该站点的控制菜单名字,会根据内置设定转为中文名显示在菜单上。 65 | - 写法一:最简单,一般情况下的手选,为该按钮的 css 选择器,如 "next" 按钮的选择器是 "#playerpanel-btnskip" 66 | - 写法二:"play": "win.player.play()" 函数的简化版。已 `win` 开头,`win` 为 GM 脚本的 unsafeWindow,后面的 `player.play()` 则是该网页的 js 对象的调用。 67 | - 写法三:函数,如 "play-pause" 的函数 68 | - **openLinkInsided**:为 true 则强制打开链接在 iframe 内,**可能有bug**。 69 | 70 | ### 窗口方式 71 | 72 | 豆瓣FM 等网站因为在 iframe 无法点击播放,故采用窗口方式。 73 | 74 | ```js 75 | { 76 | name: "豆瓣FM(窗口)", 77 | url: "http://douban.fm/", 78 | isWindow: true, 79 | windowFeatures: 'width=1110px,height=626px,resizable,scrollbars=yes', 80 | }, 81 | ``` 82 | 83 | - **isWindow**:该参数为 true 则是窗口方式。 84 | - **windowFeatures**:打开窗口的属性,详见 [window.open - DOM | MDN](https://developer.mozilla.org/zh-CN/docs/DOM/window.open#Position_and_size_features) 85 | 86 | TODO 87 | ---- 88 | 89 | - 是否在播放中 90 | - 是否加星号 91 | - 如果使用了 `UserAgentChange.uc.js`,则 "百度随心听(手机版)" 打开界面会多个下载按钮,且没有歌词。**原因不明** 92 | 93 | ### Flashgot 捕获音频? 94 | 95 | 需要修改 Flashgot 扩展的代码? 96 | 97 | 文件 MediaSniffer.js 98 | 99 | updateUI: function (win) { 100 | var bw = DOM.mostRecentBrowserWindow; 101 | if (bw && bw.gFlashGot && bw.content == win.top) bw.gFlashGot.updateMediaUI(); 102 | }, -------------------------------------------------------------------------------- /openLinkTabThirdPart.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name openLinkTabThirdPart.uc.js 3 | // @description 点击链接如果是第三方域名则在新标签页打开,否则当前标签页。有黑名单 4 | // @author ywzhaiqi 5 | // @namespace ywzhaiqi@gmail.com 6 | // @include main 7 | // @charset UTF-8 8 | // ==/UserScript== 9 | 10 | /** 11 | * 例: www.163.com,域名是 163.com 在当前标签页打开,其它域名新标签页打开 12 | */ 13 | 14 | (function() { 15 | 16 | // 排除列表 17 | var EXCLUDE = [ 18 | "http://booklink.me/*", 19 | "http://www.baidu.com/*", 20 | ]; 21 | 22 | 23 | let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; 24 | if (!window.Services) Cu.import("resource://gre/modules/Services.jsm"); 25 | 26 | var EXCLUDE_REGEXP = new RegExp(EXCLUDE.map(wildcardToRegExpStr).join("|")); 27 | 28 | gBrowser.mPanelContainer.addEventListener('click', function(e){ 29 | if (e.button == 0 && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) { 30 | 31 | if(EXCLUDE_REGEXP.test(gBrowser.currentURI.href)){ 32 | return; 33 | } 34 | 35 | var link = findLink(e.target); 36 | if(!link) return; 37 | 38 | var href = link.href; 39 | 40 | if (href && href.match(/^(https?|ftp):\/\//)) { 41 | e.preventDefault(); 42 | e.stopPropagation(); 43 | 44 | // if(link.host == gBrowser.currentURI.host){ 45 | if(isThirdPart(link, gBrowser.currentURI)){ 46 | gBrowser.loadOneTab(href, { 47 | referrerURI: document.documentURIObject, 48 | charset: target.charset, 49 | postData: null, 50 | inBackground: false 51 | }); 52 | }else{ 53 | gBrowser.loadURI(href); 54 | } 55 | } 56 | } 57 | 58 | }, false); 59 | 60 | function findLink(element) { 61 | switch (element.tagName) { 62 | case 'A': return element; 63 | 64 | case 'B': case 'I': case 'SPAN': case 'SMALL': 65 | case 'STRONG': case 'EM': case 'BIG': case 'SUB': 66 | case 'SUP': case 'IMG': case 'S': 67 | var parent = element.parentNode; 68 | return parent && findLink(parent); 69 | 70 | default: 71 | return null; 72 | } 73 | } 74 | 75 | function isThirdPart(aLink, bLink){ 76 | try{ 77 | var aTLD = Services.eTLD.getBaseDomainFromHost(aLink.host); 78 | var bTLD = Services.eTLD.getBaseDomainFromHost(bLink.host); 79 | return aTLD != bTLD; 80 | }catch(e){ 81 | return aLink.host != bLink.host; 82 | } 83 | } 84 | 85 | function wildcardToRegExpStr(urlstr) { 86 | if (urlstr.source) return urlstr.source; 87 | let reg = urlstr.replace(/[()\[\]{}|+.,^$?\\]/g, "\\$&").replace(/\*+/g, function(str){ 88 | return str === "*" ? ".*" : "[^/]*"; 89 | }); 90 | return "^" + reg + "$"; 91 | } 92 | })(); -------------------------------------------------------------------------------- /uAutoPagerize2/uAutoPagerizeUI/aardvark.css: -------------------------------------------------------------------------------- 1 | @namespace url("http://www.w3.org/1999/xhtml"); 2 | 3 | .my-aardvark, .my-aardvark > .label, .my-aardvark > .label > .labelTag, .my-aardvark > .label > .labelAddition, .my-aardvark > .border { 4 | display: block !important; 5 | position: static !important; 6 | float: none !important; 7 | clear: none !important; 8 | right: auto !important; 9 | bottom: auto !important; 10 | z-index: 2147483647 !important; 11 | background: transparent !important; 12 | border: none !important; 13 | clip: auto !important; 14 | cursor: auto !important; 15 | margin: 0px !important; 16 | max-width: none !important; 17 | max-height: none !important; 18 | min-width: 0px !important; 19 | min-height: 0px !important; 20 | opacity: 1 !important; 21 | outline: none !important; 22 | padding: 0px !important; 23 | visibility: visible !important; 24 | -moz-binding: none !important; 25 | border-radius: 0px !important; 26 | -moz-user-focus: none !important; 27 | -moz-user-input: none !important; 28 | -moz-user-select: none !important; 29 | } 30 | .my-aardvark { 31 | position: fixed !important; 32 | width: auto !important; 33 | height: auto !important; 34 | } 35 | .my-aardvark > .border { 36 | border: 2px solid #ff0000 !important; 37 | top: auto !important; 38 | left: auto !important; 39 | } 40 | .my-aardvark > .label { 41 | float: left !important; 42 | background-color: #fff0cc !important; 43 | border-color: #000000 !important; 44 | border-width: 0px 2px 1px 2px !important; 45 | border-style: solid !important; 46 | border-bottom-left-radius: 6px !important; 47 | border-bottom-right-radius: 6px !important; 48 | padding: 2px 5px !important; 49 | top: auto !important; 50 | left: auto !important; 51 | width: auto !important; 52 | height: auto !important; 53 | } 54 | .my-aardvark > .label.onTop { 55 | position: relative !important; 56 | left: 5px !important; 57 | top: -25px !important; 58 | border-top-width: 1px !important; 59 | border-radius: 6px !important; 60 | } 61 | .my-aardvark > .label > .labelTag, .my-aardvark > .label > .labelAddition { 62 | display: inline !important; 63 | font-family: Arial !important; 64 | font-size: 12px !important; 65 | color: #000000 !important; 66 | top: auto !important; 67 | left: auto !important; 68 | width: auto !important; 69 | height: auto !important; 70 | direction: ltr !important; 71 | font-size-adjust: none !important; 72 | font-stretch: normal !important; 73 | font-style: normal !important; 74 | font-variant: normal !important; 75 | font-weight: normal !important; 76 | letter-spacing: normal !important; 77 | line-height: normal !important; 78 | text-align: start !important; 79 | text-decoration: none !important; 80 | text-indent: 0px !important; 81 | text-shadow: none !important; 82 | text-transform: none !important; 83 | text-transform: none !important; 84 | white-space: normal !important; 85 | word-spacing: 0px !important; 86 | } 87 | .my-aardvark > .label > .labelTag { 88 | font-weight: bold !important; 89 | } 90 | -------------------------------------------------------------------------------- /InspectElementModY/xpi/src/install.rdf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | InspectElement@zbinlin 8 | 0.0.8 9 | 2 10 | Element Inspector 11 | chrome://InspectElement/content/options.xul 12 | 13 | 14 | 15 | 16 | {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 17 | 3.6 18 | 24.0a1 19 | 20 | 21 | 22 | 23 | 24 | 25 | {3550f703-e582-4d05-9a08-453d09bdfdc6} 26 | 5.0 27 | 24.0a1 28 | 29 | 30 | 31 | 32 | 33 | 34 | {92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a} 35 | 1.0 36 | 2.27 37 | 38 | 39 | 40 | true 41 | 44 | 45 | 46 | 47 | zh-CN 48 | Element Inspector 49 | 使用 shift + 右键,在 DOM Inspector 中查找并定位到相应的元素节点 50 | zbinlin 51 | http://mozcp.com/ 52 | zbinlin 53 | zbinlin 54 | 55 | 56 | 57 | 58 | 59 | en-US 60 | Element Inspector 61 | In the DOM Inspector,quickly navigate to the any elements 62 | zbinlin 63 | http://mozcp.com/ 64 | zbinlin 65 | zbinlin 66 | 67 | 68 | 69 | 70 | 71 | 72 | inspector@mozilla.org 73 | 1.0 74 | 3.0 75 | 76 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /.一些摘要/Sublime text 摘要.md: -------------------------------------------------------------------------------- 1 | Sublime text 摘要 2 | ================ 3 | 4 | @[my|editor|text] 5 | 6 | 设置 7 | ---- 8 | 9 | "color_scheme": "Packages/Solarized Color Scheme/Solarized (dark).tmTheme", 10 | "font_face": "Monaco", 11 | "font_size": 11, 12 | "word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?,。、“”:()" 13 | 14 | 扩展 15 | ---- 16 | 17 | 官方扩展中心:[Package Control - the Sublime Text package manager](https://sublime.wbond.net/) 18 | 19 | ### 常用 20 | 21 | - **[ConvertToUTF8](https://github.com/seanliang/ConvertToUTF8)** 22 | - **Solarized Color Scheme**, markdown 格式支持的好点。 23 | - [AlignTab](https://github.com/randy3k/AlignTab) 24 | - [SideBarEnhancements](https://github.com/titoBouzout/SideBarEnhancements) 25 | - [SublimeREPL](https://github.com/wuub/SublimeREPL) 26 | - Git 27 | - JsFormat, `ctrl+alt+f`, 格式化html中的js时需要先选择要格式化的js 28 | - Markdown Preview 29 | - Emment 30 | - [Better JavaScript](https://github.com/int3h/sublime-better-javascript),增强函数的识别。不必安装,可直接复制部分内容到原来的 `JavaScript` 文件夹中, 31 | 32 | ### 可选 33 | 34 | - [AdvancedNewFile](https://github.com/skuroda/Sublime-AdvancedNewFile), `ctrl+alt+n`, 35 | - [File History](https://github.com/FichteFoll/sublimetext-filehistory)。打开最近关闭的文件,`Ctrl+Shift+T` 36 | - [EasyMotion](https://github.com/tednaleid/sublime-EasyMotion)。文字跳转,`Ctrl+;` 跳转,`Ctrl+shift+;` 选择跳转 37 | - [Filter Lines](https://github.com/davidpeckham/FilterLines)。 38 | - CTags 39 | - Theme - Soda 40 | - [Edit History](https://github.com/Stuk/sublime-edit-history),Sublime text 3 已经内置。 41 | - Bracket Highlighter, 括号匹配高亮 42 | - KeymapManager, 快捷键管理 43 | - AndyPython, Python标准库帮助提示 44 | - SublimeLinter 45 | - `Show Error List` 查看代码问题 46 | - SublimeCodeIntel 47 | 48 | For Windows: 49 | * Jump to definition = ``Alt+Click`` 50 | * Jump to definition = ``Control+Windows+Alt+Up`` 51 | * Go back = ``Control+Windows+Alt+Left`` 52 | * Manual CodeIntel = ``Control+Shift+space`` 53 | 54 | - [Python PEP8 Autoformat](https://bitbucket.org/StephaneBunel/pythonpep8autoformat). 自动格式化代码以符合大部分pep8规范,windows 下,使用ctrl+shift+r 即可调用 55 | - Python Coverage: 代码覆盖率统计工具 56 | - Python Anywhere Editor: Edit your files from [www.PythonAnywhere.com](www.PythonAnywhere.com) 57 | - [Python Flake8 Lint](https://github.com/dreadatour/Flake8Lint) 58 | 59 | - Flake8Lint is a Sublime Text 2 plugin for check Python files against some of the style conventions in [PEP8](http://www.python.org/dev/peps/pep-0008/), [PyFlakes](https://launchpad.net/pyflakes) and [mccabe](http://nedbatchelder.com/blog/200803/python_code_complexity_microtool.html) 60 | - PEP 8 -- [Style Guide for Python Code](http://www.python.org/dev/peps/pep-0008/) 61 | 62 | - Python Imports Sorter 63 | 64 | ### 语法高亮 65 | 66 | - Better CoffeeScript 67 | - BBCode Syntax 68 | - AutoHotkey 69 | - AutoItScript 70 | - VBScript 71 | 72 | Sublime text 2 相关 73 | ------------------- 74 | 75 | ### 开启 Package Control 76 | 77 | Ctrl+~ (数字1左边的按键)调出控制台 78 | 79 | ```python 80 | import urllib2,os; pf='Package Control.sublime-package'; ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation' 81 | ``` 82 | -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/script/update.js: -------------------------------------------------------------------------------- 1 | var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; 2 | Cu.import("resource://gre/modules/Services.jsm"); 3 | 4 | var mainWin = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator) 5 | .getMostRecentWindow("navigator:browser"); 6 | 7 | function nano(tpl, data) { 8 | return tpl.replace(/\{([\w\.]*)\}/g, function(str, key) { 9 | var keys = key.split('.'), 10 | value = data[keys.shift()]; 11 | keys.forEach(function(key) { 12 | value = value[key]; 13 | }); 14 | return (value === null || value === undefined) ? '' : value; 15 | }); 16 | } 17 | 18 | function displayUpdateScript(newScript, oldScript) { 19 | var info = { 20 | homepageURL: newScript.homepageURL || oldScript.homepageURL, 21 | name: newScript.name || oldScript.name, 22 | oldVersion: oldScript.version, 23 | newVersion: newScript.version, 24 | downloadURL: newScript.downloadURL || oldScript.downloadURL 25 | }; 26 | 27 | var tpl = '{name} 脚本从版本 {oldVersion} 更新到了版本 {newVersion},' + 28 | '下载链接'; 29 | $('
  • ').html(nano(tpl, info)).appendTo('#infos'); 30 | } 31 | 32 | function displayNoUpdateScript(script) { 33 | var info = { 34 | name: script.name, 35 | homepageURL: script.homepageURL || script.downloadURL 36 | } 37 | var tpl = '{name} 脚本没有更新'; 38 | $('
  • ').html(nano(tpl, info)).appendTo('#infos'); 39 | } 40 | 41 | function displayNoVersionScript(script) { 42 | var info = { 43 | name: script.name, 44 | homepageURL: script.homepageURL || script.downloadURL, 45 | downloadURL: script.downloadURL 46 | } 47 | var tpl = '{name} 脚本没有检测到版本号,可能需要手动判断。' + 48 | '下载链接'; 49 | $('
  • ').html(nano(tpl, info)).appendTo('#infos'); 50 | } 51 | 52 | function compareVersion() { 53 | var text = this.responseText; 54 | var oldScript = this.oldScript; 55 | var newScript = mainWin.userChrome_js.parseScript(text); 56 | 57 | if (!oldScript.version && !newScript.version) { 58 | displayNoVersionScript(oldScript); 59 | } else if (newScript.version && Services.vc.compare(newScript.version, oldScript.version) > 0) { 60 | displayUpdateScript(newScript, oldScript); 61 | } else { 62 | displayNoUpdateScript(oldScript); 63 | } 64 | } 65 | 66 | function isHasChanged(script) { 67 | var url = script.downloadURL; 68 | if (!url) { 69 | return; 70 | } 71 | 72 | var req = new XMLHttpRequest(); 73 | req.open('GET', url, true); 74 | req.oldScript = script; 75 | req.onload = compareVersion; 76 | req.send(); 77 | } 78 | 79 | function init() { 80 | var scripts = mainWin.userChromejs.manganer.list(), 81 | downScripts = scripts.filter((s) => s.canUpdate), 82 | downLength = downScripts.length; 83 | 84 | $('#scripts-title').text(nano('共有 {downLength} 个脚本正在更新,另有 {otherLength} 脚本没有下载链接', { 85 | downLength: downLength, 86 | otherLength: scripts.length - downLength 87 | })); 88 | 89 | downScripts.map(isHasChanged); 90 | } 91 | 92 | init(); -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/script/ScriptAddon.js: -------------------------------------------------------------------------------- 1 | 2 | var EXPORTED_SYMBOLS = ["ScriptAddon"]; 3 | 4 | Cu.import("resource://gre/modules/AddonManager.jsm"); 5 | 6 | /** 7 | * 未完成 8 | */ 9 | function ScriptAddon(aScript){ 10 | this._script = aScript; 11 | 12 | this.id = this._script.url; 13 | this.name = this._script.filename; 14 | this.description = this._script.description; 15 | this.enabled = !userChrome_js.scriptDisable[this.name]; 16 | 17 | // 我修改过的 userChrome.js 新增的 18 | this.version = this._script.version; 19 | this.homepageURL = this._script.homepageURL; 20 | this.downloadURL = this._script.downloadURL; 21 | this.reviewURL = this._script.reviewURL; 22 | this.reviewCount = 0; 23 | this.fullDescription = this._script.fullDescription; 24 | 25 | this.iconURL = iconURL; 26 | } 27 | 28 | ScriptAddon.prototype = { 29 | type: "userchromejs", 30 | isCompatible: true, 31 | blocklistState: 0, 32 | appDisabled: false, 33 | scope: AddonManager.SCOPE_PROFILE, 34 | pendingOperations: AddonManager.PENDING_NONE, // 必须,否则所有都显示 restart 35 | operationsRequiringRestart: 6, 36 | // operationsRequiringRestart: AddonManager.OP_NEEDS_RESTART_DISABLE, 37 | 38 | get creator() { 39 | return { 40 | name: this._script.author, 41 | url: this.homepageURL || this.downloadURL 42 | } 43 | }, 44 | get optionsURL(){ 45 | if (this.isActive && this._script.optionsURL) 46 | return this._script.optionsURL; 47 | }, 48 | 49 | get isActive() !this.userDisabled, 50 | get userDisabled() !this.enabled, 51 | set userDisabled(val) { 52 | if (val == this.userDisabled) { 53 | return val; 54 | } 55 | 56 | AddonManagerPrivate.callAddonListeners(val ? 'onEnabling' : 'onDisabling', this, false); 57 | 58 | if(this.pendingOperations == AddonManager.PENDING_NONE){ 59 | this.pendingOperations = val ? AddonManager.PENDING_DISABLE : AddonManager.PENDING_ENABLE; 60 | }else{ 61 | this.pendingOperations = AddonManager.PENDING_NONE; 62 | } 63 | 64 | this.enabled = !val; 65 | if(window.userChromejs){ 66 | userChromejs.chgScriptStat(this.name); 67 | } 68 | 69 | AddonManagerPrivate.callAddonListeners(val ? 'onEnabled' : 'onDisabled', this); 70 | }, 71 | get permissions() { 72 | // var perms = AddonManager.PERM_CAN_UNINSTALL; 73 | // perms |= this.userDisabled ? AddonManager.PERM_CAN_ENABLE : AddonManager.PERM_CAN_DISABLE; 74 | var perms = this.userDisabled ? AddonManager.PERM_CAN_ENABLE : AddonManager.PERM_CAN_DISABLE; 75 | // if (this.updateURL) perms |= AddonManager.PERM_CAN_UPGRADE; 76 | return perms; 77 | }, 78 | 79 | edit: function() { 80 | 81 | }, 82 | 83 | uninstall: function() { 84 | AddonManagerPrivate.callAddonListeners("onUninstalling", this, false); 85 | this.needsUninstall = true; 86 | this.pendingOperations |= AddonManager.PENDING_UNINSTALL; 87 | AddonManagerPrivate.callAddonListeners("onUninstalled", this); 88 | }, 89 | cancelUninstall: function() { 90 | this.needsUninstall = false; 91 | this.pendingOperations ^= AddonManager.PENDING_UNINSTALL; 92 | AddonManagerPrivate.callAddonListeners("onOperationCancelled", this); 93 | }, 94 | }; 95 | -------------------------------------------------------------------------------- /论坛灌水.uc.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /MoreToolsMenu.uc.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | const XUL_NS = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'; 3 | 4 | var toolsPopup = $('menu_ToolsPopup'); 5 | 6 | var menu, popup; 7 | 8 | menu = document.createElement("menu"); 9 | menu.setAttribute("id", "moreTools-menu"); 10 | menu.setAttribute("label", "Tools"); 11 | menu.setAttribute("accesskey", "T"); 12 | 13 | popup = document.createElement("menupopup"); 14 | popup.setAttribute("id", "menu_MoreToolsPopup"); 15 | 16 | $A(toolsPopup.childNodes).forEach(absorb); 17 | 18 | $W('popupshowing popupshown popuphiding popuphidden').forEach(function(type) { 19 | popup.addEventListener(type, MTM_forwardEvent, true); 20 | }); 21 | 22 | menu.appendChild(popup); 23 | $('main-menubar').insertBefore(menu, $('tools-menu').nextSibling); 24 | 25 | toolsPopup.addEventListener('DOMNodeInserted', function MTM_onDOMNodeInserted(event) { 26 | var target = event.originalTarget; 27 | if (target.parentNode === this) 28 | absorb(target); 29 | }, false); 30 | 31 | function U(text) 1 < '?'.length ? decodeURIComponent(escape(text)) : text; 32 | function $A(arr) Array.slice(arr); 33 | function $W(str) str.split(' '); 34 | function $(id) document.getElementById(id); 35 | function isMoreTools(item) { 36 | switch (item.getAttribute('id')) { 37 | case 'menu_search': 38 | case 'browserToolsSeparator': 39 | case 'menu_openDownloads': 40 | case 'menu_openAddons': 41 | case 'sync-setup': 42 | case 'sync-syncnowitem': 43 | case 'devToolsSeparator': 44 | case 'javascriptConsole': 45 | case 'webConsole': 46 | case 'menu_pageInfo': 47 | case 'sanitizeSeparator': 48 | case 'privateBrowsingItem': 49 | case 'sanitizeItem': 50 | case 'prefSep': 51 | case 'menu_preferences': 52 | return false; 53 | } 54 | return true; 55 | } 56 | function absorb(item) { 57 | if (!isMoreTools(item)) return; 58 | 59 | if (item.localName === 'menuseparator') { 60 | setTimeout(function() document.adoptNode(item), 0); 61 | return; 62 | } 63 | 64 | var itemLabel = item.getAttribute('label').toLowerCase(); 65 | var nodes = $A(popup.children); 66 | for (var index = 0, len = nodes.length; index < len; index++) { 67 | if (itemLabel < nodes[index].getAttribute('label').toLowerCase()) break; 68 | } 69 | popup.insertBefore(item, nodes[index]); 70 | } 71 | function MTM_forwardEvent({type}) { 72 | var _event = document.createEvent('PopupEvents'); 73 | _event.initMouseEvent(type, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); 74 | toolsPopup.dispatchEvent(_event); 75 | } 76 | })(); -------------------------------------------------------------------------------- /.一些摘要/File IO.md: -------------------------------------------------------------------------------- 1 | File I/O 摘要 2 | ============ 3 | 4 | Firefox Only. 5 | 6 | - [JavaScript OS.File | MDN](https://developer.mozilla.org/en-US/docs/JavaScript_OS.File):高效、off-main thread、新的 API,用于取代老的 API,低版本 firefox 不支持。 7 | - [File I/O - Mozilla | MDN](https://developer.mozilla.org/en-US/Add-ons/Code_snippets/File_I_O):老的 API。 8 | 9 | OS.File 10 | -------- 11 | 12 | - [OS.File for the main thread - JavaScript OS.File | MDN](https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread) 13 | - [Path manipulation - JavaScript OS.File | MDN](https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.Path) 14 | 15 | ### 导入 16 | 17 | ```js 18 | Components.utils.import("resource://gre/modules/osfile.jsm") 19 | ``` 20 | 21 | ### 示例:读取当前配置 chrome 下的 userChrome.css 22 | 23 | ```js 24 | let decoder = new TextDecoder(); // This decoder can be reused for several reads 25 | let path = OS.Path.join(OS.Constants.Path.profileDir, "chrome", "userChrome.css"); 26 | let promise = OS.File.read(path); // Read the complete file as an array 27 | promise = promise.then( 28 | function onSuccess(array) { 29 | let text = decoder.decode(array); // Convert this array to a text 30 | return alert(text); 31 | } 32 | ); 33 | ``` 34 | 35 | ### 示例:写入内容到当前配置 chrome 下的 file.txt 36 | 37 | ```js 38 | let encoder = new TextEncoder(); // This encoder can be reused for several writes 39 | let array = encoder.encode("This is some text. 中文"); // Convert the text to an array 40 | let path = OS.Path.join(OS.Constants.Path.profileDir, "file.txt"); 41 | let promise = OS.File.writeAtomic(path, array, // Write the array atomically to "file.txt", using as temporary 42 | {tmpPath: "file.txt.tmp", noOverwrite: true}); // buffer "file.txt.tmp". 43 | ``` 44 | 45 | ### 一些代码片段 46 | 47 | ```js 48 | OS.Path.basename(PATH) 49 | 50 | OS.Path.dirname(PATH) 51 | 52 | OS.Path.join(tmpDir, "foo", "bar") 53 | 54 | OS.Path.normalize(PATH) 55 | 56 | OS.Path.split(PATH) 57 | ``` 58 | 59 | File I/O 60 | -------- 61 | 62 | [File I/O - Mozilla | MDN](https://developer.mozilla.org/en-US/Add-ons/Code_snippets/File_I_O) 63 | 64 | ### Creating an nsIFile object 65 | 66 | ```js 67 | Components.utils.import("resource://gre/modules/FileUtils.jsm"); 68 | 69 | var file = new FileUtils.File("/home"); 70 | ``` 71 | 72 | Or the same without using FileUtils.jsm: 73 | 74 | ```js 75 | var file = Components.classes["@mozilla.org/file/local;1"]. 76 | createInstance(Components.interfaces.nsILocalFile); 77 | file.initWithPath("/home"); 78 | ``` 79 | 80 | ### Getting files in special directories 81 | 82 | ```js 83 | Components.utils.import("resource://gre/modules/FileUtils.jsm"); 84 | 85 | // get the "data.txt" file in the profile directory 86 | var file = FileUtils.getFile("ProfD", ["data.txt"]); 87 | ``` 88 | 89 | Or the same without using [File Utils.jsm](https://developer.mozilla.org/en-US/docs/JavaScript_code_modules/FileUtils.jsm): 90 | 91 | ```js 92 | // get profile directory 93 | var file = Components.classes["@mozilla.org/file/directory_service;1"]. 94 | getService(Components.interfaces.nsIProperties). 95 | get("ProfD", Components.interfaces.nsIFile); 96 | file.append("data.txt"); 97 | 98 | // Note: "file" is an object that implements nsIFile. If you want the 99 | // file system path, use file.path 100 | ``` -------------------------------------------------------------------------------- /Font/README.md: -------------------------------------------------------------------------------- 1 | # 字体替换为雅黑 2 | 3 | ## 我目前在用的样式 4 | 5 | Chrome 的字体替换详见 [chrome_font.md](chrome_font.md) 6 | 7 | ### firefox 下的样式 8 | 9 | **首先需要设置浏览器字体为** Microsoft YaHei UI 或微软雅黑 10 | 11 | ```css 12 | @namespace url(http://www.w3.org/1999/xhtml); 13 | 14 | @-moz-document url-prefix("http"), url-prefix("file"){ 15 | 16 | /* 替换简体 */ 17 | /*@font-face { font-family: 'Simsun'; src: local("Monaco"), local("Microsoft YaHei UI"), local('Microsoft YaHei'); }*/ 18 | @font-face { font-family: 'Simsun'; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 19 | @font-face { font-family: 'NSimsun'; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 20 | @font-face { font-family: 'Simhei'; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 21 | 22 | @font-face { font-family: '宋体'; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 23 | @font-face { font-family: '新宋体'; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 24 | @font-face { font-family: '黑体'; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 25 | 26 | /* 替换繁体 */ 27 | @font-face {font-family: "MingLiU"; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 28 | @font-face {font-family: "PMingLiU"; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 29 | @font-face {font-family: "Microsoft JhengHei"; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 30 | @font-face {font-family: "DFKai-SB"; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 31 | 32 | @font-face {font-family: "細明體"; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 33 | @font-face {font-family: "新細明體"; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 34 | @font-face {font-family: "微軟正黑體"; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 35 | @font-face {font-family: "標楷體"; src: local("Microsoft YaHei UI"), local('Microsoft YaHei'); } 36 | 37 | /* 替换日文 */ 38 | 39 | /* 替换韩文 */ 40 | 41 | /* 替换常见英文字体 */ 42 | /* @font-face { font-family: 'Arial'; src: local('Segoe UI'),local('Microsoft YaHei'); } 43 | @font-face { font-family: 'sans-serif'; src: local('Segoe UI'), local('Microsoft YaHei'); } 44 | @font-face { font-family: 'Verdana'; src: local('Microsoft YaHei'); } 45 | @font-face { font-family: 'Tahoma'; src: local('Microsoft YaHei'); } 46 | @font-face { font-family: 'Times New Roman'; src: local('Microsoft YaHei'); } 47 | @font-face { font-family: 'Segoe UI'; src: local('Microsoft YaHei'); }*/ 48 | 49 | /* 替换常见的等宽字体 */ 50 | /* @font-face { font-family: monospace;unicode-range: U+2E80-FFFF; src: local('YaHei Consolas Hybrid')} 51 | @font-face { font-family: 'monospace';unicode-range: U+2E80-FFFF; src: local('YaHei Consolas Hybrid')} 52 | @font-face { font-family: Consolas;unicode-range: U+2E80-FFFF; src: local('YaHei Consolas Hybrid')} 53 | @font-face { font-family: Lucida Console;unicode-range: U+2E80-FFFF; src: local('YaHei Consolas Hybrid')}*/ 54 | } 55 | ``` 56 | 57 | ### 补充说明 58 | 59 | **特别注意:** firefox 和 chrome 的字体方式不一样,最好使用 2 个不同的样式 60 | 61 | - 字体替换只对设置了字体的有效,而百度搜索页面默认无字体,firefox 会调用默认的字体设置。 62 | - 如果字体为 Arial 或 Verdana,其中中文部分 firefox 会使调用默认的衬线字体,而 chrome 不会。例如 [百度贴吧](http://tieba.baidu.com/p/3285422775?pn=2) 的翻页部分,chrome 需要额外的替换 Verdana 中文部分为雅黑样式。 63 | 64 | ### 测试页面 65 | 66 | - [百度搜索](http://www.baidu.com/s?wd=firefox),默认无字体。 67 | 68 | ### 参考 69 | 70 | - [catcat520 的研究](http://bbs.kafan.cn/thread-1681393-1-1.html) 71 | - [替换字体的中文部分为雅黑 - Chrome 网上应用店](https://chrome.google.com/webstore/detail/%E6%9B%BF%E6%8D%A2%E5%AD%97%E4%BD%93%E7%9A%84%E4%B8%AD%E6%96%87%E9%83%A8%E5%88%86%E4%B8%BA%E9%9B%85%E9%BB%91/enpkigfhoabjjjonanmddidnnahopmcn) -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/bak/userchrome_old.js: -------------------------------------------------------------------------------- 1 | /* 2 | * userChromeJS 3 | * 4 | * This file can be used to customize the functioning of Mozilla's user 5 | * interface. Usage and syntax follow below; for useful code snippets see 6 | * http://mozilla.zeniko.ch/userchrome.js.html. 7 | * 8 | * Examples: 9 | * setTimeout(function() { document.title = "A new title for every window" }, 2000); 10 | * 11 | * if (location == "chrome://browser/content/browser.xul") { 12 | * alert("Script loaded in main browser only"); 13 | * } 14 | * 15 | * // DOMi window 16 | * if (location == "chrome://inspector/content/inspector.xul") { 17 | * // Move Urlbar box to main toolbar 18 | * var tb = document.getElementById('bxURLBar'); 19 | * var el = document.getElementById('mbrInspectorMain'); 20 | * if (tb && el) el.appendChild(tb, el.firstChild); 21 | * } 22 | * 23 | * NOTE: userChromeJS includes an 'import' function to facilitate file management. 24 | * An absolute path or relative path with Directory name property token can be 25 | * used, as follows: 26 | * 27 | * // Single file (javascript .js or overlay .xul file) 28 | * userChrome.import("Full file path"); 29 | * userChrome.import("Relative file path", "Token"); 30 | * // All .js and .xul files in a folder will be loaded. 31 | * userChrome.import("Full file folder path"); 32 | * userChrome.import("Relative file folder path/name", "Token"); 33 | * userChrome.import("*", "Token"); 34 | * 35 | * NOTE: absolute windows files and folders must be have backslash escaped: 36 | * "C:\\Program Files\\Mozilla\\scripts\\myscript.js" 37 | * 38 | * Examples: 39 | * // Import script in [ProfileDir]/chrome/scripts/myscript.js 40 | * userChrome.import("scripts/myscript.js", "UChrm"); 41 | * // Import script in [Profiles]/scripts/myscript.js (share same script in 42 | * // multiple profiles 43 | * userChrome.import("scripts/myscript.js", "DefProfRt"); 44 | * // All .js or .xul in profile chrome directory 45 | * userChrome.import("*", "UChrm"); 46 | * // Import overlay 47 | * userChrome.import("C:\\Program Files\\Mozilla\\scripts\\myOverlay.xul"); 48 | * // Import everything in Desktop folder /scripts 49 | * userChrome.import("scripts", "Desk"); 50 | * // Perhaps the only thing you need in this file.. 51 | * if (location == "chrome://browser/content/browser.xul") { 52 | * userChrome.import("scripts", "DefProfRt"); 53 | * } 54 | * 55 | * NOTE: for a full listing of directory tokens see the two links found here: 56 | * https://developer.mozilla.org/en/Code_snippets/File_I%2f%2fO#Getting_special_files 57 | * // What's the path for a token? This will print it in the console.. 58 | * userChrome.log(userChrome.getAbsoluteFile("Desk").path, "getAbsoluteFile:'Desk'"); 59 | * 60 | * NOTE: userChromeJS includes a log function, invoked as follows: 61 | * userChrome.log("string1", ["string2"]) 62 | * Example: 63 | * userChrome.log("hello world!", "myscript.js"); 64 | * Results in a console message: 65 | * 2009-05-22 18:07:40 userChromeJS.js::myscript.js: hello world! 66 | * 67 | * NOTE: the date format for the userChrome.log console logger may be user defined: 68 | * Example: 69 | * userChrome.dateFormat = "%Y-%m-%d %H:%M:%S"; 70 | * 71 | * NOTE: the default charSet is "UTF-8"; for code using the 'import' or 72 | * 'importFolder' functions to manage files, the charSet for subscript loader 73 | * may be user defined, prior to calling the import or importFolder functions: 74 | * Example: 75 | * userChrome.charSet = "UTF-8"; 76 | * 77 | * NOTE: the following shortcuts are predefined: 78 | * Cc = Components.classes; 79 | * Ci = Components.interfaces; 80 | * Cr = Components.results; 81 | * Cu = Components.utils; 82 | * 83 | */ 84 | -------------------------------------------------------------------------------- /DownloadEnhance.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name download_enhance.uc.js 3 | // @note testversion: 20130416 minofix lastdream2013 4 | // @description 下载另存为+修改下载文件名 5 | // @author 紫云飞 6 | // @include chrome://mozapps/content/downloads/unknownContentType.xul 7 | // @note 2014.06.06 add delay to fix for new userChrome.js 8 | // ==/UserScript== 9 | (function() { 10 | 11 | switch (location.href) { 12 | case "chrome://browser/content/browser.xul": 13 | break; 14 | case "chrome://mozapps/content/downloads/unknownContentType.xul": 15 | setTimeout(function(){ 16 | download_dialog_changeName(); // 下载改名 17 | download_dialog_saveas(); //另存为... 18 | }, 200); 19 | break; 20 | } 21 | 22 | function download_dialog_changeName() { 23 | if (location != "chrome://mozapps/content/downloads/unknownContentType.xul") return; 24 | document.querySelector("#mode").addEventListener("select", function() { 25 | if (dialog.dialogElement("save").selected) { 26 | if (!document.querySelector("#locationtext")) { 27 | var locationtext = document.querySelector("#location").parentNode.insertBefore(document.createElement("textbox"), document.querySelector("#location")); 28 | locationtext.id = "locationtext"; 29 | locationtext.setAttribute("style", "margin-top:-2px;margin-bottom:-3px"); 30 | locationtext.value = document.querySelector("#location").value; 31 | } 32 | document.querySelector("#location").hidden = true; 33 | document.querySelector("#locationtext").hidden = false; 34 | } else { 35 | document.querySelector("#locationtext").hidden = true; 36 | document.querySelector("#location").hidden = false; 37 | } 38 | }, false) 39 | dialog.dialogElement("save").click(); 40 | window.addEventListener("dialogaccept", function() { 41 | if ((document.querySelector("#locationtext").value != document.querySelector("#location").value) && dialog.dialogElement("save").selected) { 42 | var mainwin = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser"); 43 | mainwin.eval("(" + mainwin.internalSave.toString().replace("let ", "").replace("var fpParams", "fileInfo.fileExt=null;fileInfo.fileName=aDefaultFileName;var fpParams") + ")")(dialog.mLauncher.source.asciiSpec, null, document.querySelector("#locationtext").value, null, null, null, null, null, null, mainwin.document, Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch).getBoolPref("browser.download.useDownloadDir"), null); 44 | document.documentElement.removeAttribute("ondialogaccept"); 45 | } 46 | }, false); 47 | } 48 | 49 | function download_dialog_saveas() { 50 | var saveas = document.documentElement.getButton("extra1"); 51 | saveas.setAttribute("hidden", "false"); 52 | saveas.setAttribute("label", "\u53E6\u5B58\u4E3A"); 53 | saveas.setAttribute("oncommand", 'var mainwin = Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow("navigator:browser"); mainwin.eval("(" + mainwin.internalSave.toString().replace("let ", "").replace("var fpParams", "fileInfo.fileExt=null;fileInfo.fileName=aDefaultFileName;var fpParams") + ")")(dialog.mLauncher.source.asciiSpec, null, (document.querySelector("#locationtext") ? document.querySelector("#locationtext").value : dialog.mLauncher.suggestedFileName), null, null, null, null, null, null, mainwin.document, 0, null);close()'); 54 | } 55 | 56 | })(); -------------------------------------------------------------------------------- /ThunderLixianExporterPatch/ThunderLixianExporterPatch.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name ThunderLixianExporterPatch.uc.js 3 | // @namespace ywzhaiqi@gmail.com 4 | // @author ywzhaiqi 5 | // @description 迅雷离线直接导出IDM.ef2,需配合 ThunderLixianExporter.use.js 使用。 6 | // @include main 7 | // @charset UTF-8 8 | // @version 0.0.2 9 | // @note 10 | // ==/UserScript== 11 | 12 | /** 13 | * ThunderLixianExporter.use.js 下载地址 14 | * http://binux.github.io/ThunderLixianExporter/master/ThunderLixianExporter.user.js 15 | */ 16 | 17 | if(typeof window.thunderLixian != 'undefined'){ 18 | window.thunderLixian.uninit(); 19 | delete window.thunderLixian; 20 | } 21 | 22 | (function(){ 23 | 24 | // 导出名字 25 | var idm_export_name = "idm.ef2"; 26 | // 导出路径为 config 中的 browser.download.dir 27 | 28 | 29 | let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; 30 | if (!window.Services) Cu.import("resource://gre/modules/Services.jsm"); 31 | Cu.import("resource://gre/modules/FileUtils.jsm"); 32 | 33 | 34 | var ns = window.thunderLixian = { 35 | 36 | init: function(){ 37 | gBrowser.mPanelContainer.addEventListener('load', this, true); 38 | }, 39 | uninit: function(){ 40 | gBrowser.mPanelContainer.removeEventListener('load', this, true); 41 | }, 42 | handleEvent: function(event){ 43 | switch(event.type){ 44 | case 'load': 45 | var doc = event.target; 46 | var win = doc.defaultView; 47 | if(win && win.location.hostname == "dynamic.cloud.vip.xunlei.com"){ 48 | ns.addListener(win); 49 | } 50 | break; 51 | } 52 | }, 53 | addListener: function(win){ 54 | var batch_getbtn = win.document.getElementById("TLE_batch_getbtn"); 55 | if(!batch_getbtn) return; 56 | 57 | var link = win.document.createElement("a"); 58 | link.innerHTML = "直接导出IDM文件"; 59 | link.setAttribute("href", "javascript:void(0);"); 60 | batch_getbtn.insertBefore(link, batch_getbtn.children[1]); 61 | 62 | link.addEventListener("click", function(){ 63 | var TLE = win.wrappedJSObject.TLE; 64 | if(!TLE) return; 65 | 66 | TLE.batch_down(null, function(todown){ 67 | var str = ""; 68 | for(var taskId in todown.tasklist){ 69 | var task = todown.tasklist[taskId]; 70 | task.filelist.forEach(function(file, l){ 71 | if (!file.downurl) return; 72 | str += '<\r\n'+TLE.url_rewrite(file.downurl, TLE.safe_title(file.title))+'\r\ncookie: gdriveid='+todown.gdriveid+'\r\n>\r\n'; 73 | }); 74 | } 75 | saveFile(str); 76 | }); 77 | }, false); 78 | }, 79 | }; 80 | 81 | 82 | var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); 83 | 84 | function initFile(){ 85 | try{ 86 | var download_dir = Services.prefs.getComplexValue("browser.download.dir", Ci.nsISupportsString).data; 87 | var idm_export_path = download_dir + "\\" + idm_export_name; 88 | file.initWithPath(idm_export_path); 89 | }catch(ex){ 90 | file = FileUtils.getFile("DfltDwnld", [idm_export_name]); 91 | } 92 | } 93 | 94 | function saveFile(data) { 95 | initFile(); 96 | file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE); 97 | 98 | var suConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter); 99 | suConverter.charset = 'UTF-8'; 100 | data = suConverter.ConvertFromUnicode(data); 101 | 102 | var foStream = Cc['@mozilla.org/network/file-output-stream;1'].createInstance(Ci.nsIFileOutputStream); 103 | foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0); 104 | foStream.write(data, data.length); 105 | foStream.close(); 106 | 107 | alerts("IDM导出文件路径", file.path); 108 | } 109 | 110 | function checkDoc(doc) { 111 | if (!(doc instanceof HTMLDocument)) return false; 112 | if (!window.mimeTypeIsTextBased(doc.contentType)) return false; 113 | if (!doc.body || !doc.body.hasChildNodes()) return false; 114 | if (doc.body instanceof HTMLFrameSetElement) return false; 115 | return true; 116 | } 117 | 118 | function alerts(title, info){ 119 | Cc['@mozilla.org/alerts-service;1'].getService(Ci.nsIAlertsService) 120 | .showAlertNotification(null, title, info, false, "", null, ""); 121 | } 122 | 123 | })(); 124 | 125 | 126 | window.thunderLixian.init(); -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/script/tpl/quickDragTemplate.js: -------------------------------------------------------------------------------- 1 | location == "chrome://browser/content/browser.xul" && (function(event) { 2 | var self = arguments.callee; 3 | if (!event) { 4 | ["dragstart", "drag", "dragover", "drop"].forEach(function(type) { 5 | gBrowser.mPanelContainer.addEventListener(type, self, false); 6 | }); 7 | window.addEventListener("unload", function() { 8 | ["dragstart", "drag", "dragover", "drop"].forEach(function(type) { 9 | gBrowser.mPanelContainer.removeEventListener(type, self, false); 10 | }); 11 | }, false); 12 | 13 | self.seemAsURL = function(url) { // 来自 Easy DragToGo+ 扩展,略作修正 14 | var DomainName = /(\w+(\-+\w+)*\.)+\w{2,7}/i; 15 | var HasSpace = /\S\s+\S/; 16 | var KnowNameOrSlash = /^(www|bbs|forum|blog)|\//i; 17 | var KnowTopDomain1 = /\.(com|net|org|gov|edu|info|mobi|mil|asia)$/i; 18 | var KnowTopDomain2 = /\.(de|uk|eu|nl|it|cn|be|us|br|jp|ch|fr|at|se|es|cz|pt|ca|ru|hk|tw|pl|me|tv|cc)$/i; 19 | var IsIpAddress = /^([1-2]?\d?\d\.){3}[1-2]?\d?\d/; 20 | var seemAsURL = !HasSpace.test(url) && DomainName.test(url) && (KnowNameOrSlash.test(url) || KnowTopDomain1.test(url) || KnowTopDomain2.test(url) || IsIpAddress.test(url)); 21 | return seemAsURL; 22 | }; 23 | return; 24 | } 25 | switch (event.type) { 26 | case "dragstart": 27 | { 28 | event.target.localName == "img" && event.dataTransfer.setData("application/x-moz-file-promise-url", event.target.src); 29 | break; 30 | } 31 | case "drag": 32 | { 33 | self.dragFromInside = true; 34 | self.sourceNode = event.target; 35 | break; 36 | } 37 | case "dragover": 38 | { 39 | self.dragFromInside && (Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService).getCurrentSession().canDrop = true); 40 | break; 41 | } 42 | case "drop": 43 | { 44 | if (self.dragFromInside && event.target.localName != "textarea" && (!(event.target.localName == "input" && (event.target.type == "text" || event.target.type == "password"))) && event.target.contentEditable != "true") { 45 | event.preventDefault(); 46 | event.stopPropagation(); 47 | if (event.dataTransfer.types.contains("application/x-moz-file-promise-url")) { 48 | if (event.ctrlKey) { 49 | //ci 50 | return; 51 | } 52 | if (event.altKey) { 53 | //ai 54 | return; 55 | } 56 | if (event.shiftKey) { 57 | //si 58 | return; 59 | } 60 | //i 61 | } else if (event.dataTransfer.types.contains("text/x-moz-url")) { 62 | if (event.ctrlKey) { 63 | //cl 64 | return; 65 | } 66 | if (event.altKey) { 67 | //al 68 | return; 69 | } 70 | if (event.shiftKey) { 71 | //sl 72 | return; 73 | } 74 | //l 75 | } else { 76 | if (event.ctrlKey) { 77 | //ct 78 | return; 79 | } 80 | if (event.altKey) { 81 | //at 82 | return; 83 | } 84 | if (event.shiftKey) { 85 | //st 86 | return; 87 | } 88 | //t 89 | } 90 | self.dragFromInside = false; 91 | } 92 | } 93 | } 94 | })() -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/script/tpl/superDragTemplate.js: -------------------------------------------------------------------------------- 1 | location == "chrome://browser/content/browser.xul" && (function(event) { 2 | var self = arguments.callee; 3 | if (!event) { 4 | self.GESTURES = { 5 | image: { 6 | //I 7 | }, 8 | link: { 9 | //L 10 | }, 11 | text: { 12 | //T 13 | }, 14 | }; 15 | ["dragstart", "dragover", "drop"].forEach(function(type) { 16 | gBrowser.mPanelContainer.addEventListener(type, self, false); 17 | }); 18 | window.addEventListener("unload", function() { 19 | ["dragstart", "dragover", "drop"].forEach(function(type) { 20 | gBrowser.mPanelContainer.removeEventListener(type, self, false); 21 | }); 22 | }, false); 23 | 24 | self.seemAsURL = function(url) { // 来自 Easy DragToGo+ 扩展,略作修正 25 | var DomainName = /(\w+(\-+\w+)*\.)+\w{2,7}/i; 26 | var HasSpace = /\S\s+\S/; 27 | var KnowNameOrSlash = /^(www|bbs|forum|blog)|\//i; 28 | var KnowTopDomain1 = /\.(com|net|org|gov|edu|info|mobi|mil|asia)$/i; 29 | var KnowTopDomain2 = /\.(de|uk|eu|nl|it|cn|be|us|br|jp|ch|fr|at|se|es|cz|pt|ca|ru|hk|tw|pl|me|tv|cc)$/i; 30 | var IsIpAddress = /^([1-2]?\d?\d\.){3}[1-2]?\d?\d/; 31 | var seemAsURL = !HasSpace.test(url) && DomainName.test(url) && (KnowNameOrSlash.test(url) || KnowTopDomain1.test(url) || KnowTopDomain2.test(url) || IsIpAddress.test(url)); 32 | return seemAsURL; 33 | }; 34 | return; 35 | } 36 | switch (event.type) { 37 | case "dragstart": 38 | { 39 | self.lastPoint = [event.screenX, event.screenY]; 40 | self.sourceNode = event.target; 41 | self.directionChain = ""; 42 | event.target.localName == "img" && event.dataTransfer.setData("application/x-moz-file-promise-url", event.target.src); 43 | if (event.dataTransfer.types.contains("application/x-moz-file-promise-url")) { 44 | self.type = "image"; 45 | } else if (event.dataTransfer.types.contains("text/x-moz-url")) { 46 | self.type = "link"; 47 | } else { 48 | self.type = "text"; 49 | } 50 | break; 51 | } 52 | case "dragover": 53 | { 54 | if (!self.lastPoint) return; 55 | Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService).getCurrentSession().canDrop = true; 56 | var [subX, subY] = [event.screenX - self.lastPoint[0], event.screenY - self.lastPoint[1]]; 57 | var [distX, distY] = [(subX > 0 ? subX : (-subX)), (subY > 0 ? subY : (-subY))]; 58 | var direction; 59 | if (distX < 10 && distY < 10) return; 60 | if (distX > distY) direction = subX < 0 ? "L" : "R"; 61 | else direction = subY < 0 ? "U" : "D"; 62 | if (direction != self.directionChain.charAt(self.directionChain.length - 1)) { 63 | self.directionChain += direction; 64 | XULBrowserWindow.statusTextField.label = self.GESTURES[self.type][self.directionChain] ? "\u624b\u52bf: " + self.directionChain + " " + self.GESTURES[self.type][self.directionChain].name : "\u672a\u77e5\u624b\u52bf:" + self.directionChain; 65 | self.cmd = self.GESTURES[self.type][self.directionChain] ? self.GESTURES[self.type][self.directionChain].cmd : ""; 66 | } 67 | self.lastPoint = [event.screenX, event.screenY]; 68 | break; 69 | } 70 | case "drop": 71 | { 72 | if (self.lastPoint && event.target.localName != "textarea" && (!(event.target.localName == "input" && (event.target.type == "text" || event.target.type == "password"))) && event.target.contentEditable != "true") { 73 | event.preventDefault(); 74 | event.stopPropagation(); 75 | self.lastPoint = XULBrowserWindow.statusTextField.label = ""; 76 | self.cmd && self.cmd(event, self); 77 | } 78 | } 79 | } 80 | })() -------------------------------------------------------------------------------- /uSuper_preloader/README.md: -------------------------------------------------------------------------------- 1 | uSuper_preloader.uc.js 2 | ====================== 3 | 4 | 基于 NLF 的 Super_preloader(版本 2.0.22)修改而来的 uc脚本。感谢作者 NFL,同时也感谢规则更新者。 [Super\_preloader.db 超级翻页规则 个人更新版](http://www.kafan.cn/forum.php?mod=viewthread&tid=1235297) 5 | 6 | ## 特性 7 | 8 | - 保持原有功能 9 | - 增加对 noscript 的支持 10 | - 精简了代码,去掉了其它浏览器的兼容等 11 | - 如果数据文件有修改会自动载入 12 | - 默认 Ctrl + 长按鼠标左键 暂停翻页,修改如下 13 | 14 | ## 使用说明 15 | 16 | - uSuper_preloader.uc.js 脚本文件,放在uc脚本管理器指定目录下 17 | - uSuper_preloader.db.js 设置、站点配置文件,放在下面的默认路径中,如果没有 local 文件夹新建一个 18 | 19 | - 默认路径为 Chrome 目录下的 `Local\uSuper_preloader.db.js`(可在代码里更改) 20 | - 删除了无用的数据,只保留了必须的 21 | - 增加了一些站点配置 22 | - 兼容原数据文件 23 | 24 | ## 鼠标手势调用 25 | 26 | 图标总开关 27 | 28 | uSuper_preloader.toggle(); 29 | 30 | 上一页 (原脚本的方式) 31 | 32 | (function() { 33 | var document = content.document; 34 | var event = document.createEvent('HTMLEvents'); 35 | event.initEvent('superPreloader.back', true, false); 36 | document.dispatchEvent(event); 37 | })(); 38 | 39 | 下一页(原脚本的方式) 40 | 41 | (function() { 42 | var document = content.document; 43 | var event = document.createEvent('HTMLEvents'); 44 | event.initEvent('superPreloader.go', true, false); 45 | document.dispatchEvent(event); 46 | })(); 47 | 48 | 49 | 上一页(新增的,如果不存在则调用 nextPage.uc.xul) 50 | 51 | var node = FireGestures.sourceNode; 52 | var doc = node.ownerDocument || getBrowser().contentDocument; 53 | var win = doc.defaultView; 54 | 55 | if(win.uSuper_preloader) 56 | return win.uSuper_preloader.back(); 57 | 58 | if(window.nextPage) 59 | nextPage.next(); 60 | 61 | 下一页(新增的,如果不存在则调用 nextPage.uc.xul) 62 | 63 | var node = FireGestures.sourceNode; 64 | var doc = node.ownerDocument || getBrowser().contentDocument; 65 | var win = doc.defaultView; 66 | 67 | if(win.uSuper_preloader) 68 | return win.uSuper_preloader.go(); 69 | 70 | if(window.nextPage) 71 | nextPage.next(true); 72 | 73 | 74 | 下滚一页(没有则调用 FireGestures 滚动到底部或 ScrollPageDown) 75 | 76 | var node = FireGestures.sourceNode; 77 | var doc = node.ownerDocument || getBrowser().contentDocument; 78 | var win = doc.defaultView; 79 | 80 | if(win.uSuper_preloader) 81 | return win.uSuper_preloader.goNext(win); 82 | 83 | FireGestures._performAction(event, "FireGestures:ScrollBottom"); 84 | 85 | 上滚一页(没有则调用 FireGestures 滚动到顶部或 ScrollPageUp) 86 | 87 | var node = FireGestures.sourceNode; 88 | var doc = node.ownerDocument || getBrowser().contentDocument; 89 | var win = doc.defaultView; 90 | 91 | if(win.uSuper_preloader) 92 | return win.uSuper_preloader.goPre(win); 93 | 94 | FireGestures._performAction(event, "FireGestures:ScrollTop"); 95 | 96 | 97 | 滚到页面顶部(仅仅比自带的多了个平滑滚动) 98 | 99 | if(content.window.uSuper_preloader) 100 | content.window.uSuper_preloader.goTop(); 101 | 102 | 滚到页面底部(仅仅比自带的多了个平滑滚动) 103 | 104 | if(content.window.uSuper_preloader) 105 | content.window.uSuper_preloader.goBottom(); 106 | 107 | 108 | ### 修改暂停翻页为鼠标左键双击 109 | 110 | uSuper_preloader.db.js 文件 111 | 112 | Pbutton:[0,0,0] ,//需要按住的键.....0: 不按住任何键;1: shift鍵;2: ctrl鍵; 3: alt鍵;(同时按3个键.就填 1 2 3)(一个都不按.就填 0 0 0) 113 | mouseA:false ,//按住鼠标左键..否则.双击; 114 | 115 | ### 修改按钮或菜单显示方式 116 | 117 | uSuper_preloader.uc.js 文件 118 | 119 | // 1 按钮, 2 菜单, 0 无 120 | // 按钮ID: uSuper_preloader-icon 121 | // 菜单ID: uSuper_preloader-menuitem, 可用 rebulid_userChrome 移动统一管理 122 | var append_type = 1; 123 | 124 | ### 关于自动更新 125 | 126 | - 如果自动更新则自己的设置没法保留。确实需要的话用 bat 命令下载更新。 127 | 128 | ### 乱码问题 129 | 130 | 修改 `profile\chrome\userChrome.js`,加上UTF-8参数 131 | 132 | try { 133 | if (script.charset) 134 | Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader) 135 | .loadSubScript(script.url + "?" + this.getLastModifiedTime(script.file), 136 | doc.defaultView, script.charset); 137 | else 138 | Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader) 139 | .loadSubScript(script.url + "?" + this.getLastModifiedTime(script.file), 140 | doc.defaultView, 'UTF-8'); 141 | }catch(ex) { 142 | this.error(script.filename, ex); 143 | } -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/options.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | 39 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 60 | 61 | 62 | 63 | 64 | 65 | 67 | 68 | 72 | 73 | 74 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /OpenLinkinNewTabwithRightClick.uc.js: -------------------------------------------------------------------------------- 1 | // 修改自 openlinkinnewtabwithleftdoubleclick 2 | 3 | (function() { 4 | var gTimer = null; 5 | 6 | function findLink(element) { 7 | // Super_start 8 | if (element.className == 'site-snapshot') { 9 | return element.parentNode; 10 | } 11 | 12 | switch (element.tagName) { 13 | case 'A': return element; 14 | 15 | case 'B': case 'I': case 'SPAN': case 'SMALL': 16 | case 'STRONG': case 'EM': case 'BIG': case 'SUB': 17 | case 'SUP': case 'IMG': case 'S': 18 | case 'FONT': 19 | var parent = element.parentNode; 20 | return parent && findLink(parent); 21 | 22 | default: 23 | return null; 24 | } 25 | } 26 | 27 | function click(element, view) { 28 | var e = document.createEvent('MouseEvents'); 29 | e.initMouseEvent('click', true, true, view, 0, 30 | 0, 0, 0, 0, false, false, false, false, 0, element); 31 | return !element.dispatchEvent(e); 32 | } 33 | 34 | function openTab(href) { 35 | if ('TreeStyleTabService' in window) 36 | TreeStyleTabService.readyToOpenChildTab(gBrowser.selectedTab, false); 37 | return gBrowser.addTab(href); 38 | } 39 | 40 | 41 | function findFrames(frame) { 42 | var frames = frame.frames; 43 | var fs = {}; 44 | 45 | for (var i = 0, len = frames.length; i < len; ++i) { 46 | var f = frames[i]; 47 | fs[f.name] = f; 48 | 49 | var children = findFrames(f); 50 | for (k in children) { 51 | var f = children[k]; 52 | fs[f.name] = f; 53 | } 54 | } 55 | 56 | return fs; 57 | } 58 | 59 | function followLink(args) { 60 | var link = args.link; 61 | var newTab = args.newTab; 62 | var window = args.window; 63 | var activate = args.activate; 64 | var href = link.href; 65 | var target = link.target; 66 | 67 | if (newTab) { 68 | var tab = openTab(href); 69 | if (activate) { 70 | gBrowser.selectedTab = tab; 71 | } 72 | } else if (!target || target == '_self') { 73 | window.location.href = href; 74 | } else { 75 | switch (target) { 76 | case '_top': 77 | window.top.location.href = href; 78 | break; 79 | 80 | case '_parent': 81 | window.parent.location.href = href; 82 | break; 83 | 84 | case '_blank': 85 | gBrowser.selectedTab = gBrowser.addTab(href); 86 | break; 87 | 88 | default: 89 | var frames = findFrames(window.top); 90 | var frame = frames[target]; 91 | 92 | if (frame) { 93 | frame.location.href = href; 94 | } else { 95 | gBrowser.selectedTab = gBrowser.addTab(href); 96 | } 97 | } 98 | } 99 | } 100 | 101 | gBrowser.mPanelContainer.addEventListener('click', function(e) { 102 | if (e.button == 2 && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) { 103 | var link = findLink(e.target); 104 | if (link) { 105 | var href = link.href; 106 | 107 | if (href && href.match(/^(https?|ftp):\/\//)) { 108 | e.preventDefault(); 109 | e.stopPropagation(); 110 | 111 | if (!gTimer) { 112 | gTimer = setTimeout(function() { 113 | try { 114 | // if (click(link, e.view)) { 115 | followLink({ link: link, window: e.view, newTab: true, activate: false }); 116 | // } 117 | clearTimeout(gTimer); 118 | } finally { 119 | gTimer = null; 120 | } 121 | }, 200); 122 | } 123 | } 124 | } 125 | } 126 | }, false); 127 | 128 | // 书签工具栏右键后台打开 129 | document.getElementById("PlacesToolbar").addEventListener('click', bookmarkClicked, false); 130 | // 书签按钮的书签右键后台打开 131 | document.getElementById("nav-bar").addEventListener('click', bookmarkClicked, false); 132 | //var BMB_bookmarksPopup = document.getElementById("BMB_bookmarksPopup"); 133 | //if (BMB_bookmarksPopup) { 134 | // BMB_bookmarksPopup.addEventListener('click', bookmarkClicked, false); 135 | //} 136 | 137 | function bookmarkClicked(e) { 138 | if (e.button == 2 && !e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey) { 139 | let target = e.originalTarget; 140 | let aNode = target._placesNode 141 | if (aNode && PlacesUtils.nodeIsBookmark(aNode)) { 142 | e.preventDefault(); 143 | e.stopPropagation(); 144 | 145 | PlacesUIUtils._openNodeIn(aNode, 'tabshifted', window); 146 | } 147 | } 148 | } 149 | 150 | })(); -------------------------------------------------------------------------------- /IME-Colors.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name IME-Colors.uc.js 3 | // @namespace http://d.hatena.ne.jp/Griever/ 4 | // @include main 5 | // @license MIT License 6 | // @version 0.0.9 7 | // @note 0.0.9 変換中に IME を OFF にすると色が変わらないのを修正 8 | // @note 0.0.7 CSS のリセットの処理を修正 9 | // @note 0.0.6 IME_DISABLE_STYLE を空にすれば IME が OFF の時は色を変えないようにできるようにした 10 | // @note 0.0.5 Firefox 5.0 で動くように微修正。 3.6 とかもう(゚⊿゚)シラネ 11 | // ==/UserScript== 12 | 13 | (function() { 14 | 15 | window.IMEColorsClass = function(elem){ 16 | this.init(elem); 17 | } 18 | 19 | IMEColorsClass.prototype = { 20 | 21 | IME_ENABLE_STYLE: { 22 | 'background-image': '-moz-linear-gradient(left, #fed, #ffe)', 23 | // 'background-color': '#fed', 24 | 'color': 'black', 25 | }, 26 | IME_DISABLE_STYLE: { // IME OFF の時に色を変えたくなければこの括弧を空にする 27 | 'background-image': '-moz-linear-gradient(left, #def, #eff)', 28 | // 'background-color': '#def', 29 | 'color': 'black', 30 | }, 31 | 32 | _timer: null, 33 | get timer() this._timer, 34 | set timer(t) { 35 | if (this._timer) clearTimeout(this._timer); 36 | return this._timer = t; 37 | }, 38 | utils: window 39 | .QueryInterface(Components.interfaces.nsIInterfaceRequestor) 40 | .getInterface(Components.interfaces.nsIDOMWindowUtils), 41 | init: function(elem) { 42 | var doc = elem.ownerDocument; 43 | this.win = doc.defaultView; 44 | this.inputField = elem; 45 | this.textbox = elem.hasAttribute('anonid')? 46 | doc.evaluate( 47 | 'ancestor::*[local-name()="textbox"]', 48 | elem, 49 | null, 50 | XPathResult.FIRST_ORDERED_NODE_TYPE, 51 | null 52 | ).singleNodeValue : 53 | null; 54 | 55 | this.elem = this.textbox || this.inputField; 56 | var s = this.elem.style; 57 | this.originalStyle = {}; 58 | this.backupPropertyNames.forEach(function(n){ 59 | this.originalStyle[n] = s.getPropertyValue(n); 60 | }, this); 61 | this.inputFieldStyle = this.win.getComputedStyle(this.inputField, null); 62 | if (this.textbox) { 63 | this.originalStyle['border-width'] = s.getPropertyValue('border-width'); 64 | this.originalStyle['-moz-appearance'] = s.getPropertyValue('-moz-appearance'); 65 | var borderWidth = this.win.getComputedStyle(this.textbox, null).borderTopWidth; 66 | s.setProperty('-moz-appearance', 'none', 'important'); 67 | s.setProperty('border-width', borderWidth, 'important'); 68 | } 69 | this.setColor(); 70 | if (doc !== document) 71 | this.win.addEventListener('pagehide', this, false); 72 | this.elem.addEventListener('blur', this, false); 73 | this.elem.addEventListener('keyup', this, false); 74 | this.elem.addEventListener('compositionend', this, false); 75 | }, 76 | setColor: function() { 77 | try{ 78 | var ime = this.inputFieldStyle.imeMode == 'disabled'? false : this.utils.IMEIsOpen; 79 | }catch(e) {} 80 | 81 | if (this.state == ime) return; 82 | 83 | var obj = ime? this.IME_ENABLE_STYLE : this.IME_DISABLE_STYLE; 84 | var obj2 = ime? this.IME_DISABLE_STYLE : this.IME_ENABLE_STYLE; 85 | var s = this.elem.style; 86 | Object.keys(obj2).forEach(function(n) obj[n] || s.removeProperty(n) ); 87 | Object.keys(obj).forEach(function(n) s.setProperty(n, obj[n], 'important') ); 88 | this.state = ime; 89 | }, 90 | resetColor: function() { 91 | var s = this.elem.style; 92 | Object.keys(this.originalStyle).forEach(function(n){ 93 | let val = this.originalStyle[n]; 94 | val ? s.setProperty(n, val) : s.removeProperty(n); 95 | }, this); 96 | }, 97 | handleEvent: function(event) { 98 | switch(event.type) { 99 | case 'keyup': 100 | var key = event.keyCode; 101 | if (key === 16 || key === 17 || key === 18) 102 | return; 103 | if (key > 240 || key < 33) { 104 | var self = this; 105 | this.timer = setTimeout(function(){ 106 | self.setColor(); 107 | }, 50); 108 | } 109 | break; 110 | case 'compositionend': 111 | this.setColor(); 112 | break; 113 | case 'blur': 114 | case 'pagehide': 115 | this.timer = null; 116 | this.win.removeEventListener('pagehide', this, false); 117 | this.elem.removeEventListener('blur', this, false); 118 | this.elem.removeEventListener('keyup', this, false); 119 | this.elem.removeEventListener('compositionend', this, false); 120 | this.resetColor(); 121 | break; 122 | } 123 | }, 124 | }; 125 | IMEColorsClass.prototype.backupPropertyNames = Object.keys(IMEColorsClass.prototype.IME_ENABLE_STYLE) 126 | .concat(Object.keys(IMEColorsClass.prototype.IME_DISABLE_STYLE)) 127 | .filter(function(e,i,a) a.indexOf(e) === i); 128 | 129 | 130 | function IMEColors({ originalTarget: elem }){ 131 | if ((elem instanceof HTMLTextAreaElement || 132 | elem instanceof HTMLInputElement &&( /^(?:text|search)$/.test(elem.type) || !elem.type)) && 133 | !elem.readOnly) { 134 | new IMEColorsClass(elem); 135 | } 136 | } 137 | 138 | document.documentElement.addEventListener('focus', IMEColors, true); 139 | window.addEventListener('unload', function() { 140 | document.documentElement.removeEventListener('focus', IMEColors, true); 141 | }, false); 142 | 143 | })() 144 | -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/script/tpl/easyDragTemplate.js: -------------------------------------------------------------------------------- 1 | location == "chrome://browser/content/browser.xul" && (function(event) { 2 | var self = arguments.callee; 3 | if (!event) { 4 | ["dragstart", "dragover", "drop"].forEach(function(type) { 5 | gBrowser.mPanelContainer.addEventListener(type, self, false); 6 | }); 7 | window.addEventListener("unload", function() { 8 | ["dragstart", "dragover", "drop"].forEach(function(type) { 9 | gBrowser.mPanelContainer.removeEventListener(type, self, false); 10 | }); 11 | }, false); 12 | 13 | self.seemAsURL = function(url) { // 来自 Easy DragToGo+ 扩展,略作修正 14 | var DomainName = /(\w+(\-+\w+)*\.)+\w{2,7}/i; 15 | var HasSpace = /\S\s+\S/; 16 | var KnowNameOrSlash = /^(www|bbs|forum|blog)|\//i; 17 | var KnowTopDomain1 = /\.(com|net|org|gov|edu|info|mobi|mil|asia)$/i; 18 | var KnowTopDomain2 = /\.(de|uk|eu|nl|it|cn|be|us|br|jp|ch|fr|at|se|es|cz|pt|ca|ru|hk|tw|pl|me|tv|cc)$/i; 19 | var IsIpAddress = /^([1-2]?\d?\d\.){3}[1-2]?\d?\d/; 20 | var seemAsURL = !HasSpace.test(url) && DomainName.test(url) && (KnowNameOrSlash.test(url) || KnowTopDomain1.test(url) || KnowTopDomain2.test(url) || IsIpAddress.test(url)); 21 | return seemAsURL; 22 | }; 23 | return; 24 | } 25 | switch (event.type) { 26 | case "dragstart": 27 | { 28 | self.startPoint = [event.screenX, event.screenY]; 29 | self.sourceNode = event.target; 30 | event.target.localName == "img" && event.dataTransfer.setData("application/x-moz-file-promise-url", event.target.src); 31 | break; 32 | } 33 | case "dragover": 34 | { 35 | self.startPoint && (Components.classes["@mozilla.org/widget/dragservice;1"].getService(Components.interfaces.nsIDragService).getCurrentSession().canDrop = true); 36 | break; 37 | } 38 | case "drop": 39 | { 40 | if (self.startPoint && event.target.localName != "textarea" && (!(event.target.localName == "input" && (event.target.type == "text" || event.target.type == "password"))) && event.target.contentEditable != "true") { 41 | event.preventDefault(); 42 | event.stopPropagation(); 43 | var [subX, subY] = [event.screenX - self.startPoint[0], event.screenY - self.startPoint[1]]; 44 | var [distX, distY] = [(subX > 0 ? subX : (-subX)), (subY > 0 ? subY : (-subY))]; 45 | var direction; 46 | if (distX > distY) direction = subX < 0 ? "L" : "R"; 47 | else direction = subY < 0 ? "U" : "D"; 48 | if (event.dataTransfer.types.contains("application/x-moz-file-promise-url")) { 49 | if (direction == "U") { 50 | //eiu 51 | return; 52 | } 53 | if (direction == "D") { 54 | //eid 55 | return; 56 | } 57 | if (direction == "L") { 58 | //eil 59 | return; 60 | } 61 | if (direction == "R") { 62 | //eir 63 | return; 64 | } 65 | 66 | //eie 67 | 68 | 69 | } else if (event.dataTransfer.types.contains("text/x-moz-url")) { 70 | if (direction == "U") { 71 | //elu 72 | return; 73 | } 74 | if (direction == "D") { 75 | //eld 76 | return; 77 | } 78 | if (direction == "L") { 79 | //ell 80 | return; 81 | } 82 | if (direction == "R") { 83 | //elr 84 | return; 85 | } 86 | 87 | //ele 88 | 89 | 90 | } else { 91 | if (direction == "U") { 92 | //etu 93 | return; 94 | } 95 | if (direction == "D") { 96 | //etd 97 | return; 98 | } 99 | if (direction == "L") { 100 | //etl 101 | return; 102 | } 103 | if (direction == "R") { 104 | //etr 105 | return; 106 | } 107 | 108 | //ete 109 | 110 | 111 | } 112 | self.startPoint = 0; 113 | } 114 | } 115 | } 116 | })() -------------------------------------------------------------------------------- /JSOff.uc.xul: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/script/utils.js: -------------------------------------------------------------------------------- 1 | 2 | Cu.import("resource://gre/modules/Services.jsm"); 3 | 4 | userChromejs.openChromeURL = function(name) { 5 | var url = 'chrome://userchromejs/content/' + name; 6 | gBrowser.selectedTab = gBrowser.addTab(url); 7 | }; 8 | 9 | userChromejs.openConfig = function(script) { 10 | // 包括 url、文件、函数 3 种情况 11 | var url = script.config || script.optionsURL; 12 | if (!url) return; 13 | 14 | if (url.match(/^(?:about|chrome):/i)) { 15 | toOpenWindowByType('pref:pref', url); 16 | } else { 17 | try { 18 | eval(url); 19 | } catch(e) { 20 | console.error('userChromejs.openConfig 错误', e, script); 21 | } 22 | } 23 | // else if (typeof url == 'string' || url instanceof Ci.nsILocalFile) { 24 | // url.launch(); 25 | // } 26 | }; 27 | 28 | userChromejs.editFile = function(aFile) { 29 | if (typeof aFile == 'string') { 30 | return; 31 | } 32 | if (!aFile || !aFile.exists() || !aFile.isFile()) return; 33 | 34 | var editor = gPrefService.getCharPref("view_source.editor.path"); 35 | 36 | // 用 Scratchpad 编辑 37 | if (!editor) { 38 | userChromejs.openScriptInScratchpad(window, aFile); 39 | return; 40 | } 41 | 42 | var appfile = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsILocalFile); 43 | appfile.initWithPath(editor); 44 | var process = Cc['@mozilla.org/process/util;1'].createInstance(Ci.nsIProcess); 45 | process.init(appfile); 46 | process.run(false, [aFile.path], 1, {}); 47 | }; 48 | 49 | userChromejs.utils = { 50 | unique: function (a){ 51 | var o = {}, 52 | r = [], 53 | t; 54 | for (var i = 0, l = a.length; i < l; i++) { 55 | t = a[i]; 56 | if(!o[t]){ 57 | o[t] = true; 58 | r.push(t); 59 | } 60 | } 61 | return r; 62 | }, 63 | saveFile: function(file, data) { 64 | var suConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter); 65 | suConverter.charset = 'UTF-8'; 66 | data = suConverter.ConvertFromUnicode(data); 67 | 68 | var foStream = Cc['@mozilla.org/network/file-output-stream;1'].createInstance(Ci.nsIFileOutputStream); 69 | foStream.init(file, 0x02 | 0x08 | 0x20, 0664, 0); 70 | foStream.write(data, data.length); 71 | foStream.close(); 72 | }, 73 | loadText: function (aFile) { 74 | var fstream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream); 75 | var sstream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(Ci.nsIScriptableInputStream); 76 | fstream.init(aFile, -1, 0, 0); 77 | sstream.init(fstream); 78 | 79 | var data = sstream.read(sstream.available()); 80 | try { data = decodeURIComponent(escape(data)); } catch(e) {} 81 | sstream.close(); 82 | fstream.close(); 83 | return data; 84 | }, 85 | popupNotification: function(details){ 86 | var win = userChromejs.utils.getMostRecentWindow(); 87 | if (win && win.PopupNotifications) { 88 | win.PopupNotifications.show( 89 | win.gBrowser.selectedBrowser, 90 | details.id, 91 | details.message, 92 | "", 93 | details.mainAction, 94 | details.secondActions, 95 | details.options); 96 | return true; 97 | } 98 | 99 | return false; 100 | }, 101 | getFocusedWindow: function() { 102 | var win = document.commandDispatcher.focusedWindow; 103 | return (!win || win == window) ? content : win; 104 | }, 105 | getMostRecentWindow: function(){ 106 | return Services.wm.getMostRecentWindow("navigator:browser") 107 | }, 108 | }; 109 | 110 | 111 | // Class 112 | userChromejs.Prefs = function (str) { 113 | this.pref = Services.prefs.getBranch(str || ''); 114 | }; 115 | userChromejs.Prefs.prototype = { 116 | get: function(name, defaultValue){ 117 | var value = defaultValue; 118 | try { 119 | switch(this.pref.getPrefType(name)) { 120 | case Ci.nsIPrefBranch.PREF_STRING: value = this.pref.getComplexValue(name, Ci.nsISupportsString).data; break; 121 | case Ci.nsIPrefBranch.PREF_INT : value = this.pref.getIntPref(name); break; 122 | case Ci.nsIPrefBranch.PREF_BOOL : value = this.pref.getBoolPref(name); break; 123 | } 124 | } catch(e) { } 125 | return value; 126 | }, 127 | set: function(name, value) { 128 | try { 129 | switch(typeof value) { 130 | case 'string' : 131 | var str = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString); 132 | str.data = value; 133 | this.pref.setComplexValue(name, Ci.nsISupportsString, str); 134 | break; 135 | case 'number' : this.pref.setIntPref(name, value); break; 136 | case 'boolean': this.pref.setBoolPref(name, value); break; 137 | } 138 | } catch(e) { } 139 | }, 140 | delete: function(name) { 141 | try { 142 | this.pref.deleteBranch(name); 143 | } catch(e) { } 144 | }, 145 | list: function(name) this.pref.getChildList(name, {}), 146 | has: function(name){ 147 | return this.pref.getPrefType(name) !== 0; 148 | } 149 | }; -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/content/style/index.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'iconfont'; 3 | src: url('iconfont.eot'); 4 | /* IE9*/ 5 | src: url('iconfont.eot?#iefix') format('embedded-opentype'), 6 | /* IE6-IE8 */ 7 | url('iconfont.woff') format('woff'), 8 | /* chrome、firefox */ 9 | url('iconfont.ttf') format('truetype'), 10 | /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ 11 | url('iconfont.svg#uxiconfont') format('svg'); 12 | /* iOS 4.1- */ 13 | } 14 | .iconfont { 15 | font-family: "iconfont" !important; 16 | font-size: 16px; 17 | font-style: normal; 18 | -webkit-font-smoothing: antialiased; 19 | -webkit-text-stroke-width: 0.2px; 20 | -moz-osx-font-smoothing: grayscale; 21 | color: black; 22 | } 23 | a { 24 | text-decoration: none; 25 | } 26 | a:hover { 27 | position:relative; 28 | top:-1px; 29 | left:-1px; 30 | text-shadow:1px 1px 1px #ddd!important; 31 | } 32 | .head a { 33 | color: #1B2B2B; 34 | } 35 | 36 | .icon16 { 37 | width: 1.3em; 38 | height: 1.3em; 39 | } 40 | .clickable { 41 | cursor: pointer; 42 | } 43 | .clickable:hover { 44 | position: relative; 45 | top: -1px; 46 | left: -1px; 47 | text-shadow: 1px 1px 1px #ddd; 48 | } 49 | 50 | .head_container { 51 | display: block; 52 | position: relative; 53 | padding: 12px 0 0 15px; 54 | height: 60px; 55 | min-width: 670px; 56 | } 57 | .margin4 { 58 | margin: 4px; 59 | } 60 | .float { 61 | float: left; 62 | } 63 | .banner { 64 | width: 4em; 65 | height: 4em; 66 | margin: -10px 10px 10px 14px; 67 | } 68 | .head { 69 | margin-top: 0; 70 | text-align: center; 71 | vertical-align: middle; 72 | font-size: 1.7em; 73 | color: black; 74 | } 75 | .version { 76 | position: relative; 77 | left: 77px; 78 | text-align: center; 79 | vertical-align: middle; 80 | font-size: .5em; 81 | } 82 | 83 | .tv_tabs_fill { 84 | margin-bottom: 20px; 85 | width: 100%; 86 | height: 2.6em; 87 | position: relative; 88 | border-bottom: 1px solid black; 89 | } 90 | .tv_tabs { 91 | position: absolute; 92 | bottom: -1px; 93 | right: 0; 94 | padding: 0 20px 0 20px; 95 | } 96 | .tv_tab { 97 | position: relative; 98 | color: white; 99 | cursor: pointer; 100 | text-align: center; 101 | padding: 4px 12px 7px 12px; 102 | float: left; 103 | margin-top: 2px; 104 | margin-right: 4px; 105 | background: linear-gradient(to bottom, #5a5a5a 0, #383838 100%); 106 | border-left: 1px #555 solid; 107 | border-top: 1px #606060 solid; 108 | border-right: 1px #666 solid; 109 | text-shadow: 1px 1px 3px #424242; 110 | } 111 | .tv_selected { 112 | color: black!important; 113 | background-color: #fdfffc!important; 114 | background-image: url()!important; 115 | text-shadow: 1px 1px 3px #ccc!important; 116 | } 117 | .tv_tab:hover { 118 | position:relative; 119 | top:-1px; 120 | left:-1px; 121 | box-shadow:1px 1px 3px #888; 122 | } 123 | .tv_selected:hover { 124 | top:0; 125 | left:0; 126 | box-shadow:none; 127 | } 128 | 129 | 130 | /* 脚本管理主页面 */ 131 | .tv_container { 132 | margin-top: 20px; 133 | } 134 | #toolbararea { 135 | padding-bottom: 10px; 136 | } 137 | #search { 138 | width: 200px; 139 | margin-right: 50px; 140 | } 141 | 142 | /* 表格 */ 143 | .scripttable { 144 | display: table; 145 | width: 100%; 146 | border-collapse: collapse; 147 | } 148 | .scripttable td, .scripttable th { 149 | display: table-cell; 150 | margin: 5px; 151 | padding: 4px 5px 4px 5px; 152 | text-align: center; 153 | 154 | overflow:hidden; 155 | white-space: nowrap; 156 | text-overflow: ellipsis; 157 | } 158 | .scripttr { 159 | display: table-row; 160 | border-width: 1px 0 1px 0; 161 | border-style: solid; 162 | border-color: #66a32f; 163 | vertical-align: middle; 164 | } 165 | .scripttr:hover { 166 | background-color: #eeef98; 167 | } 168 | 169 | /* 被卸载的脚本 */ 170 | .script_deleted { 171 | text-decoration: line-through; 172 | } 173 | 174 | .script_sel { 175 | min-width: 36px; 176 | } 177 | .enabler { 178 | display: inline-block; 179 | font-size: 1em; 180 | padding: .15em; 181 | border-radius: 1.1em; 182 | border: 1px black solid; 183 | vertical-align: middle; 184 | text-align: center; 185 | height: 1.35em; 186 | line-height: 1.35em; 187 | min-width: 1.35em; 188 | } 189 | .enabler_disabled { 190 | background: linear-gradient(to bottom, #e11 0, #811 100%); 191 | color: white; 192 | } 193 | .enabler_enabled { 194 | background: linear-gradient(to bottom, #1e1 0, #181 100%); 195 | color: black; 196 | } 197 | 198 | 199 | .script_name { 200 | padding-left: .5em; 201 | text-align: left !important; 202 | max-width: 280px; 203 | } 204 | .script_version { 205 | width: 5%; 206 | } 207 | .script_author { 208 | width: 15%; 209 | } 210 | .script_desciption { 211 | text-align: left !important; 212 | max-width: 500px; 213 | } 214 | 215 | .script_urls { 216 | padding-left: 12px; 217 | padding-right: 12px; 218 | } 219 | .restartless { 220 | color: blue; 221 | } 222 | 223 | /* 实用工具 */ 224 | .section { 225 | width: 100%:display:table-row; 226 | border-bottom: 1px #66a32f solid; 227 | } 228 | .section_head { 229 | vertical-align: top; 230 | font-weight: bold; 231 | font-size: 1.2em; 232 | width: 130px; 233 | padding: 20px 20px 20px 20px; 234 | display: table-cell; 235 | } 236 | .section_content { 237 | display: table-cell; 238 | padding: 20px 0; 239 | } 240 | 241 | /* 在线网址 */ 242 | .site-table { 243 | font-size: 1.2em; 244 | } 245 | .site-table th { 246 | width: 5.4em; 247 | vertical-align: top; 248 | text-align: left; 249 | } 250 | .site-table td { 251 | float: left; 252 | height: 2.2em; 253 | min-width: 16em; 254 | text-align: left; 255 | list-style: outside none none; 256 | } 257 | .site-icon { 258 | width: 20px; 259 | height: 20px; 260 | } -------------------------------------------------------------------------------- /userChromeJS_Mix.xpi/src/components/userChrome_js.js: -------------------------------------------------------------------------------- 1 | /* ***** BEGIN LICENSE BLOCK ***** 2 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1 3 | * 4 | * The contents of this file are subject to the Mozilla Public License Version 5 | * 1.1 (the "License"); you may not use this file except in compliance with 6 | * the License. You may obtain a copy of the License at 7 | * http://www.mozilla.org/MPL/ 8 | * 9 | * Software distributed under the License is distributed on an "AS IS" basis, 10 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 11 | * for the specific language governing rights and limitations under the 12 | * License. 13 | * 14 | * The Original Code is the userChrome.js component. 15 | * 16 | * The Initial Developer of the Original Code is 17 | * Simon Bünzli 18 | * 19 | * Portions created by the Initial Developer are Copyright (C) 2007 20 | * the Initial Developer. All Rights Reserved. 21 | * 22 | * Contributor(s): 23 | * alta88 24 | * 25 | * Alternatively, the contents of this file may be used under the terms of 26 | * either the GNU General Public License Version 2 or later (the "GPL"), or 27 | * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 28 | * in which case the provisions of the GPL or the LGPL are applicable instead 29 | * of those above. If you wish to allow use of your version of this file only 30 | * under the terms of either the GPL or the LGPL, and not to allow others to 31 | * use your version of this file under the terms of the MPL, indicate your 32 | * decision by deleting the provisions above and replace them with the notice 33 | * and other provisions required by the GPL or the LGPL. If you do not delete 34 | * the provisions above, a recipient may use your version of this file under 35 | * the terms of any one of the MPL, the GPL or the LGPL. 36 | * 37 | * ***** END LICENSE BLOCK ***** */ 38 | 39 | Components.utils.import("resource://gre/modules/Services.jsm"); 40 | Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); 41 | 42 | function UserChrome_js() {}; 43 | 44 | UserChrome_js.prototype = { 45 | // Properties required for XPCOM registration: 46 | classDescription: "userChromeJS Loading Component", 47 | classID : Components.ID("{8DEB3B5E-7585-4029-B6D0-4733CE8DED50}"), 48 | contractID : "@userChromeJS;1", 49 | 50 | _xpcom_categories: [{ 51 | category: "app-startup", 52 | service: true 53 | }], 54 | 55 | /* ........ QueryInterface .................................................. */ 56 | 57 | QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsISupports, 58 | Components.interfaces.nsIObserver, 59 | Components.interfaces.nsIModule, 60 | Components.interfaces.nsIFactory, 61 | Components.interfaces.nsIDOMEventListener]), 62 | 63 | /* ........ nsIObserver ..................................................... */ 64 | 65 | observe: function(aSubject, aTopic, aData) { 66 | switch (aTopic) { 67 | case "app-startup": 68 | case "profile-after-change": 69 | Services.obs.addObserver(this, "final-ui-startup", false); 70 | break; 71 | case "final-ui-startup": 72 | var file = Services.dirsvc.get("UChrm", Components.interfaces.nsIFile); 73 | file.append("userChrome.js"); 74 | 75 | // if (!file.exists()) { 76 | // var componentFile = __LOCATION__; 77 | // var componentsDir = componentFile.parent; 78 | // var extensionDir = componentsDir.parent; 79 | // extensionDir.append("README.txt"); 80 | // if (extensionDir.exists()) 81 | // extensionDir.copyTo(file.parent, "userChrome.js"); 82 | // } 83 | 84 | if (file.exists()) { 85 | file.renameTo(file.parent, 'userChrome-1.js'); 86 | } 87 | 88 | // if (file.exists() && file.isFile() && !Services.appinfo.inSafeMode) { 89 | // this.mFileURL = Services.io.getProtocolHandler("file") 90 | // .QueryInterface(Components.interfaces.nsIFileProtocolHandler) 91 | // .getURLSpecFromFile(file); 92 | 93 | Services.obs.addObserver(this, "domwindowopened", false); 94 | // } 95 | break; 96 | case "domwindowopened": 97 | aSubject.addEventListener("load", this, true); 98 | break; 99 | } 100 | }, 101 | 102 | /* ........ nsIDOMEventListener ............................................. */ 103 | 104 | handleEvent: function(aEvent) { 105 | var document = aEvent.originalTarget; 106 | if (document.location && 107 | (document.location.protocol == "chrome:" || document.location.protocol == "about:")) { 108 | try { 109 | Services.scriptloader.loadSubScript("chrome://userChromeJS/content/userChromeJS.js", 110 | document.defaultView, 111 | "UTF-8"); 112 | 113 | // Services.scriptloader.loadSubScript(this.mFileURL, 114 | // document.defaultView, 115 | // "UTF-8"); 116 | 117 | Services.scriptloader.loadSubScript("chrome://userChromeJS/content/userChrome.js", 118 | document.defaultView, 119 | "UTF-8"); 120 | } 121 | catch (ex) { 122 | // script execution can be stopped with |throw "stop";| 123 | if (ex !== "stop") { 124 | Components.utils.reportError(ex); 125 | } 126 | } 127 | } 128 | } 129 | 130 | }; 131 | 132 | /** 133 | * The following line is what XPCOM uses to create components. Each component 134 | * prototype must have a .classID which is used to create it. 135 | * 136 | * XPCOMUtils.generateNSGetFactory was introduced in Mozilla 2 (Firefox 4). 137 | */ 138 | var NSGetFactory = XPCOMUtils.generateNSGetFactory([UserChrome_js]); 139 | -------------------------------------------------------------------------------- /sendToGmail.uc.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name sendToGmail.uc.js 3 | // @namespace ithinc#mozine.cn 4 | // @description Send the selection to Gmail 5 | // @include main 6 | // @compatibility Firefox 3.x 7 | // @author ithinc 8 | // @version LastMod 2014/8/17 01:30 Fix gmailSendURL Error 9 | // @version LastMod 2009/3/15 20:30 Improvment on sending images 10 | // @version LastMod 2009/3/14 20:30 Add support for all Gmail display languages 11 | // @version LastMod 2009/3/13 21:30 Initial release 12 | // @Note null 13 | // ==/UserScript== 14 | 15 | /* :::: Send the selection to Gmail :::: */ 16 | 17 | function SendToGmail(from, to, cc, bcc, subject, body) { 18 | var gmailComposeURL = 'https://mail.google.com/mail/?ui=html&v=b&pv=tl&cs=b'; 19 | var req = new XMLHttpRequest(); 20 | req.open('GET', gmailComposeURL, true); 21 | req.onreadystatechange = function() { 22 | if (req.readyState == 4) { 23 | if (req.status == 200 && req.responseText.match(/"]+"[\s]+name=(f|"f")[^>]*>/i)) { 24 | if (!to && /([\w.]+)@gmail.com/.test(req.responseText)) to = RegExp.$1 + "+note@gmail.com"; 25 | 26 | var gmailSendURL = req.responseText.match(/]*>/i).toString().split(/"/)[1] + req.responseText.match(/"]+"[\s]+name=(f|"f")[^>]*>/i).toString().split(/"/)[1]; 27 | var gmailSendParams = 'redir=?&nvp_bu_send=Send'; 28 | //gmailSendParams += '&from=' + encodeURIComponent(from); 29 | gmailSendParams += '&to=' + encodeURIComponent(to); 30 | gmailSendParams += '&cc=' + encodeURIComponent(cc); 31 | gmailSendParams += '&bcc=' + encodeURIComponent(bcc); 32 | gmailSendParams += '&subject=' + encodeURIComponent(subject); 33 | gmailSendParams += '&body=' + encodeURIComponent(body); 34 | 35 | // Fix gmailSendURL Error 36 | gmailSendURL = gmailSendURL.replace(/&/g, '&'); 37 | 38 | var req2 = new XMLHttpRequest(); 39 | req2.open('POST', gmailSendURL, true); 40 | req2.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 41 | req2.onreadystatechange = function() { 42 | if (req2.readyState == 4) { 43 | if (req2.status == 200) { 44 | // document.getElementById("statusbar-display").label = req2.responseText.match(/]+>[^<>]*[^<>]*<\/b>/i).toString().split(/<|>/i)[4]; 45 | var alertsService=Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService); 46 | alertsService.showAlertNotification("chrome://global/skin/icons/information-32.png","SentToGmail",req2.responseText.match(/]+>[^<>]*[^<>]*<\/b>/i).toString().split(/<|>/i)[4],false,"",null,""); 47 | } 48 | else { 49 | alert("Message sent unsuccessfully!"); 50 | } 51 | } 52 | } 53 | req2.send(gmailSendParams); 54 | } 55 | else { 56 | alert("You've not sign into your Gmail!"); 57 | } 58 | } 59 | } 60 | req.send(null); 61 | } 62 | 63 | (function() { 64 | var mainContextMenu = document.getElementById("contentAreaContextMenu"); 65 | 66 | var menuitem = mainContextMenu.insertBefore(document.createElement("menuitem"), document.getElementById("context-bookmarkpage").nextSibling); 67 | menuitem.setAttribute("id", "context-sendpagetogmail"); 68 | menuitem.setAttribute("label", "Send Link to Gmail"); 69 | menuitem.setAttribute("accesskey", "G"); 70 | menuitem.setAttribute("oncommand", "SendToGmail('', '', '', '', gBrowser.selectedTab.label, gBrowser.currentURI.spec);"); 71 | 72 | var menuitem = mainContextMenu.insertBefore(document.createElement("menuitem"), document.getElementById("context-bookmarklink").nextSibling); 73 | menuitem.setAttribute("id", "context-sendlinktogmail"); 74 | menuitem.setAttribute("label", "Send Link to Gmail"); 75 | menuitem.setAttribute("accesskey", "G"); 76 | menuitem.setAttribute("oncommand", "SendToGmail('', '', '', '', gContextMenu.linkText(), gContextMenu.linkURL);"); 77 | 78 | var menuitem = mainContextMenu.insertBefore(document.createElement("menuitem"), document.getElementById("context-sendimage").nextSibling); 79 | menuitem.setAttribute("id", "context-sendimagetogmail"); 80 | menuitem.setAttribute("label", "Send Image to Gmail"); 81 | menuitem.setAttribute("accesskey", "G"); 82 | menuitem.setAttribute("oncommand", "SendToGmail('', '', '', '', gContextMenu.target.getAttribute('title') || gContextMenu.target.getAttribute('alt') || gContextMenu.target.currentURI.spec, gBrowser.currentURI.spec + '\\n\\n' + gContextMenu.target.currentURI.spec);"); 83 | 84 | var menuitem = mainContextMenu.insertBefore(document.createElement("menuitem"), document.getElementById("context-selectall")); 85 | menuitem.setAttribute("id", "context-sendselecttogmail"); 86 | menuitem.setAttribute("label", "Send ... to Gmail"); 87 | menuitem.setAttribute("accesskey", "G"); 88 | menuitem.setAttribute("oncommand", "SendToGmail('', '', '', '', gBrowser.selectedTab.label, gBrowser.currentURI.spec + '\\n\\n' + document.commandDispatcher.focusedWindow.getSelection());"); 89 | 90 | mainContextMenu.addEventListener("popupshowing", function(e) { 91 | document.getElementById("context-sendpagetogmail").setAttribute("hidden", "true"); 92 | document.getElementById("context-sendlinktogmail").setAttribute("hidden", "true"); 93 | document.getElementById("context-sendimagetogmail").setAttribute("hidden", "true"); 94 | document.getElementById("context-sendselecttogmail").setAttribute("hidden", "true"); 95 | 96 | if (gContextMenu.onLink) { 97 | document.getElementById("context-sendlinktogmail").removeAttribute("hidden"); 98 | } 99 | 100 | if (gContextMenu.onImage) { 101 | document.getElementById("context-sendimagetogmail").removeAttribute("hidden"); 102 | } 103 | 104 | if (gContextMenu.isTextSelected) { 105 | var selection = getBrowserSelection(16); 106 | if (selection && selection.length > 15) 107 | selection = selection.substr(0,15) + "..."; 108 | 109 | document.getElementById("context-sendselecttogmail").setAttribute("label", 'Send "' + selection + '" to Gmail'); 110 | document.getElementById("context-sendselecttogmail").removeAttribute("hidden"); 111 | } 112 | 113 | if (!gContextMenu.onLink && !gContextMenu.onImage && !gContextMenu.isContentSelected && !gContextMenu.onTextInput) { 114 | document.getElementById("context-sendpagetogmail").removeAttribute("hidden"); 115 | } 116 | }, false); 117 | })(); 118 | -------------------------------------------------------------------------------- /uAutoPagerize2/README.md: -------------------------------------------------------------------------------- 1 | uAutoPagerize2.uc.js 2 | ==================== 3 | 4 | uAutoPagerize 中文规则简化改进版,原作者链接:[Griever/userChromeJS](https://github.com/Griever/userChromeJS/tree/master/uAutoPagerize)。跟 [uAutoPagerize](../uAutoPagerize) 比 5 | 6 | - 基于日文原版重新改写。 7 | - 兼容 Super_preloader 规则。 8 | - **中文规则数据库**为:[Super_preloaderPlus_one for Greasemonkey](https://greasyfork.org/scripts/293-super-preloaderplus-one),这是我用于其它浏览器的翻页脚本 + 数据库。 9 | - **按钮默认位置**为地址栏,修改代码 `isUrlbar: 0` 则为可移动按钮。 10 | - 文件 `_uAutoPagerize.js` 是自己的配置文件。但里面的 EXCLUDE(黑名单)已经不可用,改在右键菜单里设置中,存储在 about:config 中。 11 | - 文件 `uSuper_preloader.db.js` 是中文规则数据库文件,每次更新后被覆盖。 12 | - 新增 `载入配置出错提示`,点击可直接定位到第几行,需要首先设置参数,详见 [编辑器及参数说明](https://github.com/ywzhaiqi/userChromeJS#%E7%BC%96%E8%BE%91%E5%99%A8%E5%8F%8A%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E)。 13 | - 新增 `添加下一页到历史记录`。 14 | - 新增 `鼠标双击或按键暂停翻页`,在配置文件中。 15 | - 无多功能的分隔条,无强制翻页。 16 | - **百度贴吧早已经不再支持,请改用 [Tieba Preload - Greasy Fork](https://greasyfork.org/scripts/282-tieba-preload) 脚本。** 17 | 18 | 19 | ### 右键菜单 20 | 21 | ![右键菜单](右键菜单.png) 22 | 23 | ### 分隔条 24 | 25 | ![分隔条](分隔条.png) 26 | 27 | ### 首选项 28 | 29 | ![首选项](首选项.png) 30 | 31 | 使用技巧和说明 32 | -------------- 33 | 34 | - 默认为附加组件栏,可通过 `isUrlbar` 更改,0 为附加组件栏,1 为地址栏 35 | - 文件 *_uAutoPagerize.js* 为自定义配置文件,自定义规则放在这里。 36 | - 文件 *uSuper_preloader.db.js* 为中文规则数据库文件,会被下载替换。 37 | - 鼠标中键点击图标会同时载入配置文件和中文规则数据库文件。 38 | - 如果配置文件修改了,刷新页面会重新载入。 39 | 40 | ### 其它说明 41 | 42 | - 百度如果无法翻页,请清除 cookie 43 | - 贴吧下一页有问题,可改用脚本 [Tieba Preload for Greasemonkey](http://userscripts.org/scripts/show/423917) 44 | - [uAutoPagerizeUI](uAutoPagerizeUI):图形管理规则,待完善。 45 | 46 | ### uc 脚本与 GM 脚本的问题 47 | 48 | - GM 脚本不支持一些特殊的如 Google 搜索(详细如下)和水木社区页面,而 uc 脚本无此问题。 49 | 50 | ### Google 搜索的问题 51 | 52 | [Super_preloaderPlus_one](http://userscripts.org/scripts/show/178900) 脚本不支持从 Google 主页搜索的翻页,只能用这样的搜索 53 | 54 | https://www.google.com/search?q=firefox 55 | 56 | 这几类都不支持 57 | 58 | https://www.google.com/#newwindow=1&q=firefox 59 | https://www.google.com/webhp?hl=en&tab=ww&ei=dhFeUuHaBo2aiAeNm4CgCw&ved=0CBgQ1S4#hl=en&newwindow=1&q=firefox 60 | 61 | ### 原 json 数据库 62 | 63 | uAutoPagerize2 默认禁用原 json 数据库(国外网站为主),如需启用,修改代码 64 | 65 | var SITEINFO_IMPORT_URLS = [ 66 | // 'http://wedata.net/databases/AutoPagerize/items.json' 67 | ]; 68 | 为 69 | 70 | var SITEINFO_IMPORT_URLS = [ 71 | 'http://wedata.net/databases/AutoPagerize/items.json' 72 | ]; 73 | 74 | ### ipages 参数的使用 75 | 76 | 示例:打开百度后立即加载3页。 77 | 78 | { 79 | // 通过更改 pageElement 解决清爽百度的问题 80 | name: '百度搜索', 81 | url: "^https?://www\\.baidu\\.com/(?:s|baidu)\\?", 82 | nextLink: '//p[@id="page"]/a[contains(text(),"下一页")][@href]', 83 | pageElement: 'css;div#content_left', 84 | stylish: '.autopagerize_page_info { margin-bottom: 10px; }', 85 | ipages: [true, 3] 86 | }, 87 | 88 | 89 | SITEINFO_Writer.uc.js 90 | -------------------- 91 | 92 | 规则辅助工具,原作者链接:[SITEINFOを書く.uc.js](https://gist.github.com/Griever/1044551)。 93 | 94 | - 略加改进的选取 xpath 生成 95 | - xpath 正确与否的颜色提示 96 | - 简易自动补全 97 | - 右键查看元素、查看元素(Firebug) 98 | - 其它看图 99 | 100 | ![SITEINFO_Writer效果图](SITEINFO_Writer.jpg) 101 | 102 | 103 | 手势调用(FireGestures) 104 | ----------------------- 105 | 106 | 启用禁用 107 | 108 | ```js 109 | uAutoPagerize.toggle() 110 | ``` 111 | 112 | 启用禁用(仅当前页面) 113 | 114 | ```js 115 | if (content.ap) content.ap.stateToggle(); 116 | ``` 117 | 118 | 立即加载3页 119 | 120 | ```js 121 | var node = FireGestures.sourceNode; 122 | var doc = node.ownerDocument || getBrowser().contentDocument; 123 | var win = doc.defaultView; 124 | 125 | if(win.ap) 126 | win.ap.loadImmediately(3); 127 | ``` 128 | 129 | 增强型后退,没前进翻到上一页 130 | 131 | ```js 132 | var doc = FireGestures.sourceNode.ownerDocument; 133 | var win = doc.defaultView; 134 | 135 | // 删除下面这部分(到空行为止) 则为普通的上一页 136 | var nav = gBrowser.webNavigation; 137 | if (nav.canGoBack) { 138 | nav.goBack(); 139 | return; 140 | } 141 | 142 | if (win.uSuper_preloader) { 143 | win.uSuper_preloader.back(); 144 | } else if (window.nextPage) { // nextPage.uc.js 145 | window.nextPage.next(); 146 | } else { 147 | SuperPreloaderPrevPage(); 148 | } 149 | 150 | // SuperPreloader 脚本的上一页 151 | function SuperPreloaderPrevPage(){ 152 | var event = doc.createEvent('HTMLEvents'); 153 | event.initEvent('superPreloader.back', true, false); 154 | doc.dispatchEvent(event); 155 | } 156 | ``` 157 | 158 | 增强型前进,没前进翻到下一页 159 | 160 | ```js 161 | var doc = FireGestures.sourceNode.ownerDocument; 162 | var win = doc.defaultView; 163 | 164 | // 删除下面这部分(到空行为止) 则为普通的下一页 165 | var nav = gBrowser.webNavigation; 166 | if (nav.canGoForward) { 167 | nav.goForward(); 168 | return; 169 | } 170 | 171 | if (win.ap && win.ap.requestURL) { 172 | win.location = win.ap.requestURL; 173 | } else if (win.uSuper_preloader) { 174 | win.uSuper_preloader.go(); 175 | } else if (window.nextPage) { // nextPage.uc.xul 176 | nextPage.next(true); 177 | } else { 178 | SuperPreloaderNextPage(); 179 | } 180 | 181 | // SuperPreloader 脚本的下一页 182 | function SuperPreloaderNextPage(){ 183 | var event = doc.createEvent('HTMLEvents'); 184 | event.initEvent('superPreloader.go', true, false); 185 | doc.dispatchEvent(event); 186 | } 187 | ``` 188 | 189 | 向上滚一页(5合1) 190 | 191 | 依次查找:uAutoPagerize、uSuper_preloader.uc.js、小说阅读脚本、Super_preloader 脚本、FireGestures滚到底部。 192 | 193 | ```js 194 | var srcNode = FireGestures.sourceNode; 195 | var doc = srcNode.ownerDocument || getBrowser().contentDocument; 196 | var win = doc.defaultView; 197 | 198 | if (win.ap) { 199 | uAutoPagerize.gotoprev(win); 200 | } else if (win.uSuper_preloader) { 201 | win.uSuper_preloader.goPre(); 202 | } else if (uAutoPagerize && doc.body && doc.body.getAttribute("name") == "MyNovelReader") { // 小说阅读脚本 203 | uAutoPagerize.gotoprev(win, ".title"); 204 | } else if (doc.getElementById("sp-fw-container")) { // Super_preloader 脚本版 205 | uAutoPagerize.gotoprev(win, ".sp-separator"); 206 | } else { 207 | FireGestures._performAction(event, "FireGestures:ScrollTop"); 208 | } 209 | ``` 210 | 211 | 向下滚一页(5合1) 212 | 213 | 同上 214 | 215 | ```js 216 | var srcNode = FireGestures.sourceNode; 217 | var doc = srcNode.ownerDocument || getBrowser().contentDocument; 218 | var win = doc.defaultView; 219 | 220 | if (win.ap) { 221 | uAutoPagerize.gotonext(win); 222 | } else if (win.uSuper_preloader) { 223 | win.uSuper_preloader.goNext(); 224 | } else if (uAutoPagerize && doc.body && doc.body.getAttribute("name") == "MyNovelReader") { // 小说阅读脚本 225 | uAutoPagerize.gotonext(win, ".title"); 226 | } else if (doc.getElementById("sp-fw-container")){ // Super_preloader 脚本版 227 | uAutoPagerize.gotonext(win, ".sp-separator"); 228 | } else { 229 | FireGestures._performAction(event, "FireGestures:ScrollBottom"); 230 | } 231 | ``` -------------------------------------------------------------------------------- /.test/PanelSubMenu.uc.js: -------------------------------------------------------------------------------- 1 | 2 | (function(){ 3 | 4 | var toolbarbuttons = [ 5 | { 6 | label: '测试菜单1', 7 | oncommand: '', 8 | } 9 | ]; 10 | 11 | // 来自 User Agent Overrider 扩展 12 | const ToolbarManager = (function() { 13 | 14 | /** 15 | * Remember the button position. 16 | * This function Modity from addon-sdk file lib/sdk/widget.js, and 17 | * function BrowserWindow.prototype._insertNodeInToolbar 18 | */ 19 | let layoutWidget = function(document, button, isFirstRun) { 20 | 21 | // Add to the customization palette 22 | let toolbox = document.getElementById('navigator-toolbox'); 23 | toolbox.palette.appendChild(button); 24 | 25 | // Search for widget toolbar by reading toolbar's currentset attribute 26 | let container = null; 27 | let toolbars = document.getElementsByTagName('toolbar'); 28 | let id = button.getAttribute('id'); 29 | for (let i = 0; i < toolbars.length; i += 1) { 30 | let toolbar = toolbars[i]; 31 | if (toolbar.getAttribute('currentset').indexOf(id) !== -1) { 32 | container = toolbar; 33 | } 34 | } 35 | 36 | // if widget isn't in any toolbar, default add it next to searchbar 37 | if (!container) { 38 | if (isFirstRun) { 39 | container = document.getElementById('nav-bar'); 40 | } else { 41 | return; 42 | } 43 | } 44 | 45 | // Now retrieve a reference to the next toolbar item 46 | // by reading currentset attribute on the toolbar 47 | let nextNode = null; 48 | let currentSet = container.getAttribute('currentset'); 49 | let ids = (currentSet === '__empty') ? [] : currentSet.split(','); 50 | let idx = ids.indexOf(id); 51 | if (idx !== -1) { 52 | for (let i = idx; i < ids.length; i += 1) { 53 | nextNode = document.getElementById(ids[i]); 54 | if (nextNode) { 55 | break; 56 | } 57 | } 58 | } 59 | 60 | // Finally insert our widget in the right toolbar and in the right position 61 | container.insertItem(id, nextNode, null, false); 62 | 63 | // Update DOM in order to save position 64 | // in this toolbar. But only do this the first time we add it to the toolbar 65 | if (ids.indexOf(id) === -1) { 66 | container.setAttribute('currentset', container.currentSet); 67 | document.persist(container.id, 'currentset'); 68 | } 69 | }; 70 | 71 | let addWidget = function(window, widget, isFirstRun) { 72 | try { 73 | layoutWidget(window.document, widget, isFirstRun); 74 | } catch(error) { 75 | trace(error); 76 | } 77 | }; 78 | 79 | let removeWidget = function(window, widgetId) { 80 | try { 81 | let widget = window.document.getElementById(widgetId); 82 | widget.parentNode.removeChild(widget); 83 | } catch(error) { 84 | trace(error); 85 | } 86 | }; 87 | 88 | let exports = { 89 | addWidget: addWidget, 90 | removeWidget: removeWidget, 91 | }; 92 | return exports; 93 | })(); 94 | 95 | window.PanelCustomButton1 = { 96 | customViewID: 'PanelUI-customView', 97 | 98 | init: function() { 99 | let button = $C('toolbarbutton', { 100 | id: 'mPanelSubMenu-button1', 101 | class: 'toolbarbutton-1 chromeclass-toolbar-additional', 102 | label: '测试按钮', 103 | "cui-areatype": "menu-panel", 104 | "cui-anchorid": "PanelUI-menu-button", 105 | tooltiptext: '', 106 | oncommand: 'PanelCustomButton1.showSubView(this);', 107 | image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACYElEQVRIid3Vy04aYRjGcdfehHt3X+Z+vI4mTWzSRVMV5CAICiJyFBSlakUQz4gowwxCQySxFcUiVGk1iIOjw+OmmYRqPr+0u77Jf/v8lm9X1391odgXzEbzmFnJI7icQ+DzIaaXsvAvivAtiPCGBXjmM3DP8XCFeEzNpOEMHsAZ2IdjOgWHPwVCSA/Hcd0vArPRPP684tXrHV0BR5eA3bsHQkgfIaTnRWAmknsGhLO/mCpctmHzJMFxXD8hpPdFILh8+AwIZX8yla+1Me7apQPTS1koitIBBMQ6U9magrGpBB3wL2Yhy3IH4BOvmBKqCqyTO3TA90mEJEkdgEv8wRRffYTFsU0HvGEBjUajA3AINab2Lx5gtm/RAc9cBtfX1x2ATagylazIMNk26YA7xKNer6vj7TZgES6YSlRkjIxv0AHXbBq1Wk0dVxTAJFSY2jq/h9H6CuAMHqBSqaDdBh4fgYcHQJ/5ztTGeQsGyzodmAzso1wuq+OyDGgz50zFyy3ozWt0wOFPoVQqqeP398BA5oypWFmCzhSnAxO+PRwfH0OWgVYLkCTgA3/KVORMgta4SgfsniSKxaI6fncHvOdLTC2d3kFjiNEBm3sXhUIBkgQ0m8DtLfCOP2FqodTEkC5KB8amEsjlcup4owG8TX9jav6kicHhFTpgdSYgiqI6fnMDvEl/ZSp0cosBTYQOWCZ3MDqxDbN9CybbJkbGN2G0bsBgWYd+dA06cxzDpji0xlVoDDFo9FEM6aIY1K5gQBPBx6FlOkAI6SGE9HEc1/+3UV8mx3Hdv5Hef6jj6T8BraHEXgQsuRQAAAAASUVORK5CYII=' 108 | }); 109 | 110 | ToolbarManager.addWidget(window, button, false); 111 | 112 | this.addSubView(); 113 | }, 114 | addSubView: function() { 115 | let panelView = $C('panelview', { 116 | id: PanelCustomButton1.customViewID, 117 | flex: 1, 118 | class: 'PanelUI-subview' 119 | }); 120 | 121 | panelView.appendChild($C('label', { 122 | value: '测试', 123 | class: 'panel-subview-header' 124 | })); 125 | 126 | let vbox = $C('vbox', { 127 | id: 'PanelUI-customItems', 128 | class: 'panel-subview-body' 129 | }); 130 | 131 | try { 132 | for (let button of toolbarbuttons) { 133 | vbox.appendChild($C('toolbarbutton', button)); 134 | } 135 | } catch (e) { 136 | // console.error('添加按钮错误', e); 137 | } 138 | 139 | panelView.appendChild(vbox); 140 | 141 | $('PanelUI-multiView').appendChild(panelView); 142 | }, 143 | showSubView: function(aAnchor) { 144 | let popup = $('PanelUI-popup'); 145 | popup.addEventListener('popuphiding', function(event){ 146 | event.preventDefault(); 147 | event.stopPropagation(); 148 | popup.removeEventListener('popuphiding', arguments.callee, false); 149 | }, false); 150 | 151 | PanelUI.multiView.showSubView(PanelCustomButton1.customViewID, aAnchor); 152 | }, 153 | }; 154 | 155 | PanelCustomButton1.init(); 156 | 157 | function $(id) document.getElementById(id); 158 | function $C(name, attr) { 159 | var el = document.createElement(name); 160 | if (attr) Object.keys(attr).forEach(function(n) el.setAttribute(n, attr[n])); 161 | return el; 162 | } 163 | })() --------------------------------------------------------------------------------