阅读:2748回复:4
让stylish1.1.2在独立窗口中打开
更新stylish到1.1.2后,发现打开stylish是在附加组件管理器中打开的。习惯了1.1.1之前的独立窗口模式,想恢复成那样。于是简单改了下代码。可以直接下载我修改后的附件。
{46551EC9-40F0-4e47-8E18-8E5CF550CFB8}.xpi\content\overlay.js 从513行开始 /*-----------------行513开始,复制以下代码-----------------*/ addCode: function(code) { var style = Components.classes["@userstyles.org/style;1"].createInstance(Components.interfaces.stylishStyle); style.mode = style.CALCULATE_META | style.REGISTER_STYLE_ON_CHANGE; style.init(null, null, null, null, null, code, false, null); stylishCommon.openEdit(stylishCommon.getWindowName("stylishEdit"), {style: style}); }, openManage: function() { var manageView = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch).getIntPref("extensions.stylish.manageView"); var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo); if (manageView == 0) { var versionChecker = Components.classes["@mozilla.org/xpcom/version-comparator;1"] .getService(Components.interfaces.nsIVersionComparator); if (appInfo.ID == "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" && versionChecker.compare(appInfo.version, "3.7a5pre") >= 0) { manageView = 1; } else if (appInfo.ID == "{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}" && versionChecker.compare(appInfo.version, "2.1b1") >= 0) { manageView = 1; } } function getWindow(name) { return Components.classes["@mozilla.org/appshell/window-mediator;1"].getService(Components.interfaces.nsIWindowMediator).getMostRecentWindow(name); } /*------------------------到switch (manageView) 结束------------------*/ 独立窗口就又回来了。 |
|
|
1楼#
发布于:2011-04-22 09:18
|
|
|
2楼#
发布于:2011-04-22 09:18
才接触 stylish ,楼主能将自己的 stylish 脚本分享一下吗?谢谢!
|
|
3楼#
发布于:2011-04-22 09:18
哦,还真没注意看。哈哈。
|
|
|
4楼#
发布于:2011-04-22 09:18
楼主没仔细看更新提示,about:config里将extensions.stylish.manageView改成1就可以了。
|
|