打开任务栏中没有图标的窗口

Opening a window without an icon in the taskbar

本文关键字:图标 窗口 任务栏      更新时间:2023-09-26

Firefox的"选项"打开:

  • 任务栏上没有图标
  • 正在阻止恢复到主窗口的能力。

如何扩展到其他窗口,键入:

chrome://browser/content/search/engineManager.xul

没有图标且不在任务栏?你一定是指一个对话窗口。

var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);
ww.openWindow(window, "chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen,resizable", null);

如果你想在任务栏中没有图标和显示任何东西,你必须传递第一个参数窗口,对话框将绑定到这个窗口,并且你必须传递dialogmodal作为一个特性

https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIWindowWatcher openWindow % 28% 29日

如果导入了Services.jsm,也可以使用Services.ww.openWindow代替var ww = Components.classes["@mozilla.org/embedcomp/window-watcher;1"].getService(Components.interfaces.nsIWindowWatcher);

那个家伙@nmaier现在睡着了:哈哈:但是当你唤醒nmaier的时候,有没有任何地方列出了我们可以在features参数中使用的所有选项?


编辑:更新:

它不工作的原因是因为从你的作用域window没有定义。因此,将窗口设置为最近的窗口,如:Services.wm.getMostRecentWindow('navigator:browser')。或者您可以使用null来代替'navigator:browser'

SDK的方式,因为这看起来就像你在做你的评论:

var {Cu} = require("chrome");
Cu.import('resource://gre/modules/Services.jsm');
Services.ww.openWindow(Services.wm.getMostRecentWindow('navigator:browser'), "chrome://browser/content/search/engineManager.xul", "_blank", "chrome,dialog,modal,centerscreen,resizable", null);