ext.mx raw
1 package ext
2
3 // Browser extension API stubs (browser.storage.local, browser.runtime).
4 // Moxie JS backend replaces these with calls to ext.mjs.
5
6 // StorageGet retrieves a value from browser.storage.local.
7 func StorageGet(key string, fn func(string)) { panic("jsbridge") }
8
9 // StorageSet stores a key-value pair in browser.storage.local.
10 func StorageSet(key, value string) { panic("jsbridge") }
11
12 // StorageRemove removes a key from browser.storage.local.
13 func StorageRemove(key string) { panic("jsbridge") }
14
15 // OnMessage registers a handler for browser.runtime.onMessage.
16 // fn receives (method, paramsJSON, senderTabID, respond).
17 // respond must be called exactly once with the response JSON string.
18 func OnMessage(fn func(string, string, int, func(string))) { panic("jsbridge") }
19
20 // SendMessageToTab sends a message to a specific tab's content script.
21 func SendMessageToTab(tabID int, msg string) { panic("jsbridge") }
22
23 // GetActiveTab gets the active tab's ID and URL.
24 func GetActiveTab(fn func(int, string)) { panic("jsbridge") }
25
26 // ConsoleLog logs a message to the browser console (extension background).
27 func ConsoleLog(msg string) { panic("jsbridge") }
28
29 // SessionGet retrieves a value from sessionStorage (in-page mode only).
30 func SessionGet(key string, fn func(string)) { panic("jsbridge") }
31
32 // SessionSet stores a key-value pair in sessionStorage (in-page mode only).
33 func SessionSet(key, value string) { panic("jsbridge") }
34
35 // IsInPage returns true when running as in-page signer (not extension).
36 func IsInPage() bool { panic("jsbridge") }
37