github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/tabs1/bindings/ffi_bindings.ts (about) 1 import { importModule, Application, heap, Pointer } from "@ffi"; 2 3 importModule("plat/js/webext/tabs1", (A: Application) => { 4 const WEBEXT = typeof globalThis.browser === "undefined" ? globalThis.chrome : globalThis.browser; 5 6 return { 7 "has_Connect": (): heap.Ref<boolean> => { 8 if (WEBEXT?.tabs && "connect" in WEBEXT?.tabs) { 9 return A.H.TRUE; 10 } 11 return A.H.FALSE; 12 }, 13 "func_Connect": (fn: Pointer): void => { 14 A.store.Ref(fn, WEBEXT.tabs.connect); 15 }, 16 "call_Connect": (retPtr: Pointer, tabId: number, connectInfo: Pointer): void => { 17 const connectInfo_ffi = {}; 18 19 connectInfo_ffi["documentId"] = A.load.Ref(connectInfo + 0, undefined); 20 if (A.load.Bool(connectInfo + 20)) { 21 connectInfo_ffi["frameId"] = A.load.Int64(connectInfo + 8); 22 } 23 connectInfo_ffi["name"] = A.load.Ref(connectInfo + 16, undefined); 24 25 const _ret = WEBEXT.tabs.connect(tabId, connectInfo_ffi); 26 if (typeof _ret === "undefined") { 27 A.store.Bool(retPtr + 204, false); 28 A.store.Ref(retPtr + 0, undefined); 29 A.store.Ref(retPtr + 4, undefined); 30 A.store.Ref(retPtr + 8, undefined); 31 32 A.store.Bool(retPtr + 16 + 187, false); 33 A.store.Ref(retPtr + 16 + 0, undefined); 34 A.store.Ref(retPtr + 16 + 4, undefined); 35 A.store.Bool(retPtr + 16 + 184, false); 36 A.store.Int64(retPtr + 16 + 8, 0); 37 A.store.Bool(retPtr + 16 + 185, false); 38 A.store.Int64(retPtr + 16 + 16, 0); 39 A.store.Bool(retPtr + 16 + 186, false); 40 A.store.Int64(retPtr + 16 + 24, 0); 41 A.store.Ref(retPtr + 16 + 32, undefined); 42 A.store.Ref(retPtr + 16 + 36, undefined); 43 A.store.Ref(retPtr + 16 + 40, undefined); 44 45 A.store.Bool(retPtr + 16 + 48 + 125, false); 46 A.store.Bool(retPtr + 16 + 48 + 0, false); 47 A.store.Bool(retPtr + 16 + 48 + 120, false); 48 A.store.Bool(retPtr + 16 + 48 + 1, false); 49 A.store.Bool(retPtr + 16 + 48 + 2, false); 50 A.store.Bool(retPtr + 16 + 48 + 3, false); 51 A.store.Ref(retPtr + 16 + 48 + 4, undefined); 52 A.store.Int64(retPtr + 16 + 48 + 8, 0); 53 A.store.Bool(retPtr + 16 + 48 + 121, false); 54 A.store.Int64(retPtr + 16 + 48 + 16, 0); 55 A.store.Bool(retPtr + 16 + 48 + 24, false); 56 A.store.Bool(retPtr + 16 + 48 + 122, false); 57 A.store.Int64(retPtr + 16 + 48 + 32, 0); 58 A.store.Bool(retPtr + 16 + 48 + 40, false); 59 A.store.Int64(retPtr + 16 + 48 + 48, 0); 60 61 A.store.Bool(retPtr + 16 + 48 + 56 + 12, false); 62 A.store.Ref(retPtr + 16 + 48 + 56 + 0, undefined); 63 A.store.Bool(retPtr + 16 + 48 + 56 + 4, false); 64 A.store.Enum(retPtr + 16 + 48 + 56 + 8, -1); 65 A.store.Bool(retPtr + 16 + 48 + 123, false); 66 A.store.Int64(retPtr + 16 + 48 + 72, 0); 67 A.store.Ref(retPtr + 16 + 48 + 80, undefined); 68 A.store.Bool(retPtr + 16 + 48 + 84, false); 69 A.store.Bool(retPtr + 16 + 48 + 85, false); 70 A.store.Ref(retPtr + 16 + 48 + 88, undefined); 71 A.store.Enum(retPtr + 16 + 48 + 92, -1); 72 A.store.Ref(retPtr + 16 + 48 + 96, undefined); 73 A.store.Ref(retPtr + 16 + 48 + 100, undefined); 74 A.store.Bool(retPtr + 16 + 48 + 124, false); 75 A.store.Int64(retPtr + 16 + 48 + 104, 0); 76 A.store.Int64(retPtr + 16 + 48 + 112, 0); 77 A.store.Ref(retPtr + 16 + 176, undefined); 78 A.store.Ref(retPtr + 16 + 180, undefined); 79 } else { 80 A.store.Bool(retPtr + 204, true); 81 A.store.Ref(retPtr + 0, _ret["disconnect"]); 82 A.store.Ref(retPtr + 4, _ret["name"]); 83 A.store.Ref(retPtr + 8, _ret["postMessage"]); 84 85 if (typeof _ret["sender"] === "undefined") { 86 A.store.Bool(retPtr + 16 + 187, false); 87 A.store.Ref(retPtr + 16 + 0, undefined); 88 A.store.Ref(retPtr + 16 + 4, undefined); 89 A.store.Bool(retPtr + 16 + 184, false); 90 A.store.Int64(retPtr + 16 + 8, 0); 91 A.store.Bool(retPtr + 16 + 185, false); 92 A.store.Int64(retPtr + 16 + 16, 0); 93 A.store.Bool(retPtr + 16 + 186, false); 94 A.store.Int64(retPtr + 16 + 24, 0); 95 A.store.Ref(retPtr + 16 + 32, undefined); 96 A.store.Ref(retPtr + 16 + 36, undefined); 97 A.store.Ref(retPtr + 16 + 40, undefined); 98 99 A.store.Bool(retPtr + 16 + 48 + 125, false); 100 A.store.Bool(retPtr + 16 + 48 + 0, false); 101 A.store.Bool(retPtr + 16 + 48 + 120, false); 102 A.store.Bool(retPtr + 16 + 48 + 1, false); 103 A.store.Bool(retPtr + 16 + 48 + 2, false); 104 A.store.Bool(retPtr + 16 + 48 + 3, false); 105 A.store.Ref(retPtr + 16 + 48 + 4, undefined); 106 A.store.Int64(retPtr + 16 + 48 + 8, 0); 107 A.store.Bool(retPtr + 16 + 48 + 121, false); 108 A.store.Int64(retPtr + 16 + 48 + 16, 0); 109 A.store.Bool(retPtr + 16 + 48 + 24, false); 110 A.store.Bool(retPtr + 16 + 48 + 122, false); 111 A.store.Int64(retPtr + 16 + 48 + 32, 0); 112 A.store.Bool(retPtr + 16 + 48 + 40, false); 113 A.store.Int64(retPtr + 16 + 48 + 48, 0); 114 115 A.store.Bool(retPtr + 16 + 48 + 56 + 12, false); 116 A.store.Ref(retPtr + 16 + 48 + 56 + 0, undefined); 117 A.store.Bool(retPtr + 16 + 48 + 56 + 4, false); 118 A.store.Enum(retPtr + 16 + 48 + 56 + 8, -1); 119 A.store.Bool(retPtr + 16 + 48 + 123, false); 120 A.store.Int64(retPtr + 16 + 48 + 72, 0); 121 A.store.Ref(retPtr + 16 + 48 + 80, undefined); 122 A.store.Bool(retPtr + 16 + 48 + 84, false); 123 A.store.Bool(retPtr + 16 + 48 + 85, false); 124 A.store.Ref(retPtr + 16 + 48 + 88, undefined); 125 A.store.Enum(retPtr + 16 + 48 + 92, -1); 126 A.store.Ref(retPtr + 16 + 48 + 96, undefined); 127 A.store.Ref(retPtr + 16 + 48 + 100, undefined); 128 A.store.Bool(retPtr + 16 + 48 + 124, false); 129 A.store.Int64(retPtr + 16 + 48 + 104, 0); 130 A.store.Int64(retPtr + 16 + 48 + 112, 0); 131 A.store.Ref(retPtr + 16 + 176, undefined); 132 A.store.Ref(retPtr + 16 + 180, undefined); 133 } else { 134 A.store.Bool(retPtr + 16 + 187, true); 135 A.store.Ref(retPtr + 16 + 0, _ret["sender"]["documentId"]); 136 A.store.Ref(retPtr + 16 + 4, _ret["sender"]["documentLifecycle"]); 137 A.store.Bool(retPtr + 16 + 184, "frameId" in _ret["sender"] ? true : false); 138 A.store.Int64( 139 retPtr + 16 + 8, 140 _ret["sender"]["frameId"] === undefined ? 0 : (_ret["sender"]["frameId"] as number) 141 ); 142 A.store.Bool(retPtr + 16 + 185, "guestProcessId" in _ret["sender"] ? true : false); 143 A.store.Int64( 144 retPtr + 16 + 16, 145 _ret["sender"]["guestProcessId"] === undefined ? 0 : (_ret["sender"]["guestProcessId"] as number) 146 ); 147 A.store.Bool(retPtr + 16 + 186, "guestRenderFrameRoutingId" in _ret["sender"] ? true : false); 148 A.store.Int64( 149 retPtr + 16 + 24, 150 _ret["sender"]["guestRenderFrameRoutingId"] === undefined 151 ? 0 152 : (_ret["sender"]["guestRenderFrameRoutingId"] as number) 153 ); 154 A.store.Ref(retPtr + 16 + 32, _ret["sender"]["id"]); 155 A.store.Ref(retPtr + 16 + 36, _ret["sender"]["nativeApplication"]); 156 A.store.Ref(retPtr + 16 + 40, _ret["sender"]["origin"]); 157 158 if (typeof _ret["sender"]["tab"] === "undefined") { 159 A.store.Bool(retPtr + 16 + 48 + 125, false); 160 A.store.Bool(retPtr + 16 + 48 + 0, false); 161 A.store.Bool(retPtr + 16 + 48 + 120, false); 162 A.store.Bool(retPtr + 16 + 48 + 1, false); 163 A.store.Bool(retPtr + 16 + 48 + 2, false); 164 A.store.Bool(retPtr + 16 + 48 + 3, false); 165 A.store.Ref(retPtr + 16 + 48 + 4, undefined); 166 A.store.Int64(retPtr + 16 + 48 + 8, 0); 167 A.store.Bool(retPtr + 16 + 48 + 121, false); 168 A.store.Int64(retPtr + 16 + 48 + 16, 0); 169 A.store.Bool(retPtr + 16 + 48 + 24, false); 170 A.store.Bool(retPtr + 16 + 48 + 122, false); 171 A.store.Int64(retPtr + 16 + 48 + 32, 0); 172 A.store.Bool(retPtr + 16 + 48 + 40, false); 173 A.store.Int64(retPtr + 16 + 48 + 48, 0); 174 175 A.store.Bool(retPtr + 16 + 48 + 56 + 12, false); 176 A.store.Ref(retPtr + 16 + 48 + 56 + 0, undefined); 177 A.store.Bool(retPtr + 16 + 48 + 56 + 4, false); 178 A.store.Enum(retPtr + 16 + 48 + 56 + 8, -1); 179 A.store.Bool(retPtr + 16 + 48 + 123, false); 180 A.store.Int64(retPtr + 16 + 48 + 72, 0); 181 A.store.Ref(retPtr + 16 + 48 + 80, undefined); 182 A.store.Bool(retPtr + 16 + 48 + 84, false); 183 A.store.Bool(retPtr + 16 + 48 + 85, false); 184 A.store.Ref(retPtr + 16 + 48 + 88, undefined); 185 A.store.Enum(retPtr + 16 + 48 + 92, -1); 186 A.store.Ref(retPtr + 16 + 48 + 96, undefined); 187 A.store.Ref(retPtr + 16 + 48 + 100, undefined); 188 A.store.Bool(retPtr + 16 + 48 + 124, false); 189 A.store.Int64(retPtr + 16 + 48 + 104, 0); 190 A.store.Int64(retPtr + 16 + 48 + 112, 0); 191 } else { 192 A.store.Bool(retPtr + 16 + 48 + 125, true); 193 A.store.Bool(retPtr + 16 + 48 + 0, _ret["sender"]["tab"]["active"] ? true : false); 194 A.store.Bool(retPtr + 16 + 48 + 120, "audible" in _ret["sender"]["tab"] ? true : false); 195 A.store.Bool(retPtr + 16 + 48 + 1, _ret["sender"]["tab"]["audible"] ? true : false); 196 A.store.Bool(retPtr + 16 + 48 + 2, _ret["sender"]["tab"]["autoDiscardable"] ? true : false); 197 A.store.Bool(retPtr + 16 + 48 + 3, _ret["sender"]["tab"]["discarded"] ? true : false); 198 A.store.Ref(retPtr + 16 + 48 + 4, _ret["sender"]["tab"]["favIconUrl"]); 199 A.store.Int64( 200 retPtr + 16 + 48 + 8, 201 _ret["sender"]["tab"]["groupId"] === undefined ? 0 : (_ret["sender"]["tab"]["groupId"] as number) 202 ); 203 A.store.Bool(retPtr + 16 + 48 + 121, "height" in _ret["sender"]["tab"] ? true : false); 204 A.store.Int64( 205 retPtr + 16 + 48 + 16, 206 _ret["sender"]["tab"]["height"] === undefined ? 0 : (_ret["sender"]["tab"]["height"] as number) 207 ); 208 A.store.Bool(retPtr + 16 + 48 + 24, _ret["sender"]["tab"]["highlighted"] ? true : false); 209 A.store.Bool(retPtr + 16 + 48 + 122, "id" in _ret["sender"]["tab"] ? true : false); 210 A.store.Int64( 211 retPtr + 16 + 48 + 32, 212 _ret["sender"]["tab"]["id"] === undefined ? 0 : (_ret["sender"]["tab"]["id"] as number) 213 ); 214 A.store.Bool(retPtr + 16 + 48 + 40, _ret["sender"]["tab"]["incognito"] ? true : false); 215 A.store.Int64( 216 retPtr + 16 + 48 + 48, 217 _ret["sender"]["tab"]["index"] === undefined ? 0 : (_ret["sender"]["tab"]["index"] as number) 218 ); 219 220 if (typeof _ret["sender"]["tab"]["mutedInfo"] === "undefined") { 221 A.store.Bool(retPtr + 16 + 48 + 56 + 12, false); 222 A.store.Ref(retPtr + 16 + 48 + 56 + 0, undefined); 223 A.store.Bool(retPtr + 16 + 48 + 56 + 4, false); 224 A.store.Enum(retPtr + 16 + 48 + 56 + 8, -1); 225 } else { 226 A.store.Bool(retPtr + 16 + 48 + 56 + 12, true); 227 A.store.Ref(retPtr + 16 + 48 + 56 + 0, _ret["sender"]["tab"]["mutedInfo"]["extensionId"]); 228 A.store.Bool(retPtr + 16 + 48 + 56 + 4, _ret["sender"]["tab"]["mutedInfo"]["muted"] ? true : false); 229 A.store.Enum( 230 retPtr + 16 + 48 + 56 + 8, 231 ["user", "capture", "extension"].indexOf(_ret["sender"]["tab"]["mutedInfo"]["reason"] as string) 232 ); 233 } 234 A.store.Bool(retPtr + 16 + 48 + 123, "openerTabId" in _ret["sender"]["tab"] ? true : false); 235 A.store.Int64( 236 retPtr + 16 + 48 + 72, 237 _ret["sender"]["tab"]["openerTabId"] === undefined ? 0 : (_ret["sender"]["tab"]["openerTabId"] as number) 238 ); 239 A.store.Ref(retPtr + 16 + 48 + 80, _ret["sender"]["tab"]["pendingUrl"]); 240 A.store.Bool(retPtr + 16 + 48 + 84, _ret["sender"]["tab"]["pinned"] ? true : false); 241 A.store.Bool(retPtr + 16 + 48 + 85, _ret["sender"]["tab"]["selected"] ? true : false); 242 A.store.Ref(retPtr + 16 + 48 + 88, _ret["sender"]["tab"]["sessionId"]); 243 A.store.Enum( 244 retPtr + 16 + 48 + 92, 245 ["unloaded", "loading", "complete"].indexOf(_ret["sender"]["tab"]["status"] as string) 246 ); 247 A.store.Ref(retPtr + 16 + 48 + 96, _ret["sender"]["tab"]["title"]); 248 A.store.Ref(retPtr + 16 + 48 + 100, _ret["sender"]["tab"]["url"]); 249 A.store.Bool(retPtr + 16 + 48 + 124, "width" in _ret["sender"]["tab"] ? true : false); 250 A.store.Int64( 251 retPtr + 16 + 48 + 104, 252 _ret["sender"]["tab"]["width"] === undefined ? 0 : (_ret["sender"]["tab"]["width"] as number) 253 ); 254 A.store.Int64( 255 retPtr + 16 + 48 + 112, 256 _ret["sender"]["tab"]["windowId"] === undefined ? 0 : (_ret["sender"]["tab"]["windowId"] as number) 257 ); 258 } 259 A.store.Ref(retPtr + 16 + 176, _ret["sender"]["tlsChannelId"]); 260 A.store.Ref(retPtr + 16 + 180, _ret["sender"]["url"]); 261 } 262 } 263 }, 264 "try_Connect": (retPtr: Pointer, errPtr: Pointer, tabId: number, connectInfo: Pointer): heap.Ref<boolean> => { 265 try { 266 const connectInfo_ffi = {}; 267 268 connectInfo_ffi["documentId"] = A.load.Ref(connectInfo + 0, undefined); 269 if (A.load.Bool(connectInfo + 20)) { 270 connectInfo_ffi["frameId"] = A.load.Int64(connectInfo + 8); 271 } 272 connectInfo_ffi["name"] = A.load.Ref(connectInfo + 16, undefined); 273 274 const _ret = WEBEXT.tabs.connect(tabId, connectInfo_ffi); 275 if (typeof _ret === "undefined") { 276 A.store.Bool(retPtr + 204, false); 277 A.store.Ref(retPtr + 0, undefined); 278 A.store.Ref(retPtr + 4, undefined); 279 A.store.Ref(retPtr + 8, undefined); 280 281 A.store.Bool(retPtr + 16 + 187, false); 282 A.store.Ref(retPtr + 16 + 0, undefined); 283 A.store.Ref(retPtr + 16 + 4, undefined); 284 A.store.Bool(retPtr + 16 + 184, false); 285 A.store.Int64(retPtr + 16 + 8, 0); 286 A.store.Bool(retPtr + 16 + 185, false); 287 A.store.Int64(retPtr + 16 + 16, 0); 288 A.store.Bool(retPtr + 16 + 186, false); 289 A.store.Int64(retPtr + 16 + 24, 0); 290 A.store.Ref(retPtr + 16 + 32, undefined); 291 A.store.Ref(retPtr + 16 + 36, undefined); 292 A.store.Ref(retPtr + 16 + 40, undefined); 293 294 A.store.Bool(retPtr + 16 + 48 + 125, false); 295 A.store.Bool(retPtr + 16 + 48 + 0, false); 296 A.store.Bool(retPtr + 16 + 48 + 120, false); 297 A.store.Bool(retPtr + 16 + 48 + 1, false); 298 A.store.Bool(retPtr + 16 + 48 + 2, false); 299 A.store.Bool(retPtr + 16 + 48 + 3, false); 300 A.store.Ref(retPtr + 16 + 48 + 4, undefined); 301 A.store.Int64(retPtr + 16 + 48 + 8, 0); 302 A.store.Bool(retPtr + 16 + 48 + 121, false); 303 A.store.Int64(retPtr + 16 + 48 + 16, 0); 304 A.store.Bool(retPtr + 16 + 48 + 24, false); 305 A.store.Bool(retPtr + 16 + 48 + 122, false); 306 A.store.Int64(retPtr + 16 + 48 + 32, 0); 307 A.store.Bool(retPtr + 16 + 48 + 40, false); 308 A.store.Int64(retPtr + 16 + 48 + 48, 0); 309 310 A.store.Bool(retPtr + 16 + 48 + 56 + 12, false); 311 A.store.Ref(retPtr + 16 + 48 + 56 + 0, undefined); 312 A.store.Bool(retPtr + 16 + 48 + 56 + 4, false); 313 A.store.Enum(retPtr + 16 + 48 + 56 + 8, -1); 314 A.store.Bool(retPtr + 16 + 48 + 123, false); 315 A.store.Int64(retPtr + 16 + 48 + 72, 0); 316 A.store.Ref(retPtr + 16 + 48 + 80, undefined); 317 A.store.Bool(retPtr + 16 + 48 + 84, false); 318 A.store.Bool(retPtr + 16 + 48 + 85, false); 319 A.store.Ref(retPtr + 16 + 48 + 88, undefined); 320 A.store.Enum(retPtr + 16 + 48 + 92, -1); 321 A.store.Ref(retPtr + 16 + 48 + 96, undefined); 322 A.store.Ref(retPtr + 16 + 48 + 100, undefined); 323 A.store.Bool(retPtr + 16 + 48 + 124, false); 324 A.store.Int64(retPtr + 16 + 48 + 104, 0); 325 A.store.Int64(retPtr + 16 + 48 + 112, 0); 326 A.store.Ref(retPtr + 16 + 176, undefined); 327 A.store.Ref(retPtr + 16 + 180, undefined); 328 } else { 329 A.store.Bool(retPtr + 204, true); 330 A.store.Ref(retPtr + 0, _ret["disconnect"]); 331 A.store.Ref(retPtr + 4, _ret["name"]); 332 A.store.Ref(retPtr + 8, _ret["postMessage"]); 333 334 if (typeof _ret["sender"] === "undefined") { 335 A.store.Bool(retPtr + 16 + 187, false); 336 A.store.Ref(retPtr + 16 + 0, undefined); 337 A.store.Ref(retPtr + 16 + 4, undefined); 338 A.store.Bool(retPtr + 16 + 184, false); 339 A.store.Int64(retPtr + 16 + 8, 0); 340 A.store.Bool(retPtr + 16 + 185, false); 341 A.store.Int64(retPtr + 16 + 16, 0); 342 A.store.Bool(retPtr + 16 + 186, false); 343 A.store.Int64(retPtr + 16 + 24, 0); 344 A.store.Ref(retPtr + 16 + 32, undefined); 345 A.store.Ref(retPtr + 16 + 36, undefined); 346 A.store.Ref(retPtr + 16 + 40, undefined); 347 348 A.store.Bool(retPtr + 16 + 48 + 125, false); 349 A.store.Bool(retPtr + 16 + 48 + 0, false); 350 A.store.Bool(retPtr + 16 + 48 + 120, false); 351 A.store.Bool(retPtr + 16 + 48 + 1, false); 352 A.store.Bool(retPtr + 16 + 48 + 2, false); 353 A.store.Bool(retPtr + 16 + 48 + 3, false); 354 A.store.Ref(retPtr + 16 + 48 + 4, undefined); 355 A.store.Int64(retPtr + 16 + 48 + 8, 0); 356 A.store.Bool(retPtr + 16 + 48 + 121, false); 357 A.store.Int64(retPtr + 16 + 48 + 16, 0); 358 A.store.Bool(retPtr + 16 + 48 + 24, false); 359 A.store.Bool(retPtr + 16 + 48 + 122, false); 360 A.store.Int64(retPtr + 16 + 48 + 32, 0); 361 A.store.Bool(retPtr + 16 + 48 + 40, false); 362 A.store.Int64(retPtr + 16 + 48 + 48, 0); 363 364 A.store.Bool(retPtr + 16 + 48 + 56 + 12, false); 365 A.store.Ref(retPtr + 16 + 48 + 56 + 0, undefined); 366 A.store.Bool(retPtr + 16 + 48 + 56 + 4, false); 367 A.store.Enum(retPtr + 16 + 48 + 56 + 8, -1); 368 A.store.Bool(retPtr + 16 + 48 + 123, false); 369 A.store.Int64(retPtr + 16 + 48 + 72, 0); 370 A.store.Ref(retPtr + 16 + 48 + 80, undefined); 371 A.store.Bool(retPtr + 16 + 48 + 84, false); 372 A.store.Bool(retPtr + 16 + 48 + 85, false); 373 A.store.Ref(retPtr + 16 + 48 + 88, undefined); 374 A.store.Enum(retPtr + 16 + 48 + 92, -1); 375 A.store.Ref(retPtr + 16 + 48 + 96, undefined); 376 A.store.Ref(retPtr + 16 + 48 + 100, undefined); 377 A.store.Bool(retPtr + 16 + 48 + 124, false); 378 A.store.Int64(retPtr + 16 + 48 + 104, 0); 379 A.store.Int64(retPtr + 16 + 48 + 112, 0); 380 A.store.Ref(retPtr + 16 + 176, undefined); 381 A.store.Ref(retPtr + 16 + 180, undefined); 382 } else { 383 A.store.Bool(retPtr + 16 + 187, true); 384 A.store.Ref(retPtr + 16 + 0, _ret["sender"]["documentId"]); 385 A.store.Ref(retPtr + 16 + 4, _ret["sender"]["documentLifecycle"]); 386 A.store.Bool(retPtr + 16 + 184, "frameId" in _ret["sender"] ? true : false); 387 A.store.Int64( 388 retPtr + 16 + 8, 389 _ret["sender"]["frameId"] === undefined ? 0 : (_ret["sender"]["frameId"] as number) 390 ); 391 A.store.Bool(retPtr + 16 + 185, "guestProcessId" in _ret["sender"] ? true : false); 392 A.store.Int64( 393 retPtr + 16 + 16, 394 _ret["sender"]["guestProcessId"] === undefined ? 0 : (_ret["sender"]["guestProcessId"] as number) 395 ); 396 A.store.Bool(retPtr + 16 + 186, "guestRenderFrameRoutingId" in _ret["sender"] ? true : false); 397 A.store.Int64( 398 retPtr + 16 + 24, 399 _ret["sender"]["guestRenderFrameRoutingId"] === undefined 400 ? 0 401 : (_ret["sender"]["guestRenderFrameRoutingId"] as number) 402 ); 403 A.store.Ref(retPtr + 16 + 32, _ret["sender"]["id"]); 404 A.store.Ref(retPtr + 16 + 36, _ret["sender"]["nativeApplication"]); 405 A.store.Ref(retPtr + 16 + 40, _ret["sender"]["origin"]); 406 407 if (typeof _ret["sender"]["tab"] === "undefined") { 408 A.store.Bool(retPtr + 16 + 48 + 125, false); 409 A.store.Bool(retPtr + 16 + 48 + 0, false); 410 A.store.Bool(retPtr + 16 + 48 + 120, false); 411 A.store.Bool(retPtr + 16 + 48 + 1, false); 412 A.store.Bool(retPtr + 16 + 48 + 2, false); 413 A.store.Bool(retPtr + 16 + 48 + 3, false); 414 A.store.Ref(retPtr + 16 + 48 + 4, undefined); 415 A.store.Int64(retPtr + 16 + 48 + 8, 0); 416 A.store.Bool(retPtr + 16 + 48 + 121, false); 417 A.store.Int64(retPtr + 16 + 48 + 16, 0); 418 A.store.Bool(retPtr + 16 + 48 + 24, false); 419 A.store.Bool(retPtr + 16 + 48 + 122, false); 420 A.store.Int64(retPtr + 16 + 48 + 32, 0); 421 A.store.Bool(retPtr + 16 + 48 + 40, false); 422 A.store.Int64(retPtr + 16 + 48 + 48, 0); 423 424 A.store.Bool(retPtr + 16 + 48 + 56 + 12, false); 425 A.store.Ref(retPtr + 16 + 48 + 56 + 0, undefined); 426 A.store.Bool(retPtr + 16 + 48 + 56 + 4, false); 427 A.store.Enum(retPtr + 16 + 48 + 56 + 8, -1); 428 A.store.Bool(retPtr + 16 + 48 + 123, false); 429 A.store.Int64(retPtr + 16 + 48 + 72, 0); 430 A.store.Ref(retPtr + 16 + 48 + 80, undefined); 431 A.store.Bool(retPtr + 16 + 48 + 84, false); 432 A.store.Bool(retPtr + 16 + 48 + 85, false); 433 A.store.Ref(retPtr + 16 + 48 + 88, undefined); 434 A.store.Enum(retPtr + 16 + 48 + 92, -1); 435 A.store.Ref(retPtr + 16 + 48 + 96, undefined); 436 A.store.Ref(retPtr + 16 + 48 + 100, undefined); 437 A.store.Bool(retPtr + 16 + 48 + 124, false); 438 A.store.Int64(retPtr + 16 + 48 + 104, 0); 439 A.store.Int64(retPtr + 16 + 48 + 112, 0); 440 } else { 441 A.store.Bool(retPtr + 16 + 48 + 125, true); 442 A.store.Bool(retPtr + 16 + 48 + 0, _ret["sender"]["tab"]["active"] ? true : false); 443 A.store.Bool(retPtr + 16 + 48 + 120, "audible" in _ret["sender"]["tab"] ? true : false); 444 A.store.Bool(retPtr + 16 + 48 + 1, _ret["sender"]["tab"]["audible"] ? true : false); 445 A.store.Bool(retPtr + 16 + 48 + 2, _ret["sender"]["tab"]["autoDiscardable"] ? true : false); 446 A.store.Bool(retPtr + 16 + 48 + 3, _ret["sender"]["tab"]["discarded"] ? true : false); 447 A.store.Ref(retPtr + 16 + 48 + 4, _ret["sender"]["tab"]["favIconUrl"]); 448 A.store.Int64( 449 retPtr + 16 + 48 + 8, 450 _ret["sender"]["tab"]["groupId"] === undefined ? 0 : (_ret["sender"]["tab"]["groupId"] as number) 451 ); 452 A.store.Bool(retPtr + 16 + 48 + 121, "height" in _ret["sender"]["tab"] ? true : false); 453 A.store.Int64( 454 retPtr + 16 + 48 + 16, 455 _ret["sender"]["tab"]["height"] === undefined ? 0 : (_ret["sender"]["tab"]["height"] as number) 456 ); 457 A.store.Bool(retPtr + 16 + 48 + 24, _ret["sender"]["tab"]["highlighted"] ? true : false); 458 A.store.Bool(retPtr + 16 + 48 + 122, "id" in _ret["sender"]["tab"] ? true : false); 459 A.store.Int64( 460 retPtr + 16 + 48 + 32, 461 _ret["sender"]["tab"]["id"] === undefined ? 0 : (_ret["sender"]["tab"]["id"] as number) 462 ); 463 A.store.Bool(retPtr + 16 + 48 + 40, _ret["sender"]["tab"]["incognito"] ? true : false); 464 A.store.Int64( 465 retPtr + 16 + 48 + 48, 466 _ret["sender"]["tab"]["index"] === undefined ? 0 : (_ret["sender"]["tab"]["index"] as number) 467 ); 468 469 if (typeof _ret["sender"]["tab"]["mutedInfo"] === "undefined") { 470 A.store.Bool(retPtr + 16 + 48 + 56 + 12, false); 471 A.store.Ref(retPtr + 16 + 48 + 56 + 0, undefined); 472 A.store.Bool(retPtr + 16 + 48 + 56 + 4, false); 473 A.store.Enum(retPtr + 16 + 48 + 56 + 8, -1); 474 } else { 475 A.store.Bool(retPtr + 16 + 48 + 56 + 12, true); 476 A.store.Ref(retPtr + 16 + 48 + 56 + 0, _ret["sender"]["tab"]["mutedInfo"]["extensionId"]); 477 A.store.Bool(retPtr + 16 + 48 + 56 + 4, _ret["sender"]["tab"]["mutedInfo"]["muted"] ? true : false); 478 A.store.Enum( 479 retPtr + 16 + 48 + 56 + 8, 480 ["user", "capture", "extension"].indexOf(_ret["sender"]["tab"]["mutedInfo"]["reason"] as string) 481 ); 482 } 483 A.store.Bool(retPtr + 16 + 48 + 123, "openerTabId" in _ret["sender"]["tab"] ? true : false); 484 A.store.Int64( 485 retPtr + 16 + 48 + 72, 486 _ret["sender"]["tab"]["openerTabId"] === undefined 487 ? 0 488 : (_ret["sender"]["tab"]["openerTabId"] as number) 489 ); 490 A.store.Ref(retPtr + 16 + 48 + 80, _ret["sender"]["tab"]["pendingUrl"]); 491 A.store.Bool(retPtr + 16 + 48 + 84, _ret["sender"]["tab"]["pinned"] ? true : false); 492 A.store.Bool(retPtr + 16 + 48 + 85, _ret["sender"]["tab"]["selected"] ? true : false); 493 A.store.Ref(retPtr + 16 + 48 + 88, _ret["sender"]["tab"]["sessionId"]); 494 A.store.Enum( 495 retPtr + 16 + 48 + 92, 496 ["unloaded", "loading", "complete"].indexOf(_ret["sender"]["tab"]["status"] as string) 497 ); 498 A.store.Ref(retPtr + 16 + 48 + 96, _ret["sender"]["tab"]["title"]); 499 A.store.Ref(retPtr + 16 + 48 + 100, _ret["sender"]["tab"]["url"]); 500 A.store.Bool(retPtr + 16 + 48 + 124, "width" in _ret["sender"]["tab"] ? true : false); 501 A.store.Int64( 502 retPtr + 16 + 48 + 104, 503 _ret["sender"]["tab"]["width"] === undefined ? 0 : (_ret["sender"]["tab"]["width"] as number) 504 ); 505 A.store.Int64( 506 retPtr + 16 + 48 + 112, 507 _ret["sender"]["tab"]["windowId"] === undefined ? 0 : (_ret["sender"]["tab"]["windowId"] as number) 508 ); 509 } 510 A.store.Ref(retPtr + 16 + 176, _ret["sender"]["tlsChannelId"]); 511 A.store.Ref(retPtr + 16 + 180, _ret["sender"]["url"]); 512 } 513 } 514 return A.H.TRUE; 515 } catch (err: any) { 516 A.store.Ref(errPtr, err); 517 return A.H.FALSE; 518 } 519 }, 520 "has_Highlight": (): heap.Ref<boolean> => { 521 if (WEBEXT?.tabs && "highlight" in WEBEXT?.tabs) { 522 return A.H.TRUE; 523 } 524 return A.H.FALSE; 525 }, 526 "func_Highlight": (fn: Pointer): void => { 527 A.store.Ref(fn, WEBEXT.tabs.highlight); 528 }, 529 "call_Highlight": (retPtr: Pointer, highlightInfo: Pointer): void => { 530 const highlightInfo_ffi = {}; 531 532 highlightInfo_ffi["tabs"] = A.load.Ref(highlightInfo + 0, undefined); 533 if (A.load.Bool(highlightInfo + 16)) { 534 highlightInfo_ffi["windowId"] = A.load.Int64(highlightInfo + 8); 535 } 536 537 const _ret = WEBEXT.tabs.highlight(highlightInfo_ffi); 538 A.store.Ref(retPtr, _ret); 539 }, 540 "try_Highlight": (retPtr: Pointer, errPtr: Pointer, highlightInfo: Pointer): heap.Ref<boolean> => { 541 try { 542 const highlightInfo_ffi = {}; 543 544 highlightInfo_ffi["tabs"] = A.load.Ref(highlightInfo + 0, undefined); 545 if (A.load.Bool(highlightInfo + 16)) { 546 highlightInfo_ffi["windowId"] = A.load.Int64(highlightInfo + 8); 547 } 548 549 const _ret = WEBEXT.tabs.highlight(highlightInfo_ffi); 550 A.store.Ref(retPtr, _ret); 551 return A.H.TRUE; 552 } catch (err: any) { 553 A.store.Ref(errPtr, err); 554 return A.H.FALSE; 555 } 556 }, 557 }; 558 });