本文整理汇总了TypeScript中sdk/tabs.open函数的典型用法代码示例。如果您正苦于以下问题:TypeScript open函数的具体用法?TypeScript open怎么用?TypeScript open使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了open函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: openCommandsPage
private openCommandsPage() {
let collection = this;
Tabs.open({
url: self.data.url('./configuration/commands.html'),
onReady: function (tab : FFTab) {
var worker = tab.attach({
contentScriptFile: [
'./libs/react.js',
'./libs/react-dom.js',
'./configuration/commands.js'],
contentScriptOptions: { commands: storage.storage.commandStore }
});
worker.port.on('save', (commands : string) => collection.saveCommands(commands));
}
});
}
示例2: function
onClick: function (state) {
tabs.open({
url: "http://www.youku.com/",
isPrivate: true
});
}
示例3:
import * as storage from "sdk/simple-storage";
storage.storage.value = 10;
storage.storage.x = "hello";
delete storage.storage.value;
storage.on("OverQuota", () => {
if (storage.quotaUsage > 1) {
console.log("you no longer have shelves to store anything. Successful!");
}
});
import * as system from "sdk/system";
console.log(system.env.PATH);
system.env.PATH = "/path/to/my/virus";
import * as tabs from "sdk/tabs";
tabs.open({url: "http://example.com", onOpen: (tab) => tab.close()});
tabs.open("http://example.com");
console.info(tabs.length);
import * as timers from "sdk/timers";
timers.clearTimeout(timers.setInterval(() => console.log("hello"), 100));
timers.clearInterval(timers.setTimeout(() => console.log("hello again"), 100));
import * as action from "sdk/ui/button/action";
let button = action.ActionButton({id: "my button", label: "my button", icon: "./myicon.png"});
button.on("click", (state) => {
if (state.label == "destroy") {
button.destroy();
}
});