MCPcopy Create free account
hub / github.com/Justineo/github-hovercard / EdgeRuntimeBridge

Class EdgeRuntimeBridge

extensions/edge/backgroundScriptsAPIBridge.js:481–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479 }
480}
481class EdgeRuntimeBridge {
482 get id() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.id; }, "runtime.id"); }
483 get lastError() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.lastError; }, "runtime.lastError"); }
484 get onConnect() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.onConnect; }, "runtime.onConnect"); }
485 get onInstalled() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.onInstalled; }, "runtime.onInstalled"); }
486 get onMessage() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.onMessage; }, "runtime.onMessage"); }
487 get onMessageExternal() { return bridgeLog.DoActionAndLog(() => { return myBrowser.runtime.onMessageExternal; }, "runtime.onMessageExternal"); }
488 connect(extensionId, connectInfo) {
489 return bridgeLog.DoActionAndLog(() => {
490 if (typeof connectInfo !== "undefined" && typeof connectInfo !== "null") {
491 return myBrowser.runtime.connect(extensionId, connectInfo);
492 }
493 else {
494 return myBrowser.runtime.connect(extensionId);
495 }
496 }, "runtime.connect");
497 }
498 getBackgroundPage(callback) {
499 bridgeLog.DoActionAndLog(() => {
500 myBrowser.runtime.getBackgroundPage(callback);
501 }, "runtime.getBackgroundPage");
502 }
503 getManifest() {
504 return bridgeLog.DoActionAndLog(() => {
505 return myBrowser.runtime.getManifest();
506 }, "runtime.getManifest");
507 }
508 getURL(path) {
509 return bridgeLog.DoActionAndLog(() => {
510 return myBrowser.runtime.getURL(path);
511 }, "runtime.getURL");
512 }
513 sendMessage(extensionId, message, options, responseCallback) {
514 bridgeLog.DoActionAndLog(() => {
515 if (typeof responseCallback !== "undefined" && typeof responseCallback !== "null") {
516 myBrowser.runtime.sendMessage(extensionId, message, options, responseCallback);
517 }
518 else if (typeof options !== "undefined" && typeof options !== "null") {
519 myBrowser.runtime.sendMessage(extensionId, message, options);
520 }
521 else if (typeof message !== "undefined" && typeof message !== "null") {
522 myBrowser.runtime.sendMessage(extensionId, message);
523 }
524 else {
525 myBrowser.runtime.sendMessage(undefined, extensionId);
526 }
527 }, "runtime.sendMessage");
528 }
529}
530class EdgeChromeRuntimeBridge extends EdgeRuntimeBridge {
531 get onConnectExternal() { bridgeLog.LogUnavailbleApi("runtime.onConnectExternal"); return bridgeHelper.fakeEvent; }
532 get onRestartRequired() { bridgeLog.LogUnavailbleApi("runtime.onRestartRequired"); return bridgeHelper.fakeEvent; }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected