11 lines
423 B
Plaintext
11 lines
423 B
Plaintext
// Returns a promise of the tab object
|
|
(function createTab [:String url]
|
|
(API.browser.tabs.create (objectWith url)))
|
|
|
|
(function sendMessage [:Int tabId :String type :Array<Dynamic> data]
|
|
(API.browser.tabs.sendMessage tabId (objectWith type data)))
|
|
|
|
// Requires the activeTab permission in manifest.json
|
|
(function runCode [tab :String jsCode]
|
|
(API.browser.tabs.executeScript tab.id
|
|
(object code jsCode))) |