如何打开包含外部站点(插件 SDK)的弹出窗口?

how to open a popup including external site (addon SDK)?

我正在尝试打开一个新的弹出 HTML 页面(来自 )

window.open ('http://www.google.fr', 'win', 'height=240, width=640, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');

看起来 windows 没有指定宽度、高度和其他选项的选项。

https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/windows

您将不得不使用名为 'window/utils'Low-Level SDK API 及其 openDialog() 函数(而不是 open()),它提供更多 features 设置。

require('sdk/window/utils').openDialog({
  url: 'http://www.google.fr',
  name: 'The window I dreamt of',
  features: 'height = 240,' +
            'width = 640,' +
            'toolbar = no,' +
            'menubar = no,' +
            'scrollbars = no,' +
            'resizable = no,' +
            'location = no,' +
            'directories = no,' +
            'status = no'
});

此 API 描述如下: https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/window_utils

在这里您可以找到 openDialog() 支持的 features 的完整列表: https://developer.mozilla.org/pl/docs/Web/API/Window/open