sdkaddon: How ('sdk/window/utils').openDialog can navigate to url?

时间:2015-10-30 22:29:38

标签: firefox-addon-sdk

In sdkaddon, I have that part of code

win = require('sdk/window/utils').openDialog({
    features: Object.keys({
        resizable: true,
    }).join() + ',width='+w+',height='+h+',top='+pos.top+',left='+pos.left,
    name: 'mywin'
});

win.addEventListener('load', function () {
    tabs.activeTab.on('ready', function (tab) {

    });
    tabs.activeTab.url = "http://www.example.com";
});

which creates a new popup and goes to example.com

How can I later change the url of win (navigate to another url ?)

win.url = "http://www.example2.com" does not work

1 个答案:

答案 0 :(得分:0)

你非常接近!

要打开特定网址的新标签页:

const tabs = require("sdk/tabs");
tabs.open("http://www.example2.com");

那就是它,它什么也没有。