第一个插件帮助 - 使用 for 循环在窗口中循环
我今天正在制作我的第一个 Firefox 扩展。到目前为止我已经做了一些...但现在我想计算用户打开的 Firefox 窗口的数量(例如 3)我可以计算选项卡数,到目前为止这很容易...但我似乎看不到找到如何循环浏览窗口并对它们进行计数(窗口!=选项卡,就像窗口内的选项卡一样,抱歉,我希望这是有道理的,即使mozilla在他们的编码中混淆了它)我想基本上,我迷失了方法名称。 ..
所以我认为它会是这样的:
var tomato = SOMETHING HERE MYSTERY DIFFICULT!!!!;
for (var i = 0; i < tomato; i++) {
WINDOW COUNTER HERE (EASY)
}
知道如何做到这一点吗?
I am making my first firefox extension today. So far I have done a little...but now I would like to count the number of firefox windows the user has open (for example 3) I can count tabs, that is easy so far...but I can't seem to find how to cycle through windows and count them (windows != tabs, like tabs are within windows, sorry, I hope this makes sense, even mozilla confuses it in their coding) I think basically, I am lost for the method name...
so I think it will be like:
var tomato = SOMETHING HERE MYSTERY DIFFICULT!!!!;
for (var i = 0; i < tomato; i++) {
WINDOW COUNTER HERE (EASY)
}
Any idea how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找 nsIWindowMediator - 来自 MDC 的片段:
You're looking for nsIWindowMediator - a snippet from MDC: